mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:45:50 +00:00
[KERNEL32_APITEST] Improve InitOnce test
This commit is contained in:
parent
6286475d71
commit
7497f028f4
1 changed files with 11 additions and 0 deletions
|
@ -154,6 +154,7 @@ _test_sync:
|
||||||
|
|
||||||
/* Re-initialize One-Time initialization structure by using INIT_ONCE_STATIC_INIT */
|
/* Re-initialize One-Time initialization structure by using INIT_ONCE_STATIC_INIT */
|
||||||
InitOnce = (INIT_ONCE)INIT_ONCE_STATIC_INIT;
|
InitOnce = (INIT_ONCE)INIT_ONCE_STATIC_INIT;
|
||||||
|
ulContextData = 0xdeadbeef;
|
||||||
|
|
||||||
/* Perform synchronous initialization by using InitOnceBeginInitialize */
|
/* Perform synchronous initialization by using InitOnceBeginInitialize */
|
||||||
fPending = FALSE;
|
fPending = FALSE;
|
||||||
|
@ -169,6 +170,16 @@ _test_sync:
|
||||||
goto _test_async;
|
goto _test_async;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Call again to check whether initialization has completed */
|
||||||
|
fPending = 0xdeadbeef;
|
||||||
|
bRet = pfnInitOnceBeginInitialize(&InitOnce,
|
||||||
|
INIT_ONCE_CHECK_ONLY,
|
||||||
|
&fPending,
|
||||||
|
(LPVOID*)&ulContextData);
|
||||||
|
ok(bRet == FALSE, "InitOnceBeginInitialize should fail\n");
|
||||||
|
ok(fPending == 0xdeadbeef, "fPending should be unmodified\n");
|
||||||
|
ok(ulContextData == 0xdeadbeef, "ulContextData should be unmodified\n");
|
||||||
|
|
||||||
/* Complete the initialization */
|
/* Complete the initialization */
|
||||||
InitWorker(&ulInitCount, &ulTempContext);
|
InitWorker(&ulInitCount, &ulTempContext);
|
||||||
bRet = pfnInitOnceComplete(&InitOnce, 0, (LPVOID)ulTempContext);
|
bRet = pfnInitOnceComplete(&InitOnce, 0, (LPVOID)ulTempContext);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue