20 #ifndef WINPR_MEMORY_H
21 #define WINPR_MEMORY_H
27 #include <winpr/winpr.h>
28 #include <winpr/wtypes.h>
30 #include <winpr/crt.h>
31 #include <winpr/file.h>
40 WINPR_ATTR_MALLOC(CloseHandle, 1)
41 WINPR_API HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
42 DWORD flProtect, DWORD dwMaximumSizeHigh,
43 DWORD dwMaximumSizeLow, LPCSTR lpName);
45 WINPR_ATTR_MALLOC(CloseHandle, 1)
46 WINPR_API HANDLE CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
47 DWORD flProtect, DWORD dwMaximumSizeHigh,
48 DWORD dwMaximumSizeLow, LPCWSTR lpName);
50 WINPR_ATTR_MALLOC(CloseHandle, 1)
51 WINPR_API HANDLE OpenFileMappingA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName);
53 WINPR_ATTR_MALLOC(CloseHandle, 1)
54 WINPR_API HANDLE OpenFileMappingW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName);
56 WINPR_API LPVOID MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess,
57 DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow,
58 size_t dwNumberOfBytesToMap);
60 WINPR_API LPVOID MapViewOfFileEx(HANDLE hFileMappingObject, DWORD dwDesiredAccess,
61 DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow,
62 size_t dwNumberOfBytesToMap, LPVOID lpBaseAddress);
64 WINPR_API BOOL FlushViewOfFile(LPCVOID lpBaseAddress,
size_t dwNumberOfBytesToFlush);
66 WINPR_API BOOL UnmapViewOfFile(LPCVOID lpBaseAddress);
73 #define CreateFileMapping CreateFileMappingW
74 #define OpenFileMapping OpenFileMappingW
76 #define CreateFileMapping CreateFileMappingA
77 #define OpenFileMapping OpenFileMappingA