Author: tkreuzer Date: Tue Mar 10 00:09:20 2015 New Revision: 66636
URL: http://svn.reactos.org/svn/reactos?rev=66636&view=rev Log: [DDK/XDK] - Fix some prototypes in wdm.h (PMDLX -> PMDL) - Fix annotations for ExFreePool(WithTag)
Modified: trunk/reactos/include/ddk/wdm.h trunk/reactos/include/xdk/exfuncs.h trunk/reactos/include/xdk/mmfuncs.h trunk/reactos/win32ss/gdi/eng/mem.c
Modified: trunk/reactos/include/ddk/wdm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=66636... ============================================================================== --- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Tue Mar 10 00:09:20 2015 @@ -11593,7 +11593,7 @@ VOID NTAPI MmBuildMdlForNonPagedPool( - _Inout_ PMDLX MemoryDescriptorList); + _Inout_ PMDL MemoryDescriptorList);
//DECLSPEC_DEPRECATED_DDK NTKERNELAPI @@ -11626,7 +11626,7 @@ VOID NTAPI MmFreePagesFromMdl( - _Inout_ PMDLX MemoryDescriptorList); + _Inout_ PMDL MemoryDescriptorList);
_IRQL_requires_max_(PASSIVE_LEVEL) NTKERNELAPI @@ -11681,7 +11681,7 @@ PVOID NTAPI MmMapLockedPagesSpecifyCache( - _Inout_ PMDLX MemoryDescriptorList, + _Inout_ PMDL MemoryDescriptorList, _In_ __drv_strictType(KPROCESSOR_MODE/enum _MODE,__drv_typeConst) KPROCESSOR_MODE AccessMode, _In_ __drv_strictTypeMatch(__drv_typeCond) MEMORY_CACHING_TYPE CacheType, @@ -11703,7 +11703,7 @@ VOID NTAPI MmProbeAndLockPages( - _Inout_ PMDLX MemoryDescriptorList, + _Inout_ PMDL MemoryDescriptorList, _In_ KPROCESSOR_MODE AccessMode, _In_ LOCK_OPERATION Operation);
@@ -11738,7 +11738,7 @@ VOID NTAPI MmUnlockPages( - _Inout_ PMDLX MemoryDescriptorList); + _Inout_ PMDL MemoryDescriptorList);
_IRQL_requires_max_(DISPATCH_LEVEL) NTKERNELAPI @@ -11789,7 +11789,7 @@ NTSTATUS NTAPI MmAdvanceMdl( - _Inout_ PMDLX Mdl, + _Inout_ PMDL Mdl, _In_ ULONG NumberOfBytes);
_Must_inspect_result_ @@ -11829,7 +11829,7 @@ MmMapLockedPagesWithReservedMapping( _In_ PVOID MappingAddress, _In_ ULONG PoolTag, - _Inout_ PMDLX MemoryDescriptorList, + _Inout_ PMDL MemoryDescriptorList, _In_ __drv_strictTypeMatch(__drv_typeCond) MEMORY_CACHING_TYPE CacheType);
@@ -11839,7 +11839,7 @@ NTSTATUS NTAPI MmProtectMdlSystemAddress( - _In_ PMDLX MemoryDescriptorList, + _In_ PMDL MemoryDescriptorList, _In_ ULONG NewProtect);
_IRQL_requires_max_(DISPATCH_LEVEL) @@ -11849,7 +11849,7 @@ MmUnmapReservedMapping( _In_ PVOID BaseAddress, _In_ ULONG PoolTag, - _Inout_ PMDLX MemoryDescriptorList); + _Inout_ PMDL MemoryDescriptorList);
_IRQL_requires_max_ (APC_LEVEL) NTKERNELAPI @@ -14799,14 +14799,14 @@ VOID NTAPI ExFreePool( - _In_ __drv_freesMem(Mem) PVOID P); + _Pre_notnull_ __drv_freesMem(Mem) PVOID P);
_IRQL_requires_max_(DISPATCH_LEVEL) NTKERNELAPI VOID NTAPI ExFreePoolWithTag( - _In_ __drv_freesMem(Mem) PVOID P, + _Pre_notnull_ __drv_freesMem(Mem) PVOID P, _In_ ULONG Tag);
_IRQL_requires_max_(DISPATCH_LEVEL)
Modified: trunk/reactos/include/xdk/exfuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/exfuncs.h?rev=6... ============================================================================== --- trunk/reactos/include/xdk/exfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/exfuncs.h [iso-8859-1] Tue Mar 10 00:09:20 2015 @@ -606,14 +606,14 @@ VOID NTAPI ExFreePool( - _In_ __drv_freesMem(Mem) PVOID P); + _Pre_not __drv_freesMem(Mem) PVOID P);
_IRQL_requires_max_(DISPATCH_LEVEL) NTKERNELAPI VOID NTAPI ExFreePoolWithTag( - _In_ __drv_freesMem(Mem) PVOID P, + _Pre_not __drv_freesMem(Mem) PVOID P, _In_ ULONG Tag);
_IRQL_requires_max_(DISPATCH_LEVEL)
Modified: trunk/reactos/include/xdk/mmfuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/mmfuncs.h?rev=6... ============================================================================== --- trunk/reactos/include/xdk/mmfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/mmfuncs.h [iso-8859-1] Tue Mar 10 00:09:20 2015 @@ -232,7 +232,7 @@ VOID NTAPI MmBuildMdlForNonPagedPool( - _Inout_ PMDLX MemoryDescriptorList); + _Inout_ PMDL MemoryDescriptorList);
//DECLSPEC_DEPRECATED_DDK NTKERNELAPI @@ -265,7 +265,7 @@ VOID NTAPI MmFreePagesFromMdl( - _Inout_ PMDLX MemoryDescriptorList); + _Inout_ PMDL MemoryDescriptorList);
_IRQL_requires_max_(PASSIVE_LEVEL) NTKERNELAPI @@ -320,7 +320,7 @@ PVOID NTAPI MmMapLockedPagesSpecifyCache( - _Inout_ PMDLX MemoryDescriptorList, + _Inout_ PMDL MemoryDescriptorList, _In_ __drv_strictType(KPROCESSOR_MODE/enum _MODE,__drv_typeConst) KPROCESSOR_MODE AccessMode, _In_ __drv_strictTypeMatch(__drv_typeCond) MEMORY_CACHING_TYPE CacheType, @@ -342,7 +342,7 @@ VOID NTAPI MmProbeAndLockPages( - _Inout_ PMDLX MemoryDescriptorList, + _Inout_ PMDL MemoryDescriptorList, _In_ KPROCESSOR_MODE AccessMode, _In_ LOCK_OPERATION Operation);
@@ -377,7 +377,7 @@ VOID NTAPI MmUnlockPages( - _Inout_ PMDLX MemoryDescriptorList); + _Inout_ PMDL MemoryDescriptorList);
_IRQL_requires_max_(DISPATCH_LEVEL) NTKERNELAPI @@ -629,7 +629,7 @@ NTSTATUS NTAPI MmAdvanceMdl( - _Inout_ PMDLX Mdl, + _Inout_ PMDL Mdl, _In_ ULONG NumberOfBytes);
_Must_inspect_result_ @@ -669,7 +669,7 @@ MmMapLockedPagesWithReservedMapping( _In_ PVOID MappingAddress, _In_ ULONG PoolTag, - _Inout_ PMDLX MemoryDescriptorList, + _Inout_ PMDL MemoryDescriptorList, _In_ __drv_strictTypeMatch(__drv_typeCond) MEMORY_CACHING_TYPE CacheType);
@@ -679,7 +679,7 @@ NTSTATUS NTAPI MmProtectMdlSystemAddress( - _In_ PMDLX MemoryDescriptorList, + _In_ PMDL MemoryDescriptorList, _In_ ULONG NewProtect);
_IRQL_requires_max_(DISPATCH_LEVEL) @@ -689,7 +689,7 @@ MmUnmapReservedMapping( _In_ PVOID BaseAddress, _In_ ULONG PoolTag, - _Inout_ PMDLX MemoryDescriptorList); + _Inout_ PMDL MemoryDescriptorList);
_IRQL_requires_max_ (APC_LEVEL) NTKERNELAPI
Modified: trunk/reactos/win32ss/gdi/eng/mem.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/mem.c?rev=6... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/mem.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/mem.c [iso-8859-1] Tue Mar 10 00:09:20 2015 @@ -14,16 +14,20 @@ /* * @implemented */ +_Must_inspect_result_ +_When_(fl & FL_ZERO_MEMORY, _Ret_opt_bytecount_(cjMemSize)) +_When_(!(fl & FL_ZERO_MEMORY), _Ret_opt_bytecap_(cjMemSize)) +ENGAPI PVOID APIENTRY EngAllocMem( - ULONG Flags, - ULONG cjMemSize, - ULONG ulTag) + _In_ ULONG fl, + _In_ ULONG cjMemSize, + _In_ ULONG ulTag) { PVOID pvBaseAddress;
- pvBaseAddress = ExAllocatePoolWithTag((Flags & FL_NONPAGED_MEMORY) ? + pvBaseAddress = ExAllocatePoolWithTag((fl & FL_NONPAGED_MEMORY) ? NonPagedPool : PagedPool, cjMemSize, ulTag); @@ -31,7 +35,7 @@ if (pvBaseAddress == NULL) return NULL;
- if (Flags & FL_ZERO_MEMORY) + if (fl & FL_ZERO_MEMORY) RtlZeroMemory(pvBaseAddress, cjMemSize);
return pvBaseAddress; @@ -55,9 +59,14 @@ /* * @implemented */ +_Must_inspect_result_ +_Ret_opt_bytecount_(cjMemSize) +ENGAPI PVOID APIENTRY -EngAllocUserMem(SIZE_T cjSize, ULONG ulTag) +EngAllocUserMem( + _In_ SIZE_T cjMemSize, + _In_ ULONG ulTag) { PVOID pvBaseAddress = NULL; NTSTATUS Status; @@ -65,7 +74,7 @@ Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &pvBaseAddress, 0, - &cjSize, + &cjMemSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
@@ -77,7 +86,7 @@ /* TODO: Add allocation info to AVL tree (stored inside W32PROCESS structure) */ //hSecure = EngSecureMem(pvBaseAddress, cj);
- return pvBaseAddress; + return pvBaseAddress; }
/* @@ -96,7 +105,6 @@
/* TODO: Remove allocation info from AVL tree */ } -
PVOID APIENTRY