1 | /**
|
---|
2 | * This file has no copyright assigned and is placed in the Public Domain.
|
---|
3 | * This file is part of the mingw-w64 runtime package.
|
---|
4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
---|
5 | */
|
---|
6 | #ifndef _INC_WCT
|
---|
7 | #define _INC_WCT
|
---|
8 | #if (_WIN32_WINNT >= 0x0600)
|
---|
9 |
|
---|
10 | #ifdef __cplusplus
|
---|
11 | extern "C" {
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | typedef LPVOID HWCT;
|
---|
15 |
|
---|
16 | typedef enum _WCT_OBJECT_TYPE {
|
---|
17 | WctCriticalSectionType = 1,
|
---|
18 | WctSendMessageType,
|
---|
19 | WctMutexType,
|
---|
20 | WctAlpcType,
|
---|
21 | WctComType,
|
---|
22 | WctThreadWaitType,
|
---|
23 | WctProcessWaitType,
|
---|
24 | WctThreadType,
|
---|
25 | WctComActivationType,
|
---|
26 | WctUnknownType
|
---|
27 | } WCT_OBJECT_TYPE;
|
---|
28 |
|
---|
29 | typedef enum _WCT_OBJECT_STATUS {
|
---|
30 | WctStatusNoAccess = 1,
|
---|
31 | WctStatusRunning,
|
---|
32 | WctStatusBlocked,
|
---|
33 | WctStatusPidOnly,
|
---|
34 | WctStatusPidOnlyRpcss,
|
---|
35 | WctStatusOwned,
|
---|
36 | WctStatusNotOwned,
|
---|
37 | WctStatusAbandoned,
|
---|
38 | WctStatusUnknown,
|
---|
39 | WctStatusError
|
---|
40 | } WCT_OBJECT_STATUS;
|
---|
41 |
|
---|
42 | /* According to http://msdn.microsoft.com/en-us/magazine/cc163395.aspx
|
---|
43 | RealObjectName has 0x8 offset and TimeOutLowPart has 0x108
|
---|
44 | WCT_OBJNAME_LENGTH assumed to be 128 ((0x108-0x8)/sizeof (ushort) = 128)
|
---|
45 | */
|
---|
46 | #define WCT_OBJNAME_LENGTH 128
|
---|
47 |
|
---|
48 | typedef struct _WAITCHAIN_NODE_INFO {
|
---|
49 | WCT_OBJECT_TYPE ObjectType;
|
---|
50 | WCT_OBJECT_STATUS ObjectStatus;
|
---|
51 | __C89_NAMELESS union {
|
---|
52 | struct {
|
---|
53 | WCHAR ObjectName[WCT_OBJNAME_LENGTH];
|
---|
54 | LARGE_INTEGER Timeout;
|
---|
55 | WINBOOL Alertable;
|
---|
56 | } LockObject;
|
---|
57 | struct {
|
---|
58 | DWORD ProcessId;
|
---|
59 | DWORD ThreadId;
|
---|
60 | DWORD WaitTime;
|
---|
61 | DWORD ContextSwitches;
|
---|
62 | } ThreadObject;
|
---|
63 | };
|
---|
64 | } WAITCHAIN_NODE_INFO, *PWAITCHAIN_NODE_INFO;
|
---|
65 |
|
---|
66 | typedef VOID (CALLBACK *PWAITCHAINCALLBACK)(HWCT WctHandle,DWORD_PTR Context,DWORD CallbackStatus,LPDWORD NodeCount,PWAITCHAIN_NODE_INFO NodeInfoArray,LPBOOL IsCycle);
|
---|
67 |
|
---|
68 | HWCT WINAPI OpenThreadWaitChainSession(DWORD Flags,PWAITCHAINCALLBACK callback);
|
---|
69 | VOID WINAPI CloseThreadWaitChainSession(HWCT WctHandle);
|
---|
70 | WINBOOL WINAPI GetThreadWaitChain(HWCT WctHandle,DWORD_PTR Context,DWORD Flags,DWORD ThreadId,LPDWORD NodeCount,PWAITCHAIN_NODE_INFO NodeInfoArray,LPBOOL IsCycle);
|
---|
71 |
|
---|
72 | /* Unknown Callbacks */
|
---|
73 | typedef LPVOID (WINAPI *PCOGETCALLSTATE)();
|
---|
74 | typedef LPVOID (WINAPI *PCOGETACTIVATIONSTATE)();
|
---|
75 |
|
---|
76 | VOID WINAPI RegisterWaitChainCOMCallback(PCOGETCALLSTATE CallStateCallback,PCOGETACTIVATIONSTATE ActivationStateCallback);
|
---|
77 |
|
---|
78 | #ifdef __cplusplus
|
---|
79 | }
|
---|
80 | #endif
|
---|
81 |
|
---|
82 | #endif /* (_WIN32_WINNT >= 0x0600) */
|
---|
83 | #endif /*_INC_WCT*/
|
---|