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