Details
Description
(Noticed while working on CORE-7241.)
The first check is (partly) broken,
the second check indentation is misleading.
5089 NtFreeVirtualMemory(IN HANDLE ProcessHandle, |
5090 IN PVOID* UBaseAddress, |
5091 IN PSIZE_T URegionSize, |
5092 IN ULONG FreeType) |
|
5110 // |
5111 // Only two flags are supported |
5112 // |
5113 if (!(FreeType & (MEM_RELEASE | MEM_DECOMMIT))) |
5114 {
|
5115 DPRINT1("Invalid FreeType\n"); |
5116 return STATUS_INVALID_PARAMETER_4; |
5117 }
|
5118
|
5119 // |
5120 // Check if no flag was used, or if both flags were used |
5121 // |
5122 if (!((FreeType & (MEM_DECOMMIT | MEM_RELEASE))) || |
5123 ((FreeType & (MEM_DECOMMIT | MEM_RELEASE)) == (MEM_DECOMMIT | MEM_RELEASE)))
|
5124 {
|
5125 DPRINT1("Invalid FreeType combination\n"); |
5126 return STATUS_INVALID_PARAMETER_4; |
5127 }
|
—
kmtests/ntos_mm/ZwAllocateVirtualMemory.c
uses 'MEM_RELEASE' case only.
We should also add tests for the 4 other cases,
either there or in a dedicated ZwFreeVirtualMemory.c.