ReactOS  0.4.12-dev-919-gfc3b8d5
classpnp.h
Go to the documentation of this file.
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 max(a,b) (((a) > (b)) ? (a) : (b))
17 #define min(a,b) (((a) < (b)) ? (a) : (b))
18 
19 #define SRB_CLASS_FLAGS_LOW_PRIORITY 0x10000000
20 #define SRB_CLASS_FLAGS_PERSISTANT 0x20000000
21 #define SRB_CLASS_FLAGS_PAGING 0x40000000
22 #define SRB_CLASS_FLAGS_FREE_MDL 0x80000000
23 
24 #define ASSERT_FDO(x) \
25  ASSERT(((PCOMMON_DEVICE_EXTENSION) (x)->DeviceExtension)->IsFdo)
26 
27 #define ASSERT_PDO(x) \
28  ASSERT(!(((PCOMMON_DEVICE_EXTENSION) (x)->DeviceExtension)->IsFdo))
29 
30 #define IS_CLEANUP_REQUEST(majorFunction) \
31  ((majorFunction == IRP_MJ_CLOSE) || \
32  (majorFunction == IRP_MJ_CLEANUP) || \
33  (majorFunction == IRP_MJ_SHUTDOWN))
34 
35 #define DO_MCD(fdoExtension) \
36  (((fdoExtension)->MediaChangeDetectionInfo != NULL) && \
37  ((fdoExtension)->MediaChangeDetectionInfo->MediaChangeDetectionDisableCount == 0))
38 
39 #define IS_SCSIOP_READ(opCode) \
40  ((opCode == SCSIOP_READ6) || \
41  (opCode == SCSIOP_READ) || \
42  (opCode == SCSIOP_READ12) || \
43  (opCode == SCSIOP_READ16))
44 
45 #define IS_SCSIOP_WRITE(opCode) \
46  ((opCode == SCSIOP_WRITE6) || \
47  (opCode == SCSIOP_WRITE) || \
48  (opCode == SCSIOP_WRITE12) || \
49  (opCode == SCSIOP_WRITE16))
50 
51 #define IS_SCSIOP_READWRITE(opCode) (IS_SCSIOP_READ(opCode) || IS_SCSIOP_WRITE(opCode))
52 
53 #define ADJUST_FUA_FLAG(fdoExt) { \
54  if (TEST_FLAG(fdoExt->DeviceFlags, DEV_WRITE_CACHE) && \
55  !TEST_FLAG(fdoExt->DeviceFlags, DEV_POWER_PROTECTED) && \
56  !TEST_FLAG(fdoExt->ScanForSpecialFlags, CLASS_SPECIAL_FUA_NOT_SUPPORTED) ) { \
57  fdoExt->CdbForceUnitAccess = TRUE; \
58  } else { \
59  fdoExt->CdbForceUnitAccess = FALSE; \
60  } \
61 }
62 
63 #define FREE_POOL(_PoolPtr) \
64  if (_PoolPtr != NULL) { \
65  ExFreePool(_PoolPtr); \
66  _PoolPtr = NULL; \
67  }
68 
69 #ifdef POOL_TAGGING
70 #undef ExAllocatePool
71 #undef ExAllocatePoolWithQuota
72 #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,'nUcS')
73 //#define ExAllocatePool(a,b) #assert(0)
74 #define ExAllocatePoolWithQuota(a,b) ExAllocatePoolWithQuotaTag(a,b,'nUcS')
75 #endif
76 
77 #define CLASS_TAG_AUTORUN_DISABLE 'ALcS'
78 #define CLASS_TAG_FILE_OBJECT_EXTENSION 'FLcS'
79 #define CLASS_TAG_MEDIA_CHANGE_DETECTION 'MLcS'
80 #define CLASS_TAG_MOUNT 'mLcS'
81 #define CLASS_TAG_RELEASE_QUEUE 'qLcS'
82 #define CLASS_TAG_POWER 'WLcS'
83 #define CLASS_TAG_WMI 'wLcS'
84 #define CLASS_TAG_FAILURE_PREDICT 'fLcS'
85 #define CLASS_TAG_DEVICE_CONTROL 'OIcS'
86 #define CLASS_TAG_MODE_DATA 'oLcS'
87 #define CLASS_TAG_MULTIPATH 'mPcS'
88 
89 #define MAXIMUM_RETRIES 4
90 
91 #define CLASS_DRIVER_EXTENSION_KEY ((PVOID) ClassInitialize)
92 
93 #define NO_REMOVE 0
94 #define REMOVE_PENDING 1
95 #define REMOVE_COMPLETE 2
96 
97 #define ClassAcquireRemoveLock(devobj, tag) \
98  ClassAcquireRemoveLockEx(devobj, tag, __FILE__, __LINE__)
99 
100 #ifdef TRY
101 #undef TRY
102 #endif
103 #ifdef LEAVE
104 #undef LEAVE
105 #endif
106 
107 #ifdef FINALLY
108 #undef FINALLY
109 #endif
110 
111 #define TRY
112 #define LEAVE goto __tryLabel;
113 #define FINALLY __tryLabel:
114 
115 #if defined DebugPrint
116 #undef DebugPrint
117 #endif
118 
119 #if DBG
120 #define DebugPrint(x) ClassDebugPrint x
121 #else
122 #define DebugPrint(x)
123 #endif
124 
125 #define DEBUG_BUFFER_LENGTH 256
126 
127 #define START_UNIT_TIMEOUT (60 * 4)
128 
129 #define MEDIA_CHANGE_DEFAULT_TIME 1
130 #define MEDIA_CHANGE_TIMEOUT_TIME 300
131 
132 #ifdef ALLOCATE_SRB_FROM_POOL
133 
134 #define ClasspAllocateSrb(ext) \
135  ExAllocatePoolWithTag(NonPagedPool, \
136  sizeof(SCSI_REQUEST_BLOCK), \
137  'sBRS')
138 
139 #define ClasspFreeSrb(ext, srb) ExFreePool((srb));
140 
141 #else /* ALLOCATE_SRB_FROM_POOL */
142 
143 #define ClasspAllocateSrb(ext) \
144  ExAllocateFromNPagedLookasideList( \
145  &((ext)->CommonExtension.SrbLookasideList))
146 
147 #define ClasspFreeSrb(ext, srb) \
148  ExFreeToNPagedLookasideList( \
149  &((ext)->CommonExtension.SrbLookasideList), \
150  (srb))
151 
152 #endif /* ALLOCATE_SRB_FROM_POOL */
153 
154 #define SET_FLAG(Flags, Bit) ((Flags) |= (Bit))
155 #define CLEAR_FLAG(Flags, Bit) ((Flags) &= ~(Bit))
156 #define TEST_FLAG(Flags, Bit) (((Flags) & (Bit)) != 0)
157 
158 #define CLASS_WORKING_SET_MAXIMUM 2048
159 
160 #define CLASS_INTERPRET_SENSE_INFO2_MAXIMUM_HISTORY_COUNT 30000
161 
162 #define CLASS_SPECIAL_DISABLE_SPIN_DOWN 0x00000001
163 #define CLASS_SPECIAL_DISABLE_SPIN_UP 0x00000002
164 #define CLASS_SPECIAL_NO_QUEUE_LOCK 0x00000008
165 #define CLASS_SPECIAL_DISABLE_WRITE_CACHE 0x00000010
166 #define CLASS_SPECIAL_CAUSE_NOT_REPORTABLE_HACK 0x00000020
167 #if ((NTDDI_VERSION == NTDDI_WIN2KSP3) || (OSVER(NTDDI_VERSION) == NTDDI_WINXP))
168 #define CLASS_SPECIAL_DISABLE_WRITE_CACHE_NOT_SUPPORTED 0x00000040
169 #endif
170 #define CLASS_SPECIAL_MODIFY_CACHE_UNSUCCESSFUL 0x00000040
171 #define CLASS_SPECIAL_FUA_NOT_SUPPORTED 0x00000080
172 #define CLASS_SPECIAL_VALID_MASK 0x000000FB
173 #define CLASS_SPECIAL_RESERVED (~CLASS_SPECIAL_VALID_MASK)
174 
175 #define DEV_WRITE_CACHE 0x00000001
176 #define DEV_USE_SCSI1 0x00000002
177 #define DEV_SAFE_START_UNIT 0x00000004
178 #define DEV_NO_12BYTE_CDB 0x00000008
179 #define DEV_POWER_PROTECTED 0x00000010
180 #define DEV_USE_16BYTE_CDB 0x00000020
181 
182 #define GUID_CLASSPNP_QUERY_REGINFOEX {0x00e34b11, 0x2444, 0x4745, {0xa5, 0x3d, 0x62, 0x01, 0x00, 0xcd, 0x82, 0xf7}}
183 #define GUID_CLASSPNP_SENSEINFO2 {0x509a8c5f, 0x71d7, 0x48f6, {0x82, 0x1e, 0x17, 0x3c, 0x49, 0xbf, 0x2f, 0x18}}
184 #define GUID_CLASSPNP_WORKING_SET {0x105701b0, 0x9e9b, 0x47cb, {0x97, 0x80, 0x81, 0x19, 0x8a, 0xf7, 0xb5, 0x24}}
185 
186 #define DEFAULT_FAILURE_PREDICTION_PERIOD 60 * 60 * 1
187 
188 #define MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS (0x3b9aca00)
189 
191 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
193 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
195 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
197 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
199 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
200 
207 
208 typedef enum _CLASS_DEBUG_LEVEL {
223 
224 typedef enum {
228 
229 typedef enum {
235 
236 typedef enum {
243 
244 typedef enum {
252 
253 typedef enum {
260 
261 struct _CLASS_INIT_DATA;
263 
266 
267 struct _CLASS_PRIVATE_PDO_DATA;
268 typedef struct _CLASS_PRIVATE_PDO_DATA CLASS_PRIVATE_PDO_DATA, *PCLASS_PRIVATE_PDO_DATA;
269 
270 struct _CLASS_PRIVATE_COMMON_DATA;
271 typedef struct _CLASS_PRIVATE_COMMON_DATA CLASS_PRIVATE_COMMON_DATA, *PCLASS_PRIVATE_COMMON_DATA;
272 
275 
276 typedef struct _DICTIONARY {
281 
288 
290 typedef VOID
296 
298 typedef NTSTATUS
299 (NTAPI *PCLASS_ADD_DEVICE)(
302 
303 typedef NTSTATUS
306  _In_ PIRP Irp);
307 
309 typedef NTSTATUS
310 (NTAPI *PCLASS_START_DEVICE)(
312 
314 typedef NTSTATUS
315 (NTAPI *PCLASS_STOP_DEVICE)(
318 
320 typedef NTSTATUS
321 (NTAPI *PCLASS_INIT_DEVICE)(
323 
325 typedef NTSTATUS
326 (NTAPI *PCLASS_ENUM_DEVICE)(
328 
330 typedef NTSTATUS
334 
336 typedef NTSTATUS
339  _In_ PIRP Irp);
340 
342 typedef NTSTATUS
345  _In_ PIRP Irp);
346 
348 typedef NTSTATUS
351  _In_ PIRP Irp);
352 
354 typedef NTSTATUS
355 (NTAPI *PCLASS_QUERY_ID)(
359 
361 typedef NTSTATUS
362 (NTAPI *PCLASS_REMOVE_DEVICE)(
364  _In_ UCHAR Type);
365 
367 typedef VOID
368 (NTAPI *PCLASS_UNLOAD)(
370 
372 typedef NTSTATUS
373 (NTAPI *PCLASS_QUERY_PNP_CAPABILITIES)(
376 
378 typedef VOID
379 (NTAPI *PCLASS_TICK)(
381 
383 typedef NTSTATUS
384 (NTAPI *PCLASS_QUERY_WMI_REGINFO_EX)(
389 
391 typedef NTSTATUS
392 (NTAPI *PCLASS_QUERY_WMI_REGINFO)(
396 
398 typedef NTSTATUS
399 (NTAPI *PCLASS_QUERY_WMI_DATABLOCK)(
405 
407 typedef NTSTATUS
408 (NTAPI *PCLASS_SET_WMI_DATABLOCK)(
414 
416 typedef NTSTATUS
417 (NTAPI *PCLASS_SET_WMI_DATAITEM)(
424 
426 typedef NTSTATUS
427 (NTAPI *PCLASS_EXECUTE_WMI_METHOD)(
434  _In_reads_(_Inexpressible_(max(InBufferSize, OutBufferSize))) PUCHAR Buffer);
435 
437 typedef NTSTATUS
438 (NTAPI *PCLASS_WMI_FUNCTION_CONTROL)(
444 
445 typedef struct _SRB_HISTORY_ITEM {
453 
454 typedef struct _SRB_HISTORY {
456  _Field_range_(1,30000) ULONG TotalHistoryCount;
457  _Field_range_(0,TotalHistoryCount) ULONG UsedHistoryCount;
458  _Field_size_part_(TotalHistoryCount, UsedHistoryCount) SRB_HISTORY_ITEM History[1];
460 
462 typedef BOOLEAN
463 (NTAPI *PCLASS_INTERPRET_SENSE_INFO)(
464  _In_ PDEVICE_OBJECT Fdo,
473  LONGLONG *RetryIn100nsUnits);
474 
476 _At_(RequestHistory->UsedHistoryCount, _Pre_equal_to_(RequestHistory->TotalHistoryCount)
477  _Out_range_(0, RequestHistory->TotalHistoryCount - 1))
478 typedef VOID
479 (NTAPI *PCLASS_COMPRESS_RETRY_HISTORY_DATA)(
482 
483 typedef struct {
488 
489 typedef struct _CLASS_WMI_INFO {
492  PCLASS_QUERY_WMI_REGINFO ClassQueryWmiRegInfo;
493  PCLASS_QUERY_WMI_DATABLOCK ClassQueryWmiDataBlock;
494  PCLASS_SET_WMI_DATABLOCK ClassSetWmiDataBlock;
495  PCLASS_SET_WMI_DATAITEM ClassSetWmiDataItem;
496  PCLASS_EXECUTE_WMI_METHOD ClassExecuteWmiMethod;
497  PCLASS_WMI_FUNCTION_CONTROL ClassWmiFunctionControl;
499 
500 typedef struct _CLASS_DEV_INFO {
510  PCLASS_INIT_DEVICE ClassInitDevice;
511  PCLASS_START_DEVICE ClassStartDevice;
513  PCLASS_STOP_DEVICE ClassStopDevice;
514  PCLASS_REMOVE_DEVICE ClassRemoveDevice;
515  PCLASS_QUERY_PNP_CAPABILITIES ClassQueryPnpCapabilities;
518 
519 struct _CLASS_INIT_DATA {
520  ULONG InitializationDataSize;
523  PCLASS_ADD_DEVICE ClassAddDevice;
524  PCLASS_ENUM_DEVICE ClassEnumerateDevice;
525  PCLASS_QUERY_ID ClassQueryId;
527  PCLASS_UNLOAD ClassUnload;
528  PCLASS_TICK ClassTick;
529 };
530 
531 typedef struct _FILE_OBJECT_EXTENSION {
537 
538 typedef struct _CLASS_WORKING_SET {
540  _Field_range_(0,2048) ULONG XferPacketsWorkingSetMaximum;
541  _Field_range_(0,2048) ULONG XferPacketsWorkingSetMinimum;
543 
545  _Field_range_(sizeof(CLASS_INTERPRET_SENSE_INFO),sizeof(CLASS_INTERPRET_SENSE_INFO))
546  ULONG Size;
547  _Field_range_(1,30000) ULONG HistoryCount;
548  __callback PCLASS_COMPRESS_RETRY_HISTORY_DATA Compress;
549  __callback PCLASS_INTERPRET_SENSE_INFO Interpret;
551 
552 C_ASSERT((MAXULONG - sizeof(SRB_HISTORY)) / 30000 >= sizeof(SRB_HISTORY_ITEM));
553 
554 typedef struct _CLASS_DRIVER_EXTENSION {
558 #if (NTDDI_VERSION >= NTDDI_WINXP)
559  PCLASS_QUERY_WMI_REGINFO_EX ClassFdoQueryWmiRegInfoEx;
560  PCLASS_QUERY_WMI_REGINFO_EX ClassPdoQueryWmiRegInfoEx;
561 #endif
562 #if (NTDDI_VERSION >= NTDDI_VISTA)
564  PDRIVER_DISPATCH DeviceMajorFunctionTable[IRP_MJ_MAXIMUM_FUNCTION + 1];
565  PDRIVER_DISPATCH MpDeviceMajorFunctionTable[IRP_MJ_MAXIMUM_FUNCTION + 1];
568 #endif
570 
571 typedef struct _COMMON_DEVICE_EXTENSION {
583  _ANONYMOUS_STRUCT struct {
587  } DUMMYSTRUCTNAME;
601 #ifndef ALLOCATE_SRB_FROM_POOL
603 #endif
608 #if (NTDDI_VERSION >= NTDDI_WINXP)
610 #else
612 #endif
613 #if (NTDDI_VERSION >= NTDDI_VISTA)
615 #else
617 #endif
621 
623  _ANONYMOUS_UNION union {
624  _ANONYMOUS_STRUCT struct {
627  } DUMMYSTRUCTNAME;
629  } DUMMYUNIONNAME;
632 #if (NTDDI_VERSION >= NTDDI_WINXP)
634 #else
636 #endif
641 
642 typedef struct _CLASS_POWER_OPTIONS {
649 
650 typedef struct _CLASS_POWER_CONTEXT {
651  union {
655  } PowerChangeState;
667 
668 typedef struct _COMPLETION_CONTEXT {
672 
676 ULONG
677 NTAPI
682 
685  __callback PCLASS_QUERY_WMI_REGINFO_EX ClassFdoQueryWmiRegInfoEx;
686  __callback PCLASS_QUERY_WMI_REGINFO_EX ClassPdoQueryWmiRegInfoEx;
688 
690  _ANONYMOUS_UNION union {
691  _ANONYMOUS_STRUCT struct {
694  } DUMMYSTRUCTNAME;
696  } DUMMYUNIONNAME;
716 #if (NTDDI_VERSION >= NTDDI_VISTA)
718 #else
719  UCHAR ReservedByte;
720 #endif
745 
746 #if (NTDDI_VERSION <= NTDDI_WIN2K)
747 
748 #if (SPVER(NTDDI_VERSION) < 2))
753 #else
754  ULONG CompletionSuccessCount;
755  ULONG SavedSrbFlags;
756  ULONG SavedErrorCount;
758 #endif
759 
760 #else /* (NTDDI_VERSION <= NTDDI_WIN2K) */
761 
762  PCLASS_PRIVATE_FDO_DATA PrivateFdoData;
766 
767 #endif /* (NTDDI_VERSION <= NTDDI_WIN2K) */
768 
770 
774 ULONG
775 NTAPI
779  _In_ PVOID Data);
780 
783 _Post_satisfies_(return <= 0)
785 NTSTATUS
786 NTAPI
794 
797 NTSTATUS
798 NTAPI
801 
803 VOID
804 NTAPI
807 
809 VOID
810 NTAPI
813  _In_ PIRP Irp,
814  _In_ ULONG MaximumBytes);
815 
817 NTSTATUS
818 NTAPI
821  _Inout_ PIRP Irp);
822 
824 NTSTATUS
825 NTAPI
828  PIRP Irp,
829  PVOID Context);
830 
832 NTSTATUS
833 NTAPI
836  PIRP Irp,
837  PVOID Context);
838 
840 BOOLEAN
841 NTAPI
847  _In_ ULONG RetryCount,
849  _Out_opt_ _Deref_out_range_(0,100) ULONG *RetryInterval);
850 
851 VOID
852 NTAPI
857  PVOID Buffer,
862 
864 NTSTATUS
865 NTAPI
868  _In_ PIRP Irp);
869 
871 NTSTATUS
872 NTAPI
874  _In_ PCOMMON_DEVICE_EXTENSION CommonExtension,
875  _In_ PIRP Irp);
876 
878 NTSTATUS
879 NTAPI
883  _In_reads_bytes_opt_(BufferLength) PVOID BufferAddress,
885  _In_ BOOLEAN WriteToDevice);
886 
888 NTSTATUS
889 NTAPI
893  _In_ PIRP Irp,
896  _In_ BOOLEAN WriteToDevice);
897 
899 NTSTATUS
900 NTAPI
903  _In_ PIRP Irp);
904 
906 ULONG
907 NTAPI
910  _In_reads_bytes_(Length) PCHAR ModeSenseBuffer,
911  _In_ ULONG Length,
912  _In_ UCHAR PageMode);
913 
915 PVOID
916 NTAPI
918  _In_reads_bytes_(Length) PCHAR ModeSenseBuffer,
919  _In_ ULONG Length,
920  _In_ UCHAR PageMode,
921  _In_ BOOLEAN Use6Byte);
922 
925 NTSTATUS
926 NTAPI
930 
932 NTSTATUS
933 NTAPI
936  PIRP Irp);
937 
940 VOID
941 NTAPI
943  _Inout_ PCOMMON_DEVICE_EXTENSION CommonExtension,
945 
948 VOID
949 NTAPI
951  _Inout_ PCOMMON_DEVICE_EXTENSION CommonExtension);
952 
955 ULONG
956 NTAPI
959 
962 NTSTATUS
963 NTAPI
968 
971 VOID
972 NTAPI
974  _In_ PDEVICE_OBJECT Fdo);
975 
978 VOID
979 NTAPI
982 
985 BOOLEAN
986 NTAPI
990 
992 VOID
994  _In_ CLASS_DEBUG_LEVEL DebugPrintLevel,
995  _In_z_ PCCHAR DebugMessage,
996  ...);
997 
1002 NTAPI
1005 
1007 VOID
1008 NTAPI
1011  _In_ PIRP Irp,
1013 
1015 VOID
1016 NTAPI
1019  PIRP Tag);
1020 
1022 ULONG
1023 NTAPI
1026  PVOID Tag,
1027  _In_ PCSTR File,
1028  _In_ ULONG Line);
1029 
1032 VOID
1033 NTAPI
1035  _In_ PDEVICE_OBJECT Fdo,
1040 
1042 NTSTATUS
1043 NTAPI
1046  _Inout_ PIRP Irp,
1048  _In_ ULONG BufferUsed,
1050 
1053 NTSTATUS
1054 NTAPI
1060  _In_reads_bytes_(EventDataSize) PVOID EventData);
1061 
1063 VOID
1064 NTAPI
1067 
1070 VOID
1071 NTAPI
1075 
1078 NTSTATUS
1079 NTAPI
1083 
1085 PVPB
1086 NTAPI
1087 ClassGetVpb(
1089 
1091 NTSTATUS
1092 NTAPI
1095  _In_ PIRP Irp);
1096 
1097 NTSTATUS
1098 NTAPI
1101  _In_ PIRP Irp);
1102 
1104 NTSTATUS
1105 NTAPI
1110 
1112 VOID
1113 NTAPI
1120  _In_ UCHAR PathId,
1122  _In_ UCHAR Lun);
1123 
1126 VOID
1127 NTAPI
1130 
1132 VOID
1133 NTAPI
1136 
1137 IO_COMPLETION_ROUTINE ClassSignalCompletion;
1138 
1139 VOID
1140 NTAPI
1143 
1146 NTSTATUS
1147 NTAPI
1151 
1153 NTSTATUS
1154 NTAPI
1157  PIRP Irp,
1158  PVOID Event);
1159 
1161 VOID
1162 NTAPI
1165 
1167 NTSTATUS
1168 NTAPI
1171  PIRP Irp,
1172  PVOID Context);
1173 
1176 VOID
1177 NTAPI
1181  _In_ BOOLEAN Wait);
1182 
1185 VOID
1186 NTAPI
1189 
1192 VOID
1193 NTAPI
1196 
1199 VOID
1200 NTAPI
1203 
1205 VOID
1206 NTAPI
1212 
1214 NTSTATUS
1215 NTAPI
1221 
1222 #if (NTDDI_VERSION >= NTDDI_VISTA)
1223 
1226 NTAPI
1227 ClassGetFsContext(
1228  _In_ PCOMMON_DEVICE_EXTENSION CommonExtension,
1230 
1232 VOID
1233 NTAPI
1234 ClassSendNotification(
1236  _In_ const GUID *Guid,
1239 
1240 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
1241 
1242 static __inline
1243 BOOLEAN
1247 {
1248  return ((BOOLEAN)((TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_PORT_DRIVER_ALLOCSENSE) &&
1249  TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER)) &&
1250  (Srb->SenseInfoBuffer != FdoExtension->SenseData)));
1251 }
1252 
1253 static __inline
1254 VOID
1258 {
1261  ASSERT(Srb->SenseInfoBuffer != FdoExtension->SenseData);
1262 
1263  ExFreePool(Srb->SenseInfoBuffer);
1264  Srb->SenseInfoBuffer = FdoExtension->SenseData;
1265  Srb->SenseInfoBufferLength = SENSE_BUFFER_SIZE;
1267  return;
1268 }
1269 
1271 typedef VOID
1272 (NTAPI *PCLASS_SCAN_FOR_SPECIAL_HANDLER)(
1274  _In_ ULONG_PTR Data);
1275 
1277 VOID
1278 NTAPI
1282  _In_ PCLASS_SCAN_FOR_SPECIAL_HANDLER Function);
__callback PCLASS_COMPRESS_RETRY_HISTORY_DATA Compress
Definition: classpnp.h:548
COMMON_DEVICE_EXTENSION CommonExtension
Definition: classpnp.h:628
_In_ ULONG _In_ BOOLEAN _In_ ULONG UniqueErrorValue
Definition: classpnp.h:1117
SCSIPORTAPI NTSTATUS NTAPI ClassDeviceControl(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
signed char * PCHAR
Definition: retypes.h:7
ULONG NTAPI ClassInitialize(IN PVOID Argument1, IN PVOID Argument2, IN PCLASS_INIT_DATA InitializationData)
Definition: class.c:120
LARGE_INTEGER PartitionLength
Definition: classpnp.h:594
VOID NTAPI ClassDisableMediaChangeDetection(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:2803
SCSIPORTAPI NTSTATUS NTAPI ClassSendSrbSynchronous(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PSCSI_REQUEST_BLOCK Srb, _In_reads_bytes_opt_(BufferLength) PVOID BufferAddress, _In_ ULONG BufferLength, _In_ BOOLEAN WriteToDevice)
UCHAR ClassDriverUse
Definition: classpnp.h:451
enum _MEDIA_CHANGE_DETECTION_STATE MEDIA_CHANGE_DETECTION_STATE
#define _Must_inspect_result_
Definition: no_sal2.h:314
PGUIDREGINFO GuidRegInfo
Definition: classpnp.h:491
struct _CLASS_PRIVATE_FDO_DATA * PCLASS_PRIVATE_FDO_DATA
Definition: classpnp.h:265
* PSTORAGE_DESCRIPTOR_HEADER
Definition: ntddstor.h:441
* PSTORAGE_ADAPTER_DESCRIPTOR
Definition: ntddstor.h:476
GUID Guid
Definition: classpnp.h:484
NTSTATUS(NTAPI * PCLASS_READ_WRITE)(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class2.h:57
struct _MEDIA_CHANGE_DETECTION_INFO * PMEDIA_CHANGE_DETECTION_INFO
Definition: classpnp.h:274
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
NTSTATUS NTAPI ClassRemoveDevice(IN PDEVICE_OBJECT DeviceObject, IN UCHAR RemoveType)
Definition: class.c:6971
unsigned int ULONG32
Definition: basetsd.h:125
static ULONG CountOfSetBitsUlongPtr(ULONG_PTR _X)
Definition: classpnp.h:198
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
_In_ PIRP _In_ ULONG _In_ CLASSENABLEDISABLEFUNCTION Function
Definition: classpnp.h:440
SCSIPORTAPI NTSTATUS NTAPI ClassIoCompleteAssociated(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
VOID NTAPI ClassDeleteSrbLookasideList(IN PCOMMON_DEVICE_EXTENSION CommonExtension)
Definition: obsolete.c:899
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR _In_ UCHAR Lun
Definition: classpnp.h:1117
_In_ PDEVICE_OBJECT Pdo
Definition: classpnp.h:301
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS * Status
Definition: classpnp.h:293
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG IoControlCode
Definition: fltkernel.h:1383
struct _SRB_HISTORY_ITEM * PSRB_HISTORY_ITEM
_IRQL_requires_same_ _In_opt_ PVOID Argument1
Definition: cmtypes.h:694
VOID NTAPI ClassAcquireChildLock(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: class.c:8483
struct GUIDREGINFO * PGUIDREGINFO
_In_ BOOLEAN Release
Definition: classpnp.h:929
PMEDIA_CHANGE_DETECTION_INFO MediaChangeDetectionInfo
Definition: classpnp.h:721
_In_ ULONG _In_ BOOLEAN LogError
Definition: classpnp.h:1117
NTSTATUS FinalStatus
Definition: classpnp.h:659
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: classpnp.h:966
#define _Inout_updates_opt_(size)
Definition: no_sal2.h:293
_Field_range_(1, 30000) ULONG TotalHistoryCount
VOID NTAPI ClassNotifyFailurePredicted(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PUCHAR Buffer, ULONG BufferSize, BOOLEAN LogError, ULONG UniqueErrorValue, UCHAR PathId, UCHAR TargetId, UCHAR Lun)
Definition: autorun.c:3468
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
_Out_ ULONG _Out_ PUNICODE_STRING Name
Definition: classpnp.h:386
PCLASS_QUERY_ID ClassQueryId
Definition: classpnp.h:525
CLASS_DEV_INFO FdoData
Definition: classpnp.h:521
#define TEST_FLAG(Flags, Bit)
Definition: classpnp.h:156
_In_ const GUID _In_ ULONG ExtraDataSize
Definition: classpnp.h:1236
DISK_GEOMETRY DiskGeometry
Definition: classpnp.h:704
#define SRB_FLAGS_FREE_SENSE_BUFFER
Definition: srb.h:398
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR PathId
Definition: classpnp.h:1117
_In_ PIRP Irp
Definition: csq.h:116
_In_ PIRP _In_ ULONG _In_ ULONG DataItemId
Definition: classpnp.h:419
struct _CLASS_PRIVATE_PDO_DATA CLASS_PRIVATE_PDO_DATA
Definition: classpnp.h:268
_In_ BUS_QUERY_ID_TYPE _In_ PUNICODE_STRING IdString
Definition: classpnp.h:357
uint16_t * PWSTR
Definition: typedefs.h:54
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
struct _CLASSPNP_SCAN_FOR_SPECIAL_INFO CLASSPNP_SCAN_FOR_SPECIAL_INFO
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR TargetId
Definition: classpnp.h:1117
unsigned char * PUCHAR
Definition: retypes.h:3
_In_z_ PCCHAR _In_ PDEVICE_OBJECT _In_ BOOLEAN IsFdo
Definition: classpnp.h:789
static ULONG CountOfSetBitsULong(ULONG _X)
Definition: classpnp.h:192
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID _In_ ULONG _In_ BOOLEAN InternalDeviceIoControl
Definition: iofuncs.h:713
struct _FUNCTIONAL_DEVICE_EXTENSION * PartitionZeroExtension
Definition: classpnp.h:575
IO_COMPLETION_ROUTINE ClassSignalCompletion
Definition: classpnp.h:1137
SCSIPORTAPI VOID NTAPI ClassReleaseQueue(_In_ PDEVICE_OBJECT DeviceObject)
#define IRP_MJ_MAXIMUM_FUNCTION
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP _In_ ULONG _In_ ULONG _Out_writes_bytes_(BufferAvail) PUCHAR Buffer)
COMMON_DEVICE_EXTENSION CommonExtension
Definition: classpnp.h:695
_In_ LPGUID _In_ ULONG InstanceIndex
Definition: classpnp.h:1057
__callback PCLASS_QUERY_WMI_REGINFO_EX ClassFdoQueryWmiRegInfoEx
Definition: classpnp.h:685
#define _Outptr_
Definition: no_sal2.h:396
CLASS_POWER_OPTIONS Options
Definition: classpnp.h:656
PCLASS_INTERPRET_SENSE_INFO2 InterpretSenseInfo
Definition: classpnp.h:566
struct _COMPLETION_CONTEXT COMPLETION_CONTEXT
static ULONG CountOfSetBitsULong32(ULONG32 _X)
Definition: classpnp.h:194
CLASS_POWER_DOWN_STATE PowerDown
Definition: classpnp.h:652
_In_ PIRP _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG OutBufferSize
Definition: classpnp.h:429
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
NTSTATUS(NTAPI * PCLASS_SHUTDOWN_FLUSH)(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class2.h:72
C_ASSERT((MAXULONG - sizeof(SRB_HISTORY))/30000 >=sizeof(SRB_HISTORY_ITEM))
SCSIPORTAPI NTSTATUS NTAPI ClassBuildRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
SCSIPORTAPI NTSTATUS NTAPI ClassWmiCompleteRequest(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _In_ NTSTATUS Status, _In_ ULONG BufferUsed, _In_ CCHAR PriorityBoost)
VOID NTAPI ClassSetMediaChangeState(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN MEDIA_CHANGE_DETECTION_STATE NewState, IN BOOLEAN Wait)
Definition: autorun.c:780
CLASS_POWER_UP_STATE PowerUp
Definition: classpnp.h:654
_In_z_ PCCHAR _In_ PDEVICE_OBJECT _In_ BOOLEAN _Outptr_result_nullonfailure_ _At_ * DeviceObject(Mem) __drv_aliasesMem) PDEVICE_OBJECT *DeviceObject
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: classpnp.h:293
struct _CLASS_PRIVATE_COMMON_DATA CLASS_PRIVATE_COMMON_DATA
Definition: classpnp.h:271
PCLASS_CREATE_CLOSE ClassCreateClose
Definition: classpnp.h:509
enum _CLASS_DEBUG_LEVEL * PCLASS_DEBUG_LEVEL
struct _CLASS_POWER_CONTEXT * PCLASS_POWER_CONTEXT
struct _CLASS_WORKING_SET CLASS_WORKING_SET
PCLASS_DEVICE_CONTROL ClassDeviceControl
Definition: classpnp.h:507
#define DUMMYUNIONNAME
Definition: ntbasedef.h:32
PDEVICE_OBJECT DeviceObject
Definition: classpnp.h:533
PDEVICE_OBJECT DeviceObject
Definition: classpnp.h:663
VOID NTAPI ClassMarkChildrenMissing(IN PFUNCTIONAL_DEVICE_EXTENSION Fdo)
Definition: class.c:6604
ULONG DeviceCharacteristics
Definition: classpnp.h:504
#define SENSE_BUFFER_SIZE
Definition: cdrw_hw.h:1183
static ULONG CountOfSetBitsUChar(UCHAR _X)
Definition: classpnp.h:190
#define _In_opt_
Definition: no_sal2.h:213
_In_opt_ PIRP OriginalRequest
Definition: classpnp.h:465
PCLASS_QUERY_WMI_DATABLOCK ClassQueryWmiDataBlock
Definition: classpnp.h:493
static ULONG CountOfSetBitsULong64(ULONG64 _X)
Definition: classpnp.h:196
ULONG_PTR ClassDriverUse[4]
Definition: classpnp.h:455
ULONGLONG Signature
Definition: classpnp.h:277
uint32_t ULONG_PTR
Definition: typedefs.h:63
PCLASS_TICK ClassTick
Definition: classpnp.h:528
SCSIPORTAPI BOOLEAN NTAPI ClassInterpretSenseInfo(_In_ PDEVICE_OBJECT DeviceObject, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ UCHAR MajorFunctionCode, _In_ ULONG IoDeviceCode, _In_ ULONG RetryCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, 100) ULONG *RetryInterval)
struct _DICTIONARY DICTIONARY
VOID NTAPI ClassGetDeviceParameter(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PWSTR SubkeyName OPTIONAL, IN PWSTR ParameterName, IN OUT PULONG ParameterValue)
Definition: utils.c:52
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
SCSIPORTAPI NTSTATUS NTAPI ClassIoComplete(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
SCSIPORTAPI VOID NTAPI ClassCompleteRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ CCHAR PriorityBoost)
struct _DICTIONARY_HEADER * List
Definition: classpnp.h:278
struct _CLASS_POWER_CONTEXT CLASS_POWER_CONTEXT
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR _In_ ULONG _In_ ULONG _In_opt_ SRB_HISTORY * RequestHistory
Definition: classpnp.h:465
* PSTORAGE_DEVICE_DESCRIPTOR
Definition: ntddstor.h:457
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
CLASS_POWER_DOWN_STATE2
Definition: classpnp.h:244
#define max(a, b)
Definition: classpnp.h:16
_Field_size_part_(TotalHistoryCount, UsedHistoryCount) SRB_HISTORY_ITEM History[1]
long LONG
Definition: pedump.c:60
#define _X(x)
Definition: CString.cpp:210
_In_ ULONG BufferLength
Definition: usbdlib.h:225
struct _FUNCTIONAL_DEVICE_EXTENSION * PFUNCTIONAL_DEVICE_EXTENSION
SCSI_REQUEST_BLOCK Srb
Definition: classpnp.h:665
SCSIPORTAPI VOID NTAPI ClassSplitRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ ULONG MaximumBytes)
ULONG InstanceCount
Definition: classpnp.h:485
struct _FUNCTIONAL_DEVICE_EXTENSION FUNCTIONAL_DEVICE_EXTENSION
SCSIPORTAPI NTSTATUS NTAPI ClassCheckVerifyComplete(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
#define CLEAR_FLAG(Flags, Bit)
Definition: classpnp.h:155
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR _In_ ULONG _In_ ULONG _In_opt_ SRB_HISTORY _Out_ NTSTATUS _Out_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIn100nsUnits)
_In_ CCHAR PriorityBoost
Definition: iofuncs.h:763
_In_ BOOLEAN AcquireChildLock
Definition: classpnp.h:989
SCSIPORTAPI VOID NTAPI ClassResetMediaChangeTimer(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
struct _FILE_OBJECT_EXTENSION * PFILE_OBJECT_EXTENSION
DRIVER_STARTIO * PDRIVER_STARTIO
Definition: iotypes.h:2136
#define __drv_aliasesMem
Definition: btrfs_drv.h:167
_In_ PFILE_OBJECT FileObject
Definition: classpnp.h:1229
VOID(* PCLASS_ERROR)(IN PDEVICE_OBJECT DeviceObject, IN PSCSI_REQUEST_BLOCK Srb, IN OUT NTSTATUS *Status, IN OUT BOOLEAN *Retry)
Definition: class.h:58
PCLASS_INIT_DEVICE ClassInitDevice
Definition: classpnp.h:510
KSPIN_LOCK ReleaseQueueSpinLock
Definition: classpnp.h:727
PCLASS_SET_WMI_DATABLOCK ClassSetWmiDataBlock
Definition: classpnp.h:494
CLASS_POWER_DOWN_STATE
Definition: classpnp.h:236
unsigned char BOOLEAN
PCLASS_ADD_DEVICE ClassAddDevice
Definition: classpnp.h:523
_In_ PIRP _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_reads_(_Inexpressible_(max(InBufferSize, OutBufferSize))) PUCHAR Buffer)
_Out_ ULONG * RegFlags
Definition: classpnp.h:386
_In_z_ PCCHAR ObjectNameBuffer
Definition: classpnp.h:789
_Out_ ULONG _Out_ PUNICODE_STRING _Out_ PUNICODE_STRING MofResourceName
Definition: classpnp.h:386
static __inline BOOLEAN PORT_ALLOCATED_SENSE(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ PSCSI_REQUEST_BLOCK Srb)
Definition: classpnp.h:1244
LARGE_INTEGER TickCountSent
Definition: classpnp.h:446
VOID NTAPI ClassSendStartUnit(_In_ PDEVICE_OBJECT DeviceObject)
CLASS_POWER_UP_STATE
Definition: classpnp.h:253
_In_ UCHAR RemoveType
Definition: classpnp.h:1150
NTSTATUS NTAPI ClassCreateDeviceObject(IN PDRIVER_OBJECT DriverObject, IN PCCHAR ObjectNameBuffer, IN PDEVICE_OBJECT LowerDevice, IN BOOLEAN IsFdo, IN OUT PDEVICE_OBJECT *DeviceObject)
Definition: class.c:5687
SCSIPORTAPI NTSTATUS NTAPI ClassSpinDownPowerHandler(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
#define _Out_
Definition: no_sal2.h:323
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
_In_ PIRP _In_ ULONG GuidIndex
Definition: classpnp.h:401
#define _At_(target, annos)
Definition: no_sal2.h:11
PCLASS_READ_WRITE ClassReadWriteVerification
Definition: classpnp.h:506
struct _CLASS_DRIVER_EXTENSION * PCLASS_DRIVER_EXTENSION
NTSTATUS(NTAPI * PCLASS_POWER_DEVICE)(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
Definition: classpnp.h:304
Definition: bufpool.h:45
NPAGED_LOOKASIDE_LIST SrbLookasideList
Definition: classpnp.h:602
PCLASS_QUERY_WMI_REGINFO_EX ClassFdoQueryWmiRegInfoEx
Definition: classpnp.h:559
_MEDIA_CHANGE_DETECTION_STATE
Definition: classpnp.h:201
PCLASS_ERROR ClassError
Definition: classpnp.h:505
struct _CLASS_WMI_INFO * PCLASS_WMI_INFO
_In_ BUS_QUERY_ID_TYPE IdType
Definition: classpnp.h:357
Definition: bcd.h:202
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
_In_ PVOID Argument2
Definition: classpnp.h:680
CLASS_POWER_DOWN_STATE2 PowerDown2
Definition: classpnp.h:653
SCSIPORTAPI PVOID NTAPI ClassFindModePage(_In_reads_bytes_(Length) PCHAR ModeSenseBuffer, _In_ ULONG Length, _In_ UCHAR PageMode, _In_ BOOLEAN Use6Byte)
UNICODE_STRING DeviceName
Definition: classpnp.h:591
struct _CLASS_INTERPRET_SENSE_INFO2 CLASS_INTERPRET_SENSE_INFO2
LARGE_INTEGER StartingOffset
Definition: classpnp.h:595
PDEVICE_OBJECT DeviceObject
Definition: classpnp.h:626
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
struct _PHYSICAL_DEVICE_EXTENSION * PPHYSICAL_DEVICE_EXTENSION
_In_ PIRP _In_ ULONG _In_ ULONG MethodId
Definition: classpnp.h:429
int64_t LONGLONG
Definition: typedefs.h:66
#define _Out_opt_
Definition: no_sal2.h:339
LARGE_INTEGER TickCountCompleted
Definition: classpnp.h:447
_In_ LPGUID Guid
Definition: classpnp.h:778
#define __drv_allocatesMem(kind)
Definition: driverspecs.h:239
_In_ PIRP _In_ ULONG _In_ ULONG _In_ ULONG InBufferSize
Definition: classpnp.h:429
SCSIPORTAPI ULONG NTAPI ClassModeSense(_In_ PDEVICE_OBJECT DeviceObject, _In_reads_bytes_(Length) PCHAR ModeSenseBuffer, _In_ ULONG Length, _In_ UCHAR PageMode)
ULONG Flags
Definition: classpnp.h:486
PCLASS_POWER_DEVICE ClassPowerDevice
Definition: classpnp.h:512
_In_ PUCHAR EventPrefix
Definition: classpnp.h:1074
CLASS_WMI_INFO ClassWmiInfo
Definition: classpnp.h:516
_In_ LPGUID _In_ ULONG _In_ ULONG EventDataSize
Definition: classpnp.h:1057
PCLASS_START_DEVICE ClassStartDevice
Definition: classpnp.h:511
char CCHAR
Definition: typedefs.h:50
SCSIPORTAPI ULONG NTAPI ClassAcquireRemoveLockEx(_In_ PDEVICE_OBJECT DeviceObject, PVOID Tag, _In_ PCSTR File, _In_ ULONG Line)
VOID NTAPI ClassEnableMediaChangeDetection(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:2718
uint64_t ULONGLONG
Definition: typedefs.h:65
PCLASS_QUERY_WMI_REGINFO_EX ClassPdoQueryWmiRegInfoEx
Definition: classpnp.h:560
NTSTATUS NTAPI ClassSetDeviceParameter(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PWSTR SubkeyName OPTIONAL, IN PWSTR ParameterName, IN ULONG ParameterValue)
Definition: utils.c:136
struct _CLASS_QUERY_WMI_REGINFO_EX_LIST CLASS_QUERY_WMI_REGINFO_EX_LIST
static __inline VOID FREE_PORT_ALLOCATED_SENSE_BUFFER(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ PSCSI_REQUEST_BLOCK Srb)
Definition: classpnp.h:1255
PSTORAGE_ADAPTER_DESCRIPTOR AdapterDescriptor
Definition: classpnp.h:699
static DRIVER_STARTIO ClassStartIo
Definition: kbdclass.c:25
SCSIPORTAPI VOID NTAPI ClassReleaseRemoveLock(_In_ PDEVICE_OBJECT DeviceObject, PIRP Tag)
PSTORAGE_DEVICE_DESCRIPTOR DeviceDescriptor
Definition: classpnp.h:698
UNICODE_STRING MountedDeviceInterfaceName
Definition: classpnp.h:604
enum FAILURE_PREDICTION_METHOD * PFAILURE_PREDICTION_METHOD
struct _FILE_OBJECT_EXTENSION FILE_OBJECT_EXTENSION
struct _PHYSICAL_DEVICE_EXTENSION * ChildList
Definition: classpnp.h:592
VOID NTAPI ClassCleanupMediaChangeDetection(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:2849
PCLASS_UNLOAD ClassUnload
Definition: classpnp.h:527
enum _STORAGE_PROPERTY_ID * PSTORAGE_PROPERTY_ID
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR MajorFunctionCode
Definition: classpnp.h:465
#define _Inout_
Definition: no_sal2.h:244
struct _CLASS_PRIVATE_COMMON_DATA * PCLASS_PRIVATE_COMMON_DATA
Definition: classpnp.h:271
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
struct _COMMON_DEVICE_EXTENSION COMMON_DEVICE_EXTENSION
* PFILE_OBJECT
Definition: iotypes.h:1954
struct _CLASS_QUERY_WMI_REGINFO_EX_LIST * PCLASS_QUERY_WMI_REGINFO_EX_LIST
PCLASS_SHUTDOWN_FLUSH ClassShutdownFlush
Definition: classpnp.h:508
PDEVICE_OBJECT DeviceObject
Definition: classpnp.h:693
CLASS_POWER_CONTEXT PowerContext
Definition: classpnp.h:744
struct _COMPLETION_CONTEXT * PCOMPLETION_CONTEXT
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
SCSIPORTAPI VOID NTAPI ClassCheckMediaState(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: ncftp.h:79
_In_opt_ PWSTR _In_ PWSTR _Inout_ PULONG ParameterValue
Definition: classpnp.h:1209
unsigned __int64 ULONG64
Definition: imports.h:198
_In_ PCHAR _In_ ULONG _In_reads_bytes_opt_(InquiryDataLength) PINQUIRYDATA InquiryData
_In_ PIRP _In_ ULONG _In_ CLASSENABLEDISABLEFUNCTION _In_ BOOLEAN Enable
Definition: classpnp.h:440
unsigned char UCHAR
Definition: xmlstorage.h:181
PIO_COMPLETION_ROUTINE CompletionRoutine
Definition: classpnp.h:662
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR _In_ ULONG _In_ ULONG PreviousRetryCount
Definition: classpnp.h:465
__callback PCLASS_QUERY_WMI_REGINFO_EX ClassPdoQueryWmiRegInfoEx
Definition: classpnp.h:686
struct _CLASS_DEV_INFO * PCLASS_DEV_INFO
PDEVICE_OBJECT LowerPdo
Definition: classpnp.h:697
SCSIPORTAPI PVPB NTAPI ClassGetVpb(_In_ PDEVICE_OBJECT DeviceObject)
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:293
CLASSENABLEDISABLEFUNCTION
Definition: classpnp.h:224
Definition: ketypes.h:687
PCLASS_ENUM_DEVICE ClassEnumerateDevice
Definition: classpnp.h:524
#define NTSTATUS
Definition: precomp.h:20
_In_ PVOID _In_ PCLASS_INIT_DATA InitializationData
Definition: classpnp.h:680
PCLASS_DRIVER_EXTENSION DriverExtension
Definition: classpnp.h:576
struct _SRB_HISTORY_ITEM SRB_HISTORY_ITEM
#define VOID
Definition: acefi.h:82
PCLASS_WORKING_SET WorkingSet
Definition: classpnp.h:567
_In_z_ PCCHAR _In_ PDEVICE_OBJECT LowerDeviceObject
Definition: classpnp.h:789
NTSTATUS NTAPI ClassSetFailurePredictionPoll(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, FAILURE_PREDICTION_METHOD FailurePredictionMethod, ULONG PollingPeriod)
Definition: autorun.c:3552
#define _Outptr_result_nullonfailure_
Definition: no_sal2.h:428
_In_ PIRP _In_ ULONG _In_ ULONG BufferAvail
Definition: classpnp.h:401
VOID NTAPI ClassSendDeviceIoControlSynchronous(_In_ ULONG IoControlCode, _In_ PDEVICE_OBJECT TargetDeviceObject, _Inout_updates_opt_(_Inexpressible_(max(InputBufferLength, OutputBufferLength))) PVOID Buffer, _In_ ULONG InputBufferLength, _In_ ULONG OutputBufferLength, _In_ BOOLEAN InternalDeviceIoControl, _Out_ PIO_STATUS_BLOCK IoStatus)
_In_opt_ PWSTR SubkeyName
Definition: classpnp.h:1209
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
PCLASS_STOP_DEVICE ClassStopDevice
Definition: classpnp.h:513
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
_IRQL_requires_max_(DISPATCH_LEVEL) typedef VOID(NTAPI *PCLASS_ERROR)(_In_ PDEVICE_OBJECT DeviceObject
Definition: rmap.c:30
#define _ANONYMOUS_STRUCT
Definition: ntbasedef.h:56
* PDEVICE_CAPABILITIES
Definition: iotypes.h:927
NTSTATUS NTAPI ClassClaimDevice(IN PDEVICE_OBJECT LowerDeviceObject, IN BOOLEAN Release)
Definition: class.c:5985
Status
Definition: gdiplustypes.h:24
_In_ PIRP Irp
Definition: classpnp.h:333
#define MAXULONG
Definition: typedefs.h:250
#define _Pre_equal_to_(expr)
Definition: no_sal2.h:493
_In_ FAILURE_PREDICTION_METHOD _In_ ULONG PollingPeriod
Definition: classpnp.h:1108
SCSIPORTAPI NTSTATUS NTAPI ClassSendIrpSynchronous(_In_ PDEVICE_OBJECT TargetDeviceObject, _In_ PIRP Irp)
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define _In_
Definition: no_sal2.h:204
struct _CLASS_PRIVATE_PDO_DATA * PCLASS_PRIVATE_PDO_DATA
Definition: classpnp.h:268
ULONG NTAPI ClassInitializeEx(IN PDRIVER_OBJECT DriverObject, IN LPGUID Guid, IN PVOID Data)
Definition: class.c:367
DRIVER_DISPATCH * PDRIVER_DISPATCH
Definition: iotypes.h:2153
PCLASS_SET_WMI_DATAITEM ClassSetWmiDataItem
Definition: classpnp.h:495
PCLASS_REMOVE_DEVICE ClassRemoveDevice
Definition: classpnp.h:514
#define MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS
Definition: classpnp.h:188
struct _CLASS_INIT_DATA * PCLASS_INIT_DATA
Definition: classpnp.h:262
#define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE
Definition: srb.h:405
SCSIPORTAPI NTSTATUS NTAPI ClassSendSrbAsynchronous(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PSCSI_REQUEST_BLOCK Srb, _In_ PIRP Irp, _In_reads_bytes_opt_(BufferLength) __drv_aliasesMem PVOID BufferAddress, _In_ ULONG BufferLength, _In_ BOOLEAN WriteToDevice)
BOOLEAN IsSrbLookasideListInitialized
Definition: classpnp.h:586
struct _FAILURE_PREDICTION_INFO * FailurePredictionInfo
Definition: classpnp.h:735
PGUIDREGINFO GuidRegInfo
Definition: classpnp.h:606
#define __callback
Definition: sal.h:1746
unsigned short USHORT
Definition: pedump.c:61
ULONG GuidCount
Definition: classpnp.h:490
ULONG NTAPI ClassQueryTimeOutRegistryValue(IN PDEVICE_OBJECT DeviceObject)
Definition: class.c:6190
#define _In_z_
Definition: no_sal2.h:239
PCLASS_DEV_INFO DevInfo
Definition: classpnp.h:596
enum _MEDIA_CHANGE_DETECTION_STATE * PMEDIA_CHANGE_DETECTION_STATE
NTSTATUS NTAPI ClassGetDescriptor(IN PDEVICE_OBJECT DeviceObject, IN PSTORAGE_PROPERTY_ID PropertyId, OUT PSTORAGE_DESCRIPTOR_HEADER *Descriptor)
Definition: class.c:6364
VOID NTAPI ClassScanForSpecial(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN CLASSPNP_SCAN_FOR_SPECIAL_INFO DeviceList[], IN PCLASS_SCAN_FOR_SPECIAL_HANDLER Function)
Definition: utils.c:213
PCLASS_PRIVATE_COMMON_DATA PrivateCommonData
Definition: classpnp.h:609
_In_opt_ PWSTR _In_ PWSTR ParameterName
Definition: classpnp.h:1209
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
#define DEVICE_TYPE
Definition: guid.c:10
VOID NTAPI ClassInitializeSrbLookasideList(IN PCOMMON_DEVICE_EXTENSION CommonExtension, IN ULONG NumberElements)
Definition: obsolete.c:941
PCLASS_PRIVATE_PDO_DATA PrivatePdoData
Definition: classpnp.h:633
_In_ PIRP _In_ ULONG _In_ ULONG _In_reads_bytes_(BufferSize) PUCHAR Buffer)
struct _PHYSICAL_DEVICE_EXTENSION PHYSICAL_DEVICE_EXTENSION
ULONG MillisecondsDelayOnRetry
Definition: classpnp.h:448
_In_ PCHAR DeviceName
Definition: classpnp.h:1036
unsigned int * PULONG
Definition: retypes.h:1
SCSIPORTAPI NTSTATUS NTAPI ClassInternalIoControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
_IRQL_requires_(DISPATCH_LEVEL) typedef VOID(NTAPI *PCLASS_TICK)(_In_ PDEVICE_OBJECT DeviceObject)
Definition: expool.c:1456
SCSIPORTAPI VOID ClassDebugPrint(_In_ CLASS_DEBUG_LEVEL DebugPrintLevel, _In_z_ PCCHAR DebugMessage,...)
PDEVICE_OBJECT LowerDeviceObject
Definition: classpnp.h:574
FAILURE_PREDICTION_METHOD
Definition: classpnp.h:229
struct _CLASS_INTERPRET_SENSE_INFO2 * PCLASS_INTERPRET_SENSE_INFO2
Definition: bcd.h:201
VOID NTAPI ClassInvalidateBusRelations(IN PDEVICE_OBJECT Fdo)
Definition: class.c:6915
_In_ BOOLEAN AllowDriveToSleep
Definition: classpnp.h:1082
IO_COMPLETION_ROUTINE * PIO_COMPLETION_ROUTINE
Definition: iotypes.h:2479
NTSTATUS(NTAPI * PCLASS_CREATE_CLOSE)(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class2.h:76
_In_ PCHAR _In_ ULONG _In_ ULONG InquiryDataLength
Definition: classpnp.h:1039
#define _Post_satisfies_(a)
Definition: btrfs_drv.h:173
UCHAR StackSize
Definition: classpnp.h:503
CLASS_DEV_INFO PdoData
Definition: classpnp.h:522
_In_ ULONG NumberElements
Definition: classpnp.h:944
VOID NTAPI ClassInitializeMediaChangeDetection(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PUCHAR EventPrefix)
Definition: autorun.c:2058
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
#define _Out_range_(lb, ub)
Definition: no_sal2.h:366
KSPIN_LOCK SpinLock
Definition: classpnp.h:279
DEVICE_TYPE DeviceType
Definition: classpnp.h:502
BOOLEAN NTAPI ClassMarkChildMissing(IN PPHYSICAL_DEVICE_EXTENSION Child, IN BOOLEAN AcquireChildLock)
Definition: class.c:6657
_In_ MEDIA_CHANGE_DETECTION_STATE _In_ BOOLEAN Wait
Definition: classpnp.h:1180
Definition: iotypes.h:166
struct _DICTIONARY * PDICTIONARY
struct _CLASS_POWER_OPTIONS CLASS_POWER_OPTIONS
#define SCSIPORTAPI
Definition: srb.h:541
NTSTATUS NTAPI ClassStopUnitPowerHandler(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
CLASS_INIT_DATA InitData
Definition: classpnp.h:556
struct _CLASS_DEV_INFO CLASS_DEV_INFO
unsigned int ULONG
Definition: retypes.h:1
_In_ UCHAR Type
Definition: classpnp.h:317
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
PCLASS_EXECUTE_WMI_METHOD ClassExecuteWmiMethod
Definition: classpnp.h:496
VOID History(INT, LPTSTR)
Definition: history.c:326
DICTIONARY FileObjectDictionary
Definition: classpnp.h:607
PDRIVER_DISPATCH * DispatchTable
Definition: classpnp.h:614
ULONGLONG REGHANDLE
Definition: evntprov.h:48
struct _CLASSPNP_SCAN_FOR_SPECIAL_INFO * PCLASSPNP_SCAN_FOR_SPECIAL_INFO
const char * PCSTR
Definition: typedefs.h:51
Definition: File.h:15
KSPIN_LOCK RemoveTrackingSpinlock
Definition: classpnp.h:579
enum _CLASS_DEBUG_LEVEL CLASS_DEBUG_LEVEL
NTSTATUS NTAPI ClassInitializeTestUnitPolling(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN BOOLEAN AllowDriveToSleep)
Definition: autorun.c:2023
NTSTATUS(NTAPI * PCLASS_DEVICE_CONTROL)(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class2.h:68
_In_ PCHAR _In_ ULONG DeviceNumber
Definition: classpnp.h:1036
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
VOID NTAPI ClassUpdateInformationInRegistry(IN PDEVICE_OBJECT Fdo, IN PCHAR DeviceName, IN ULONG DeviceNumber, IN PINQUIRYDATA InquiryData, IN ULONG InquiryDataLength)
Definition: class.c:7322
PCLASS_DRIVER_EXTENSION NTAPI ClassGetDriverExtension(IN PDRIVER_OBJECT DriverObject)
Definition: class.c:7236
SCSIPORTAPI VOID NTAPI ClassReleaseChildLock(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
_In_ FAILURE_PREDICTION_METHOD FailurePredictionMethod
Definition: classpnp.h:1108
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
IN OUT PVCB IN PDEVICE_OBJECT TargetDeviceObject
Definition: fatprocs.h:1664
_In_ PDEVICE_CAPABILITIES Capabilities
Definition: classpnp.h:375
struct _CLASS_WORKING_SET * PCLASS_WORKING_SET
#define DUMMYSTRUCTNAME
Definition: ntbasedef.h:58
struct _CLASS_WMI_INFO CLASS_WMI_INFO
PFILE_OBJECT FileObject
Definition: classpnp.h:532
struct _CLASS_POWER_OPTIONS * PCLASS_POWER_OPTIONS
PCLASS_WMI_FUNCTION_CONTROL ClassWmiFunctionControl
Definition: classpnp.h:497
SENSE_DATA NormalizedSenseData
Definition: classpnp.h:449
_In_ CLASSPNP_SCAN_FOR_SPECIAL_INFO DeviceList[]
Definition: classpnp.h:1281
ULONG DeviceExtensionSize
Definition: classpnp.h:501
__callback PCLASS_INTERPRET_SENSE_INFO Interpret
Definition: classpnp.h:549
SCSI_REQUEST_BLOCK ReleaseQueueSrb
Definition: classpnp.h:729
_CLASS_DEBUG_LEVEL
Definition: classpnp.h:208
_In_ PIRP _In_ ULONG _In_ ULONG BufferSize
Definition: classpnp.h:410
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
FILE_OBJECT_EXTENSION KernelModeMcnContext
Definition: classpnp.h:724
_Must_inspect_result_ SCSIPORTAPI NTSTATUS NTAPI ClassReadDriveCapacity(_In_ PDEVICE_OBJECT DeviceObject)
PCLASS_QUERY_WMI_REGINFO ClassQueryWmiRegInfo
Definition: classpnp.h:492
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR _In_ ULONG IoDeviceCode
Definition: classpnp.h:465
NTSTATUS NTAPI ClassWmiFireEvent(IN PDEVICE_OBJECT DeviceObject, IN LPGUID Guid, IN ULONG InstanceIndex, IN ULONG EventDataSize, IN PVOID EventData)
Definition: classwmi.c:721
struct _CLASS_DRIVER_EXTENSION CLASS_DRIVER_EXTENSION
DEVICE_POWER_STATE DevicePowerState
Definition: classpnp.h:700
SCSIPORTAPI NTSTATUS NTAPI ClassAsynchronousCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Event)
Definition: class.c:2168
PCLASS_QUERY_PNP_CAPABILITIES ClassQueryPnpCapabilities
Definition: classpnp.h:515
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966
SCSIPORTAPI NTSTATUS NTAPI ClassForwardIrpSynchronous(_In_ PCOMMON_DEVICE_EXTENSION CommonExtension, _In_ PIRP Irp)