1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! ApiSet Contract for api-ms-win-core-threadpool-l1.
7 use shared
::basetsd
::ULONG_PTR
;
8 use shared
::minwindef
::{BOOL, DWORD, HMODULE, PFILETIME, ULONG}
;
9 use um
::minwinbase
::PCRITICAL_SECTION
;
11 HANDLE
, PTP_CALLBACK_ENVIRON
, PTP_CALLBACK_INSTANCE
, PTP_CLEANUP_GROUP
, PTP_IO
, PTP_POOL
,
12 PTP_POOL_STACK_INFORMATION
, PTP_SIMPLE_CALLBACK
, PTP_TIMER
, PTP_TIMER_CALLBACK
, PTP_WAIT
,
13 PTP_WAIT_CALLBACK
, PTP_WORK
, PTP_WORK_CALLBACK
, PVOID
,
15 FN
!{stdcall
PTP_WIN32_IO_CALLBACK(
16 Instance
: PTP_CALLBACK_INSTANCE
,
20 NumberOfBytesTransferred
: ULONG_PTR
,
24 pub fn CreateThreadpool(
27 pub fn SetThreadpoolThreadMaximum(
31 pub fn SetThreadpoolThreadMinimum(
35 pub fn SetThreadpoolStackInformation(
37 ptpsi
: PTP_POOL_STACK_INFORMATION
,
39 pub fn QueryThreadpoolStackInformation(
41 ptpsi
: PTP_POOL_STACK_INFORMATION
,
43 pub fn CloseThreadpool(
46 pub fn CreateThreadpoolCleanupGroup() -> PTP_CLEANUP_GROUP
;
47 pub fn CloseThreadpoolCleanupGroupMembers(
48 ptpcg
: PTP_CLEANUP_GROUP
,
49 fCancelPendingCallbacks
: BOOL
,
50 pvCleanupContext
: PVOID
,
52 pub fn CloseThreadpoolCleanupGroup(
53 ptpcg
: PTP_CLEANUP_GROUP
,
55 pub fn SetEventWhenCallbackReturns(
56 pci
: PTP_CALLBACK_INSTANCE
,
59 pub fn ReleaseSemaphoreWhenCallbackReturns(
60 pci
: PTP_CALLBACK_INSTANCE
,
64 pub fn ReleaseMutexWhenCallbackReturns(
65 pci
: PTP_CALLBACK_INSTANCE
,
68 pub fn LeaveCriticalSectionWhenCallbackReturns(
69 pci
: PTP_CALLBACK_INSTANCE
,
70 pcs
: PCRITICAL_SECTION
,
72 pub fn FreeLibraryWhenCallbackReturns(
73 pci
: PTP_CALLBACK_INSTANCE
,
76 pub fn CallbackMayRunLong(
77 pci
: PTP_CALLBACK_INSTANCE
,
79 pub fn DisassociateCurrentThreadFromCallback(
80 pci
: PTP_CALLBACK_INSTANCE
,
82 pub fn TrySubmitThreadpoolCallback(
83 pfns
: PTP_SIMPLE_CALLBACK
,
85 pcbe
: PTP_CALLBACK_ENVIRON
,
87 pub fn CreateThreadpoolWork(
88 pfnwk
: PTP_WORK_CALLBACK
,
90 pcbe
: PTP_CALLBACK_ENVIRON
,
92 pub fn SubmitThreadpoolWork(
95 pub fn WaitForThreadpoolWorkCallbacks(
97 fCancelPendingCallbacks
: BOOL
,
99 pub fn CloseThreadpoolWork(
102 pub fn CreateThreadpoolTimer(
103 pfnti
: PTP_TIMER_CALLBACK
,
105 pcbe
: PTP_CALLBACK_ENVIRON
,
107 pub fn SetThreadpoolTimer(
109 pftDueTime
: PFILETIME
,
111 msWindowLength
: DWORD
,
113 pub fn IsThreadpoolTimerSet(
116 pub fn WaitForThreadpoolTimerCallbacks(
118 fCancelPendingCallbacks
: BOOL
,
120 pub fn CloseThreadpoolTimer(
123 pub fn CreateThreadpoolWait(
124 pfnwa
: PTP_WAIT_CALLBACK
,
126 pcbe
: PTP_CALLBACK_ENVIRON
,
128 pub fn SetThreadpoolWait(
131 pftTimeout
: PFILETIME
,
133 pub fn WaitForThreadpoolWaitCallbacks(
135 fCancelPendingCallbacks
: BOOL
,
137 pub fn CloseThreadpoolWait(
140 pub fn CreateThreadpoolIo(
142 pfnio
: PTP_WIN32_IO_CALLBACK
,
144 pcbe
: PTP_CALLBACK_ENVIRON
,
146 pub fn StartThreadpoolIo(
149 pub fn CancelThreadpoolIo(
152 pub fn WaitForThreadpoolIoCallbacks(
154 fCancelPendingCallbacks
: BOOL
,
156 pub fn CloseThreadpoolIo(
159 pub fn SetThreadpoolTimerEx(
161 pftDueTime
: PFILETIME
,
163 msWindowLength
: DWORD
,
165 pub fn SetThreadpoolWaitEx(
168 pftTimeout
: PFILETIME
,