Fix 32-bit compilation failure

This commit is contained in:
Boring
2022-11-17 13:06:19 +08:00
parent a4bf9430d1
commit dcf5f3ccde
4 changed files with 11 additions and 9 deletions
+2 -2
View File
@@ -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;
+5 -4
View File
@@ -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);
+3 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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