Reflective initialization in release configuration

This commit is contained in:
Boring
2023-12-17 15:08:33 +08:00
parent 8d1454fab1
commit 2aa3cf99c8
5 changed files with 58 additions and 28 deletions
+4 -2
View File
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "LoaderPrivate.h"
#include <wchar.h>
#include <cassert>
#include <cstdio>
PMMP_GLOBAL_DATA MmpGlobalDataPtr;
@@ -544,7 +544,9 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReser
if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
if (NT_SUCCESS(Initialize())) {
if (lpReserved == (PVOID)-1) {
assert(ReflectiveMapDll(hModule));
if (!ReflectiveMapDll(hModule)) {
RtlRaiseStatus(STATUS_NOT_SUPPORTED);
}
}
return TRUE;