https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3d298831db03c30682ac1…
commit 3d298831db03c30682ac10d449655b68751362f9
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Nov 13 20:04:34 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Sun Nov 13 20:04:34 2022 +0900
[IMM32] Get gHighestUserAddress in ImmInitializeGlobals
CORE-11700
---
dll/win32/imm32/imm.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c
index 14193efb5cb..40f686e44f0 100644
--- a/dll/win32/imm32/imm.c
+++ b/dll/win32/imm32/imm.c
@@ -10,6 +10,7 @@
*/
#include "precomp.h"
+#include <ndk/exfuncs.h>
WINE_DEFAULT_DEBUG_CHANNEL(imm);
@@ -17,11 +18,13 @@ HMODULE ghImm32Inst = NULL; // Win: ghInst
PSERVERINFO gpsi = NULL; // Win: gpsi
SHAREDINFO gSharedInfo = { NULL }; // Win: gSharedInfo
BYTE gfImmInitialized = FALSE; // Win: gfInitialized
+ULONG_PTR gHighestUserAddress = 0;
// Win: ImmInitializeGlobals
static BOOL APIENTRY ImmInitializeGlobals(HMODULE hMod)
{
NTSTATUS status;
+ SYSTEM_BASIC_INFORMATION SysInfo;
if (hMod)
ghImm32Inst = hMod;
@@ -36,6 +39,14 @@ static BOOL APIENTRY ImmInitializeGlobals(HMODULE hMod)
return FALSE;
}
+ status = NtQuerySystemInformation(SystemBasicInformation, &SysInfo,
sizeof(SysInfo), NULL);
+ if (NT_ERROR(status))
+ {
+ ERR("\n");
+ return FALSE;
+ }
+ gHighestUserAddress = SysInfo.MaximumUserModeAddress;
+
gfImmInitialized = TRUE;
return TRUE;
}