driver: switch to MS-recommended memory alloc
Suggested-by: Static Driver Verifier Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
		
							parent
							
								
									dccf2085cb
								
							
						
					
					
						commit
						928f21c573
					
				| @ -89,7 +89,7 @@ | ||||
|   </PropertyGroup> | ||||
|   <ItemDefinitionGroup> | ||||
|     <ClCompile> | ||||
|       <PreprocessorDefinitions>NDIS_MINIPORT_DRIVER=1;NDIS620_MINIPORT=1;NDIS683_MINIPORT=1;NDIS_WDM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <PreprocessorDefinitions>NDIS_MINIPORT_DRIVER=1;NDIS620_MINIPORT=1;NDIS683_MINIPORT=1;NDIS_WDM=1;POOL_ZERO_DOWN_LEVEL_SUPPORT;POOL_NX_OPTIN=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <AdditionalOptions>/volatile:iso %(AdditionalOptions)</AdditionalOptions> | ||||
|       <EnablePREfast>true</EnablePREfast> | ||||
|     </ClCompile> | ||||
|  | ||||
| @ -988,10 +988,10 @@ TunInitializeEx( | ||||
| 
 | ||||
| /* Leaking memory 'Ctx'. Note: 'Ctx' is freed in TunHaltEx or on failure. */ | ||||
| #pragma warning(suppress : 6014) | ||||
|     TUN_CTX *Ctx = ExAllocatePoolWithTag(NonPagedPoolNx, sizeof(*Ctx), TUN_MEMORY_TAG); | ||||
| #pragma warning(suppress : 28160) | ||||
|     TUN_CTX *Ctx = ExAllocatePoolZero(NonPagedPool, sizeof(*Ctx), TUN_MEMORY_TAG); | ||||
|     if (!Ctx) | ||||
|         return NDIS_STATUS_FAILURE; | ||||
|     NdisZeroMemory(Ctx, sizeof(*Ctx)); | ||||
| 
 | ||||
|     Ctx->MiniportAdapterHandle = MiniportAdapterHandle; | ||||
| 
 | ||||
| @ -1420,6 +1420,8 @@ DriverEntry(DRIVER_OBJECT *DriverObject, UNICODE_STRING *RegistryPath) | ||||
| { | ||||
|     NTSTATUS Status; | ||||
| 
 | ||||
|     ExInitializeDriverRuntime(DrvRtPoolNxOptIn); | ||||
| 
 | ||||
|     NdisVersion = NdisGetVersion(); | ||||
|     if (NdisVersion < NDIS_MINIPORT_VERSION_MIN) | ||||
|         return NDIS_STATUS_UNSUPPORTED_REVISION; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user