Commit 1992f500 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Implement the InitOnce functions.

parent fcb3e603
...@@ -745,12 +745,15 @@ ...@@ -745,12 +745,15 @@
@ stdcall IdnToNameprepUnicode(long wstr long ptr long) @ stdcall IdnToNameprepUnicode(long wstr long ptr long)
@ stdcall IdnToUnicode(long wstr long ptr long) @ stdcall IdnToUnicode(long wstr long ptr long)
@ stdcall InitAtomTable(long) @ stdcall InitAtomTable(long)
@ stdcall InitializeSRWLock(ptr) @ stdcall InitOnceBeginInitialize(ptr long ptr ptr)
@ stdcall InitOnceComplete(ptr long ptr)
@ stdcall InitOnceExecuteOnce(ptr ptr ptr ptr)
@ stdcall InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize
@ stdcall InitializeCriticalSection(ptr) @ stdcall InitializeCriticalSection(ptr)
@ stdcall InitializeCriticalSectionAndSpinCount(ptr long) @ stdcall InitializeCriticalSectionAndSpinCount(ptr long)
@ stdcall InitializeCriticalSectionEx(ptr long long) @ stdcall InitializeCriticalSectionEx(ptr long long)
@ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead @ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead
@ stdcall InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize @ stdcall InitializeSRWLock(ptr)
@ stdcall -arch=i386 InterlockedCompareExchange (ptr long long) @ stdcall -arch=i386 InterlockedCompareExchange (ptr long long)
@ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr int64 int64) ntdll.RtlInterlockedCompareExchange64 @ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr int64 int64) ntdll.RtlInterlockedCompareExchange64
@ stdcall -arch=i386 InterlockedDecrement(ptr) @ stdcall -arch=i386 InterlockedDecrement(ptr)
......
...@@ -2237,6 +2237,35 @@ BOOL WINAPI QueryMemoryResourceNotification(HANDLE handle, PBOOL state) ...@@ -2237,6 +2237,35 @@ BOOL WINAPI QueryMemoryResourceNotification(HANDLE handle, PBOOL state)
return FALSE; return FALSE;
} }
/***********************************************************************
* InitOnceBeginInitialize (KERNEL32.@)
*/
BOOL WINAPI InitOnceBeginInitialize( INIT_ONCE *once, DWORD flags, BOOL *pending, void **context )
{
NTSTATUS status = RtlRunOnceBeginInitialize( once, flags, context );
if (status >= 0) *pending = (status == STATUS_PENDING);
else SetLastError( RtlNtStatusToDosError(status) );
return status >= 0;
}
/***********************************************************************
* InitOnceComplete (KERNEL32.@)
*/
BOOL WINAPI InitOnceComplete( INIT_ONCE *once, DWORD flags, void *context )
{
NTSTATUS status = RtlRunOnceComplete( once, flags, context );
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
return !status;
}
/***********************************************************************
* InitOnceExecuteOnce (KERNEL32.@)
*/
BOOL WINAPI InitOnceExecuteOnce( INIT_ONCE *once, PINIT_ONCE_FN func, void *param, void **context )
{
return !RtlRunOnceExecuteOnce( once, (PRTL_RUN_ONCE_INIT_FN)func, param, context );
}
#ifdef __i386__ #ifdef __i386__
/*********************************************************************** /***********************************************************************
......
...@@ -1164,7 +1164,7 @@ static void test_initonce(void) ...@@ -1164,7 +1164,7 @@ static void test_initonce(void)
if (!pInitOnceInitialize || !pInitOnceExecuteOnce) if (!pInitOnceInitialize || !pInitOnceExecuteOnce)
{ {
todo_wine win_skip("one-time initialization API not supported\n"); win_skip("one-time initialization API not supported\n");
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment