Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / include / ddk / scsiwmi.h
blob7aae2a83a1831ab03e135e436a1ff53bad691d9f
1 /*
2 * scsiwmi.h
4 * SCSI WMILIB interface.
6 * This file is part of the w32api package.
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 #ifndef __SCSIWMI_H
24 #define __SCSIWMI_H
26 #if __GNUC__ >=3
27 #pragma GCC system_header
28 #endif
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #pragma pack(push,4)
36 #include "ntddk.h"
37 #include "srb.h"
40 typedef struct _SCSIWMI_REQUEST_CONTEXT {
41 PVOID UserContext;
42 ULONG BufferSize;
43 PUCHAR Buffer;
44 UCHAR MinorFunction;
45 UCHAR ReturnStatus;
46 ULONG ReturnSize;
47 } SCSIWMI_REQUEST_CONTEXT, *PSCSIWMI_REQUEST_CONTEXT;
49 #ifdef _GUID_DEFINED
50 # warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
51 #endif
53 #if ! (defined _GUID_DEFINED || defined GUID_DEFINED)
54 #define GUID_DEFINED
55 typedef struct _GUID {
56 unsigned long Data1;
57 unsigned short Data2;
58 unsigned short Data3;
59 unsigned char Data4[ 8 ];
60 } GUID;
61 #endif
63 #ifndef _LPCGUID_DEFINED
64 #define _LPCGUID_DEFINED
65 typedef const GUID *LPCGUID;
66 #endif
68 typedef struct _SCSIWMIGUIDREGINFO {
69 LPCGUID Guid;
70 ULONG InstanceCount;
71 ULONG Flags;
72 } SCSIWMIGUIDREGINFO, *PSCSIWMIGUIDREGINFO;
74 typedef UCHAR DDKAPI
75 (*PSCSIWMI_QUERY_REGINFO)(
76 /*IN*/ PVOID DeviceContext,
77 /*IN*/ PSCSIWMI_REQUEST_CONTEXT RequestContext,
78 /*OUT*/ PWCHAR *MofResourceName);
80 typedef BOOLEAN DDKAPI
81 (*PSCSIWMI_QUERY_DATABLOCK)(
82 /*IN*/ PVOID Context,
83 /*IN*/ PSCSIWMI_REQUEST_CONTEXT DispatchContext,
84 /*IN*/ ULONG GuidIndex,
85 /*IN*/ ULONG InstanceIndex,
86 /*IN*/ ULONG InstanceCount,
87 /*IN OUT*/ PULONG InstanceLengthArray,
88 /*IN*/ ULONG BufferAvail,
89 /*OUT*/ PUCHAR Buffer);
91 typedef BOOLEAN DDKAPI
92 (*PSCSIWMI_SET_DATABLOCK)(
93 /*IN*/ PVOID DeviceContext,
94 /*IN*/ PSCSIWMI_REQUEST_CONTEXT RequestContext,
95 /*IN*/ ULONG GuidIndex,
96 /*IN*/ ULONG InstanceIndex,
97 /*IN*/ ULONG BufferSize,
98 /*IN*/ PUCHAR Buffer);
100 typedef BOOLEAN DDKAPI
101 (*PSCSIWMI_SET_DATAITEM)(
102 /*IN*/ PVOID DeviceContext,
103 /*IN*/ PSCSIWMI_REQUEST_CONTEXT RequestContext,
104 /*IN*/ ULONG GuidIndex,
105 /*IN*/ ULONG InstanceIndex,
106 /*IN*/ ULONG DataItemId,
107 /*IN*/ ULONG BufferSize,
108 /*IN*/ PUCHAR Buffer);
110 typedef BOOLEAN DDKAPI
111 (*PSCSIWMI_EXECUTE_METHOD)(
112 /*IN*/ PVOID DeviceContext,
113 /*IN*/ PSCSIWMI_REQUEST_CONTEXT RequestContext,
114 /*IN*/ ULONG GuidIndex,
115 /*IN*/ ULONG InstanceIndex,
116 /*IN*/ ULONG MethodId,
117 /*IN*/ ULONG InBufferSize,
118 /*IN*/ ULONG OutBufferSize,
119 /*IN OUT*/ PUCHAR Buffer);
121 typedef enum _SCSIWMI_ENABLE_DISABLE_CONTROL {
122 ScsiWmiEventControl,
123 ScsiWmiDataBlockControl
124 } SCSIWMI_ENABLE_DISABLE_CONTROL;
126 typedef BOOLEAN DDKAPI
127 (*PSCSIWMI_FUNCTION_CONTROL)(
128 /*IN*/ PVOID DeviceContext,
129 /*IN*/ PSCSIWMI_REQUEST_CONTEXT RequestContext,
130 /*IN*/ ULONG GuidIndex,
131 /*IN*/ SCSIWMI_ENABLE_DISABLE_CONTROL Function,
132 /*IN*/ BOOLEAN Enable);
134 typedef struct _SCSIWMILIB_CONTEXT {
135 ULONG GuidCount;
136 PSCSIWMIGUIDREGINFO GuidList;
137 PSCSIWMI_QUERY_REGINFO QueryWmiRegInfo;
138 PSCSIWMI_QUERY_DATABLOCK QueryWmiDataBlock;
139 PSCSIWMI_SET_DATABLOCK SetWmiDataBlock;
140 PSCSIWMI_SET_DATAITEM SetWmiDataItem;
141 PSCSIWMI_EXECUTE_METHOD ExecuteWmiMethod;
142 PSCSIWMI_FUNCTION_CONTROL WmiFunctionControl;
143 } SCSI_WMILIB_CONTEXT, *PSCSI_WMILIB_CONTEXT;
145 SCSIPORTAPI
146 BOOLEAN
147 DDKAPI
148 ScsiPortWmiDispatchFunction(
149 /*IN*/ PSCSI_WMILIB_CONTEXT WmiLibInfo,
150 /*IN*/ UCHAR MinorFunction,
151 /*IN*/ PVOID DeviceContext,
152 /*IN*/ PSCSIWMI_REQUEST_CONTEXT RequestContext,
153 /*IN*/ PVOID DataPath,
154 /*IN*/ ULONG BufferSize,
155 /*IN*/ PVOID Buffer);
157 #define ScsiPortWmiFireAdapterEvent( \
158 HwDeviceExtension, \
159 Guid, \
160 InstanceIndex, \
161 EventDataSize, \
162 EventData) \
163 ScsiPortWmiFireLogicalUnitEvent( \
164 HwDeviceExtension, \
165 0xff, \
166 0, \
167 0, \
168 Guid, \
169 InstanceIndex, \
170 EventDataSize, \
171 EventData)
174 * ULONG
175 * ScsiPortWmiGetReturnSize(
176 * PSCSIWMI_REQUEST_CONTEXT RequestContext);
178 #define ScsiPortWmiGetReturnSize(RequestContext) \
179 ((RequestContext)->ReturnSize)
181 /* UCHAR
182 * ScsiPortWmiGetReturnStatus(
183 * PSCSIWMI_REQUEST_CONTEXT RequestContext);
185 #define ScsiPortWmiGetReturnStatus(RequestContext) \
186 ((RequestContext)->ReturnStatus)
188 SCSIPORTAPI
189 VOID
190 DDKAPI
191 ScsiPortWmiPostProcess(
192 /*IN*/ PSCSIWMI_REQUEST_CONTEXT RequestContext,
193 /*IN*/ UCHAR SrbStatus,
194 /*IN*/ ULONG BufferUsed);
196 SCSIPORTAPI
197 VOID
198 DDKAPI
199 ScsiPortWmiFireLogicalUnitEvent(
200 /*IN*/ PVOID HwDeviceExtension,
201 /*IN*/ UCHAR PathId,
202 /*IN*/ UCHAR TargetId,
203 /*IN*/ UCHAR Lun,
204 /*IN*/ LPGUID Guid,
205 /*IN*/ ULONG InstanceIndex,
206 /*IN*/ ULONG EventDataSize,
207 /*IN*/ PVOID EventData);
209 #pragma pack(pop)
211 #ifdef __cplusplus
213 #endif
215 #endif /* __SCSIWMI_H */