1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! ApiSet Contract for api-ms-win-core-heap-l1
7 use shared::basetsd::{PSIZE_T, SIZE_T};
8 use shared::minwindef::{BOOL, DWORD, LPCVOID, LPVOID};
9 use um::minwinbase::LPPROCESS_HEAP_ENTRY;
10 use um::winnt::{HANDLE, HEAP_INFORMATION_CLASS, PHANDLE, PVOID};
11 STRUCT!{struct HEAP_SUMMARY {
12     cb: DWORD,
13     cbAllocated: SIZE_T,
14     cbCommitted: SIZE_T,
15     cbReserved: SIZE_T,
16     cbMaxReserve: SIZE_T,
17 }}
18 pub type PHEAP_SUMMARY = *mut HEAP_SUMMARY;
19 pub type LPHEAP_SUMMARY = PHEAP_SUMMARY;
20 extern "system" {
HeapCreate( flOptions: DWORD, dwInitialSize: SIZE_T, dwMaximumSize: SIZE_T, ) -> HANDLE21     pub fn HeapCreate(
22         flOptions: DWORD,
23         dwInitialSize: SIZE_T,
24         dwMaximumSize: SIZE_T,
25     ) -> HANDLE;
HeapDestroy( hHeap: HANDLE, ) -> BOOL26     pub fn HeapDestroy(
27         hHeap: HANDLE,
28     ) -> BOOL;
HeapAlloc( hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T, ) -> LPVOID29     pub fn HeapAlloc(
30         hHeap: HANDLE,
31         dwFlags: DWORD,
32         dwBytes: SIZE_T,
33     ) -> LPVOID;
HeapReAlloc( hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID, dwBytes: SIZE_T, ) -> LPVOID34     pub fn HeapReAlloc(
35         hHeap: HANDLE,
36         dwFlags: DWORD,
37         lpMem: LPVOID,
38         dwBytes: SIZE_T,
39     ) -> LPVOID;
HeapFree( hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID, ) -> BOOL40     pub fn HeapFree(
41         hHeap: HANDLE,
42         dwFlags: DWORD,
43         lpMem: LPVOID,
44     ) -> BOOL;
HeapSize( hHeap: HANDLE, dwFlags: DWORD, lpMem: LPCVOID, ) -> SIZE_T45     pub fn HeapSize(
46         hHeap: HANDLE,
47         dwFlags: DWORD,
48         lpMem: LPCVOID,
49     ) -> SIZE_T;
GetProcessHeap() -> HANDLE50     pub fn GetProcessHeap() -> HANDLE;
HeapCompact( hHeap: HANDLE, dwFlags: DWORD, ) -> SIZE_T51     pub fn HeapCompact(
52         hHeap: HANDLE,
53         dwFlags: DWORD,
54     ) -> SIZE_T;
HeapSetInformation( HeapHandle: HANDLE, HeapInformationClass: HEAP_INFORMATION_CLASS, HeapInformation: PVOID, HeapInformationLength: SIZE_T, ) -> BOOL55     pub fn HeapSetInformation(
56         HeapHandle: HANDLE,
57         HeapInformationClass: HEAP_INFORMATION_CLASS,
58         HeapInformation: PVOID,
59         HeapInformationLength: SIZE_T,
60     ) -> BOOL;
HeapValidate( hHeap: HANDLE, dwFlags: DWORD, lpMem: LPCVOID, ) -> BOOL61     pub fn HeapValidate(
62         hHeap: HANDLE,
63         dwFlags: DWORD,
64         lpMem: LPCVOID,
65     ) -> BOOL;
HeapSummary( hHeap: HANDLE, dwFlags: DWORD, lpSummary: LPHEAP_SUMMARY, ) -> BOOL66     pub fn HeapSummary(
67         hHeap: HANDLE,
68         dwFlags: DWORD,
69         lpSummary: LPHEAP_SUMMARY,
70     ) -> BOOL;
GetProcessHeaps( NumberOfHeaps: DWORD, ProcessHeaps: PHANDLE, ) -> DWORD71     pub fn GetProcessHeaps(
72         NumberOfHeaps: DWORD,
73         ProcessHeaps: PHANDLE,
74     ) -> DWORD;
HeapLock( hHeap: HANDLE, ) -> BOOL75     pub fn HeapLock(
76         hHeap: HANDLE,
77     ) -> BOOL;
HeapUnlock( hHeap: HANDLE, ) -> BOOL78     pub fn HeapUnlock(
79         hHeap: HANDLE,
80     ) -> BOOL;
HeapWalk( hHeap: HANDLE, lpEntry: LPPROCESS_HEAP_ENTRY, ) -> BOOL81     pub fn HeapWalk(
82         hHeap: HANDLE,
83         lpEntry: LPPROCESS_HEAP_ENTRY,
84     ) -> BOOL;
HeapQueryInformation( HeapHandle: HANDLE, HeapInformationClass: HEAP_INFORMATION_CLASS, HeapInformation: PVOID, HeapInformationLength: SIZE_T, ReturnLength: PSIZE_T, ) -> BOOL85     pub fn HeapQueryInformation(
86         HeapHandle: HANDLE,
87         HeapInformationClass: HEAP_INFORMATION_CLASS,
88         HeapInformation: PVOID,
89         HeapInformationLength: SIZE_T,
90         ReturnLength: PSIZE_T,
91     ) -> BOOL;
92 }
93