source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/ddk/scsiwmi.h@ 1181

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

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

File size: 4.9 KB
RevLine 
[1166]1/*
2 * scsiwmi.h
3 *
4 * SCSI WMILIB interface.
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
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.
20 *
21 */
22
23#ifndef __SCSIWMI_H
24#define __SCSIWMI_H
25
26#include "srb.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#pragma pack(push,4)
33
34typedef struct _SCSIWMI_REQUEST_CONTEXT {
35 PVOID UserContext;
36 ULONG BufferSize;
37 PUCHAR Buffer;
38 UCHAR MinorFunction;
39 UCHAR ReturnStatus;
40 ULONG ReturnSize;
41} SCSIWMI_REQUEST_CONTEXT, *PSCSIWMI_REQUEST_CONTEXT;
42
43#ifdef _GUID_DEFINED
44# warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
45#endif
46
47#if ! (defined _GUID_DEFINED || defined GUID_DEFINED)
48#define GUID_DEFINED
49typedef struct _GUID {
50 ULONG Data1;
51 unsigned short Data2;
52 unsigned short Data3;
53 unsigned char Data4[ 8 ];
54} GUID;
55#endif
56
57typedef struct _SCSIWMIGUIDREGINFO {
58 LPCGUID Guid;
59 ULONG InstanceCount;
60 ULONG Flags;
61} SCSIWMIGUIDREGINFO, *PSCSIWMIGUIDREGINFO;
62
63typedef UCHAR
64(NTAPI *PSCSIWMI_QUERY_REGINFO)(
65 IN PVOID DeviceContext,
66 IN PSCSIWMI_REQUEST_CONTEXT RequestContext,
67 OUT PWCHAR *MofResourceName);
68
69typedef BOOLEAN
70(NTAPI *PSCSIWMI_QUERY_DATABLOCK)(
71 IN PVOID Context,
72 IN PSCSIWMI_REQUEST_CONTEXT DispatchContext,
73 IN ULONG GuidIndex,
74 IN ULONG InstanceIndex,
75 IN ULONG InstanceCount,
76 IN OUT PULONG InstanceLengthArray,
77 IN ULONG BufferAvail,
78 OUT PUCHAR Buffer);
79
80typedef BOOLEAN
81(NTAPI *PSCSIWMI_SET_DATABLOCK)(
82 IN PVOID DeviceContext,
83 IN PSCSIWMI_REQUEST_CONTEXT RequestContext,
84 IN ULONG GuidIndex,
85 IN ULONG InstanceIndex,
86 IN ULONG BufferSize,
87 IN PUCHAR Buffer);
88
89typedef BOOLEAN
90(NTAPI *PSCSIWMI_SET_DATAITEM)(
91 IN PVOID DeviceContext,
92 IN PSCSIWMI_REQUEST_CONTEXT RequestContext,
93 IN ULONG GuidIndex,
94 IN ULONG InstanceIndex,
95 IN ULONG DataItemId,
96 IN ULONG BufferSize,
97 IN PUCHAR Buffer);
98
99typedef BOOLEAN
100(NTAPI *PSCSIWMI_EXECUTE_METHOD)(
101 IN PVOID DeviceContext,
102 IN PSCSIWMI_REQUEST_CONTEXT RequestContext,
103 IN ULONG GuidIndex,
104 IN ULONG InstanceIndex,
105 IN ULONG MethodId,
106 IN ULONG InBufferSize,
107 IN ULONG OutBufferSize,
108 IN OUT PUCHAR Buffer);
109
110typedef enum _SCSIWMI_ENABLE_DISABLE_CONTROL {
111 ScsiWmiEventControl,
112 ScsiWmiDataBlockControl
113} SCSIWMI_ENABLE_DISABLE_CONTROL;
114
115typedef BOOLEAN
116(NTAPI *PSCSIWMI_FUNCTION_CONTROL)(
117 IN PVOID DeviceContext,
118 IN PSCSIWMI_REQUEST_CONTEXT RequestContext,
119 IN ULONG GuidIndex,
120 IN SCSIWMI_ENABLE_DISABLE_CONTROL Function,
121 IN BOOLEAN Enable);
122
123typedef struct _SCSIWMILIB_CONTEXT {
124 ULONG GuidCount;
125 PSCSIWMIGUIDREGINFO GuidList;
126 PSCSIWMI_QUERY_REGINFO QueryWmiRegInfo;
127 PSCSIWMI_QUERY_DATABLOCK QueryWmiDataBlock;
128 PSCSIWMI_SET_DATABLOCK SetWmiDataBlock;
129 PSCSIWMI_SET_DATAITEM SetWmiDataItem;
130 PSCSIWMI_EXECUTE_METHOD ExecuteWmiMethod;
131 PSCSIWMI_FUNCTION_CONTROL WmiFunctionControl;
132} SCSI_WMILIB_CONTEXT, *PSCSI_WMILIB_CONTEXT;
133
134SCSIPORTAPI
135BOOLEAN
136NTAPI
137ScsiPortWmiDispatchFunction(
138 IN PSCSI_WMILIB_CONTEXT WmiLibInfo,
139 IN UCHAR MinorFunction,
140 IN PVOID DeviceContext,
141 IN PSCSIWMI_REQUEST_CONTEXT RequestContext,
142 IN PVOID DataPath,
143 IN ULONG BufferSize,
144 IN PVOID Buffer);
145
146#define ScsiPortWmiFireAdapterEvent( \
147 HwDeviceExtension, \
148 Guid, \
149 InstanceIndex, \
150 EventDataSize, \
151 EventData) \
152 ScsiPortWmiFireLogicalUnitEvent( \
153 HwDeviceExtension, \
154 0xff, \
155 0, \
156 0, \
157 Guid, \
158 InstanceIndex, \
159 EventDataSize, \
160 EventData)
161
162/*
163 * ULONG
164 * ScsiPortWmiGetReturnSize(
165 * PSCSIWMI_REQUEST_CONTEXT RequestContext);
166 */
167#define ScsiPortWmiGetReturnSize(RequestContext) \
168 ((RequestContext)->ReturnSize)
169
170/* UCHAR
171 * ScsiPortWmiGetReturnStatus(
172 * PSCSIWMI_REQUEST_CONTEXT RequestContext);
173 */
174#define ScsiPortWmiGetReturnStatus(RequestContext) \
175 ((RequestContext)->ReturnStatus)
176
177SCSIPORTAPI
178VOID
179NTAPI
180ScsiPortWmiPostProcess(
181 IN PSCSIWMI_REQUEST_CONTEXT RequestContext,
182 IN UCHAR SrbStatus,
183 IN ULONG BufferUsed);
184
185SCSIPORTAPI
186VOID
187NTAPI
188ScsiPortWmiFireLogicalUnitEvent(
189 IN PVOID HwDeviceExtension,
190 IN UCHAR PathId,
191 IN UCHAR TargetId,
192 IN UCHAR Lun,
193 IN LPGUID Guid,
194 IN ULONG InstanceIndex,
195 IN ULONG EventDataSize,
196 IN PVOID EventData);
197
198#pragma pack(pop)
199
200#ifdef __cplusplus
201}
202#endif
203
204#endif /* __SCSIWMI_H */
Note: See TracBrowser for help on using the repository browser.