diff --git a/CHANGELOG b/CHANGELOG index 1036733..6427190 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -78,7 +78,9 @@ WinDivert 1.2.0-rc - Support for the old WinDivert1.0 API has been removed. WinDivert 1.2.1 - Identical to WinDivert 1.2.0-rc. -WinDivert 1.2.2 +WinDivert 1.3.0 - Fix BSOD that sometimes occurs after abnormal user application exit. - Fix BSOD that sometimes occurs when WinDivert is combined with other callout drivers. + - WinDivertSend() has been optimized. However, it may not detect as + many packet injection errors as it could before. diff --git a/VERSION b/VERSION index 23aa839..f0bb29e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.2 +1.3.0 diff --git a/doc/windivert.html b/doc/windivert.html index 2a8a5f5..be43885 100644 --- a/doc/windivert.html +++ b/doc/windivert.html @@ -1,10 +1,10 @@
--sc stop WinDivert1.2 -sc delete WinDivert1.2 +sc stop WinDivert1.3 +sc delete WinDivert1.3Note that this is not recommended as it will interfere with other applications that depend on WinDivert. diff --git a/include/windivert_device.h b/include/windivert_device.h index 3911ccf..d2c920a 100644 --- a/include/windivert_device.h +++ b/include/windivert_device.h @@ -1,6 +1,6 @@ /* * windivert_device.h - * (C) 2016, all rights reserved, + * (C) 2017, all rights reserved, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -20,7 +20,7 @@ #define __WINDIVERT_DEVICE_H /* - * NOTE: This is the low-level interface to the divert device driver. + * NOTE: This is the low-level interface to the WinDivert device driver. * This interface should not be used directly, instead use the high-level * interface provided by the divert API. */ @@ -43,8 +43,8 @@ #define WINDIVERT_DEVICE_NAME \ L"WinDivert" WINDIVERT_VERSION_LSTR -#define WINDIVERT_IOCTL_VERSION 4 -#define WINDIVERT_IOCTL_MAGIC 0x529B +#define WINDIVERT_IOCTL_VERSION 5 +#define WINDIVERT_IOCTL_MAGIC 0x1E06 #define WINDIVERT_FILTER_FIELD_ZERO 0 #define WINDIVERT_FILTER_FIELD_INBOUND 1 diff --git a/sys/windivert.c b/sys/windivert.c index f637b5e..6a91895 100644 --- a/sys/windivert.c +++ b/sys/windivert.c @@ -1,6 +1,6 @@ /* * windivert.c - * (C) 2016, all rights reserved, + * (C) 2017, all rights reserved, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -104,7 +104,7 @@ typedef struct filter_s *filter_t; /* * WinDivert context information. */ -#define WINDIVERT_CONTEXT_MAGIC 0x4F55ED0DBA2AD939ull +#define WINDIVERT_CONTEXT_MAGIC 0x1C1E48D280D7F487ull #define WINDIVERT_CONTEXT_SIZE (sizeof(struct context_s)) #define WINDIVERT_CONTEXT_MAXLAYERS 4 #define WINDIVERT_CONTEXT_MAXWORKERS 2 @@ -201,7 +201,6 @@ WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(req_context_s, windivert_req_context_get); struct packet_s { LIST_ENTRY entry; // Entry for queue. - PNET_BUFFER_LIST net_buffer_list; // Clone of the net buffer list. size_t data_len; // Length of `data'. UINT8 checksums; // Which checksums are valid. UINT8 direction; // Packet direction. @@ -1585,21 +1584,10 @@ static void NTAPI windivert_inject_complete(VOID *context, PMDL mdl; PVOID data; PNET_BUFFER buffer; - size_t length = 0; - NTSTATUS status; UNREFERENCED_PARAMETER(context); UNREFERENCED_PARAMETER(dispatch_level); buffer = NET_BUFFER_LIST_FIRST_NB(buffers); - status = NET_BUFFER_LIST_STATUS(buffers); - if (NT_SUCCESS(status)) - { - length = NET_BUFFER_DATA_LENGTH(buffer); - } - else - { - DEBUG_ERROR("failed to inject packet", status); - } mdl = NET_BUFFER_FIRST_MDL(buffer); data = MmGetSystemAddressForMdlSafe(mdl, NormalPagePriority); if (data != NULL) @@ -2347,7 +2335,6 @@ static BOOL windivert_queue_packet(context_t context, PNET_BUFFER buffer, { return FALSE; } - packet->net_buffer_list = NULL; packet->data_len = data_len; data = NdisGetDataBuffer(buffer, data_len, NULL, 1, 0); if (data == NULL) @@ -2512,10 +2499,6 @@ static void NTAPI windivert_reinject_complete(VOID *context, */ static void windivert_free_packet(packet_t packet) { - if (packet->net_buffer_list != NULL) - { - FwpsFreeCloneNetBufferList0(packet->net_buffer_list, 0); - } ExFreePoolWithTag(packet, WINDIVERT_TAG); } diff --git a/sys/windivert.rc b/sys/windivert.rc index bf3f491..cd0ee77 100644 --- a/sys/windivert.rc +++ b/sys/windivert.rc @@ -22,20 +22,20 @@ #define VER_FILETYPE VFT_DRV #define VER_FILESUBTYPE VFT2_DRV_NETWORK #define VER_FILEDESCRIPTION_STR \ - "WinDivert" \ + "WinDivert 1.3" \ " https://reqrypt.org/windivert.html" \ " 1C5vZVSbizPeZ8ydTYhUfm4LA2cNwBfcYh" #define VER_INTERNALNAME_STR "WinDivert.sys" #define VER_ORIGINALFILENAME_STR "WinDivert.sys" -#define VER_PRODUCTVERSION 1.2 -#define VER_PRODUCTVERSION_STR "1.2" +#define VER_PRODUCTVERSION 1.3 +#define VER_PRODUCTVERSION_STR "1.3" #define VER_COMPANYNAME_STR "Basil" #define VER_LEGALCOPYRIGHT_YEARS "2011-2017" #define VER_LEGALCOPYRIGHT_STR \ "Copyright \251 " VER_COMPANYNAME_STR " " VER_LEGALCOPYRIGHT_YEARS #define VER_FILEVERSION VER_PRODUCTVERSION #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR -#define VER_PRODUCTNAME_STR "WinDivert driver" +#define VER_PRODUCTNAME_STR "WinDivert 1.3 driver" #include "common.ver"