[IMM32] Improve ImmUnlockClientImc and Imm32HeapAlloc (#3834)

- Fix Imm32HeapAlloc function.
- Fix ImmUnlockClientImc function.
CORE-11700
This commit is contained in:
Katayama Hirofumi MZ 2021-07-25 11:55:03 +09:00 committed by GitHub
parent f2bc1f0e11
commit 5afc324359
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View 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;

View 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" {