-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathLoadDllMemoryApi.h
More file actions
51 lines (39 loc) · 1.37 KB
/
Copy pathLoadDllMemoryApi.h
File metadata and controls
51 lines (39 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <Windows.h>
typedef HMODULE HMEMORYMODULE;
#include "Loader.h"
#define MemoryModuleToModule(_hMemoryModule_) (_hMemoryModule_)
#ifndef NT_SUCCESS
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
#endif
HMEMORYMODULE WINAPI LoadLibraryMemory(_In_ PVOID BufferAddress);
HMEMORYMODULE WINAPI LoadLibraryMemoryExA(
_In_ PVOID BufferAddress,
_In_ size_t Reserved,
_In_opt_ LPCSTR DllBaseName,
_In_opt_ LPCSTR DllFullName,
_In_ DWORD Flags
);
HMEMORYMODULE WINAPI LoadLibraryMemoryExW(
_In_ PVOID BufferAddress,
_In_ size_t Reserved,
_In_opt_ LPCWSTR DllBaseName,
_In_opt_ LPCWSTR DllFullName,
_In_ DWORD Flags
);
BOOL WINAPI FreeLibraryMemory(_In_ HMEMORYMODULE hMemoryModule);
#define NtLoadDllMemory LdrLoadDllMemory
#define NtLoadDllMemoryExA LdrLoadDllMemoryExA
#define NtLoadDllMemoryExW LdrLoadDllMemoryExW
#define NtUnloadDllMemory LdrUnloadDllMemory
#define NtUnloadDllMemoryAndExitThread LdrUnloadDllMemoryAndExitThread
#define FreeLibraryMemoryAndExitThread LdrUnloadDllMemoryAndExitThread
#define NtQuerySystemMemoryModuleFeatures LdrQuerySystemMemoryModuleFeatures
#ifdef UNICODE
#define LdrLoadDllMemoryEx LdrLoadDllMemoryExW
#define LoadLibraryMemoryEx LoadLibraryMemoryExW
#else
#define LdrLoadDllMemoryEx LdrLoadDllMemoryExA
#define LoadLibraryMemoryEx LoadLibraryMemoryExA
#endif
#define NtLoadDllMemoryEx LdrLoadDllMemoryEx