[PSDK/DDK]: Add more missing definitions. Fix classpnp.h.
[reactos.git] / reactos / include / ddk / classpnp.h
1
2 #pragma once
3
4 #define _CLASS_
5
6 #include <ntdddisk.h>
7 #include <ntddcdrm.h>
8 #include <ntddtape.h>
9 #include <ntddscsi.h>
10 #include <ntddstor.h>
11
12 #include <stdio.h>
13
14 #include <scsi.h>
15
16 #define SRB_CLASS_FLAGS_LOW_PRIORITY 0x10000000
17 #define SRB_CLASS_FLAGS_PERSISTANT 0x20000000
18 #define SRB_CLASS_FLAGS_PAGING 0x40000000
19 #define SRB_CLASS_FLAGS_FREE_MDL 0x80000000
20
21 #define IS_CLEANUP_REQUEST(majorFunction) \
22 ((majorFunction == IRP_MJ_CLOSE) || \
23 (majorFunction == IRP_MJ_CLEANUP) || \
24 (majorFunction == IRP_MJ_SHUTDOWN))
25
26 #define DO_MCD(fdoExtension) \
27 (((fdoExtension)->MediaChangeDetectionInfo != NULL) && \
28 ((fdoExtension)->MediaChangeDetectionInfo->MediaChangeDetectionDisableCount == 0))
29
30 #define IS_SCSIOP_READ(opCode) \
31 ((opCode == SCSIOP_READ6) || \
32 (opCode == SCSIOP_READ) || \
33 (opCode == SCSIOP_READ12) || \
34 (opCode == SCSIOP_READ16))
35
36 #define IS_SCSIOP_WRITE(opCode) \
37 ((opCode == SCSIOP_WRITE6) || \
38 (opCode == SCSIOP_WRITE) || \
39 (opCode == SCSIOP_WRITE12) || \
40 (opCode == SCSIOP_WRITE16))
41
42 #define IS_SCSIOP_READWRITE(opCode) (IS_SCSIOP_READ(opCode) || IS_SCSIOP_WRITE(opCode))
43
44 #define ADJUST_FUA_FLAG(fdoExt) { \
45 if (TEST_FLAG(fdoExt->DeviceFlags, DEV_WRITE_CACHE) && \
46 !TEST_FLAG(fdoExt->DeviceFlags, DEV_POWER_PROTECTED) && \
47 !TEST_FLAG(fdoExt->ScanForSpecialFlags, CLASS_SPECIAL_FUA_NOT_SUPPORTED) ) { \
48 fdoExt->CdbForceUnitAccess = TRUE; \
49 } else { \
50 fdoExt->CdbForceUnitAccess = FALSE; \
51 } \
52 }
53
54 #define FREE_POOL(_PoolPtr) \
55 if (_PoolPtr != NULL) { \
56 ExFreePool(_PoolPtr); \
57 _PoolPtr = NULL; \
58 }
59
60 #ifdef POOL_TAGGING
61 #undef ExAllocatePool
62 #undef ExAllocatePoolWithQuota
63 #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,'nUcS')
64 //#define ExAllocatePool(a,b) #assert(0)
65 #define ExAllocatePoolWithQuota(a,b) ExAllocatePoolWithQuotaTag(a,b,'nUcS')
66 #endif
67
68 #define CLASS_TAG_AUTORUN_DISABLE 'ALcS'
69 #define CLASS_TAG_FILE_OBJECT_EXTENSION 'FLcS'
70 #define CLASS_TAG_MEDIA_CHANGE_DETECTION 'MLcS'
71 #define CLASS_TAG_MOUNT 'mLcS'
72 #define CLASS_TAG_RELEASE_QUEUE 'qLcS'
73 #define CLASS_TAG_POWER 'WLcS'
74 #define CLASS_TAG_WMI 'wLcS'
75 #define CLASS_TAG_FAILURE_PREDICT 'fLcS'
76 #define CLASS_TAG_DEVICE_CONTROL 'OIcS'
77 #define CLASS_TAG_MODE_DATA 'oLcS'
78 #define CLASS_TAG_MULTIPATH 'mPcS'
79
80 #define MAXIMUM_RETRIES 4
81
82 #define CLASS_DRIVER_EXTENSION_KEY ((PVOID) ClassInitialize)
83
84 #define NO_REMOVE 0
85 #define REMOVE_PENDING 1
86 #define REMOVE_COMPLETE 2
87
88 #define ClassAcquireRemoveLock(devobj, tag) \
89 ClassAcquireRemoveLockEx(devobj, tag, __FILE__, __LINE__)
90
91 #ifdef TRY
92 #undef TRY
93 #endif
94 #ifdef LEAVE
95 #undef LEAVE
96 #endif
97
98 #ifdef FINALLY
99 #undef FINALLY
100 #endif
101
102 #define TRY
103 #define LEAVE goto __tryLabel;
104 #define FINALLY __tryLabel:
105
106 #if defined DebugPrint
107 #undef DebugPrint
108 #endif
109
110 #if DBG
111 #define DebugPrint(x) ClassDebugPrint x
112 #else
113 #define DebugPrint(x)
114 #endif
115
116 #define DEBUG_BUFFER_LENGTH 256
117
118 #define START_UNIT_TIMEOUT (60 * 4)
119
120 #define MEDIA_CHANGE_DEFAULT_TIME 1
121 #define MEDIA_CHANGE_TIMEOUT_TIME 300
122
123 #define MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS 0x3b9aca00
124
125 #ifdef ALLOCATE_SRB_FROM_POOL
126
127 #define ClasspAllocateSrb(ext)
128 ExAllocatePoolWithTag(NonPagedPool, \
129 sizeof(SCSI_REQUEST_BLOCK), \
130 'sBRS')
131
132 #define ClasspFreeSrb(ext, srb) ExFreePool((srb));
133
134 #else /* ALLOCATE_SRB_FROM_POOL */
135
136 #define ClasspAllocateSrb(ext) \
137 ExAllocateFromNPagedLookasideList( \
138 &((ext)->CommonExtension.SrbLookasideList))
139
140 #define ClasspFreeSrb(ext, srb) \
141 ExFreeToNPagedLookasideList( \
142 &((ext)->CommonExtension.SrbLookasideList), \
143 (srb))
144
145 #endif /* ALLOCATE_SRB_FROM_POOL */
146
147 #define SET_FLAG(Flags, Bit) ((Flags) |= (Bit))
148 #define CLEAR_FLAG(Flags, Bit) ((Flags) &= ~(Bit))
149 #define TEST_FLAG(Flags, Bit) (((Flags) & (Bit)) != 0)
150
151 #define CLASS_WORKING_SET_MAXIMUM 2048
152
153 #define CLASS_INTERPRET_SENSE_INFO2_MAXIMUM_HISTORY_COUNT 30000
154
155 #define CLASS_SPECIAL_DISABLE_SPIN_DOWN 0x00000001
156 #define CLASS_SPECIAL_DISABLE_SPIN_UP 0x00000002
157 #define CLASS_SPECIAL_NO_QUEUE_LOCK 0x00000008
158 #define CLASS_SPECIAL_DISABLE_WRITE_CACHE 0x00000010
159 #define CLASS_SPECIAL_CAUSE_NOT_REPORTABLE_HACK 0x00000020
160 #if ((NTDDI_VERSION == NTDDI_WIN2KSP3) || (OSVER(NTDDI_VERSION) == NTDDI_WINXP))
161 #define CLASS_SPECIAL_DISABLE_WRITE_CACHE_NOT_SUPPORTED 0x00000040
162 #endif
163 #define CLASS_SPECIAL_MODIFY_CACHE_UNSUCCESSFUL 0x00000040
164 #define CLASS_SPECIAL_FUA_NOT_SUPPORTED 0x00000080
165 #define CLASS_SPECIAL_VALID_MASK 0x000000FB
166 #define CLASS_SPECIAL_RESERVED (~CLASS_SPECIAL_VALID_MASK)
167
168 #define DEV_WRITE_CACHE 0x00000001
169 #define DEV_USE_SCSI1 0x00000002
170 #define DEV_SAFE_START_UNIT 0x00000004
171 #define DEV_NO_12BYTE_CDB 0x00000008
172 #define DEV_POWER_PROTECTED 0x00000010
173 #define DEV_USE_16BYTE_CDB 0x00000020
174
175 #define GUID_CLASSPNP_QUERY_REGINFOEX {0x00e34b11, 0x2444, 0x4745, {0xa5, 0x3d, 0x62, 0x01, 0x00, 0xcd, 0x82, 0xf7}}
176 #define GUID_CLASSPNP_SENSEINFO2 {0x509a8c5f, 0x71d7, 0x48f6, {0x82, 0x1e, 0x17, 0x3c, 0x49, 0xbf, 0x2f, 0x18}}
177 #define GUID_CLASSPNP_WORKING_SET {0x105701b0, 0x9e9b, 0x47cb, {0x97, 0x80, 0x81, 0x19, 0x8a, 0xf7, 0xb5, 0x24}}
178
179 #define DEFAULT_FAILURE_PREDICTION_PERIOD 60 * 60 * 1
180
181 typedef enum _MEDIA_CHANGE_DETECTION_STATE {
182 MediaUnknown,
183 MediaPresent,
184 MediaNotPresent,
185 MediaUnavailable
186 } MEDIA_CHANGE_DETECTION_STATE, *PMEDIA_CHANGE_DETECTION_STATE;
187
188 typedef enum _CLASS_DEBUG_LEVEL {
189 ClassDebugError = 0,
190 ClassDebugWarning = 1,
191 ClassDebugTrace = 2,
192 ClassDebugInfo = 3,
193 ClassDebugMediaLocks = 8,
194 ClassDebugMCN = 9,
195 ClassDebugDelayedRetry = 10,
196 ClassDebugSenseInfo = 11,
197 ClassDebugRemoveLock = 12,
198 ClassDebugExternal4 = 13,
199 ClassDebugExternal3 = 14,
200 ClassDebugExternal2 = 15,
201 ClassDebugExternal1 = 16
202 } CLASS_DEBUG_LEVEL, *PCLASS_DEBUG_LEVEL;
203
204 typedef enum {
205 EventGeneration,
206 DataBlockCollection
207 } CLASSENABLEDISABLEFUNCTION;
208
209 typedef enum {
210 FailurePredictionNone = 0,
211 FailurePredictionIoctl,
212 FailurePredictionSmart,
213 FailurePredictionSense
214 } FAILURE_PREDICTION_METHOD, *PFAILURE_PREDICTION_METHOD;
215
216 typedef enum {
217 PowerDownDeviceInitial,
218 PowerDownDeviceLocked,
219 PowerDownDeviceStopped,
220 PowerDownDeviceOff,
221 PowerDownDeviceUnlocked
222 } CLASS_POWER_DOWN_STATE;
223
224 typedef enum {
225 PowerDownDeviceInitial2,
226 PowerDownDeviceLocked2,
227 PowerDownDeviceFlushed2,
228 PowerDownDeviceStopped2,
229 PowerDownDeviceOff2,
230 PowerDownDeviceUnlocked2
231 } CLASS_POWER_DOWN_STATE2;
232
233 typedef enum {
234 PowerUpDeviceInitial,
235 PowerUpDeviceLocked,
236 PowerUpDeviceOn,
237 PowerUpDeviceStarted,
238 PowerUpDeviceUnlocked
239 } CLASS_POWER_UP_STATE;
240
241 struct _CLASS_INIT_DATA;
242 typedef struct _CLASS_INIT_DATA CLASS_INIT_DATA, *PCLASS_INIT_DATA;
243
244 struct _CLASS_PRIVATE_FDO_DATA;
245 typedef struct _CLASS_PRIVATE_FDO_DATA CLASS_PRIVATE_FDO_DATA, *PCLASS_PRIVATE_FDO_DATA;
246
247 struct _CLASS_PRIVATE_PDO_DATA;
248 typedef struct _CLASS_PRIVATE_PDO_DATA CLASS_PRIVATE_PDO_DATA, *PCLASS_PRIVATE_PDO_DATA;
249
250 struct _CLASS_PRIVATE_COMMON_DATA;
251 typedef struct _CLASS_PRIVATE_COMMON_DATA CLASS_PRIVATE_COMMON_DATA, *PCLASS_PRIVATE_COMMON_DATA;
252
253 struct _MEDIA_CHANGE_DETECTION_INFO;
254 typedef struct _MEDIA_CHANGE_DETECTION_INFO MEDIA_CHANGE_DETECTION_INFO, *PMEDIA_CHANGE_DETECTION_INFO;
255
256 typedef struct _DICTIONARY {
257 ULONGLONG Signature;
258 struct _DICTIONARY_HEADER* List;
259 KSPIN_LOCK SpinLock;
260 } DICTIONARY, *PDICTIONARY;
261
262 typedef struct _CLASSPNP_SCAN_FOR_SPECIAL_INFO {
263 PCHAR VendorId;
264 PCHAR ProductId;
265 PCHAR ProductRevision;
266 ULONG_PTR Data;
267 } CLASSPNP_SCAN_FOR_SPECIAL_INFO, *PCLASSPNP_SCAN_FOR_SPECIAL_INFO;
268
269 typedef VOID
270 (NTAPI *PCLASS_ERROR)(
271 PDEVICE_OBJECT DeviceObject,
272 PSCSI_REQUEST_BLOCK Srb,
273 NTSTATUS *Status,
274 BOOLEAN *Retry);
275
276 typedef NTSTATUS
277 (NTAPI *PCLASS_ADD_DEVICE)(
278 PDRIVER_OBJECT DriverObject,
279 PDEVICE_OBJECT Pdo);
280
281 typedef NTSTATUS
282 (NTAPI *PCLASS_POWER_DEVICE)(
283 PDEVICE_OBJECT DeviceObject,
284 PIRP Irp);
285
286 typedef NTSTATUS
287 (NTAPI *PCLASS_START_DEVICE)(
288 PDEVICE_OBJECT DeviceObject);
289
290 typedef NTSTATUS
291 (NTAPI *PCLASS_STOP_DEVICE)(
292 PDEVICE_OBJECT DeviceObject,
293 UCHAR Type);
294
295 typedef NTSTATUS
296 (NTAPI *PCLASS_INIT_DEVICE)(
297 PDEVICE_OBJECT DeviceObject);
298
299 typedef NTSTATUS
300 (NTAPI *PCLASS_ENUM_DEVICE)(
301 PDEVICE_OBJECT DeviceObject);
302
303 typedef NTSTATUS
304 (NTAPI *PCLASS_READ_WRITE)(
305 PDEVICE_OBJECT DeviceObject,
306 PIRP Irp);
307
308 typedef NTSTATUS
309 (NTAPI *PCLASS_DEVICE_CONTROL)(
310 PDEVICE_OBJECT DeviceObject,
311 PIRP Irp);
312
313 typedef NTSTATUS
314 (NTAPI *PCLASS_SHUTDOWN_FLUSH)(
315 PDEVICE_OBJECT DeviceObject,
316 PIRP Irp);
317
318 typedef NTSTATUS
319 (NTAPI *PCLASS_CREATE_CLOSE)(
320 PDEVICE_OBJECT DeviceObject,
321 PIRP Irp);
322
323 typedef NTSTATUS
324 (NTAPI *PCLASS_QUERY_ID)(
325 PDEVICE_OBJECT DeviceObject,
326 BUS_QUERY_ID_TYPE IdType,
327 PUNICODE_STRING IdString);
328
329 typedef NTSTATUS
330 (NTAPI *PCLASS_REMOVE_DEVICE)(
331 PDEVICE_OBJECT DeviceObject,
332 UCHAR Type);
333
334 typedef VOID
335 (NTAPI *PCLASS_UNLOAD)(
336 PDRIVER_OBJECT DriverObject);
337
338 typedef NTSTATUS
339 (NTAPI *PCLASS_QUERY_PNP_CAPABILITIES)(
340 PDEVICE_OBJECT PhysicalDeviceObject,
341 PDEVICE_CAPABILITIES Capabilities);
342
343 typedef VOID
344 (NTAPI *PCLASS_TICK)(
345 PDEVICE_OBJECT DeviceObject);
346
347 typedef NTSTATUS
348 (NTAPI *PCLASS_QUERY_WMI_REGINFO_EX)(
349 PDEVICE_OBJECT DeviceObject,
350 ULONG *RegFlags,
351 PUNICODE_STRING Name,
352 PUNICODE_STRING MofResouceName);
353
354 typedef NTSTATUS
355 (NTAPI *PCLASS_QUERY_WMI_REGINFO)(
356 PDEVICE_OBJECT DeviceObject,
357 ULONG *RegFlags,
358 PUNICODE_STRING Name);
359
360 typedef NTSTATUS
361 (NTAPI *PCLASS_QUERY_WMI_DATABLOCK)(
362 PDEVICE_OBJECT DeviceObject,
363 PIRP Irp,
364 ULONG GuidIndex,
365 ULONG BufferAvail,
366 PUCHAR Buffer);
367
368 typedef NTSTATUS
369 (NTAPI *PCLASS_SET_WMI_DATABLOCK)(
370 PDEVICE_OBJECT DeviceObject,
371 PIRP Irp,
372 ULONG GuidIndex,
373 ULONG BufferSize,
374 PUCHAR Buffer);
375
376 typedef NTSTATUS
377 (NTAPI *PCLASS_SET_WMI_DATAITEM)(
378 PDEVICE_OBJECT DeviceObject,
379 PIRP Irp,
380 ULONG GuidIndex,
381 ULONG DataItemId,
382 ULONG BufferSize,
383 PUCHAR Buffer);
384
385 typedef NTSTATUS
386 (NTAPI *PCLASS_EXECUTE_WMI_METHOD)(
387 PDEVICE_OBJECT DeviceObject,
388 PIRP Irp,
389 ULONG GuidIndex,
390 ULONG MethodId,
391 ULONG InBufferSize,
392 ULONG OutBufferSize,
393 PUCHAR Buffer);
394
395 typedef NTSTATUS
396 (NTAPI *PCLASS_WMI_FUNCTION_CONTROL)(
397 PDEVICE_OBJECT DeviceObject,
398 PIRP Irp,
399 ULONG GuidIndex,
400 CLASSENABLEDISABLEFUNCTION Function,
401 BOOLEAN Enable);
402
403 typedef struct _SRB_HISTORY_ITEM {
404 LARGE_INTEGER TickCountSent;
405 LARGE_INTEGER TickCountCompleted;
406 ULONG MillisecondsDelayOnRetry;
407 SENSE_DATA NormalizedSenseData;
408 UCHAR SrbStatus;
409 UCHAR ClassDriverUse;
410 } SRB_HISTORY_ITEM, *PSRB_HISTORY_ITEM;
411
412 typedef struct _SRB_HISTORY {
413 ULONG_PTR ClassDriverUse[4];
414 ULONG TotalHistoryCount;
415 ULONG UsedHistoryCount;
416 SRB_HISTORY_ITEM History[1];
417 } SRB_HISTORY, *PSRB_HISTORY;
418
419 typedef BOOLEAN
420 (NTAPI *PCLASS_INTERPRET_SENSE_INFO)(
421 PDEVICE_OBJECT Fdo,
422 PIRP OriginalRequest,
423 PSCSI_REQUEST_BLOCK Srb,
424 UCHAR MajorFunctionCode,
425 ULONG IoDeviceCode,
426 ULONG PreviousRetryCount,
427 SRB_HISTORY *RequestHistory,
428 NTSTATUS *Status,
429 LONGLONG *RetryIn100nsUnits);
430
431 typedef VOID
432 (NTAPI *PCLASS_COMPRESS_RETRY_HISTORY_DATA)(
433 PDEVICE_OBJECT DeviceObject,
434 PSRB_HISTORY RequestHistory);
435
436 typedef struct {
437 GUID Guid;
438 ULONG InstanceCount;
439 ULONG Flags;
440 } GUIDREGINFO, *PGUIDREGINFO;
441
442 typedef struct _CLASS_WMI_INFO {
443 ULONG GuidCount;
444 PGUIDREGINFO GuidRegInfo;
445 PCLASS_QUERY_WMI_REGINFO ClassQueryWmiRegInfo;
446 PCLASS_QUERY_WMI_DATABLOCK ClassQueryWmiDataBlock;
447 PCLASS_SET_WMI_DATABLOCK ClassSetWmiDataBlock;
448 PCLASS_SET_WMI_DATAITEM ClassSetWmiDataItem;
449 PCLASS_EXECUTE_WMI_METHOD ClassExecuteWmiMethod;
450 PCLASS_WMI_FUNCTION_CONTROL ClassWmiFunctionControl;
451 } CLASS_WMI_INFO, *PCLASS_WMI_INFO;
452
453 typedef struct _CLASS_DEV_INFO {
454 ULONG DeviceExtensionSize;
455 DEVICE_TYPE DeviceType;
456 UCHAR StackSize;
457 ULONG DeviceCharacteristics;
458 PCLASS_ERROR ClassError;
459 PCLASS_READ_WRITE ClassReadWriteVerification;
460 PCLASS_DEVICE_CONTROL ClassDeviceControl;
461 PCLASS_SHUTDOWN_FLUSH ClassShutdownFlush;
462 PCLASS_CREATE_CLOSE ClassCreateClose;
463 PCLASS_INIT_DEVICE ClassInitDevice;
464 PCLASS_START_DEVICE ClassStartDevice;
465 PCLASS_POWER_DEVICE ClassPowerDevice;
466 PCLASS_STOP_DEVICE ClassStopDevice;
467 PCLASS_REMOVE_DEVICE ClassRemoveDevice;
468 PCLASS_QUERY_PNP_CAPABILITIES ClassQueryPnpCapabilities;
469 CLASS_WMI_INFO ClassWmiInfo;
470 } CLASS_DEV_INFO, *PCLASS_DEV_INFO;
471
472 struct _CLASS_INIT_DATA {
473 ULONG InitializationDataSize;
474 CLASS_DEV_INFO FdoData;
475 CLASS_DEV_INFO PdoData;
476 PCLASS_ADD_DEVICE ClassAddDevice;
477 PCLASS_ENUM_DEVICE ClassEnumerateDevice;
478 PCLASS_QUERY_ID ClassQueryId;
479 PDRIVER_STARTIO ClassStartIo;
480 PCLASS_UNLOAD ClassUnload;
481 PCLASS_TICK ClassTick;
482 };
483
484 typedef struct _FILE_OBJECT_EXTENSION {
485 PFILE_OBJECT FileObject;
486 PDEVICE_OBJECT DeviceObject;
487 ULONG LockCount;
488 ULONG McnDisableCount;
489 } FILE_OBJECT_EXTENSION, *PFILE_OBJECT_EXTENSION;
490
491 typedef struct _CLASS_WORKING_SET {
492 ULONG Size;
493 ULONG XferPacketsWorkingSetMaximum;
494 ULONG XferPacketsWorkingSetMinimum;
495 } CLASS_WORKING_SET, *PCLASS_WORKING_SET;
496
497 typedef struct _CLASS_INTERPRET_SENSE_INFO2 {
498 ULONG Size;
499 ULONG HistoryCount;
500 PCLASS_COMPRESS_RETRY_HISTORY_DATA Compress;
501 PCLASS_INTERPRET_SENSE_INFO Interpret;
502 } CLASS_INTERPRET_SENSE_INFO2, *PCLASS_INTERPRET_SENSE_INFO2;
503
504 C_ASSERT((MAXULONG - sizeof(SRB_HISTORY)) / 30000 >= sizeof(SRB_HISTORY_ITEM));
505
506 typedef struct _CLASS_DRIVER_EXTENSION {
507 UNICODE_STRING RegistryPath;
508 CLASS_INIT_DATA InitData;
509 ULONG DeviceCount;
510 #if (NTDDI_VERSION >= NTDDI_WINXP)
511 PCLASS_QUERY_WMI_REGINFO_EX ClassFdoQueryWmiRegInfoEx;
512 PCLASS_QUERY_WMI_REGINFO_EX ClassPdoQueryWmiRegInfoEx;
513 #endif
514 #if (NTDDI_VERSION >= NTDDI_VISTA)
515 REGHANDLE EtwHandle;
516 PDRIVER_DISPATCH DeviceMajorFunctionTable[IRP_MJ_MAXIMUM_FUNCTION + 1];
517 PDRIVER_DISPATCH MpDeviceMajorFunctionTable[IRP_MJ_MAXIMUM_FUNCTION + 1];
518 PCLASS_INTERPRET_SENSE_INFO2 InterpretSenseInfo;
519 PCLASS_WORKING_SET WorkingSet;
520 #endif
521 } CLASS_DRIVER_EXTENSION, *PCLASS_DRIVER_EXTENSION;
522
523 typedef struct _COMMON_DEVICE_EXTENSION {
524 ULONG Version;
525 PDEVICE_OBJECT DeviceObject;
526 PDEVICE_OBJECT LowerDeviceObject;
527 struct _FUNCTIONAL_DEVICE_EXTENSION *PartitionZeroExtension;
528 PCLASS_DRIVER_EXTENSION DriverExtension;
529 LONG RemoveLock;
530 KEVENT RemoveEvent;
531 KSPIN_LOCK RemoveTrackingSpinlock;
532 PVOID RemoveTrackingList;
533 LONG RemoveTrackingUntrackedCount;
534 PVOID DriverData;
535 _ANONYMOUS_STRUCT struct {
536 BOOLEAN IsFdo:1;
537 BOOLEAN IsInitialized:1;
538 BOOLEAN IsSrbLookasideListInitialized:1;
539 } DUMMYSTRUCTNAME;
540 UCHAR PreviousState;
541 UCHAR CurrentState;
542 ULONG IsRemoved;
543 UNICODE_STRING DeviceName;
544 struct _PHYSICAL_DEVICE_EXTENSION *ChildList;
545 ULONG PartitionNumber;
546 LARGE_INTEGER PartitionLength;
547 LARGE_INTEGER StartingOffset;
548 PCLASS_DEV_INFO DevInfo;
549 ULONG PagingPathCount;
550 ULONG DumpPathCount;
551 ULONG HibernationPathCount;
552 KEVENT PathCountEvent;
553 #ifndef ALLOCATE_SRB_FROM_POOL
554 NPAGED_LOOKASIDE_LIST SrbLookasideList;
555 #endif
556 UNICODE_STRING MountedDeviceInterfaceName;
557 ULONG GuidCount;
558 PGUIDREGINFO GuidRegInfo;
559 DICTIONARY FileObjectDictionary;
560 #if (NTDDI_VERSION >= NTDDI_WINXP)
561 PCLASS_PRIVATE_COMMON_DATA PrivateCommonData;
562 #else
563 ULONG_PTR Reserved1;
564 #endif
565 #if (NTDDI_VERSION >= NTDDI_VISTA)
566 PDRIVER_DISPATCH *DispatchTable;
567 #else
568 ULONG_PTR Reserved2;
569 #endif
570 ULONG_PTR Reserved3;
571 ULONG_PTR Reserved4;
572 } COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
573
574 typedef struct _PHYSICAL_DEVICE_EXTENSION {
575 _ANONYMOUS_UNION union {
576 _ANONYMOUS_STRUCT struct {
577 ULONG Version;
578 PDEVICE_OBJECT DeviceObject;
579 } DUMMYSTRUCTNAME;
580 COMMON_DEVICE_EXTENSION CommonExtension;
581 } DUMMYUNIONNAME;
582 BOOLEAN IsMissing;
583 BOOLEAN IsEnumerated;
584 #if (NTDDI_VERSION >= NTDDI_WINXP)
585 PCLASS_PRIVATE_PDO_DATA PrivatePdoData;
586 #else
587 ULONG_PTR Reserved1;
588 #endif
589 ULONG_PTR Reserved2;
590 ULONG_PTR Reserved3;
591 ULONG_PTR Reserved4;
592 } PHYSICAL_DEVICE_EXTENSION, *PPHYSICAL_DEVICE_EXTENSION;
593
594 typedef struct _CLASS_POWER_OPTIONS {
595 ULONG PowerDown:1;
596 ULONG LockQueue:1;
597 ULONG HandleSpinDown:1;
598 ULONG HandleSpinUp:1;
599 ULONG Reserved:27;
600 } CLASS_POWER_OPTIONS, *PCLASS_POWER_OPTIONS;
601
602 typedef struct _CLASS_POWER_CONTEXT {
603 union {
604 CLASS_POWER_DOWN_STATE PowerDown;
605 CLASS_POWER_DOWN_STATE2 PowerDown2;
606 CLASS_POWER_UP_STATE PowerUp;
607 } PowerChangeState;
608 CLASS_POWER_OPTIONS Options;
609 BOOLEAN InUse;
610 BOOLEAN QueueLocked;
611 NTSTATUS FinalStatus;
612 ULONG RetryCount;
613 ULONG RetryInterval;
614 PIO_COMPLETION_ROUTINE CompletionRoutine;
615 PDEVICE_OBJECT DeviceObject;
616 PIRP Irp;
617 SCSI_REQUEST_BLOCK Srb;
618 } CLASS_POWER_CONTEXT, *PCLASS_POWER_CONTEXT;
619
620 typedef struct _COMPLETION_CONTEXT {
621 PDEVICE_OBJECT DeviceObject;
622 SCSI_REQUEST_BLOCK Srb;
623 } COMPLETION_CONTEXT, *PCOMPLETION_CONTEXT;
624
625 SCSIPORTAPI
626 ULONG
627 NTAPI
628 ClassInitialize(
629 PVOID Argument1,
630 PVOID Argument2,
631 PCLASS_INIT_DATA InitializationData);
632
633 typedef struct _CLASS_QUERY_WMI_REGINFO_EX_LIST {
634 ULONG Size;
635 PCLASS_QUERY_WMI_REGINFO_EX ClassFdoQueryWmiRegInfoEx;
636 PCLASS_QUERY_WMI_REGINFO_EX ClassPdoQueryWmiRegInfoEx;
637 } CLASS_QUERY_WMI_REGINFO_EX_LIST, *PCLASS_QUERY_WMI_REGINFO_EX_LIST;
638
639 typedef struct _FUNCTIONAL_DEVICE_EXTENSION {
640 _ANONYMOUS_UNION union {
641 _ANONYMOUS_STRUCT struct {
642 ULONG Version;
643 PDEVICE_OBJECT DeviceObject;
644 } DUMMYSTRUCTNAME;
645 COMMON_DEVICE_EXTENSION CommonExtension;
646 } DUMMYUNIONNAME;
647 PDEVICE_OBJECT LowerPdo;
648 PSTORAGE_DEVICE_DESCRIPTOR DeviceDescriptor;
649 PSTORAGE_ADAPTER_DESCRIPTOR AdapterDescriptor;
650 DEVICE_POWER_STATE DevicePowerState;
651 ULONG DMByteSkew;
652 ULONG DMSkew;
653 BOOLEAN DMActive;
654 DISK_GEOMETRY DiskGeometry;
655 PSENSE_DATA SenseData;
656 ULONG TimeOutValue;
657 ULONG DeviceNumber;
658 ULONG SrbFlags;
659 ULONG ErrorCount;
660 LONG LockCount;
661 LONG ProtectedLockCount;
662 LONG InternalLockCount;
663 KEVENT EjectSynchronizationEvent;
664 USHORT DeviceFlags;
665 UCHAR SectorShift;
666 #if (NTDDI_VERSION >= NTDDI_VISTA)
667 UCHAR CdbForceUnitAccess;
668 #else
669 UCHAR ReservedByte;
670 #endif
671 PMEDIA_CHANGE_DETECTION_INFO MediaChangeDetectionInfo;
672 PKEVENT Unused1;
673 HANDLE Unused2;
674 FILE_OBJECT_EXTENSION KernelModeMcnContext;
675 ULONG MediaChangeCount;
676 HANDLE DeviceDirectory;
677 KSPIN_LOCK ReleaseQueueSpinLock;
678 PIRP ReleaseQueueIrp;
679 SCSI_REQUEST_BLOCK ReleaseQueueSrb;
680 BOOLEAN ReleaseQueueNeeded;
681 BOOLEAN ReleaseQueueInProgress;
682 BOOLEAN ReleaseQueueIrpFromPool;
683 BOOLEAN FailurePredicted;
684 ULONG FailureReason;
685 struct _FAILURE_PREDICTION_INFO* FailurePredictionInfo;
686 BOOLEAN PowerDownInProgress;
687 ULONG EnumerationInterlock;
688 KEVENT ChildLock;
689 PKTHREAD ChildLockOwner;
690 ULONG ChildLockAcquisitionCount;
691 ULONG ScanForSpecialFlags;
692 KDPC PowerRetryDpc;
693 KTIMER PowerRetryTimer;
694 CLASS_POWER_CONTEXT PowerContext;
695
696 #if (NTDDI_VERSION <= NTDDI_WIN2K)
697
698 #if (SPVER(NTDDI_VERSION) < 2))
699 ULONG_PTR Reserved1;
700 ULONG_PTR Reserved2;
701 ULONG_PTR Reserved3;
702 ULONG_PTR Reserved4;
703 #else
704 ULONG CompletionSuccessCount;
705 ULONG SavedSrbFlags;
706 ULONG SavedErrorCount;
707 ULONG_PTR Reserved1;
708 #endif
709
710 #else /* (NTDDI_VERSION <= NTDDI_WIN2K) */
711
712 PCLASS_PRIVATE_FDO_DATA PrivateFdoData;
713 ULONG_PTR Reserved2;
714 ULONG_PTR Reserved3;
715 ULONG_PTR Reserved4;
716
717 #endif /* (NTDDI_VERSION <= NTDDI_WIN2K) */
718
719 } FUNCTIONAL_DEVICE_EXTENSION, *PFUNCTIONAL_DEVICE_EXTENSION;
720
721 SCSIPORTAPI
722 ULONG
723 NTAPI
724 ClassInitializeEx(
725 PDRIVER_OBJECT DriverObject,
726 LPGUID Guid,
727 PVOID Data);
728
729 SCSIPORTAPI
730 NTSTATUS
731 NTAPI
732 ClassCreateDeviceObject(
733 PDRIVER_OBJECT DriverObject,
734 PCCHAR ObjectNameBuffer,
735 PDEVICE_OBJECT LowerDeviceObject,
736 BOOLEAN IsFdo,
737 PDEVICE_OBJECT *DeviceObject);
738
739 SCSIPORTAPI
740 NTSTATUS
741 NTAPI
742 ClassReadDriveCapacity(
743 PDEVICE_OBJECT DeviceObject);
744
745 SCSIPORTAPI
746 VOID
747 NTAPI
748 ClassReleaseQueue(
749 PDEVICE_OBJECT DeviceObject);
750
751 SCSIPORTAPI
752 VOID
753 NTAPI
754 ClassSplitRequest(
755 PDEVICE_OBJECT DeviceObject,
756 PIRP Irp,
757 ULONG MaximumBytes);
758
759 SCSIPORTAPI
760 NTSTATUS
761 NTAPI
762 ClassDeviceControl(
763 PDEVICE_OBJECT DeviceObject,
764 PIRP Irp);
765
766 SCSIPORTAPI
767 NTSTATUS
768 NTAPI
769 ClassIoComplete(
770 PDEVICE_OBJECT DeviceObject,
771 PIRP Irp,
772 PVOID Context);
773
774 SCSIPORTAPI
775 BOOLEAN
776 NTAPI
777 ClassInterpretSenseInfo(
778 PDEVICE_OBJECT DeviceObject,
779 PSCSI_REQUEST_BLOCK Srb,
780 UCHAR MajorFunctionCode,
781 ULONG IoDeviceCode,
782 ULONG RetryCount,
783 NTSTATUS *Status,
784 ULONG *RetryInterval);
785
786 VOID
787 NTAPI
788 ClassSendDeviceIoControlSynchronous(
789 ULONG IoControlCode,
790 PDEVICE_OBJECT TargetDeviceObject,
791 PVOID Buffer,
792 ULONG InputBufferLength,
793 ULONG OutputBufferLength,
794 BOOLEAN InternalDeviceIoControl,
795 PIO_STATUS_BLOCK IoStatus);
796
797 SCSIPORTAPI
798 NTSTATUS
799 NTAPI
800 ClassSendIrpSynchronous(
801 PDEVICE_OBJECT TargetDeviceObject,
802 PIRP Irp);
803
804 SCSIPORTAPI
805 NTSTATUS
806 NTAPI
807 ClassForwardIrpSynchronous(
808 PCOMMON_DEVICE_EXTENSION CommonExtension,
809 PIRP Irp);
810
811 SCSIPORTAPI
812 NTSTATUS
813 NTAPI
814 ClassSendSrbSynchronous(
815 PDEVICE_OBJECT DeviceObject,
816 PSCSI_REQUEST_BLOCK Srb,
817 PVOID BufferAddress,
818 ULONG BufferLength,
819 BOOLEAN WriteToDevice);
820
821 SCSIPORTAPI
822 NTSTATUS
823 NTAPI
824 ClassSendSrbAsynchronous(
825 PDEVICE_OBJECT DeviceObject,
826 PSCSI_REQUEST_BLOCK Srb,
827 PIRP Irp,
828 PVOID BufferAddress,
829 ULONG BufferLength,
830 BOOLEAN WriteToDevice);
831
832 SCSIPORTAPI
833 NTSTATUS
834 NTAPI
835 ClassBuildRequest(
836 PDEVICE_OBJECT DeviceObject,
837 PIRP Irp);
838
839 SCSIPORTAPI
840 ULONG
841 NTAPI
842 ClassModeSense(
843 PDEVICE_OBJECT DeviceObject,
844 PCHAR ModeSenseBuffer,
845 ULONG Length,
846 UCHAR PageMode);
847
848 SCSIPORTAPI
849 PVOID
850 NTAPI
851 ClassFindModePage(
852 PCHAR ModeSenseBuffer,
853 ULONG Length,
854 UCHAR PageMode,
855 BOOLEAN Use6Byte);
856
857 SCSIPORTAPI
858 NTSTATUS
859 NTAPI
860 ClassClaimDevice(
861 PDEVICE_OBJECT LowerDeviceObject,
862 BOOLEAN Release);
863
864 SCSIPORTAPI
865 VOID
866 NTAPI
867 ClassInitializeSrbLookasideList(
868 PCOMMON_DEVICE_EXTENSION CommonExtension,
869 ULONG NumberElements);
870
871 SCSIPORTAPI
872 VOID
873 NTAPI
874 ClassDeleteSrbLookasideList(
875 PCOMMON_DEVICE_EXTENSION CommonExtension);
876
877 SCSIPORTAPI
878 ULONG
879 NTAPI
880 ClassQueryTimeOutRegistryValue(
881 PDEVICE_OBJECT DeviceObject);
882
883 SCSIPORTAPI
884 NTSTATUS
885 NTAPI
886 ClassGetDescriptor(
887 PDEVICE_OBJECT DeviceObject,
888 PSTORAGE_PROPERTY_ID PropertyId,
889 PSTORAGE_DESCRIPTOR_HEADER *Descriptor);
890
891 SCSIPORTAPI
892 VOID
893 NTAPI
894 ClassInvalidateBusRelations(
895 PDEVICE_OBJECT Fdo);
896
897 SCSIPORTAPI
898 VOID
899 NTAPI
900 ClassMarkChildrenMissing(
901 PFUNCTIONAL_DEVICE_EXTENSION Fdo);
902
903 SCSIPORTAPI
904 BOOLEAN
905 NTAPI
906 ClassMarkChildMissing(
907 PPHYSICAL_DEVICE_EXTENSION PdoExtension,
908 BOOLEAN AcquireChildLock);
909
910 SCSIPORTAPI
911 VOID
912 NTAPI
913 ClassDebugPrint(
914 CLASS_DEBUG_LEVEL DebugPrintLevel,
915 PCCHAR DebugMessage,
916 ...);
917
918 SCSIPORTAPI
919 PCLASS_DRIVER_EXTENSION
920 NTAPI
921 ClassGetDriverExtension(
922 PDRIVER_OBJECT DriverObject);
923
924 SCSIPORTAPI
925 VOID
926 NTAPI
927 ClassCompleteRequest(
928 PDEVICE_OBJECT DeviceObject,
929 PIRP Irp,
930 CCHAR PriorityBoost);
931
932 SCSIPORTAPI
933 VOID
934 NTAPI
935 ClassReleaseRemoveLock(
936 PDEVICE_OBJECT DeviceObject,
937 PIRP Tag);
938
939 SCSIPORTAPI
940 ULONG
941 NTAPI
942 ClassAcquireRemoveLockEx(
943 PDEVICE_OBJECT DeviceObject,
944 PVOID Tag,
945 PCSTR File,
946 ULONG Line);
947
948 SCSIPORTAPI
949 VOID
950 NTAPI
951 ClassUpdateInformationInRegistry(
952 PDEVICE_OBJECT Fdo,
953 PCHAR DeviceName,
954 ULONG DeviceNumber,
955 PINQUIRYDATA InquiryData,
956 ULONG InquiryDataLength);
957
958 SCSIPORTAPI
959 NTSTATUS
960 NTAPI
961 ClassWmiCompleteRequest(
962 PDEVICE_OBJECT DeviceObject,
963 PIRP Irp,
964 NTSTATUS Status,
965 ULONG BufferUsed,
966 CCHAR PriorityBoost);
967
968 SCSIPORTAPI
969 NTSTATUS
970 NTAPI
971 ClassWmiFireEvent(
972 PDEVICE_OBJECT DeviceObject,
973 LPGUID Guid,
974 ULONG InstanceIndex,
975 ULONG EventDataSize,
976 PVOID EventData);
977
978 SCSIPORTAPI
979 VOID
980 NTAPI
981 ClassResetMediaChangeTimer(
982 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension);
983
984 SCSIPORTAPI
985 VOID
986 NTAPI
987 ClassInitializeMediaChangeDetection(
988 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
989 PUCHAR EventPrefix);
990
991 SCSIPORTAPI
992 NTSTATUS
993 NTAPI
994 ClassInitializeTestUnitPolling(
995 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
996 BOOLEAN AllowDriveToSleep);
997
998 SCSIPORTAPI
999 PVPB
1000 NTAPI
1001 ClassGetVpb(
1002 PDEVICE_OBJECT DeviceObject);
1003
1004 SCSIPORTAPI
1005 NTSTATUS
1006 NTAPI
1007 ClassSpinDownPowerHandler(
1008 PDEVICE_OBJECT DeviceObject,
1009 PIRP Irp);
1010
1011 NTSTATUS
1012 NTAPI
1013 ClassStopUnitPowerHandler(
1014 PDEVICE_OBJECT DeviceObject,
1015 PIRP Irp);
1016
1017 NTSTATUS
1018 NTAPI
1019 ClassSetFailurePredictionPoll(
1020 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1021 FAILURE_PREDICTION_METHOD FailurePredictionMethod,
1022 ULONG PollingPeriod);
1023
1024 VOID
1025 NTAPI
1026 ClassNotifyFailurePredicted(
1027 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1028 PUCHAR Buffer,
1029 ULONG BufferSize,
1030 BOOLEAN LogError,
1031 ULONG UniqueErrorValue,
1032 UCHAR PathId,
1033 UCHAR TargetId,
1034 UCHAR Lun);
1035
1036 SCSIPORTAPI
1037 VOID
1038 NTAPI
1039 ClassAcquireChildLock(
1040 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension);
1041
1042 SCSIPORTAPI
1043 VOID
1044 NTAPI
1045 ClassReleaseChildLock(
1046 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension);
1047
1048 NTSTATUS
1049 NTAPI
1050 ClassSignalCompletion(
1051 PDEVICE_OBJECT DeviceObject,
1052 PIRP Irp,
1053 PKEVENT Event);
1054
1055 VOID
1056 NTAPI
1057 ClassSendStartUnit(
1058 PDEVICE_OBJECT DeviceObject);
1059
1060 SCSIPORTAPI
1061 NTSTATUS
1062 NTAPI
1063 ClassRemoveDevice(
1064 PDEVICE_OBJECT DeviceObject,
1065 UCHAR RemoveType);
1066
1067 SCSIPORTAPI
1068 NTSTATUS
1069 NTAPI
1070 ClassAsynchronousCompletion(
1071 PDEVICE_OBJECT DeviceObject,
1072 PIRP Irp,
1073 PVOID Event);
1074
1075 SCSIPORTAPI
1076 VOID
1077 NTAPI
1078 ClassCheckMediaState(
1079 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension);
1080
1081 SCSIPORTAPI
1082 NTSTATUS
1083 NTAPI
1084 ClassCheckVerifyComplete(
1085 PDEVICE_OBJECT DeviceObject,
1086 PIRP Irp,
1087 PVOID Context);
1088
1089 SCSIPORTAPI
1090 VOID
1091 NTAPI
1092 ClassSetMediaChangeState(
1093 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1094 MEDIA_CHANGE_DETECTION_STATE State,
1095 BOOLEAN Wait);
1096
1097 SCSIPORTAPI
1098 VOID
1099 NTAPI
1100 ClassEnableMediaChangeDetection(
1101 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension);
1102
1103 SCSIPORTAPI
1104 VOID
1105 NTAPI
1106 ClassDisableMediaChangeDetection(
1107 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension);
1108
1109 SCSIPORTAPI
1110 VOID
1111 NTAPI
1112 ClassCleanupMediaChangeDetection(
1113 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension);
1114
1115 VOID
1116 NTAPI
1117 ClassGetDeviceParameter(
1118 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1119 PWSTR SubkeyName,
1120 PWSTR ParameterName,
1121 PULONG ParameterValue);
1122
1123 NTSTATUS
1124 NTAPI
1125 ClassSetDeviceParameter(
1126 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1127 PWSTR SubkeyName,
1128 PWSTR ParameterName,
1129 ULONG ParameterValue);
1130
1131 #if (NTDDI_VERSION >= NTDDI_VISTA)
1132
1133 PFILE_OBJECT_EXTENSION
1134 NTAPI
1135 ClassGetFsContext(
1136 PCOMMON_DEVICE_EXTENSION CommonExtension,
1137 PFILE_OBJECT FileObject);
1138
1139 VOID
1140 NTAPI
1141 ClassSendNotification(
1142 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1143 const GUID *Guid,
1144 ULONG ExtraDataSize,
1145 PVOID ExtraData);
1146
1147 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
1148
1149 static __inline
1150 BOOLEAN
1151 PORT_ALLOCATED_SENSE(
1152 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1153 PSCSI_REQUEST_BLOCK Srb)
1154 {
1155 return ((BOOLEAN)((TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_PORT_DRIVER_ALLOCSENSE) &&
1156 TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER)) &&
1157 (Srb->SenseInfoBuffer != FdoExtension->SenseData)));
1158 }
1159
1160 static __inline
1161 VOID
1162 FREE_PORT_ALLOCATED_SENSE_BUFFER(
1163 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1164 PSCSI_REQUEST_BLOCK Srb)
1165 {
1166 ASSERT(TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_PORT_DRIVER_ALLOCSENSE));
1167 ASSERT(TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER));
1168 ASSERT(Srb->SenseInfoBuffer != FdoExtension->SenseData);
1169
1170 ExFreePool(Srb->SenseInfoBuffer);
1171 Srb->SenseInfoBuffer = FdoExtension->SenseData;
1172 Srb->SenseInfoBufferLength = SENSE_BUFFER_SIZE;
1173 CLEAR_FLAG(Srb->SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER);
1174 return;
1175 }
1176
1177 typedef VOID
1178 (NTAPI *PCLASS_SCAN_FOR_SPECIAL_HANDLER)(
1179 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1180 ULONG_PTR Data);
1181
1182 VOID
1183 NTAPI
1184 ClassScanForSpecial(
1185 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
1186 CLASSPNP_SCAN_FOR_SPECIAL_INFO DeviceList[],
1187 PCLASS_SCAN_FOR_SPECIAL_HANDLER Function);