Bump version to WinDivert 1.3.0

This prevents the old 1.2 driver from being used by new 1.3 software.

Also, clean up the driver code.
This commit is contained in:
basil00
2017-09-24 15:48:38 +08:00
parent 200da2fba1
commit 7b7d92cd26
6 changed files with 18 additions and 33 deletions
+3 -1
View File
@@ -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.
+1 -1
View File
@@ -1 +1 @@
1.2.2
1.3.0
+4 -4
View File
@@ -1,10 +1,10 @@
<!doctype html>
<html>
<head>
<title>WinDivert 1.2 Documentation</title>
<title>WinDivert 1.3 Documentation</title>
</head>
<body>
<h1>WinDivert 1.2: Windows Packet Divert</h1>
<h1>WinDivert 1.3: Windows Packet Divert</h1>
<h2>Table of Contents</h2>
<ul>
<li><a href="#introduction">1. Introduction</a></li>
@@ -286,8 +286,8 @@ uninstalled during the next machine reboot.
The WinDivert driver can also be manually removed by issuing the following
commands at the command prompt
<pre>
sc stop WinDivert1.2
sc delete WinDivert1.2
sc stop WinDivert1.3
sc delete WinDivert1.3
</pre>
Note that this is not recommended as it will interfere with other
applications that depend on WinDivert.
+4 -4
View File
@@ -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
+2 -19
View File
@@ -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);
}
+4 -4
View File
@@ -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"