From 2dc195e508f841d3393e031123abeecefa30b6e4 Mon Sep 17 00:00:00 2001 From: Guillaume Hetier Date: Thu, 2 Apr 2020 11:50:18 -0700 Subject: Fix deprecated pool allocation function --- .../PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c | 30 +++++++++------------- network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c | 7 +++-- 2 files changed, 15 insertions(+), 22 deletions(-) (limited to 'network') diff --git a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c index d48ee104..86a16e03 100644 --- a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c +++ b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6SdioPlatformWindows.c @@ -1006,17 +1006,15 @@ PlatformSdioGetProperty( PSDBUS_REQUEST_PACKET psdrp = NULL; NTSTATUS status; - psdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(SDBUS_REQUEST_PACKET), '3278'); + psdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SDBUS_REQUEST_PACKET), '3278'); if(!psdrp) return STATUS_INSUFFICIENT_RESOURCES; - RtlZeroMemory(psdrp, sizeof(SDBUS_REQUEST_PACKET)); - - psdrp->RequestFunction = SDRF_GET_PROPERTY; - psdrp->Parameters.GetSetProperty.Property = Property; - psdrp->Parameters.GetSetProperty.Buffer = Buffer; - psdrp->Parameters.GetSetProperty.Length = Length; + psdrp->RequestFunction = SDRF_GET_PROPERTY; + psdrp->Parameters.GetSetProperty.Property = Property; + psdrp->Parameters.GetSetProperty.Buffer = Buffer; + psdrp->Parameters.GetSetProperty.Length = Length; NdisAcquireSpinLock( &(pDevice->IrpSpinLock) ); RT_SDIO_INC_CMD_REF(pDevice); @@ -1062,17 +1060,15 @@ PlatformSdioSetProperty( PSDBUS_REQUEST_PACKET psdrp = NULL; NTSTATUS status; - psdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(SDBUS_REQUEST_PACKET), '3278'); + psdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SDBUS_REQUEST_PACKET), '3278'); if(!psdrp) return STATUS_INSUFFICIENT_RESOURCES; - RtlZeroMemory(psdrp, sizeof(SDBUS_REQUEST_PACKET)); - - psdrp->RequestFunction = SDRF_SET_PROPERTY; - psdrp->Parameters.GetSetProperty.Property = Property; - psdrp->Parameters.GetSetProperty.Buffer = Buffer; - psdrp->Parameters.GetSetProperty.Length = Length; + psdrp->RequestFunction = SDRF_SET_PROPERTY; + psdrp->Parameters.GetSetProperty.Property = Property; + psdrp->Parameters.GetSetProperty.Buffer = Buffer; + psdrp->Parameters.GetSetProperty.Length = Length; NdisAcquireSpinLock( &(pDevice->IrpSpinLock) ); RT_SDIO_INC_CMD_REF(pDevice); @@ -1409,14 +1405,12 @@ PlatformSdioCmd53ReadWriteMDL( // // Now allocate a request packet for the arguments of the command. // - psdrp = ExAllocatePoolWithTag(NonPagedPool, sizeof(SDBUS_REQUEST_PACKET), '3278'); + psdrp = ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SDBUS_REQUEST_PACKET), '3278'); if(!psdrp) { RT_TRACE(COMP_IO, DBG_SERIOUS, ("PlatformSdioCmd53ReadWriteMDL(): Allocate sdrp fail!!\n")); return rtstatus; } - - RtlZeroMemory(psdrp, sizeof(SDBUS_REQUEST_PACKET)); psdrp->RequestFunction = SDRF_DEVICE_COMMAND; psdrp->Parameters.DeviceCommand.Mdl = pmdl; @@ -2985,7 +2979,7 @@ PrepareSdioAWBs( // // Allocate SD Request Packet // - device->pAsynIoWriteSdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(SDBUS_REQUEST_PACKET), '3278'); + device->pAsynIoWriteSdrp = (PSDBUS_REQUEST_PACKET)ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(SDBUS_REQUEST_PACKET), '3278'); if(device->pAsynIoWriteSdrp == NULL) goto Error; diff --git a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c index fb9160a4..1165eed1 100644 --- a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c +++ b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/N6Sdio_main.c @@ -1489,10 +1489,9 @@ N6SdioInitTxQueue( pDevice->RtNumTxQueue = SDIO_MAX_TX_QUEUE; // TX_HIQ, TX_MIQ and TX_LOQ // Initialize the contexts in Tx Queue. - pDevice->RtTxQueue = - (PRT_SDIO_TX_QUEUE)ExAllocatePoolWithTag(NonPagedPool, SDIO_MAX_TX_QUEUE*sizeof(RT_SDIO_TX_QUEUE), '3278' ); - PlatformZeroMemory(pDevice->RtTxQueue, SDIO_MAX_TX_QUEUE*sizeof(RT_SDIO_TX_QUEUE)); - + pDevice->RtTxQueue = + (PRT_SDIO_TX_QUEUE)ExAllocatePool2(POOL_FLAG_NON_PAGED, SDIO_MAX_TX_QUEUE*sizeof(RT_SDIO_TX_QUEUE), '3278' ); + if (pDevice->RtTxQueue != NULL) { -- cgit v1.3.1 From b1848123d234530731ac009b82e8eb3bccb04148 Mon Sep 17 00:00:00 2001 From: Guillaume Hetier Date: Fri, 3 Apr 2020 10:26:46 -0700 Subject: Fix WDI sample build --- network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj | 12 ++++++------ network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'network') diff --git a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj index af48c0a4..a8432de0 100644 --- a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj +++ b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj @@ -336,13 +336,9 @@ $(SolutionDir)COMMON\$(Configuration)\common.lib;$(SolutionDir)PLATFORM\NdisComm\$(Configuration)\NdisComm.lib;$(SolutionDir)\LIB\x86\hal.lib;$(SolutionDir)\LIB\x86\rtklibcom.lib;$(WindowsSDK_LibraryPath_x86)km\x86\ndis.lib;$(WindowsSDK_LibraryPath_x86)km\x86\ntoskrnl.lib;$(WindowsSDK_LibraryPath_x86)km\x86\sdbus.lib;$(WindowsSDK_LibraryPath_x86)km\x86\wlan\1.0\TlvGeneratorParser.lib; - - - - + + $(AdditionalOptions) /IGNORE:4099 $(OutDir)$(TargetName)$(TargetExt) - - _X86_;DBG;NDIS60_MINIPORT;USE_KLOCKS=1;BINARY_COMPATIBLE=0;NDIS650_MINIPORT=1;NDIS640_MINIPORT=1;NDIS630_MINIPORT=1;NDIS620_MINIPORT=1;NDIS61_MINIPORT=1;NDIS_MINIPORT_DRIVER;%(PreprocessorDefinitions) @@ -425,6 +421,8 @@ None + + $(AdditionalOptions) /IGNORE:4099 $(OutDir)$(TargetName)$(TargetExt) $(SolutionDir)COMMON\$(Configuration)\common.lib;$(SolutionDir)PLATFORM\NdisComm\$(Configuration)\NdisComm.lib;$(SolutionDir)\LIB\x86\hal.lib;$(SolutionDir)\LIB\x86\rtklibcom.lib;$(WindowsSDK_LibraryPath_x86)km\x86\ndis.lib;$(WindowsSDK_LibraryPath_x86)km\x86\ntoskrnl.lib;$(WindowsSDK_LibraryPath_x86)km\x86\sdbus.lib;$(WindowsSDK_LibraryPath_x86)km\x86\wlan\1.0\TlvGeneratorParser.lib; @@ -626,6 +624,8 @@ $(OutDir)$(TargetName)$(TargetExt) + + $(AdditionalOptions) /IGNORE:4099 $(SolutionDir)COMMON\$(Configuration)\$(Platform)\common.lib;$(SolutionDir)PLATFORM\NdisComm\$(Configuration)\$(Platform)\NdisComm.lib;$(SolutionDir)\LIB\x64\hal.lib;$(SolutionDir)\LIB\x64\rtklibcom.lib;$(WindowsSDK_LibraryPath_x64)km\x64\ndis.lib;$(WindowsSDK_LibraryPath_x64)km\x64\ntoskrnl.lib;$(WindowsSDK_LibraryPath_x64)km\x64\sdbus.lib;$(WindowsSDK_LibraryPath_x64)km\x64\wlan\1.0\TlvGeneratorParser.lib; diff --git a/network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c b/network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c index ec5cddd6..943038dd 100644 --- a/network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c +++ b/network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c @@ -3191,24 +3191,24 @@ Wdi_Set_Add_Pm_Protocol_Offload( //2 DOT11 RSN REKey Offload - if(Params->DOT11RSNREKeyOffload.ProtocolOffloadId) + if(Params->DOT11RSNREKeyOffload.RsnKeyInfo.ProtocolOffloadId) { RT_TRACE(COMP_OID_SET, DBG_LOUD, ("ProtocolOffloadId = %d\n", - Params->DOT11RSNREKeyOffload.ProtocolOffloadId)); + Params->DOT11RSNREKeyOffload.RsnKeyInfo.ProtocolOffloadId)); pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eGTKOffloadIdx] - = Params->DOT11RSNREKeyOffload.ProtocolOffloadId; + = Params->DOT11RSNREKeyOffload.RsnKeyInfo.ProtocolOffloadId; //Copy kck, kek PlatformMoveMemory(&(pMgntInfo->PMDot11RSNRekeyPara.KCK), - Params->DOT11RSNREKeyOffload.KCK_CONTENT, 32); + &Params->DOT11RSNREKeyOffload.RsnKeyInfo.KCK_CONTENT, 32); RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("KCK_CONTENT:\n"), pMgntInfo->PMDot11RSNRekeyPara.KCK, 16); RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("KEK_CONTENT:\n"), pMgntInfo->PMDot11RSNRekeyPara.KEK, 16); - pMgntInfo->PMDot11RSNRekeyPara.KeyReplayCounter = Params->DOT11RSNREKeyOffload.ReplayCounter; + pMgntInfo->PMDot11RSNRekeyPara.KeyReplayCounter = Params->DOT11RSNREKeyOffload.RsnKeyInfo.ReplayCounter; if(pPSC->RegGTKOffloadEnable) pPSC->GTKOffloadEnable = TRUE; -- cgit v1.3.1 From 5f79744859170d03e72c236ff099e21cc3e949ff Mon Sep 17 00:00:00 2001 From: Barry Golden Date: Wed, 10 Jun 2020 13:49:58 -0700 Subject: Updated comment in line 698 Updated comment text to meet bias-free communication guidance. For more information, see https://docs.microsoft.com/style-guide/bias-free-communication. --- network/wlan/WDI/HAL/phydm/phydm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'network') diff --git a/network/wlan/WDI/HAL/phydm/phydm.h b/network/wlan/WDI/HAL/phydm/phydm.h index 21651973..492a4f2a 100644 --- a/network/wlan/WDI/HAL/phydm/phydm.h +++ b/network/wlan/WDI/HAL/phydm/phydm.h @@ -620,7 +620,7 @@ typedef struct DM_Out_Source_Dynamic_Mechanism_Structure //-----------HOOK BEFORE REG INIT-----------// // ODM Platform info AP/ADSL/CE/MP = 1/2/3/4 u1Byte SupportPlatform; - // ODM Support Ability DIG/RATR/TX_PWR_TRACK/ ¡K¡K = 1/2/3/¡K + // ODM Support Ability DIG/RATR/TX_PWR_TRACK/ ¡K¡K = 1/2/3/¡K u4Byte SupportAbility; // ODM PCIE/USB/SDIO = 1/2/3 u1Byte SupportInterface; @@ -695,7 +695,7 @@ typedef struct DM_Out_Source_Dynamic_Mechanism_Structure BOOLEAN *pbGetValueFromOtherMac; PADAPTER *pBuddyAdapter; - BOOLEAN *pbMasterOfDMSP; //MAC0: master, MAC1: slave + BOOLEAN *pbMasterOfDMSP; //MAC0: master, MAC1: subordinate // Common info for Status BOOLEAN *pbScanInProcess; BOOLEAN *pbPowerSaving; -- cgit v1.3.1 From 802b74f21520695f1b6e04fc42580e12cc76b278 Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 3 Dec 2020 08:56:10 +0900 Subject: Fix UDP inbound reinject scenario (#551) Modify the inbound NBL's UDP port # to that of the original outbound traffic, in order to meet the inbound filter conditions --- network/trans/ddproxy/sys/DD_proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'network') diff --git a/network/trans/ddproxy/sys/DD_proxy.c b/network/trans/ddproxy/sys/DD_proxy.c index a75e2cf9..a5901908 100644 --- a/network/trans/ddproxy/sys/DD_proxy.c +++ b/network/trans/ddproxy/sys/DD_proxy.c @@ -833,7 +833,7 @@ DDProxyCloneModifyReinjectInbound( // is contiguous and 2-byte aligned. _Analysis_assume_(udpHeader != NULL); - udpHeader->destPort = + udpHeader->srcPort = packet->belongingFlow->toRemotePort; // This is our new source port -- or // the destination port of the original -- cgit v1.3.1 From b9d5a5b7c1e7c8acce7b3206054ac7be3e1199ee Mon Sep 17 00:00:00 2001 From: yjqms <67753771+yjqms@users.noreply.github.com> Date: Wed, 16 Dec 2020 10:21:09 -0800 Subject: Use SHA256 for ndisprot60's driver signing (#558) --- network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj | 12 ++++++++++++ network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj.Filters | 5 +++++ 2 files changed, 17 insertions(+) (limited to 'network') diff --git a/network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj b/network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj index 0f930a7b..da4c5c58 100644 --- a/network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj +++ b/network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj @@ -154,6 +154,9 @@ %(AdditionalIncludeDirectories);.. + + sha256 + @@ -170,6 +173,9 @@ %(AdditionalIncludeDirectories);.. + + sha256 + @@ -186,6 +192,9 @@ %(AdditionalIncludeDirectories);.. + + sha256 + @@ -202,6 +211,9 @@ %(AdditionalIncludeDirectories);.. + + sha256 + diff --git a/network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj.Filters b/network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj.Filters index fb3baf30..32ecad3d 100644 --- a/network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj.Filters +++ b/network/ndis/ndisprot/6x/sys/60/ndisprot60.vcxproj.Filters @@ -46,4 +46,9 @@ Resource Files + + + Driver Files + + \ No newline at end of file -- cgit v1.3.1 From be65c5c73c8b8bae8b7dafb8cc1585c7ee8df28e Mon Sep 17 00:00:00 2001 From: houha2 <38798233+houha2@users.noreply.github.com> Date: Fri, 22 Jan 2021 12:05:15 -0800 Subject: WFPSampler: Replaces ExAllocatePoolWithTag to ExAllocatePoolZero (#490) * replaces ExAllocatePoolWithTag to ExAllocatePoolZero * adds marco for downlevel support * removes unneeded change * changes comment to reflect new API usage * fixes alignment issues * changes spacing Co-authored-by: Elaine Houha --- .../WFPSampler/syslib/HelperFunctions_Macros.h | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'network') diff --git a/network/trans/WFPSampler/syslib/HelperFunctions_Macros.h b/network/trans/WFPSampler/syslib/HelperFunctions_Macros.h index 36c2ec00..8af997bb 100644 --- a/network/trans/WFPSampler/syslib/HelperFunctions_Macros.h +++ b/network/trans/WFPSampler/syslib/HelperFunctions_Macros.h @@ -155,7 +155,7 @@ extern "C" /** @macro="HLPR_DELETE" - Purpose: Free memory allocated with ExAllocatePoolWithTag and set the pointer to 0.
+ Purpose: Free memory allocated with ExAllocatePoolZero and set the pointer to 0.

Notes:

@@ -172,7 +172,7 @@ extern "C" /** @macro="HLPR_DELETE_ARRAY" - Purpose: Free memory allocated with ExAllocatePoolWithTag and set the pointer to 0.
+ Purpose: Free memory allocated with ExAllocatePoolZero and set the pointer to 0.

Notes:

@@ -184,7 +184,7 @@ extern "C" /** @macro="HLPR_NEW" - Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolWithTag and initialize it's + Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolZero and initialize it's contents with 0's.

Notes: Caller responsible for freeing allocated memory using macro HLPR_DELETE.
@@ -196,9 +196,9 @@ extern "C" pPtr == 0; \ ) \ { \ - pPtr = (object*)ExAllocatePoolWithTag(NonPagedPoolNx, \ - sizeof(object), \ - tag); \ + pPtr = (object*)ExAllocatePoolZero(NonPagedPoolNx, \ + sizeof(object), \ + tag); \ if(pPtr) \ RtlSecureZeroMemory(pPtr, \ sizeof(object)); \ @@ -207,7 +207,7 @@ extern "C" /** @macro="HLPR_NEW_ARRAY" - Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolWithTag and initialize it's + Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolZero and initialize it's contents with 0's.

Notes: Caller responsible for freeing allocated memory using macro HLPR_DELETE_ARRAY.
@@ -226,9 +226,9 @@ extern "C" &SAFE_SIZE) == STATUS_SUCCESS && \ SAFE_SIZE >= (sizeof(object) * count)) \ { \ - pPtr = (object*)ExAllocatePoolWithTag(NonPagedPoolNx, \ - SAFE_SIZE, \ - tag); \ + pPtr = (object*)ExAllocatePoolZero(NonPagedPoolNx, \ + SAFE_SIZE, \ + tag); \ if(pPtr) \ RtlZeroMemory(pPtr, \ SAFE_SIZE); \ @@ -243,7 +243,7 @@ extern "C" /** @macro="HLPR_NEW_CASTED_ARRAY" - Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolWithTag and initialize it's + Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolZero and initialize it's contents with 0's.

Notes: Caller responsible for freeing allocated memory using macro HLPR_DELETE_ARRAY.
@@ -262,9 +262,9 @@ extern "C" &SAFE_SIZE) == STATUS_SUCCESS && \ SAFE_SIZE >= (sizeof(object) * count)) \ { \ - pPtr = (CAST_TYPE*)ExAllocatePoolWithTag(NonPagedPoolNx, \ - SAFE_SIZE, \ - tag); \ + pPtr = (CAST_TYPE*)ExAllocatePoolZero(NonPagedPoolNx, \ + SAFE_SIZE, \ + tag); \ if(pPtr) \ RtlZeroMemory(pPtr, \ SAFE_SIZE); \ @@ -279,7 +279,7 @@ extern "C" /** @macro="HLPR_NEW" - Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolWithTag and leave it's + Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolZero and leave it's contents as is.

Notes: Caller responsible for freeing allocated memory using macro HLPR_DELETE.
@@ -291,9 +291,9 @@ extern "C" pPtr == 0; \ ) \ { \ - pPtr = (object*)ExAllocatePoolWithTag(NonPagedPoolNx, \ - sizeof(object), \ - tag); \ + pPtr = (object*)ExAllocatePoolZero(NonPagedPoolNx, \ + sizeof(object), \ + tag); \ } /** -- cgit v1.3.1 From ad7d35781451b0718072593408d0d392371952aa Mon Sep 17 00:00:00 2001 From: houha2 <38798233+houha2@users.noreply.github.com> Date: Fri, 22 Jan 2021 12:07:25 -0800 Subject: msnmntr: Replace ExAllocatePoolWithTag with ExAllocatePoolZero (#494) Updated sample to remove deprecated API usage (ExAllocatePoolWithTag to ExAllocatePoolZero) Co-authored-by: Elaine Houha --- network/trans/msnmntr/sys/msnmntr.c | 12 ++++++------ network/trans/msnmntr/sys/notify.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'network') diff --git a/network/trans/msnmntr/sys/msnmntr.c b/network/trans/msnmntr/sys/msnmntr.c index a2c59cf2..214b98be 100644 --- a/network/trans/msnmntr/sys/msnmntr.c +++ b/network/trans/msnmntr/sys/msnmntr.c @@ -257,9 +257,9 @@ MonitorCoAllocFlowContext( *flowContextOut = NULL; - flowContext = ExAllocatePoolWithTag(NonPagedPool, - sizeof(FLOW_DATA), - TAG_NAME_CALLOUT); + flowContext = ExAllocatePoolZero(NonPagedPool, + sizeof(FLOW_DATA), + TAG_NAME_CALLOUT); if (!flowContext) { @@ -271,9 +271,9 @@ MonitorCoAllocFlowContext( sizeof(FLOW_DATA)); - flowContext->processPath = ExAllocatePoolWithTag(NonPagedPool, - processPathSize, - TAG_NAME_CALLOUT); + flowContext->processPath = ExAllocatePoolZero(NonPagedPool, + processPathSize, + TAG_NAME_CALLOUT); if (!flowContext->processPath) { status = STATUS_NO_MEMORY; diff --git a/network/trans/msnmntr/sys/notify.c b/network/trans/msnmntr/sys/notify.c index 22253797..935cd161 100644 --- a/network/trans/msnmntr/sys/notify.c +++ b/network/trans/msnmntr/sys/notify.c @@ -270,9 +270,9 @@ NTSTATUS MonitorNfNotifyMessage( if(streamLength == 0) return status; - stream = ExAllocatePoolWithTag(NonPagedPool, - streamLength, - TAG_NAME_NOTIFY); + stream = ExAllocatePoolZero(NonPagedPool, + streamLength, + TAG_NAME_NOTIFY); if (!stream) return STATUS_INSUFFICIENT_RESOURCES; -- cgit v1.3.1 From f9d9c5035a7ddfee600763965d412be5bf6b8059 Mon Sep 17 00:00:00 2001 From: houha2 <38798233+houha2@users.noreply.github.com> Date: Fri, 22 Jan 2021 12:16:49 -0800 Subject: Improvements to WFP Inspect Sample (#516) Changes a `NT_ASSERT` to match what the comment above is saying, the previous version caused a system crash if the packet was not inbound and had a auth decision made already. The comment ` // Skip pended connections in the list, for which the auth decision is already taken.` ` // They should not be for inbound connections.` to my understanding means inbound connections should be ignored and ignore connections for which the auth decision was already made. The latter is checked by: ` if (packet->authConnectDecision == 0)` which keeps `found` equal to `FALSE` triggering the packet and list entry to be set to `NULL` here: `if (!found) { listEntry = NULL; packet = NULL; }` Change also updates the .sln and .vxproj files so the sample compiles on VS2019 without any changes - addressing #366 Co-authored-by: Elaine Houha --- network/trans/inspect/inspect.sln | 17 ++++++++++------- network/trans/inspect/sys/inspect.c | 2 +- network/trans/inspect/sys/inspect.vcxproj | 18 ++++++++++-------- network/trans/inspect/sys/inspect.vcxproj.Filters | 13 +++++++++++++ 4 files changed, 34 insertions(+), 16 deletions(-) (limited to 'network') diff --git a/network/trans/inspect/inspect.sln b/network/trans/inspect/inspect.sln index 40b0cead..3f3ae438 100644 --- a/network/trans/inspect/inspect.sln +++ b/network/trans/inspect/inspect.sln @@ -1,28 +1,31 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30114.105 MinimumVisualStudioVersion = 12.0 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inspect", "sys\inspect.vcxproj", "{5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Debug|Win32.ActiveCfg = Debug|Win32 - {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Debug|Win32.Build.0 = Debug|Win32 - {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Release|Win32.ActiveCfg = Release|Win32 - {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Release|Win32.Build.0 = Release|Win32 + {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Debug|Win32.ActiveCfg = Debug|x64 + {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Debug|Win32.Build.0 = Debug|x64 {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Debug|x64.ActiveCfg = Debug|x64 {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Debug|x64.Build.0 = Debug|x64 + {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Release|Win32.ActiveCfg = Release|Win32 + {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Release|Win32.Build.0 = Release|Win32 {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Release|x64.ActiveCfg = Release|x64 {5CF7CFC1-02B4-4938-AC5F-47D743D82E8A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F084D2B3-2035-4BCE-A4D1-FA6AE812D7A1} + EndGlobalSection EndGlobal diff --git a/network/trans/inspect/sys/inspect.c b/network/trans/inspect/sys/inspect.c index 418daf9a..8dd6b72a 100644 --- a/network/trans/inspect/sys/inspect.c +++ b/network/trans/inspect/sys/inspect.c @@ -1278,7 +1278,7 @@ TLInspectWorker( listEntry ); - NT_ASSERT((packet->direction == FWP_DIRECTION_INBOUND) || + NT_ASSERT((packet->direction != FWP_DIRECTION_INBOUND) || (packet->authConnectDecision == 0)); if (packet->authConnectDecision == 0) diff --git a/network/trans/inspect/sys/inspect.vcxproj b/network/trans/inspect/sys/inspect.vcxproj index 2115972e..c154521d 100644 --- a/network/trans/inspect/sys/inspect.vcxproj +++ b/network/trans/inspect/sys/inspect.vcxproj @@ -23,14 +23,14 @@ $(MSBuildProjectName) 1 Debug - Win32 + Desktop {910EE323-2C33-42E0-B2DD-3C3BB1F4689E} Windows10 False - Universal + Desktop KMDF WindowsKernelModeDriver10.0 Driver @@ -38,7 +38,7 @@ Windows10 True - Universal + Desktop KMDF WindowsKernelModeDriver10.0 Driver @@ -46,7 +46,7 @@ Windows10 False - Universal + Desktop KMDF WindowsKernelModeDriver10.0 Driver @@ -54,7 +54,7 @@ Windows10 True - Universal + Desktop KMDF WindowsKernelModeDriver10.0 Driver @@ -75,7 +75,10 @@ - + + + + inspect @@ -170,7 +173,6 @@ - @@ -179,7 +181,7 @@ - + \ No newline at end of file diff --git a/network/trans/inspect/sys/inspect.vcxproj.Filters b/network/trans/inspect/sys/inspect.vcxproj.Filters index 96fc4202..f4a5dbe0 100644 --- a/network/trans/inspect/sys/inspect.vcxproj.Filters +++ b/network/trans/inspect/sys/inspect.vcxproj.Filters @@ -29,4 +29,17 @@ Source Files + + + Header Files + + + Header Files + + + + + Driver Files + + \ No newline at end of file -- cgit v1.3.1 From 6e893a444143639dd30ef19e60329a640de8c61f Mon Sep 17 00:00:00 2001 From: bodengMS <79470645+bodengMS@users.noreply.github.com> Date: Mon, 22 Feb 2021 10:55:27 -0800 Subject: Update ndis filter driver file digest algorithm to SHA256. (#580) --- network/ndis/filter/ndislwf.vcxproj | 12 ++++++++++++ network/ndis/filter/ndislwf.vcxproj.Filters | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'network') diff --git a/network/ndis/filter/ndislwf.vcxproj b/network/ndis/filter/ndislwf.vcxproj index f381ba89..fa4f9d39 100644 --- a/network/ndis/filter/ndislwf.vcxproj +++ b/network/ndis/filter/ndislwf.vcxproj @@ -211,6 +211,9 @@ + + SHA256 + @@ -220,6 +223,9 @@ + + SHA256 + @@ -229,6 +235,9 @@ + + SHA256 + @@ -238,6 +247,9 @@ + + SHA256 + diff --git a/network/ndis/filter/ndislwf.vcxproj.Filters b/network/ndis/filter/ndislwf.vcxproj.Filters index 200de09e..fab2d582 100644 --- a/network/ndis/filter/ndislwf.vcxproj.Filters +++ b/network/ndis/filter/ndislwf.vcxproj.Filters @@ -37,4 +37,23 @@ Resource Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Driver Files + + \ No newline at end of file -- cgit v1.3.1