source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/computedefs.h@ 1180

Last change on this file since 1180 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 3.9 KB
RevLine 
[1166]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
7#ifndef _HYPERV_COMPUTEDEFS_H_
8#define _HYPERV_COMPUTEDEFS_H_
9
10DECLARE_HANDLE(HCS_SYSTEM);
11DECLARE_HANDLE(HCS_PROCESS);
12DECLARE_HANDLE(HCS_OPERATION);
13DECLARE_HANDLE(HCS_CALLBACK);
14
15typedef enum HCS_OPERATION_TYPE {
16 HcsOperationTypeNone = -1,
17 HcsOperationTypeEnumerate = 0,
18 HcsOperationTypeCreate = 1,
19 HcsOperationTypeStart = 2,
20 HcsOperationTypeShutdown = 3,
21 HcsOperationTypePause = 4,
22 HcsOperationTypeResume = 5,
23 HcsOperationTypeSave = 6,
24 HcsOperationTypeTerminate = 7,
25 HcsOperationTypeModify = 8,
26 HcsOperationTypeGetProperties = 9,
27 HcsOperationTypeCreateProcess = 10,
28 HcsOperationTypeSignalProcess = 11,
29 HcsOperationTypeGetProcessInfo = 12,
30 HcsOperationTypeGetProcessProperties = 13,
31 HcsOperationTypeModifyProcess = 14,
32 HcsOperationTypeCrash = 15
33} HCS_OPERATION_TYPE;
34
35#define HCS_INVALID_OPERATION_ID (UINT64)(-1)
36
37typedef void (CALLBACK *HCS_OPERATION_COMPLETION)(HCS_OPERATION operation, void *context);
38
39typedef enum HCS_EVENT_TYPE {
40 HcsEventInvalid = 0x00000000,
41 HcsEventSystemExited = 0x00000001,
42 HcsEventSystemCrashInitiated = 0x00000002,
43 HcsEventSystemCrashReport = 0x00000003,
44 HcsEventSystemRdpEnhancedModeStateChanged = 0x00000004,
45 HcsEventSystemSiloJobCreated = 0x00000005,
46 HcsEventSystemGuestConnectionClosed = 0x00000006,
47 HcsEventProcessExited = 0x00010000,
48 HcsEventOperationCallback = 0x01000000,
49 HcsEventServiceDisconnect = 0x02000000
50} HCS_EVENT_TYPE;
51
52typedef struct HCS_EVENT {
53 HCS_EVENT_TYPE Type;
54 PCWSTR EventData;
55 HCS_OPERATION Operation;
56} HCS_EVENT;
57
58typedef enum HCS_EVENT_OPTIONS {
59 HcsEventOptionNone = 0x00000000,
60 HcsEventOptionEnableOperationCallbacks = 0x00000001
61} HCS_EVENT_OPTIONS;
62
63DEFINE_ENUM_FLAG_OPERATORS(HCS_EVENT_OPTIONS);
64
65typedef void (CALLBACK *HCS_EVENT_CALLBACK)(HCS_EVENT *event, void *context);
66
67typedef enum HCS_NOTIFICATION_FLAGS {
68 HcsNotificationFlagSuccess = 0x00000000,
69 HcsNotificationFlagFailure = 0x80000000
70} HCS_NOTIFICATION_FLAGS;
71
72typedef enum HCS_NOTIFICATIONS {
73 HcsNotificationInvalid = 0x00000000,
74 HcsNotificationSystemExited = 0x00000001,
75 HcsNotificationSystemCreateCompleted = 0x00000002,
76 HcsNotificationSystemStartCompleted = 0x00000003,
77 HcsNotificationSystemPauseCompleted = 0x00000004,
78 HcsNotificationSystemResumeCompleted = 0x00000005,
79 HcsNotificationSystemCrashReport = 0x00000006,
80 HcsNotificationSystemSiloJobCreated = 0x00000007,
81 HcsNotificationSystemSaveCompleted = 0x00000008,
82 HcsNotificationSystemRdpEnhancedModeStateChanged = 0x00000009,
83 HcsNotificationSystemShutdownFailed = 0x0000000A,
84 HcsNotificationSystemShutdownCompleted = 0x0000000A,
85 HcsNotificationSystemGetPropertiesCompleted = 0x0000000B,
86 HcsNotificationSystemModifyCompleted = 0x0000000C,
87 HcsNotificationSystemCrashInitiated = 0x0000000D,
88 HcsNotificationSystemGuestConnectionClosed = 0x0000000E,
89 HcsNotificationSystemOperationCompletion = 0x0000000F,
90 HcsNotificationSystemPassThru = 0x00000010,
91 HcsNotificationProcessExited = 0x00010000,
92 HcsNotificationServiceDisconnect = 0x01000000,
93 HcsNotificationFlagsReserved = 0xF0000000
94} HCS_NOTIFICATIONS;
95
96typedef void (CALLBACK *HCS_NOTIFICATION_CALLBACK)(DWORD notificationType, void *context, HRESULT notificationStatus, PCWSTR notificationData);
97
98typedef struct {
99 DWORD ProcessId;
100 DWORD Reserved;
101 HANDLE StdInput;
102 HANDLE StdOutput;
103 HANDLE StdError;
104} HCS_PROCESS_INFORMATION;
105
106typedef enum HCS_CREATE_OPTIONS {
107 HcsCreateOptions_1 = 0x00010000
108}HCS_CREATE_OPTIONS;
109
110typedef struct {
111 HCS_CREATE_OPTIONS Version;
112 HANDLE UserToken;
113 SECURITY_DESCRIPTOR* SecurityDescriptor;
114 HCS_EVENT_OPTIONS CallbackOptions;
115 void* CallbackContext;
116 HCS_EVENT_CALLBACK Callback;
117} HCS_CREATE_OPTIONS_1;
118
119#endif /* _HYPERV_COMPUTEDEFS_H_ */
Note: See TracBrowser for help on using the repository browser.