mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:25:39 +00:00
Phase 1:
- Implement RegisterWaitForSingleObject/Ex and UnregisterWait/Ex in stubs.c. I'm not sure where to place the exports. So ATM it is here. - Stub RtlRegisterWait and RtlDeregisterWait/Ex. - Import from Wine source and is LGPL. - Ref: http://source.winehq.org/WineAPI/RtlRegisterWait.html http://source.winehq.org/WineAPI/RtlDeregisterWait.html svn path=/trunk/; revision=32778
This commit is contained in:
parent
5b92a7951b
commit
fd52a49081
3 changed files with 133 additions and 8 deletions
|
@ -404,6 +404,8 @@ RtlDeleteSecurityObject@4
|
||||||
RtlDeleteTimer@12
|
RtlDeleteTimer@12
|
||||||
RtlDeleteTimerQueue@4
|
RtlDeleteTimerQueue@4
|
||||||
RtlDeleteTimerQueueEx@8
|
RtlDeleteTimerQueueEx@8
|
||||||
|
RtlDeregisterWait@4
|
||||||
|
RtlDeregisterWaitEx@8
|
||||||
RtlDestroyAtomTable@4
|
RtlDestroyAtomTable@4
|
||||||
RtlDestroyEnvironment@4
|
RtlDestroyEnvironment@4
|
||||||
RtlDestroyHandleTable@4
|
RtlDestroyHandleTable@4
|
||||||
|
@ -622,6 +624,7 @@ RtlRandomEx=RtlRandom@4
|
||||||
RtlReAllocateHeap@16
|
RtlReAllocateHeap@16
|
||||||
RtlRealPredecessor@4
|
RtlRealPredecessor@4
|
||||||
RtlRealSuccessor@4
|
RtlRealSuccessor@4
|
||||||
|
RtlRegisterWait@24
|
||||||
RtlReleasePebLock@0
|
RtlReleasePebLock@0
|
||||||
RtlReleaseRelativeName@4
|
RtlReleaseRelativeName@4
|
||||||
RtlReleaseResource@4
|
RtlReleaseResource@4
|
||||||
|
|
|
@ -8,6 +8,10 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
NTSTATUS NTAPI RtlRegisterWait(PHANDLE, HANDLE, WAITORTIMERCALLBACKFUNC, PVOID, ULONG, ULONG);
|
||||||
|
NTSTATUS NTAPI RtlDeregisterWaitEx(HANDLE, HANDLE);
|
||||||
|
NTSTATUS NTAPI RtlDeregisterWait(HANDLE);
|
||||||
|
|
||||||
|
|
||||||
#define STUB \
|
#define STUB \
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
|
||||||
|
@ -657,8 +661,18 @@ RegisterWaitForSingleObject(
|
||||||
ULONG dwFlags
|
ULONG dwFlags
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
STUB;
|
NTSTATUS status;
|
||||||
return 0;
|
|
||||||
|
// TRACE("%p %p %p %p %d %d\n",
|
||||||
|
// phNewWaitObject,hObject,Callback,Context,dwMilliseconds,dwFlags);
|
||||||
|
|
||||||
|
status = RtlRegisterWait( phNewWaitObject, hObject, Callback, Context, dwMilliseconds, dwFlags );
|
||||||
|
if (status != STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
SetLastError( RtlNtStatusToDosError(status) );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -674,8 +688,19 @@ RegisterWaitForSingleObjectEx(
|
||||||
ULONG dwFlags
|
ULONG dwFlags
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
STUB;
|
NTSTATUS status;
|
||||||
return 0;
|
HANDLE hNewWaitObject;
|
||||||
|
|
||||||
|
// TRACE("%p %p %p %d %d\n",
|
||||||
|
// hObject,Callback,Context,dwMilliseconds,dwFlags);
|
||||||
|
|
||||||
|
status = RtlRegisterWait( &hNewWaitObject, hObject, Callback, Context, dwMilliseconds, dwFlags );
|
||||||
|
if (status != STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
SetLastError( RtlNtStatusToDosError(status) );
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return hNewWaitObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -794,8 +819,17 @@ UnregisterWait(
|
||||||
HANDLE WaitHandle
|
HANDLE WaitHandle
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
STUB;
|
NTSTATUS status;
|
||||||
return 0;
|
|
||||||
|
// TRACE("%p\n",WaitHandle);
|
||||||
|
|
||||||
|
status = RtlDeregisterWaitEx( WaitHandle, NULL );
|
||||||
|
if (status != STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
SetLastError( RtlNtStatusToDosError(status) );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -808,8 +842,17 @@ UnregisterWaitEx(
|
||||||
HANDLE CompletionEvent
|
HANDLE CompletionEvent
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
STUB;
|
NTSTATUS status;
|
||||||
return 0;
|
|
||||||
|
// TRACE("%p\n",WaitHandle);
|
||||||
|
|
||||||
|
status = RtlDeregisterWaitEx( WaitHandle, CompletionEvent );
|
||||||
|
if (status != STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
SetLastError( RtlNtStatusToDosError(status) );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -274,4 +274,83 @@ _NtCurrentTeb(VOID)
|
||||||
return NtCurrentTeb();
|
return NtCurrentTeb();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* RtlRegisterWait
|
||||||
|
*
|
||||||
|
* Registers a wait for a handle to become signaled.
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* NewWaitObject [I] Handle to the new wait object. Use RtlDeregisterWait() to free it.
|
||||||
|
* Object [I] Object to wait to become signaled.
|
||||||
|
* Callback [I] Callback function to execute when the wait times out or the handle is signaled.
|
||||||
|
* Context [I] Context to pass to the callback function when it is executed.
|
||||||
|
* Milliseconds [I] Number of milliseconds to wait before timing out.
|
||||||
|
* Flags [I] Flags. See notes.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: STATUS_SUCCESS.
|
||||||
|
* Failure: Any NTSTATUS code.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* Flags can be one or more of the following:
|
||||||
|
*|WT_EXECUTEDEFAULT - Executes the work item in a non-I/O worker thread.
|
||||||
|
*|WT_EXECUTEINIOTHREAD - Executes the work item in an I/O worker thread.
|
||||||
|
*|WT_EXECUTEINPERSISTENTTHREAD - Executes the work item in a thread that is persistent.
|
||||||
|
*|WT_EXECUTELONGFUNCTION - Hints that the execution can take a long time.
|
||||||
|
*|WT_TRANSFER_IMPERSONATION - Executes the function with the current access token.
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
RtlRegisterWait(PHANDLE NewWaitObject,
|
||||||
|
HANDLE Object,
|
||||||
|
WAITORTIMERCALLBACKFUNC Callback,
|
||||||
|
PVOID Context,
|
||||||
|
ULONG Milliseconds,
|
||||||
|
ULONG Flags)
|
||||||
|
{
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* RtlDeregisterWaitEx
|
||||||
|
*
|
||||||
|
* Cancels a wait operation and frees the resources associated with calling
|
||||||
|
* RtlRegisterWait().
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* WaitObject [I] Handle to the wait object to free.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: STATUS_SUCCESS.
|
||||||
|
* Failure: Any NTSTATUS code.
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
RtlDeregisterWaitEx(HANDLE WaitHandle,
|
||||||
|
HANDLE CompletionEvent)
|
||||||
|
{
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* RtlDeregisterWait
|
||||||
|
*
|
||||||
|
* Cancels a wait operation and frees the resources associated with calling
|
||||||
|
* RtlRegisterWait().
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* WaitObject [I] Handle to the wait object to free.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: STATUS_SUCCESS.
|
||||||
|
* Failure: Any NTSTATUS code.
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
RtlDeregisterWait(HANDLE WaitHandle)
|
||||||
|
{
|
||||||
|
return RtlDeregisterWaitEx(WaitHandle, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue