ReactOS 0.4.15-dev-7958-gcd0bb1a
disk.h
Go to the documentation of this file.
1/*++
2
3Copyright (C) Microsoft Corporation, 1991 - 2010
4
5Module Name:
6
7 disk.c
8
9Abstract:
10
11 SCSI disk class driver
12
13Environment:
14
15 kernel mode only
16
17Notes:
18
19Revision History:
20
21--*/
22
23#include "ntddk.h"
24#include "scsi.h"
25#include <wmidata.h>
26#include "classpnp.h"
27
28#include <wmistr.h>
29#include "ntstrsafe.h"
30
31//
32// Set component ID for DbgPrintEx calls
33//
34#ifndef DEBUG_COMP_ID
35#define DEBUG_COMP_ID DPFLTR_DISK_ID
36#endif
37
38//
39// Include header file and setup GUID for tracing
40//
41#include <storswtr.h>
42#define WPP_GUID_DISK (945186BF, 3DD6, 4f3f, 9C8E, 9EDD3FC9D558)
43#ifndef WPP_CONTROL_GUIDS
44#define WPP_CONTROL_GUIDS WPP_CONTROL_GUIDS_NORMAL_FLAGS(WPP_GUID_DISK)
45#endif
46
47
48#ifdef ExAllocatePool
49#undef ExAllocatePool
50#define ExAllocatePool #NT_ASSERT(FALSE)
51#endif
52
53#define DISK_TAG_GENERAL ' DcS' // "ScD " - generic tag
54#define DISK_TAG_SMART 'aDcS' // "ScDa" - SMART allocations
55#define DISK_TAG_INFO_EXCEPTION 'ADcS' // "ScDA" - Info Exceptions
56#define DISK_TAG_DISABLE_CACHE 'CDcS' // "ScDC" - disable cache paths
57#define DISK_TAG_CCONTEXT 'cDcS' // "ScDc" - disk allocated completion context
58#define DISK_TAG_DISK_GEOM 'GDcS' // "ScDG" - disk geometry buffer
59#define DISK_TAG_UPDATE_GEOM 'gDcS' // "ScDg" - update disk geometry paths
60#define DISK_TAG_SENSE_INFO 'IDcS' // "ScDI" - sense info buffers
61#define DISK_TAG_PNP_ID 'iDcS' // "ScDp" - pnp ids
62#define DISK_TAG_MODE_DATA 'MDcS' // "ScDM" - mode data buffer
63#define DISK_CACHE_MBR_CHECK 'mDcS' // "ScDM" - mbr checksum code
64#define DISK_TAG_NAME 'NDcS' // "ScDN" - disk name code
65#define DISK_TAG_READ_CAP 'PDcS' // "ScDP" - read capacity buffer
66#define DISK_TAG_PART_LIST 'pDcS' // "ScDp" - disk partition lists
67#define DISK_TAG_SRB 'SDcS' // "ScDS" - srb allocation
68#define DISK_TAG_START 'sDcS' // "ScDs" - start device paths
69#define DISK_TAG_UPDATE_CAP 'UDcS' // "ScDU" - update capacity path
70#define DISK_TAG_WI_CONTEXT 'WDcS' // "ScDW" - work-item context
71
72#ifdef __REACTOS__
73#undef MdlMappingNoExecute
74#define MdlMappingNoExecute 0
75#define NonPagedPoolNx NonPagedPool
76#define NonPagedPoolNxCacheAligned NonPagedPoolCacheAligned
77#undef POOL_NX_ALLOCATION
78#define POOL_NX_ALLOCATION 0
79#endif
80
81
82#if defined(_X86_) || defined(_AMD64_)
83
84//
85// Disk device data
86//
87
88typedef enum _DISK_GEOMETRY_SOURCE {
89 DiskGeometryUnknown,
90 DiskGeometryFromBios,
91 DiskGeometryFromPort,
92 DiskGeometryFromNec98,
93 DiskGeometryGuessedFromBios,
94 DiskGeometryFromDefault,
95 DiskGeometryFromNT4
96} DISK_GEOMETRY_SOURCE, *PDISK_GEOMETRY_SOURCE;
97#endif
98
99//
100// Context for requests that can be combined and sent down
101//
102
104{
105 //
106 // Queue of requests whose representative is currently outstanding at the port driver
107 //
109
110 //
111 // The representative for the above queue
112 //
114
115 //
116 // Queue of requests whose representative is waiting to go down
117 //
119
120 //
121 // The representative for the above queue
122 //
124
125 //
126 // The srb associated with this group
127 //
128#if (NTDDI_VERSION >= NTDDI_WIN8)
129
130 union {
135
136#else
138#endif
139
140 //
141 // The spinlock that will synchronize access to this context
142 //
144
145 //
146 // This event will allow for the requests to be sent down synchronously
147 //
149
150
151#if DBG
152
153 //
154 // This counter maintains the number of requests currently tagged
155 // to the request that is waiting to go down
156 //
157 ULONG DbgTagCount;
158
159 //
160 // This counter maintains the number of requests that were avoided
161 //
162 ULONG DbgSavCount;
163
164 //
165 // This counter maintains the total number of times that we combined
166 // requests and the respective number of requests that were tagged
167 //
168 ULONG DbgRefCount[64];
169
170#endif
171
173
174//
175// Write cache setting as defined by the user
176//
178{
182
184
185typedef struct _DISK_DATA {
186
187 //
188 // This field is the ordinal of a partition as it appears on a disk.
189 //
190
192
193 //
194 // How has this disk been partitioned? Either EFI or MBR.
195 //
196
198
199 union {
200
201 struct {
202
203 //
204 // Disk signature (from MBR)
205 //
206
208
209 //
210 // MBR checksum
211 //
212
214
215 //
216 // Number of hidden sectors for BPB.
217 //
218
220
221 //
222 // Partition type of this device object
223 //
224 // This field is set by:
225 //
226 // 1. Initially set according to the partition list entry
227 // partition type returned by IoReadPartitionTable.
228 //
229 // 2. Subsequently set by the
230 // IOCTL_DISK_SET_PARTITION_INFORMATION I/O control
231 // function when IoSetPartitionInformation function
232 // successfully updates the partition type on the disk.
233 //
234
236
237 //
238 // Boot indicator - indicates whether this partition is a
239 // bootable (active) partition for this device
240 //
241 // This field is set according to the partition list entry boot
242 // indicator returned by IoReadPartitionTable.
243 //
244
246
248
249 struct {
250
251 //
252 // The DiskGUID field from the EFI partition header.
253 //
254
256
257 //
258 // Partition type of this device object.
259 //
260
262
263 //
264 // Unique partition identifier for this partition.
265 //
266
268
269 //
270 // EFI partition attributes for this partition.
271 //
272
274
275 //
276 // EFI partition name of this partition.
277 //
278
280
282
283#ifdef _MSC_VER
284#pragma warning(suppress: 4201) //this is intended to be an unnamed union
285#endif
286 };
287
288 struct {
289 //
290 // This flag is set when the well known name is created (through
291 // DiskCreateSymbolicLinks) and cleared when destroying it
292 // (by calling DiskDeleteSymbolicLinks).
293 //
294
295 unsigned int WellKnownNameCreated : 1;
296
297 //
298 // This flag is set when the PhysicalDriveN link is created (through
299 // DiskCreateSymbolicLinks) and is cleared when destroying it (through
300 // DiskDeleteSymbolicLinks)
301 //
302
303 unsigned int PhysicalDriveLinkCreated : 1;
304
306
307 //
308 // ReadyStatus - STATUS_SUCCESS indicates that the drive is ready for
309 // use. Any error status is to be returned as an explaination for why
310 // a request is failed.
311 //
312 // This was done solely for the zero-length partition case of having no
313 // media in a removable disk drive. When that occurs, and a read is sent
314 // to the zero-length non-partition-zero PDO that was created, we had to
315 // be able to fail the request with a reasonable value. This may not have
316 // been the best way to do this, but it works.
317 //
318
320
321 //
322 // SCSI address used for SMART operations.
323 //
324
326
327 //
328 // What type of failure prediction mechanism is available
329 //
330
333
334 //
335 // Indicates that the SCSI Informational Exceptions mode page is supported.
336 // Note that this only indicates *support* and does not necessarily
337 // indicate that Informational Exception reporting via sense code is
338 // actually enabled.
339 //
341
342 //
343 // Indicates if failure prediction is actually enabled (via whatever)
344 // method is applicable as indicated by FailurePredictionCapability.
345 //
347
348#if defined(_X86_) || defined(_AMD64_)
349 //
350 // This flag indiciates that a non-default geometry for this drive has
351 // already been determined by the disk driver. This field is ignored
352 // for removable media drives.
353 //
354
355 DISK_GEOMETRY_SOURCE GeometrySource;
356
357 //
358 // If GeometryDetermined is TRUE this will contain the geometry which was
359 // reported by the firmware or by the BIOS. For removable media drives
360 // this will contain the last geometry used when media was present.
361 //
362
363 DISK_GEOMETRY RealGeometry;
364#endif
365
366 //
367 // This mutex prevents more than one IOCTL_DISK_VERIFY from being
368 // sent down to the disk. This greatly reduces the possibility of
369 // a Denial-of-Service attack
370 //
371
373
374 //
375 // This allows for parallel flush requests to be combined into one so as to
376 // reduce the number of outstanding requests that are sent down to the disk
377 //
378
380
381 //
382 // The user-specified disk write cache setting
383 //
384
386
387
389
390//
391// Define a general structure of identfing disk controllers with bad
392// hardware.
393//
394
395#define HackDisableTaggedQueuing (0x01)
396#define HackDisableSynchronousTransfers (0x02)
397#define HackDisableSpinDown (0x04)
398#define HackDisableWriteCache (0x08)
399#define HackCauseNotReportableHack (0x10)
400#define HackRequiresStartUnitCommand (0x20)
401
402
403#define DiskDeviceParameterSubkey L"Disk"
404#define DiskDeviceUserWriteCacheSetting L"UserWriteCacheSetting"
405#define DiskDeviceCacheIsPowerProtected L"CacheIsPowerProtected"
406
407
408#define FUNCTIONAL_EXTENSION_SIZE sizeof(FUNCTIONAL_DEVICE_EXTENSION) + sizeof(DISK_DATA)
409
410#define MODE_DATA_SIZE 192
411#define VALUE_BUFFER_SIZE 2048
412#define SCSI_DISK_TIMEOUT 10
413#define PARTITION0_LIST_SIZE 4
414
415#define MAX_MEDIA_TYPES 4
417 PCCHAR VendorId;
418 PCCHAR ProductId;
419 PCCHAR Revision;
424
425//
426// WMI reregistration structures used for reregister work item
427//
428typedef struct
429{
434
435#define MAX_SECTORS_PER_VERIFY 0x100
436
437//
438// This is based off 100ns units
439//
440#define ONE_MILLI_SECOND ((ULONGLONG)10 * 1000)
441
442//
443// Context for the work-item
444//
446{
450
452
453//
454// Poll for Failure Prediction every hour
455//
456#define DISK_DEFAULT_FAILURE_POLLING_PERIOD 1 * 60 * 60
457
458#define CHECK_IRQL() \
459 if (KeGetCurrentIrql() >= DISPATCH_LEVEL) { \
460 NT_ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL); \
461 return STATUS_INVALID_LEVEL; \
462 }
463
464//
465// Static global lookup tables.
466//
467
471
472#if defined(__REACTOS__) && defined(_MSC_VER)
473# pragma section("PAGECONS", read)
474# pragma section("PAGEDATA", read,write)
475#endif
476//
477// Macros
478//
479
480//
481// Routine prototypes.
482//
483
484
485DRIVER_INITIALIZE DriverEntry;
486
487VOID
488NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
491 );
492
494NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
498 );
499
501NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
504 );
505
507NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
510 );
511
513NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
517 );
518
520NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
524 );
525
527NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
530 IN PIRP Irp
531 );
532
534NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
537 IN PIRP Irp
538 );
539
540VOID
541NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
547 );
548
550NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
553 IN PIRP Irp
554 );
555
557NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
561 );
562
564NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
568 );
569
570VOID
573 IN PDISK_CACHE_INFORMATION CacheInfo,
575 );
576
580 IN PIRP Irp
581 );
582
586 IN PIRP Irp
587 );
588
589IO_WORKITEM_ROUTINE DisableWriteCache;
590
591IO_WORKITEM_ROUTINE DiskIoctlVerifyThread;
592
593VOID
596 IN PDISK_GROUP_CONTEXT FlushContext
597 );
598
599IO_COMPLETION_ROUTINE DiskFlushComplete;
600
601
605 _In_reads_bytes_(Length) PCHAR ModeSelectBuffer,
607 IN BOOLEAN SavePage
608 );
609
610//
611// We need to validate that the self test subcommand is valid and
612// appropriate. Right now we allow subcommands 0, 1 and 2 which are non
613// captive mode tests. Once we figure out a way to know if it is safe to
614// run a captive test then we can allow captive mode tests. Also if the
615// atapi 5 spec is ever updated to denote that bit 7 is the captive
616// mode bit, we can allow any request that does not have bit 7 set. Until
617// that is done we want to be sure
618//
619#define DiskIsValidSmartSelfTest(Subcommand) \
620 ( ((Subcommand) == SMART_OFFLINE_ROUTINE_OFFLINE) || \
621 ((Subcommand) == SMART_SHORT_SELFTEST_OFFLINE) || \
622 ((Subcommand) == SMART_EXTENDED_SELFTEST_OFFLINE) )
623
624
628 IN ULONG SrbControlCode,
632 IN UCHAR SectorNumber,
633 IN OUT PSRB_IO_CONTROL SrbControl,
635 );
636
640 OUT PMODE_INFO_EXCEPTIONS ReturnPageData
641 );
642
647 );
648
649#if (NTDDI_VERSION >= NTDDI_WINBLUE)
656 _Inout_ PULONG ModeDataSize,
657 _Out_ PVOID* PageData
658 );
659
664 );
665#endif // (NTDDI_VERSION >= NTDDI_WINBLUE)
666
670 PFAILURE_PREDICTION_METHOD FailurePredictCapability,
671 BOOLEAN ScsiAddressAvailable
672 );
673
679 IN BOOLEAN DasdAccessOnly
680 );
681
682VOID
683NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
687 );
688
689VOID
692 );
693
697 OUT PCCHAR *RawName
698 );
699
700VOID
703 );
704
705VOID
708 );
709
710
712NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
717 );
718
720NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
725 OUT PUNICODE_STRING MofName
726 );
727
729NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
732 IN PIRP Irp,
736 );
737
739NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
742 IN PIRP Irp,
746 );
747
749NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
752 IN PIRP Irp,
757 );
758
760NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
763 IN PIRP Irp,
769 );
770
772NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
775 IN PIRP Irp,
779 );
780
784 PSTORAGE_FAILURE_PREDICT_STATUS DiskSmartStatus
785 );
786
791 );
792
797 );
798
803 ULONG PollTimeInSeconds
804 );
805
807 VOID
808 );
809
811
812#if defined(_X86_) || defined(_AMD64_)
816 );
817#else
818#define DiskReadDriveCapacity(Fdo) ClassReadDriveCapacity(Fdo)
819#endif
820
821
822#if defined(_X86_) || defined(_AMD64_)
823
825DiskSaveDetectInfo(
827 );
828
829VOID
830DiskCleanupDetectInfo(
832 );
833
834VOID
835DiskDriverReinitialization (
839 );
840
841#endif
842
843#if defined(_X86_) || defined(_AMD64_)
847 OUT PDISK_DETECTION_INFO DetectInfo
848 );
849
851DiskReadSignature(
853 );
854
856DiskIsNT4Geometry(
858 );
859
860#else
861#define DiskGetDetectInfo(FdoExtension, DetectInfo) (STATUS_UNSUCCESSFUL)
862#endif
863
864
865#define DiskHashGuid(Guid) (((PULONG) &Guid)[0] ^ ((PULONG) &Guid)[0] ^ ((PULONG) &Guid)[0] ^ ((PULONG) &Guid)[0])
866
867
871 IN PIRP Irp,
872 IN UCHAR MediumType,
873 IN UCHAR DensityCode,
876 );
877
881 IN PIRP Irp
882 );
883
887 IN OUT PIRP Irp
888 );
889
893 IN PIRP Irp
894 );
895
899 IN OUT PIRP Irp
900 );
901
905 IN OUT PIRP Irp
906 );
907
911 IN OUT PIRP Irp
912 );
913
917 IN OUT PIRP Irp
918 );
919
923 IN OUT PIRP Irp
924 );
925
929 IN OUT PIRP Irp
930 );
931
935 IN OUT PIRP Irp
936 );
937
941 IN OUT PIRP Irp
942 );
943
947 IN OUT PIRP Irp
948 );
949
953 IN OUT PIRP Irp
954 );
955
959 IN OUT PIRP Irp
960 );
961
965 IN OUT PIRP Irp
966 );
967
971 IN OUT PIRP Irp
972 );
973
977 IN OUT PIRP Irp
978 );
979
983 IN OUT PIRP Irp
984 );
985
989 IN OUT PIRP Irp
990 );
991
992FORCEINLINE // __REACTOS__
993PCDB
996 _In_opt_ PUCHAR CdbLength8,
997 _In_opt_ PULONG CdbLength32,
998 _In_opt_ PUCHAR ScsiStatus,
999 _In_opt_ PVOID *SenseInfoBuffer,
1001 )
1002/*++
1003
1004Routine Description:
1005
1006 Helper function to retrieve SCSI related fields from an extended SRB. If SRB is
1007 not a SRB_FUNCTION_EXECUTE_SCSI or not an extended SRB, default values will be returned.
1008
1009Arguments:
1010
1011 SrbEx - Pointer to extended SRB.
1012
1013 CdbLength8 - Pointer to buffer to hold CdbLength field value for
1014 SRBEX_DATA_SCSI_CDB16 or SRBEX_DATA_SCSI_CDB32
1015
1016 CdbLength32 - Pointer to buffer to hold CdbLength field value for
1017 SRBEX_DATA_SCSI_CDB_VAR
1018
1019 ScsiStatus - Pointer to buffer to hold ScsiStatus field value.
1020
1021 SenseInfoBuffer - Pointer to buffer to hold SenseInfoBuffer value.
1022
1023 SenseInfoBufferLength - Pointer to buffer to hold SenseInfoBufferLength value.
1024
1025Return Value:
1026
1027 Pointer to Cdb field or NULL if SRB is not a SRB_FUNCTION_EXECUTE_SCSI.
1028
1029--*/
1030{
1031 PCDB Cdb = NULL;
1032 ULONG i;
1033 PSRBEX_DATA SrbExData = NULL;
1034 BOOLEAN FoundEntry = FALSE;
1035
1036 if ((SrbEx->Function == SRB_FUNCTION_STORAGE_REQUEST_BLOCK) &&
1037 (SrbEx->SrbFunction == SRB_FUNCTION_EXECUTE_SCSI)) {
1038 NT_ASSERT(SrbEx->NumSrbExData > 0);
1039
1040 for (i = 0; i < SrbEx->NumSrbExData; i++) {
1041
1042 // Skip any invalid offsets
1043 if ((SrbEx->SrbExDataOffset[i] < sizeof(STORAGE_REQUEST_BLOCK)) ||
1044 (SrbEx->SrbExDataOffset[i] > SrbEx->SrbLength)){
1045 // Catch any invalid offsets
1047 continue;
1048 }
1049
1050 SrbExData = (PSRBEX_DATA)((PUCHAR)SrbEx + SrbEx->SrbExDataOffset[i]);
1051
1052 switch (SrbExData->Type) {
1053
1055 if (SrbEx->SrbExDataOffset[i] + sizeof(SRBEX_DATA_SCSI_CDB16) <= SrbEx->SrbLength) {
1056 FoundEntry = TRUE;
1057 if (CdbLength8) {
1058 *CdbLength8 = ((PSRBEX_DATA_SCSI_CDB16) SrbExData)->CdbLength;
1059 }
1060
1061 if (((PSRBEX_DATA_SCSI_CDB16) SrbExData)->CdbLength > 0) {
1062 Cdb = (PCDB)((PSRBEX_DATA_SCSI_CDB16) SrbExData)->Cdb;
1063 }
1064
1065 if (ScsiStatus) {
1066 *ScsiStatus =
1067 ((PSRBEX_DATA_SCSI_CDB16) SrbExData)->ScsiStatus;
1068 }
1069
1070 if (SenseInfoBuffer) {
1071 *SenseInfoBuffer =
1072 ((PSRBEX_DATA_SCSI_CDB16) SrbExData)->SenseInfoBuffer;
1073 }
1074
1077 ((PSRBEX_DATA_SCSI_CDB16) SrbExData)->SenseInfoBufferLength;
1078 }
1079
1080 } else {
1081 // Catch invalid offset
1083 }
1084 break;
1085
1087 if (SrbEx->SrbExDataOffset[i] + sizeof(SRBEX_DATA_SCSI_CDB32) <= SrbEx->SrbLength) {
1088 FoundEntry = TRUE;
1089 if (CdbLength8) {
1090 *CdbLength8 = ((PSRBEX_DATA_SCSI_CDB32) SrbExData)->CdbLength;
1091 }
1092
1093 if (((PSRBEX_DATA_SCSI_CDB32) SrbExData)->CdbLength > 0) {
1094 Cdb = (PCDB)((PSRBEX_DATA_SCSI_CDB32) SrbExData)->Cdb;
1095 }
1096
1097 if (ScsiStatus) {
1098 *ScsiStatus =
1099 ((PSRBEX_DATA_SCSI_CDB32) SrbExData)->ScsiStatus;
1100 }
1101
1102 if (SenseInfoBuffer) {
1103 *SenseInfoBuffer =
1104 ((PSRBEX_DATA_SCSI_CDB32) SrbExData)->SenseInfoBuffer;
1105 }
1106
1109 ((PSRBEX_DATA_SCSI_CDB32) SrbExData)->SenseInfoBufferLength;
1110 }
1111
1112 } else {
1113 // Catch invalid offset
1115 }
1116 break;
1117
1119 if (SrbEx->SrbExDataOffset[i] + sizeof(SRBEX_DATA_SCSI_CDB_VAR) <= SrbEx->SrbLength) {
1120 FoundEntry = TRUE;
1121 if (CdbLength32) {
1122 *CdbLength32 = ((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->CdbLength;
1123 }
1124
1125 if (((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->CdbLength > 0) {
1126 Cdb = (PCDB)((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->Cdb;
1127 }
1128
1129 if (ScsiStatus) {
1130 *ScsiStatus =
1131 ((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->ScsiStatus;
1132 }
1133
1134 if (SenseInfoBuffer) {
1135 *SenseInfoBuffer =
1136 ((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->SenseInfoBuffer;
1137 }
1138
1141 ((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->SenseInfoBufferLength;
1142 }
1143
1144 } else {
1145 // Catch invalid offset
1147 }
1148 break;
1149 }
1150
1151 if (FoundEntry) {
1152 break;
1153 }
1154 }
1155
1156 } else {
1157
1158 if (CdbLength8) {
1159 *CdbLength8 = 0;
1160 }
1161
1162 if (CdbLength32) {
1163 *CdbLength32 = 0;
1164 }
1165
1166 if (ScsiStatus) {
1167 *ScsiStatus = 0;
1168 }
1169
1170 if (SenseInfoBuffer) {
1171 *SenseInfoBuffer = NULL;
1172 }
1173
1176 }
1177 }
1178
1179 return Cdb;
1180}
1181
1182FORCEINLINE // __REACTOS__
1183VOID
1186 _In_ UCHAR CdbLength8,
1187 _In_ ULONG CdbLength32,
1188 _In_ UCHAR ScsiStatus,
1189 _In_opt_ PVOID SenseInfoBuffer,
1191 )
1192/*++
1193
1194Routine Description:
1195
1196 Helper function to set SCSI related fields from an extended SRB. If SRB is
1197 not a SRB_FUNCTION_EXECUTE_SCSI or not an extended SRB, no modifications will
1198 be made
1199
1200Arguments:
1201
1202 SrbEx - Pointer to extended SRB.
1203
1204 CdbLength8 - CdbLength field value for SRBEX_DATA_SCSI_CDB16
1205 or SRBEX_DATA_SCSI_CDB32
1206
1207 CdbLength32 - CdbLength field value for SRBEX_DATA_SCSI_CDB_VAR
1208
1209 ScsiStatus - ScsiStatus field value.
1210
1211 SenseInfoBuffer - SenseInfoBuffer value.
1212
1213 SenseInfoBufferLength - SenseInfoBufferLength value.
1214
1215Return Value:
1216
1217 None
1218
1219--*/
1220{
1221 ULONG i;
1222 PSRBEX_DATA SrbExData = NULL;
1223 BOOLEAN FoundEntry = FALSE;
1224
1225 if ((SrbEx->Function == SRB_FUNCTION_STORAGE_REQUEST_BLOCK) &&
1226 (SrbEx->SrbFunction == SRB_FUNCTION_EXECUTE_SCSI)) {
1227 NT_ASSERT(SrbEx->NumSrbExData > 0);
1228
1229 for (i = 0; i < SrbEx->NumSrbExData; i++) {
1230
1231 // Skip any invalid offsets
1232 if ((SrbEx->SrbExDataOffset[i] < sizeof(STORAGE_REQUEST_BLOCK)) ||
1233 (SrbEx->SrbExDataOffset[i] > SrbEx->SrbLength)){
1234 // Catch any invalid offsets
1236 continue;
1237 }
1238
1239 SrbExData = (PSRBEX_DATA)((PUCHAR)SrbEx + SrbEx->SrbExDataOffset[i]);
1240
1241 switch (SrbExData->Type) {
1242
1244 if (SrbEx->SrbExDataOffset[i] + sizeof(SRBEX_DATA_SCSI_CDB16) <= SrbEx->SrbLength) {
1245 FoundEntry = TRUE;
1246 ((PSRBEX_DATA_SCSI_CDB16) SrbExData)->CdbLength = CdbLength8;
1247 ((PSRBEX_DATA_SCSI_CDB16) SrbExData)->ScsiStatus = ScsiStatus;
1248 ((PSRBEX_DATA_SCSI_CDB16) SrbExData)->SenseInfoBuffer = SenseInfoBuffer;
1249 ((PSRBEX_DATA_SCSI_CDB16) SrbExData)->SenseInfoBufferLength = SenseInfoBufferLength;
1250 } else {
1251 // Catch invalid offset
1253 }
1254 break;
1255
1257 if (SrbEx->SrbExDataOffset[i] + sizeof(SRBEX_DATA_SCSI_CDB32) <= SrbEx->SrbLength) {
1258 FoundEntry = TRUE;
1259 ((PSRBEX_DATA_SCSI_CDB32) SrbExData)->CdbLength = CdbLength8;
1260 ((PSRBEX_DATA_SCSI_CDB32) SrbExData)->ScsiStatus = ScsiStatus;
1261 ((PSRBEX_DATA_SCSI_CDB32) SrbExData)->SenseInfoBuffer = SenseInfoBuffer;
1262 ((PSRBEX_DATA_SCSI_CDB32) SrbExData)->SenseInfoBufferLength = SenseInfoBufferLength;
1263 } else {
1264 // Catch invalid offset
1266 }
1267 break;
1268
1270 if (SrbEx->SrbExDataOffset[i] + sizeof(SRBEX_DATA_SCSI_CDB_VAR) <= SrbEx->SrbLength) {
1271 FoundEntry = TRUE;
1272 ((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->CdbLength = CdbLength32;
1273 ((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->ScsiStatus = ScsiStatus;
1274 ((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->SenseInfoBuffer = SenseInfoBuffer;
1275 ((PSRBEX_DATA_SCSI_CDB_VAR) SrbExData)->SenseInfoBufferLength = SenseInfoBufferLength;
1276 } else {
1277 // Catch invalid offset
1279 }
1280 break;
1281 }
1282
1283 if (FoundEntry) {
1284 break;
1285 }
1286 }
1287
1288 }
1289
1290 return;
1291}
1292
unsigned char BOOLEAN
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:989
_In_ size_t _In_ UCHAR PageMode
Definition: cdrom.h:1326
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1156
_In_ ULONG const _In_ FEATURE_NUMBER const Feature
Definition: cdrom.h:1077
_In_ ULONG _In_ UCHAR _In_ UCHAR PageControl
Definition: cdrom.h:1319
@ MediaPresent
Definition: cdromp.h:82
union _CDB * PCDB
enum _STORAGE_MEDIA_TYPE STORAGE_MEDIA_TYPE
Definition: bufpool.h:45
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:312
_In_z_ PCCHAR _In_ PDEVICE_OBJECT LowerDeviceObject
Definition: classpnp.h:983
_Out_ ULONG * RegFlags
Definition: classpnp.h:403
#define CLASS_SRBEX_SCSI_CDB16_BUFFER_SIZE
Definition: classpnp.h:695
_In_ PIRP _In_ ULONG GuidIndex
Definition: classpnp.h:419
enum FAILURE_PREDICTION_METHOD * PFAILURE_PREDICTION_METHOD
CLASSENABLEDISABLEFUNCTION
Definition: classpnp.h:228
_In_ PCHAR _In_ ULONG DeviceNumber
Definition: classpnp.h:1230
_In_ PIRP _In_ ULONG _In_ ULONG BufferAvail
Definition: classpnp.h:420
FAILURE_PREDICTION_METHOD
Definition: classpnp.h:233
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
NTSTATUS DiskEnableDisableFailurePrediction(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, BOOLEAN Enable)
Definition: diskwmi.c:1126
NTSTATUS NTAPI DiskRemoveDevice(IN PDEVICE_OBJECT DeviceObject, IN UCHAR Type)
Definition: pnp.c:843
NTSTATUS NTAPI DiskDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI DiskFdoSetWmiDataItem(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG DataItemId, IN ULONG BufferSize, IN PUCHAR Buffer)
Definition: diskwmi.c:2975
NTSTATUS NTAPI DiskWmiFunctionControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN CLASSENABLEDISABLEFUNCTION Function, IN BOOLEAN Enable)
Definition: diskwmi.c:2366
GUIDREGINFO DiskWmiFdoGuidList[]
Definition: diskwmi.c:92
NTSTATUS DiskPerformSmartCommand(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN ULONG SrbControlCode, IN UCHAR Command, IN UCHAR Feature, IN UCHAR SectorCount, IN UCHAR SectorNumber, IN OUT PSRB_IO_CONTROL SrbControl, OUT PULONG BufferSize)
Definition: diskwmi.c:476
NTSTATUS DiskGenerateDeviceName(IN ULONG DeviceNumber, OUT PCCHAR *RawName)
Definition: pnp.c:612
NTSTATUS DiskCreateFdo(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT LowerDeviceObject, IN PULONG DeviceCount, IN BOOLEAN DasdAccessOnly)
Definition: disk.c:307
NTSTATUS DiskIoctlVerify(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:4526
NTSTATUS DiskIoctlUpdateDriveSize(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:5362
NTSTATUS DiskDetectFailurePrediction(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PFAILURE_PREDICTION_METHOD FailurePredictCapability, BOOLEAN ScsiAddressAvailable)
Definition: diskwmi.c:2230
NTSTATUS NTAPI DiskFdoQueryWmiRegInfoEx(IN PDEVICE_OBJECT DeviceObject, OUT ULONG *RegFlags, OUT PUNICODE_STRING InstanceName, OUT PUNICODE_STRING MofName)
Definition: diskwmi.c:2577
NTSTATUS DiskIoctlEnableFailurePrediction(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:4419
NTSTATUS DiskIoctlSmartSendDriveCommand(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:5890
NTSTATUS DiskIoctlIsWritable(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:5063
VOID DiskFlushDispatch(IN PDEVICE_OBJECT Fdo, IN PDISK_GROUP_CONTEXT FlushContext)
Definition: disk.c:1534
NTSTATUS DiskIoctlReassignBlocks(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:4648
NTSTATUS DiskModeSelect(IN PDEVICE_OBJECT DeviceObject, _In_reads_bytes_(Length) PCHAR ModeSelectBuffer, IN ULONG Length, IN BOOLEAN SavePage)
Definition: disk.c:1802
struct DISKREREGREQUEST * PDISKREREGREQUEST
NTSTATUS DiskIoctlSetCacheInformation(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:3917
NTSTATUS DiskDetermineMediaTypes(IN PDEVICE_OBJECT Fdo, IN PIRP Irp, IN UCHAR MediumType, IN UCHAR DensityCode, IN BOOLEAN MediaPresent, IN BOOLEAN IsWritable)
Definition: disk.c:655
NTSTATUS NTAPI DiskFdoExecuteWmiMethod(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG MethodId, IN ULONG InBufferSize, IN ULONG OutBufferSize, IN PUCHAR Buffer)
Definition: diskwmi.c:3045
CLASSPNP_SCAN_FOR_SPECIAL_INFO DiskBadControllers[]
Definition: data.c:42
const DISK_MEDIA_TYPES_LIST DiskMediaTypes[]
Definition: data.c:82
NTSTATUS DiskIoctlGetVolumeDiskExtents(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:5461
NTSTATUS DiskIoctlReassignBlocksEx(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:4855
NTSTATUS NTAPI DiskGetCacheInformation(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PDISK_CACHE_INFORMATION CacheInfo)
Definition: disk.c:3019
NTSTATUS NTAPI DiskSetCacheInformation(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PDISK_CACHE_INFORMATION CacheInfo)
Definition: disk.c:3167
NTSTATUS DiskInitializeReregistration(VOID)
Definition: diskwmi.c:1560
NTSTATUS DiskGetInfoExceptionInformation(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, OUT PMODE_INFO_EXCEPTIONS ReturnPageData)
NTSTATUS DiskIoctlSmartReceiveDriveData(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:5663
NTSTATUS NTAPI DiskShutdownFlush(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: disk.c:1122
DRIVER_INITIALIZE DriverEntry
Definition: disk.h:485
NTSTATUS DiskEnableInfoExceptions(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ BOOLEAN Enable)
Definition: diskwmi.c:979
NTSTATUS DiskIoctlClearVerify(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:5313
NTSTATUS NTAPI DiskStartFdo(IN PDEVICE_OBJECT Fdo)
Definition: pnp.c:911
NTSTATUS NTAPI DiskInitFdo(IN PDEVICE_OBJECT Fdo)
Definition: pnp.c:202
VOID NTAPI DiskSetSpecialHacks(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN ULONG_PTR Data)
Definition: disk.c:2602
#define DiskGetDetectInfo(FdoExtension, DetectInfo)
Definition: disk.h:861
struct _DISK_GROUP_CONTEXT * PDISK_GROUP_CONTEXT
FORCEINLINE VOID SetSrbScsiData(_In_ PSTORAGE_REQUEST_BLOCK SrbEx, _In_ UCHAR CdbLength8, _In_ ULONG CdbLength32, _In_ UCHAR ScsiStatus, _In_opt_ PVOID SenseInfoBuffer, _In_ UCHAR SenseInfoBufferLength)
Definition: disk.h:1184
NTSTATUS DiskIoctlGetCacheSetting(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: disk.c:3347
#define DiskReadDriveCapacity(Fdo)
Definition: disk.h:818
VOID NTAPI DiskFdoProcessError(PDEVICE_OBJECT DeviceObject, PSCSI_REQUEST_BLOCK Srb, NTSTATUS *Status, BOOLEAN *Retry)
Definition: disk.c:2276
VOID DiskCreateSymbolicLinks(IN PDEVICE_OBJECT DeviceObject)
Definition: pnp.c:676
NTSTATUS DiskIoctlGetMediaTypesEx(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:3994
IO_WORKITEM_ROUTINE DisableWriteCache
Definition: disk.h:589
NTSTATUS DiskIoctlGetDriveGeometryEx(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS DiskIoctlGetDriveGeometry(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:3582
struct _DISK_GROUP_CONTEXT DISK_GROUP_CONTEXT
NTSTATUS DiskIoctlGetCacheInformation(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:3840
#define MAX_MEDIA_TYPES
Definition: disk.h:415
struct _DISK_VERIFY_WORKITEM_CONTEXT * PDISK_VERIFY_WORKITEM_CONTEXT
NTSTATUS DiskIoctlSetCacheSetting(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: disk.c:3415
struct _DISK_DATA DISK_DATA
struct _DISK_MEDIA_TYPES_LIST * PDISK_MEDIA_TYPES_LIST
const DISK_MEDIA_TYPES_LIST DiskMediaTypesExclude[]
Definition: data.c:74
NTSTATUS DiskSetInfoExceptionInformation(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PMODE_INFO_EXCEPTIONS PageData)
Definition: disk.c:2985
NTSTATUS DiskReadFailurePredictStatus(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PSTORAGE_FAILURE_PREDICT_STATUS DiskSmartStatus)
Definition: diskwmi.c:1251
NTSTATUS NTAPI DiskStopDevice(IN PDEVICE_OBJECT DeviceObject, IN UCHAR Type)
Definition: pnp.c:600
VOID ResetBus(IN PDEVICE_OBJECT DeviceObject)
Definition: disk.c:2705
IO_COMPLETION_ROUTINE DiskFlushComplete
Definition: disk.h:599
struct _DISK_DATA * PDISK_DATA
enum _DISK_USER_WRITE_CACHE_SETTING DISK_USER_WRITE_CACHE_SETTING
NTSTATUS NTAPI DiskReadWriteVerification(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: disk.c:546
NTSTATUS NTAPI DiskFdoQueryWmiDataBlock(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG BufferAvail, OUT PUCHAR Buffer)
Definition: diskwmi.c:2638
enum _DISK_USER_WRITE_CACHE_SETTING * PDISK_USER_WRITE_CACHE_SETTING
NTSTATUS NTAPI DiskAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo)
Definition: pnp.c:53
FORCEINLINE PCDB GetSrbScsiData(_In_ PSTORAGE_REQUEST_BLOCK SrbEx, _In_opt_ PUCHAR CdbLength8, _In_opt_ PULONG CdbLength32, _In_opt_ PUCHAR ScsiStatus, _In_opt_ PVOID *SenseInfoBuffer, _In_opt_ PUCHAR SenseInfoBufferLength)
Definition: disk.h:994
NTSTATUS DiskIoctlSetVerify(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:5264
NTSTATUS DiskIoctlGetLengthInfo(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI DiskFdoQueryWmiRegInfo(IN PDEVICE_OBJECT DeviceObject, OUT ULONG *RegFlags, OUT PUNICODE_STRING InstanceName)
Definition: diskwmi.c:2479
NTSTATUS DiskEnableDisableFailurePredictPolling(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, BOOLEAN Enable, ULONG PollTimeInSeconds)
Definition: diskwmi.c:1193
NTSTATUS DiskIoctlPredictFailure(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:4268
VOID DiskDeleteSymbolicLinks(IN PDEVICE_OBJECT DeviceObject)
Definition: pnp.c:780
NTSTATUS DiskReadFailurePredictData(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PSTORAGE_FAILURE_PREDICT_DATA DiskSmartData)
Definition: diskwmi.c:1327
NTSTATUS DiskGetModePage(_In_ PDEVICE_OBJECT Fdo, _In_ UCHAR PageMode, _In_ UCHAR PageControl, _In_ PMODE_PARAMETER_HEADER ModeData, _Inout_ PULONG ModeDataSize, _Out_ PVOID *PageData)
Definition: diskwmi.c:903
VOID DiskLogCacheInformation(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PDISK_CACHE_INFORMATION CacheInfo, IN NTSTATUS Status)
Definition: disk.c:2856
NTSTATUS NTAPI DiskFdoSetWmiDataBlock(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG BufferSize, IN PUCHAR Buffer)
Definition: diskwmi.c:2869
struct _DISK_MEDIA_TYPES_LIST DISK_MEDIA_TYPES_LIST
IO_WORKITEM_ROUTINE DiskIoctlVerifyThread
Definition: disk.h:591
struct _DISK_VERIFY_WORKITEM_CONTEXT DISK_VERIFY_WORKITEM_CONTEXT
NTSTATUS DiskIoctlSmartGetVersion(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: disk.c:5540
_DISK_USER_WRITE_CACHE_SETTING
Definition: disk.h:178
@ DiskWriteCacheDefault
Definition: disk.h:181
@ DiskWriteCacheDisable
Definition: disk.h:179
@ DiskWriteCacheEnable
Definition: disk.h:180
VOID NTAPI DiskUnload(IN PDRIVER_OBJECT DriverObject)
Definition: disk.c:281
#define SRB_FUNCTION_EXECUTE_SCSI
Definition: srb.h:315
@ FdoExtension
Definition: precomp.h:48
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
_Must_inspect_result_ _Inout_ PFLT_VOLUME _In_opt_ PCUNICODE_STRING InstanceName
Definition: fltkernel.h:1163
_Must_inspect_result_ _Out_ PBOOLEAN IsWritable
Definition: fltkernel.h:1743
Status
Definition: gdiplustypes.h:25
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
enum _PARTITION_STYLE PARTITION_STYLE
unsigned __int64 ULONG64
Definition: imports.h:198
ULONG DeviceCount
Definition: mpu401.c:26
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Inout_
Definition: ms_sal.h:378
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
int Count
Definition: noreturn.cpp:7
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
ULONG SectorCount
Definition: part_xbox.c:31
@ Nothing
Definition: sacdrv.h:266
_In_opt_ WDFREQUEST _In_ ULONG _In_ BOOLEAN _In_ PCDB Cdb
Definition: scratch.h:159
_In_ UCHAR SenseInfoBufferLength
Definition: scsi.h:3705
struct SRB_ALIGN _SRBEX_DATA_SCSI_CDB_VAR SRBEX_DATA_SCSI_CDB_VAR
struct SRB_ALIGN _SRBEX_DATA_SCSI_CDB_VAR * PSRBEX_DATA_SCSI_CDB_VAR
struct SRB_ALIGN _SRBEX_DATA_SCSI_CDB16 SRBEX_DATA_SCSI_CDB16
#define SRB_FUNCTION_STORAGE_REQUEST_BLOCK
Definition: srb.h:108
* PSTORAGE_REQUEST_BLOCK
Definition: srb.h:661
struct SRB_ALIGN _SRBEX_DATA * PSRBEX_DATA
@ SrbExDataTypeScsiCdb32
Definition: srb.h:460
@ SrbExDataTypeScsiCdb16
Definition: srb.h:459
@ SrbExDataTypeScsiCdbVar
Definition: srb.h:461
struct SRB_ALIGN _SRBEX_DATA_SCSI_CDB16 * PSRBEX_DATA_SCSI_CDB16
struct SRB_ALIGN _SRBEX_DATA_SCSI_CDB32 * PSRBEX_DATA_SCSI_CDB32
STORAGE_REQUEST_BLOCK
Definition: srb.h:661
struct SRB_ALIGN _SRBEX_DATA_SCSI_CDB32 SRBEX_DATA_SCSI_CDB32
Definition: shell.h:41
SINGLE_LIST_ENTRY Next
Definition: disk.h:430
PDEVICE_OBJECT DeviceObject
Definition: disk.h:431
ULONG64 Attributes
Definition: disk.h:273
unsigned int PhysicalDriveLinkCreated
Definition: disk.h:303
BOOLEAN AllowFPPerfHit
Definition: disk.h:332
GUID DiskId
Definition: disk.h:255
ULONG Signature
Definition: disk.h:207
ULONG PartitionOrdinal
Definition: disk.h:191
DISK_GROUP_CONTEXT FlushContext
Definition: disk.h:379
NTSTATUS ReadyStatus
Definition: disk.h:319
DISK_USER_WRITE_CACHE_SETTING WriteCacheOverride
Definition: disk.h:385
unsigned int WellKnownNameCreated
Definition: disk.h:295
PARTITION_STYLE PartitionStyle
Definition: disk.h:197
UCHAR PartitionType
Definition: disk.h:235
BOOLEAN ScsiInfoExceptionsSupported
Definition: disk.h:340
ULONG MbrCheckSum
Definition: disk.h:213
ULONG HiddenSectors
Definition: disk.h:219
BOOLEAN BootIndicator
Definition: disk.h:245
struct _DISK_DATA::@1055::@1059 Efi
FAILURE_PREDICTION_METHOD FailurePredictionCapability
Definition: disk.h:331
struct _DISK_DATA::@1057 LinkStatus
BOOLEAN FailurePredictionEnabled
Definition: disk.h:346
GUID PartitionId
Definition: disk.h:267
KMUTEX VerifyMutex
Definition: disk.h:372
WCHAR PartitionName[36]
Definition: disk.h:279
SCSI_ADDRESS ScsiAddress
Definition: disk.h:325
GUID PartitionType
Definition: disk.h:261
struct _DISK_DATA::@1055::@1058 Mbr
LIST_ENTRY NextList
Definition: disk.h:118
SCSI_REQUEST_BLOCK Srb
Definition: disk.h:131
UCHAR SrbExBuffer[CLASS_SRBEX_SCSI_CDB16_BUFFER_SIZE]
Definition: disk.h:133
STORAGE_REQUEST_BLOCK SrbEx
Definition: disk.h:132
KSPIN_LOCK Spinlock
Definition: disk.h:143
KEVENT Event
Definition: disk.h:148
LIST_ENTRY CurrList
Definition: disk.h:108
const STORAGE_MEDIA_TYPE MediaTypes[MAX_MEDIA_TYPES]
Definition: disk.h:422
const ULONG NumberOfTypes
Definition: disk.h:420
const ULONG NumberOfSides
Definition: disk.h:421
PSCSI_REQUEST_BLOCK Srb
Definition: disk.h:448
PIO_WORKITEM WorkItem
Definition: disk.h:449
Definition: typedefs.h:120
Definition: ntbasedef.h:628
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
Definition: cdrw_hw.h:28
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
Definition: wdfminiport.h:72
#define FORCEINLINE
Definition: wdftypes.h:67
_In_ ULONG OutBufferSize
Definition: wdfwmi.h:87
_In_ ULONG InBufferSize
Definition: wdfwmi.h:106
_In_ ULONG MethodId
Definition: wdfwmi.h:142
_In_ ULONG DataItemId
Definition: wdfwmi.h:123
#define NT_ASSERT
Definition: rtlfuncs.h:3310
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180