ReactOS  0.4.15-dev-5122-g72bdbdd
clientimc.c File Reference
#include "precomp.h"
Include dependency graph for clientimc.c:

Go to the source code of this file.

Functions

 START_TEST (clientimc)
 

Function Documentation

◆ START_TEST()

START_TEST ( clientimc  )

Definition at line 22 of file clientimc.c.

23 {
24  DWORD dwCode;
25  CLIENTIMC *pClientImc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CLIENTIMC));
26 
27  pClientImc->hInputContext = (HANDLE)ImmCreateIMCC(4);
28  pClientImc->cLockObj = 2;
29  pClientImc->dwFlags = 0x40;
30  RtlInitializeCriticalSection(&pClientImc->cs);
31  ok_long(ImmGetIMCCSize((HIMCC)pClientImc->hInputContext), 4);
32 
33  ImmUnlockClientImc(pClientImc);
34  ok_long(pClientImc->cLockObj, 1);
35  ok_long(ImmGetIMCCSize((HIMCC)pClientImc->hInputContext), 4);
36 
37  dwCode = 0;
38  _SEH2_TRY
39  {
40  ImmUnlockClientImc(pClientImc);
41  }
43  {
44  dwCode = _SEH2_GetExceptionCode();
45  }
46  _SEH2_END;
48 
49  ok_long(pClientImc->cLockObj, 0);
50  ok_long(ImmGetIMCCSize((HIMCC)pClientImc->hInputContext), 0);
51 
52  HeapFree(GetProcessHeap(), 0, pClientImc);
53 }
DWORD WINAPI ImmGetIMCCSize(HIMCC imcc)
Definition: utils.c:1147
DWORD HIMCC
Definition: dimm.idl:76
LONG cLockObj
Definition: ntuser.h:1307
#define ok_long(expression, result)
Definition: atltest.h:133
_SEH2_TRY
Definition: create.c:4226
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: utils.c:1089
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
HANDLE hInputContext
Definition: ntuser.h:1306
PVOID HANDLE
Definition: typedefs.h:73
unsigned long DWORD
Definition: ntddk_ex.h:95
RTL_CRITICAL_SECTION cs
Definition: ntuser.h:1310
_SEH2_END
Definition: create.c:4400
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
DWORD dwFlags
Definition: ntuser.h:1308
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define HeapFree(x, y, z)
Definition: compat.h:594
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:946