Make NDIS 6.80 compliant
Implement support for synchronous OID requests and declare the Wintun as NDIS 6.80 compliant. https://docs.microsoft.com/en-us/windows-hardware/drivers/network/introduction-to-ndis-6-80 Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
c394368e88
commit
de2c48db84
22
wintun.c
22
wintun.c
@ -1525,6 +1525,21 @@ static void TunCancelDirectOidRequest(NDIS_HANDLE MiniportAdapterContext, PVOID
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static MINIPORT_SYNCHRONOUS_OID_REQUEST TunSynchronousOidRequest;
|
||||||
|
_Use_decl_annotations_
|
||||||
|
static NDIS_STATUS TunSynchronousOidRequest(NDIS_HANDLE MiniportAdapterContext, PNDIS_OID_REQUEST OidRequest)
|
||||||
|
{
|
||||||
|
switch (OidRequest->RequestType) {
|
||||||
|
case NdisRequestQueryInformation:
|
||||||
|
case NdisRequestQueryStatistics:
|
||||||
|
case NdisRequestSetInformation:
|
||||||
|
return NDIS_STATUS_NOT_SUPPORTED;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return NDIS_STATUS_INVALID_OID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static MINIPORT_UNLOAD TunUnload;
|
static MINIPORT_UNLOAD TunUnload;
|
||||||
_Use_decl_annotations_
|
_Use_decl_annotations_
|
||||||
static VOID TunUnload(PDRIVER_OBJECT DriverObject)
|
static VOID TunUnload(PDRIVER_OBJECT DriverObject)
|
||||||
@ -1547,8 +1562,8 @@ NTSTATUS DriverEntry(DRIVER_OBJECT *DriverObject, UNICODE_STRING *RegistryPath)
|
|||||||
NDIS_MINIPORT_DRIVER_CHARACTERISTICS miniport = {
|
NDIS_MINIPORT_DRIVER_CHARACTERISTICS miniport = {
|
||||||
.Header = {
|
.Header = {
|
||||||
.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS,
|
.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS,
|
||||||
.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2,
|
.Revision = NdisVersion < NDIS_RUNTIME_VERSION_680 ? NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2 : NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3,
|
||||||
.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2
|
.Size = NdisVersion < NDIS_RUNTIME_VERSION_680 ? NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2 : NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3
|
||||||
},
|
},
|
||||||
|
|
||||||
.MajorNdisVersion = (UCHAR)((NdisVersion & 0x00ff0000) >> 16),
|
.MajorNdisVersion = (UCHAR)((NdisVersion & 0x00ff0000) >> 16),
|
||||||
@ -1570,7 +1585,8 @@ NTSTATUS DriverEntry(DRIVER_OBJECT *DriverObject, UNICODE_STRING *RegistryPath)
|
|||||||
.ShutdownHandlerEx = TunShutdownEx,
|
.ShutdownHandlerEx = TunShutdownEx,
|
||||||
.CancelOidRequestHandler = TunCancelOidRequest,
|
.CancelOidRequestHandler = TunCancelOidRequest,
|
||||||
.DirectOidRequestHandler = TunDirectOidRequest,
|
.DirectOidRequestHandler = TunDirectOidRequest,
|
||||||
.CancelDirectOidRequestHandler = TunCancelDirectOidRequest
|
.CancelDirectOidRequestHandler = TunCancelDirectOidRequest,
|
||||||
|
.SynchronousOidRequestHandler = TunSynchronousOidRequest
|
||||||
};
|
};
|
||||||
if (!NT_SUCCESS(status = NdisMRegisterMiniportDriver(DriverObject, RegistryPath, NULL, &miniport, &NdisMiniportDriverHandle)))
|
if (!NT_SUCCESS(status = NdisMRegisterMiniportDriver(DriverObject, RegistryPath, NULL, &miniport, &NdisMiniportDriverHandle)))
|
||||||
return status;
|
return status;
|
||||||
|
@ -124,12 +124,12 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
|
||||||
<ItemDefinitionGroup>
|
<ItemDefinitionGroup>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_STR="$(WintunVersionStr)";NDIS_MINIPORT_DRIVER=1;NDIS620_MINIPORT=1;NDIS670_MINIPORT=1;NDIS_WDM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_STR="$(WintunVersionStr)";NDIS_MINIPORT_DRIVER=1;NDIS620_MINIPORT=1;NDIS680_MINIPORT=1;NDIS_WDM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<EnablePREfast>true</EnablePREfast>
|
<EnablePREfast>true</EnablePREfast>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_STR="$(WintunVersionStr)";NDIS_MINIPORT_DRIVER=1;NDIS620_MINIPORT=1;NDIS670_MINIPORT=1;NDIS_WDM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_STR="$(WintunVersionStr)";NDIS_MINIPORT_DRIVER=1;NDIS620_MINIPORT=1;NDIS680_MINIPORT=1;NDIS_WDM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>ndis.lib;wdmsec.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>ndis.lib;wdmsec.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
Loading…
Reference in New Issue
Block a user