[HEADERS]
[reactos.git] / reactos / include / ddk / wmlib.h
1
2 #ifndef _WMILIB_
3 #define _WMILIB_
4
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8
9 typedef struct _WMIGUIDREGINFO {
10 LPCGUID Guid;
11 ULONG InstanceCount;
12 ULONG Flags;
13 } WMIGUIDREGINFO, *PWMIGUIDREGINFO;
14
15 typedef enum _WMIENABLEDISABLECONTROL {
16 WmiEventControl,
17 WmiDataBlockControl
18 } WMIENABLEDISABLECONTROL, *PWMIENABLEDISABLECONTROL;
19
20 typedef enum _SYSCTL_IRP_DISPOSITION {
21 IrpProcessed,
22 IrpNotCompleted,
23 IrpNotWmi,
24 IrpForward
25 } SYSCTL_IRP_DISPOSITION, *PSYSCTL_IRP_DISPOSITION;
26
27 typedef
28 NTSTATUS
29 (NTAPI WMI_QUERY_REGINFO_CALLBACK)(
30 IN OUT PDEVICE_OBJECT DeviceObject,
31 IN OUT PULONG RegFlags,
32 IN OUT PUNICODE_STRING InstanceName,
33 IN OUT PUNICODE_STRING *RegistryPath OPTIONAL,
34 IN OUT PUNICODE_STRING MofResourceName,
35 OUT PDEVICE_OBJECT *Pdo OPTIONAL);
36
37 typedef WMI_QUERY_REGINFO_CALLBACK *PWMI_QUERY_REGINFO;
38
39 typedef
40 NTSTATUS
41 (NTAPI WMI_QUERY_DATABLOCK_CALLBACK)(
42 IN OUT PDEVICE_OBJECT DeviceObject,
43 IN OUT PIRP Irp,
44 IN OUT ULONG GuidIndex,
45 IN ULONG InstanceIndex,
46 IN ULONG InstanceCount,
47 OUT PULONG InstanceLengthArray OPTIONAL,
48 IN ULONG BufferAvail,
49 OUT PUCHAR Buffer OPTIONAL);
50
51 typedef WMI_QUERY_DATABLOCK_CALLBACK *PWMI_QUERY_DATABLOCK;
52
53 typedef
54 NTSTATUS
55 (NTAPI WMI_SET_DATABLOCK_CALLBACK)(
56 IN OUT PDEVICE_OBJECT DeviceObject,
57 IN OUT PIRP Irp,
58 IN ULONG GuidIndex,
59 IN ULONG InstanceIndex,
60 IN ULONG BufferSize,
61 IN PUCHAR Buffer);
62
63 typedef WMI_SET_DATABLOCK_CALLBACK *PWMI_SET_DATABLOCK;
64
65 typedef
66 NTSTATUS
67 (NTAPI WMI_SET_DATAITEM_CALLBACK)(
68 IN OUT PDEVICE_OBJECT DeviceObject,
69 IN OUT PIRP Irp,
70 IN ULONG GuidIndex,
71 IN ULONG InstanceIndex,
72 IN ULONG DataItemId,
73 IN ULONG BufferSize,
74 IN PUCHAR Buffer);
75
76 typedef WMI_SET_DATAITEM_CALLBACK *PWMI_SET_DATAITEM;
77
78 typedef
79 NTSTATUS
80 (NTAPI WMI_EXECUTE_METHOD_CALLBACK)(
81 IN OUT PDEVICE_OBJECT DeviceObject,
82 IN OUT PIRP Irp,
83 IN ULONG GuidIndex,
84 IN ULONG InstanceIndex,
85 IN ULONG MethodId,
86 IN ULONG InBufferSize,
87 IN ULONG OutBufferSize,
88 IN OUT PUCHAR Buffer);
89
90 typedef WMI_EXECUTE_METHOD_CALLBACK *PWMI_EXECUTE_METHOD;
91
92 typedef
93 NTSTATUS
94 (NTAPI WMI_FUNCTION_CONTROL_CALLBACK)(
95 IN OUT PDEVICE_OBJECT DeviceObject,
96 IN OUT PIRP Irp,
97 IN ULONG GuidIndex,
98 IN WMIENABLEDISABLECONTROL Function,
99 IN BOOLEAN Enable);
100
101 typedef WMI_FUNCTION_CONTROL_CALLBACK *PWMI_FUNCTION_CONTROL;
102
103 typedef struct _WMILIB_CONTEXT {
104 ULONG GuidCount;
105 PWMIGUIDREGINFO GuidList;
106 PWMI_QUERY_REGINFO QueryWmiRegInfo;
107 PWMI_QUERY_DATABLOCK QueryWmiDataBlock;
108 PWMI_SET_DATABLOCK SetWmiDataBlock;
109 PWMI_SET_DATAITEM SetWmiDataItem;
110 PWMI_EXECUTE_METHOD ExecuteWmiMethod;
111 PWMI_FUNCTION_CONTROL WmiFunctionControl;
112 } WMILIB_CONTEXT, *PWMILIB_CONTEXT;
113
114 #if (NTDDI_VERSION >= NTDDI_WIN2K)
115 NTSTATUS
116 NTAPI
117 WmiSystemControl(
118 IN PWMILIB_CONTEXT WmiLibInfo,
119 IN PDEVICE_OBJECT DeviceObject,
120 IN OUT PIRP Irp,
121 OUT PSYSCTL_IRP_DISPOSITION IrpDisposition);
122 #endif
123
124 #ifdef __cplusplus
125 }
126 #endif
127
128 #endif /* !_WMILIB_ */
129