mirror of
https://github.com/bb107/MemoryModulePP
synced 2026-06-08 13:15:33 +00:00
Fix 32-bit compilation failure
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
VOID RtlRbInsertNodeEx(
|
||||
VOID NTAPI RtlRbInsertNodeEx(
|
||||
_In_ PRTL_RB_TREE Tree,
|
||||
_In_ PRTL_BALANCED_NODE Parent,
|
||||
_In_ BOOLEAN Right,
|
||||
@@ -11,7 +11,7 @@ VOID RtlRbInsertNodeEx(
|
||||
return decltype(&RtlRbInsertNodeEx)(MmpGlobalDataPtr->MmpBaseAddressIndex->_RtlRbInsertNodeEx)(Tree, Parent, Right, Node);
|
||||
}
|
||||
|
||||
VOID RtlRbRemoveNode(
|
||||
VOID NTAPI RtlRbRemoveNode(
|
||||
_In_ PRTL_RB_TREE Tree,
|
||||
_In_ PRTL_BALANCED_NODE Node) {
|
||||
if (!MmpGlobalDataPtr->MmpBaseAddressIndex->_RtlRbRemoveNode)return;
|
||||
|
||||
@@ -291,19 +291,20 @@ VOID InitializeWindowsVersion() {
|
||||
|
||||
NTSTATUS MmpAllocateGlobalData() {
|
||||
NTSTATUS status;
|
||||
HANDLE hSection = nullptr;
|
||||
OBJECT_ATTRIBUTES oa;
|
||||
LARGE_INTEGER li;
|
||||
WCHAR buffer[128];
|
||||
HANDLE hSection = nullptr;
|
||||
UNICODE_STRING us{};
|
||||
PVOID BaseAddress = 0;
|
||||
SIZE_T ViewSize = 0;
|
||||
WCHAR buffer[128];
|
||||
PTEB teb = NtCurrentTeb();
|
||||
|
||||
swprintf_s(
|
||||
buffer,
|
||||
L"\\Sessions\\%d\\BaseNamedObjects\\MMPP*%08X",
|
||||
L"\\Sessions\\%d\\BaseNamedObjects\\MMPP*%p",
|
||||
NtCurrentPeb()->SessionId,
|
||||
(unsigned int)(ULONG_PTR)NtCurrentProcessId()
|
||||
(PVOID)(~(ULONG_PTR)teb->ClientId.UniqueProcess ^ (ULONG_PTR)teb->ProcessEnvironmentBlock->ProcessHeap)
|
||||
);
|
||||
|
||||
RtlInitUnicodeString(&us, buffer);
|
||||
|
||||
@@ -194,8 +194,9 @@ DWORD NTAPI MmpUserThreadStart(LPVOID lpThreadParameter) {
|
||||
|
||||
PTLS_ENTRY tls = CONTAINING_RECORD(entry, TLS_ENTRY, TlsEntryLinks);
|
||||
auto len = tls->TlsDirectory.EndAddressOfRawData - tls->TlsDirectory.StartAddressOfRawData;
|
||||
PVOID data = RtlAllocateHeap(RtlProcessHeap(), 0, len);
|
||||
if (!len) {
|
||||
PVOID data = len ? RtlAllocateHeap(RtlProcessHeap(), 0, len) : nullptr;
|
||||
if (!data) {
|
||||
RtlFreeHeap(RtlProcessHeap(), 0, data);
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ SIZE_T NTAPI _RtlCompareMemory(
|
||||
const VOID* Source1,
|
||||
const VOID* Source2,
|
||||
SIZE_T Length) {
|
||||
return decltype(&_RtlCompareMemory)(RtlGetNtProcAddress("RtlCompareMemory"))(Source1, Source2, Length);
|
||||
return decltype(&_RtlCompareMemory)(GetProcAddress((HMODULE)MmpGlobalDataPtr->MmpBaseAddressIndex->NtdllLdrEntry->DllBase,"RtlCompareMemory"))(Source1, Source2, Length);
|
||||
}
|
||||
#define RtlCompareMemory _RtlCompareMemory
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user