[IMM32] Improve ImmUnlockClientImc and Imm32HeapAlloc (#3834) master
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Sun, 25 Jul 2021 02:55:03 +0000 (11:55 +0900)
committerGitHub <noreply@github.com>
Sun, 25 Jul 2021 02:55:03 +0000 (11:55 +0900)
- Fix Imm32HeapAlloc function.
- Fix ImmUnlockClientImc function.
CORE-11700

dll/win32/imm32/imm.c
sdk/include/reactos/imm32_undoc.h

index dc62b77..904e0d2 100644 (file)
@@ -1017,7 +1017,7 @@ LPVOID APIENTRY Imm32HeapAlloc(DWORD dwFlags, DWORD dwBytes)
 {
     if (!g_hImm32Heap)
     {
-        g_hImm32Heap = GetProcessHeap(); // FIXME: Use TEB
+        g_hImm32Heap = RtlGetProcessHeap();
         if (g_hImm32Heap == NULL)
             return NULL;
     }
@@ -1076,7 +1076,7 @@ PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
     }
     else
     {
-        if (pClientImc->dwFlags & CLIENTIMC_DISABLED)
+        if (pClientImc->dwFlags & CLIENTIMC_UNKNOWN1)
             return NULL;
     }
 
@@ -1092,7 +1092,7 @@ VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
     TRACE("ImmUnlockClientImc(%p)\n", pClientImc);
 
     cLocks = InterlockedDecrement(&pClientImc->cLockObj);
-    if (cLocks != 0 || (pClientImc->dwFlags & CLIENTIMC_DISABLED))
+    if (cLocks != 0 || !(pClientImc->dwFlags & CLIENTIMC_UNKNOWN1))
         return;
 
     hImc = pClientImc->hImc;
index e207d52..a2b068f 100644 (file)
@@ -21,9 +21,9 @@ typedef struct tagCLIENTIMC
 } CLIENTIMC, *PCLIENTIMC;
 
 /* flags for CLIENTIMC */
-#define CLIENTIMC_WIDE (1 << 0)
-#define CLIENTIMC_DISABLED (1 << 6)
-#define CLIENTIMC_UNKNOWN2 (1 << 8)
+#define CLIENTIMC_WIDE 0x1
+#define CLIENTIMC_UNKNOWN1 0x40
+#define CLIENTIMC_UNKNOWN2 0x100
 
 #ifdef __cplusplus
 extern "C" {