[New - Windows NT]
function adds a user-mode asynchronous procedure call (APC) object to the APC
queue of the specified thread.
| PAPCFUNC pfnAPC,
||// pointer to APC function
| HANDLE hThread,
||// handle to the thread
| DWORD dwData
||// argument for the APC function
Points to the application-supplied APC function to be called when the
specified thread performs an alertable wait operation.
Specifies the handle to the thread. The handle must have THREAD_SET_CONTEXT
access. For more information, see Thread Objects
Specifies a single DWORD argument that is passed to the APC function pointed
to by the pfnAPC
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. There are no error values
defined for this function that can be retrieved by calling GetLastError
The APC support provided in the operating system allows an application to
queue an APC object to a thread. Each thread has its own APC queue. The queuing of
an APC is a request for the thread to call the APC function. The operating
system issues a software interrupt to direct the thread to call the APC function.
When a user-mode APC is queued, the thread is not directed to call the APC
function unless it is in an alertable state. A thread enters an alertable state by
, or MsgWaitForMultipleObjectsEx
to perform an alertable wait operation. After the thread is in an alertable
state, the thread handles all pending APCs in first in, first out (FIFO) order,
and the wait operation returns WAIT_IO_COMPLETION.
If an application queues an APC before the thread begins running, the thread
begins by calling the APC function. Once the thread calls an APC function, it
calls the APC functions for all APCs in its APC queue.
When the thread is terminated using the ExitThread
function, the APCs in its APC queue are lost. The APC functions are not
Note that the ReadFileEx
functions are implemented using an APC as the completion notification
- Software for developers
Software for Android Developers
- More information resources
Unix Manual Pages
- Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database