ReactOS 0.4.16-dev-1527-g49e652b
ioctl.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Storage Stack / SCSIPORT storage port library
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: IOCTL handlers
5 * COPYRIGHT: Eric Kohl (eric.kohl@reactos.org)
6 * Aleksey Bragin (aleksey@reactos.org)
7 * 2020 Victor Perevertkin (victor.perevertkin@reactos.org)
8 */
9
10#include "scsiport.h"
11#include <sptilib.h>
12
13#define NDEBUG
14#include <debug.h>
15
16
17static
20 _In_ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
22{
23 ULONG InquiryDataSize;
24 ULONG BusCount, Length;
25 PIO_STACK_LOCATION IrpStack;
26 PSCSI_ADAPTER_BUS_INFO AdapterBusInfo;
27 PSCSI_INQUIRY_DATA InquiryData;
29
30 DPRINT("SpiGetInquiryData() called\n");
31
32 /* Get pointer to the buffer */
34 Buffer = Irp->AssociatedIrp.SystemBuffer;
35
36 /* Initialize bus and LUN counters */
37 BusCount = DeviceExtension->NumberOfBuses;
38
39 /* Calculate size of inquiry data, rounding up to sizeof(ULONG) */
40 InquiryDataSize = ALIGN_UP(sizeof(SCSI_INQUIRY_DATA) - 1 + INQUIRYDATABUFFERSIZE, ULONG);
41
42 /* Calculate data size */
43 Length = sizeof(SCSI_ADAPTER_BUS_INFO) + (BusCount - 1) * sizeof(SCSI_BUS_DATA);
44
45 Length += InquiryDataSize * DeviceExtension->TotalLUCount;
46
47 /* Check, if all data is going to fit into provided buffer */
48 if (IrpStack->Parameters.DeviceIoControl.OutputBufferLength < Length)
49 {
50 Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
52 }
53
54 /* Store data size in the IRP */
55 Irp->IoStatus.Information = Length;
56
57 DPRINT("Data size: %lu\n", Length);
58
59 AdapterBusInfo = (PSCSI_ADAPTER_BUS_INFO)Buffer;
60
61 AdapterBusInfo->NumberOfBuses = (UCHAR)BusCount;
62
63 /* Point InquiryData to the corresponding place inside Buffer */
64 InquiryData = (PSCSI_INQUIRY_DATA)(Buffer + sizeof(SCSI_ADAPTER_BUS_INFO) +
65 (BusCount - 1) * sizeof(SCSI_BUS_DATA));
66
67 /* Loop each bus */
68 for (UINT8 pathId = 0; pathId < DeviceExtension->NumberOfBuses; pathId++)
69 {
70 PSCSI_BUS_DATA BusData = &AdapterBusInfo->BusData[pathId];
71
72 /* Calculate and save an offset of the inquiry data */
73 BusData->InquiryDataOffset = (ULONG)((PUCHAR)InquiryData - Buffer);
74
75 /* Store Initiator Bus Id */
76 BusData->InitiatorBusId = DeviceExtension->Buses[pathId].BusIdentifier;
77
78 /* Store LUN count */
79 BusData->NumberOfLogicalUnits = DeviceExtension->Buses[pathId].LogicalUnitsCount;
80
81 /* Loop all LUNs */
82 PSCSI_BUS_INFO bus = &DeviceExtension->Buses[pathId];
83
84 for (PLIST_ENTRY lunEntry = bus->LunsListHead.Flink;
85 lunEntry != &bus->LunsListHead;
86 lunEntry = lunEntry->Flink)
87 {
89 CONTAINING_RECORD(lunEntry, SCSI_PORT_LUN_EXTENSION, LunEntry);
90
91 DPRINT("(Bus %lu Target %lu Lun %lu)\n", pathId, lunExt->TargetId, lunExt->Lun);
92
93 /* Fill InquiryData with values */
94 InquiryData->PathId = lunExt->PathId;
95 InquiryData->TargetId = lunExt->TargetId;
96 InquiryData->Lun = lunExt->Lun;
98 InquiryData->DeviceClaimed = lunExt->DeviceClaimed;
99 InquiryData->NextInquiryDataOffset =
100 (ULONG)((PUCHAR)InquiryData + InquiryDataSize - Buffer);
101
102 /* Copy data in it */
103 RtlCopyMemory(InquiryData->InquiryData,
104 &lunExt->InquiryData,
106
107 /* Move to the next LUN */
108 InquiryData = (PSCSI_INQUIRY_DATA) ((ULONG_PTR)InquiryData + InquiryDataSize);
109 }
110
111 /* Either mark the end, or set offset to 0 */
112 if (BusData->NumberOfLogicalUnits != 0)
113 ((PSCSI_INQUIRY_DATA) ((PCHAR)InquiryData - InquiryDataSize))->NextInquiryDataOffset = 0;
114 else
115 BusData->InquiryDataOffset = 0;
116 }
117
118 /* Finish with success */
119 Irp->IoStatus.Status = STATUS_SUCCESS;
120 return STATUS_SUCCESS;
121}
122
123static
124UINT32
127 _In_ UINT32 MaxLength)
128{
130 UINT32 LastCharacterPosition = 0;
131
132 // scan the field and return last position which contains a valid character
133 for (Index = 0; Index < MaxLength; Index++)
134 {
135 if (Name[Index] != ' ')
136 {
137 // trim white spaces from field
138 LastCharacterPosition = Index;
139 }
140 }
141
142 // convert from zero based index to length
143 return LastCharacterPosition + 1;
144}
145
146static
151{
153 PSCSI_PORT_LUN_EXTENSION lunExt = DeviceObject->DeviceExtension;
155
156 ASSERT(ioStack->Parameters.DeviceIoControl.InputBufferLength >= sizeof(STORAGE_PROPERTY_QUERY));
157 ASSERT(Irp->AssociatedIrp.SystemBuffer);
158 ASSERT(!lunExt->Common.IsFDO);
159
160 PSTORAGE_PROPERTY_QUERY PropertyQuery = Irp->AssociatedIrp.SystemBuffer;
161
162 // check property type
163 if (PropertyQuery->PropertyId != StorageDeviceProperty &&
164 PropertyQuery->PropertyId != StorageAdapterProperty)
165 {
166 // only device property / adapter property are supported
168 goto completeIrp;
169 }
170
171 // check query type
172 if (PropertyQuery->QueryType == PropertyExistsQuery)
173 {
174 // device property / adapter property is supported
176 goto completeIrp;
177 }
178
179 if (PropertyQuery->QueryType != PropertyStandardQuery)
180 {
181 // only standard query and exists query are supported
183 goto completeIrp;
184 }
185
186 switch (PropertyQuery->PropertyId)
187 {
189 {
190 PINQUIRYDATA inquiryData = &lunExt->InquiryData;
191
192 // compute extra parameters length
193 UINT32 FieldLengthVendor = GetFieldLength(inquiryData->VendorId, 8),
194 FieldLengthProduct = GetFieldLength(inquiryData->ProductId, 16),
195 FieldLengthRevision = GetFieldLength(inquiryData->ProductRevisionLevel, 4);
196
197 // total length required is sizeof(STORAGE_DEVICE_DESCRIPTOR) + FieldLength + 4 extra null bytes - 1
198 // -1 due STORAGE_DEVICE_DESCRIPTOR contains one byte length of parameter data
200 + FieldLengthVendor
201 + FieldLengthProduct
202 + FieldLengthRevision
203 + 3;
204
205 // check if output buffer is long enough
206 if (ioStack->Parameters.DeviceIoControl.OutputBufferLength < TotalLength)
207 {
208 // buffer too small
209 PSTORAGE_DESCRIPTOR_HEADER DescriptorHeader = Irp->AssociatedIrp.SystemBuffer;
210 ASSERT(ioStack->Parameters.DeviceIoControl.OutputBufferLength >=
212
213 // return required size
214 DescriptorHeader->Version = TotalLength;
215 DescriptorHeader->Size = TotalLength;
216
217 Irp->IoStatus.Information = sizeof(STORAGE_DESCRIPTOR_HEADER);
219 goto completeIrp;
220 }
221
222 // initialize the device descriptor
223 PSTORAGE_DEVICE_DESCRIPTOR deviceDescriptor = Irp->AssociatedIrp.SystemBuffer;
224
225 deviceDescriptor->Version = sizeof(STORAGE_DEVICE_DESCRIPTOR);
226 deviceDescriptor->Size = TotalLength;
227 deviceDescriptor->DeviceType = inquiryData->DeviceType;
228 deviceDescriptor->DeviceTypeModifier = inquiryData->DeviceTypeModifier;
229 deviceDescriptor->RemovableMedia = inquiryData->RemovableMedia;
230 deviceDescriptor->CommandQueueing = inquiryData->CommandQueue;
231 deviceDescriptor->BusType = BusTypeScsi;
232 deviceDescriptor->VendorIdOffset =
233 FIELD_OFFSET(STORAGE_DEVICE_DESCRIPTOR, RawDeviceProperties);
234 deviceDescriptor->ProductIdOffset =
235 deviceDescriptor->VendorIdOffset + FieldLengthVendor + 1;
236 deviceDescriptor->ProductRevisionOffset =
237 deviceDescriptor->ProductIdOffset + FieldLengthProduct + 1;
238 deviceDescriptor->SerialNumberOffset = 0;
239 deviceDescriptor->RawPropertiesLength =
240 FieldLengthVendor + FieldLengthProduct + FieldLengthRevision + 3;
241
242 // copy descriptors
243 PUCHAR Buffer = deviceDescriptor->RawDeviceProperties;
244
245 RtlCopyMemory(Buffer, inquiryData->VendorId, FieldLengthVendor);
246 Buffer[FieldLengthVendor] = '\0';
247 Buffer += FieldLengthVendor + 1;
248
249 RtlCopyMemory(Buffer, inquiryData->ProductId, FieldLengthProduct);
250 Buffer[FieldLengthProduct] = '\0';
251 Buffer += FieldLengthProduct + 1;
252
253 RtlCopyMemory(Buffer, inquiryData->ProductRevisionLevel, FieldLengthRevision);
254 Buffer[FieldLengthRevision] = '\0';
255 Buffer += FieldLengthRevision + 1;
256
257 DPRINT("Vendor %s\n",
258 (LPCSTR)((ULONG_PTR)deviceDescriptor + deviceDescriptor->VendorIdOffset));
259 DPRINT("Product %s\n",
260 (LPCSTR)((ULONG_PTR)deviceDescriptor + deviceDescriptor->ProductIdOffset));
261 DPRINT("Revision %s\n",
262 (LPCSTR)((ULONG_PTR)deviceDescriptor + deviceDescriptor->ProductRevisionOffset));
263
264 Irp->IoStatus.Information = TotalLength;
266 goto completeIrp;
267 }
269 {
270 // forward to the lower device
272 return IoCallDriver(lunExt->Common.LowerDevice, Irp);
273 }
275 {
276 // TODO
277 }
278 default:
279 {
281 goto completeIrp;
282 }
283 }
284
285completeIrp:
286 Irp->IoStatus.Status = status;
288 return status;
289}
290
291static
296{
297 PSCSI_PORT_LUN_EXTENSION lunExt = DeviceObject->DeviceExtension;
299
301 ASSERT(!lunExt->Common.IsFDO);
302
303 /* Skip requests that bypassed the class driver. See also cdrom!RequestHandleScsiPassThrough */
306
307 portExt = lunExt->Common.LowerDevice->DeviceExtension;
308
310 Irp,
313}
314
315static
320{
324
326
329
330 portExt = DeviceObject->DeviceExtension;
331 ASSERT(portExt->Common.IsFDO);
332
333 spt = Irp->AssociatedIrp.SystemBuffer;
334 lunExt = GetLunByPath(portExt, spt->PathId, spt->TargetId, spt->Lun);
335 if (!lunExt)
337
339}
340
341static
346{
348 PSCSI_PORT_DEVICE_EXTENSION portExt = DeviceObject->DeviceExtension;
350
351 ASSERT(ioStack->Parameters.DeviceIoControl.InputBufferLength >= sizeof(STORAGE_PROPERTY_QUERY));
352 ASSERT(Irp->AssociatedIrp.SystemBuffer);
353 ASSERT(portExt->Common.IsFDO);
354
355 PSTORAGE_PROPERTY_QUERY PropertyQuery = Irp->AssociatedIrp.SystemBuffer;
356
357 // check property type (handle only StorageAdapterProperty)
358 if (PropertyQuery->PropertyId != StorageAdapterProperty)
359 {
360 if (PropertyQuery->PropertyId == StorageDeviceProperty ||
361 PropertyQuery->PropertyId == StorageDeviceIdProperty)
362 {
364 }
365 else
366 {
368 }
369
370 goto completeIrp;
371 }
372
373 // check query type
374 if (PropertyQuery->QueryType == PropertyExistsQuery)
375 {
376 // device property / adapter property is supported
378 goto completeIrp;
379 }
380
381 if (PropertyQuery->QueryType != PropertyStandardQuery)
382 {
383 // only standard query and exists query are supported
385 goto completeIrp;
386 }
387
388 if (ioStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(STORAGE_ADAPTER_DESCRIPTOR_WIN8))
389 {
390 // buffer too small
391 PSTORAGE_DESCRIPTOR_HEADER DescriptorHeader = Irp->AssociatedIrp.SystemBuffer;
392 ASSERT(ioStack->Parameters.DeviceIoControl.OutputBufferLength
393 >= sizeof(STORAGE_DESCRIPTOR_HEADER));
394
395 // return required size
396 DescriptorHeader->Version = sizeof(STORAGE_ADAPTER_DESCRIPTOR_WIN8);
397 DescriptorHeader->Size = sizeof(STORAGE_ADAPTER_DESCRIPTOR_WIN8);
398
399 Irp->IoStatus.Information = sizeof(STORAGE_DESCRIPTOR_HEADER);
401 goto completeIrp;
402 }
403
404 // get adapter descriptor, information is returned in the same buffer
405 PSTORAGE_ADAPTER_DESCRIPTOR_WIN8 adapterDescriptor = Irp->AssociatedIrp.SystemBuffer;
406
407 // fill out descriptor
408 // NOTE: STORAGE_ADAPTER_DESCRIPTOR_WIN8 may vary in size, so it's important to zero out
409 // all unused fields
410 *adapterDescriptor = (STORAGE_ADAPTER_DESCRIPTOR_WIN8) {
413 .MaximumTransferLength = portExt->PortCapabilities.MaximumTransferLength,
414 .MaximumPhysicalPages = portExt->PortCapabilities.MaximumPhysicalPages,
415 .AlignmentMask = portExt->PortCapabilities.AlignmentMask,
416 .AdapterUsesPio = portExt->PortCapabilities.AdapterUsesPio,
417 .AdapterScansDown = portExt->PortCapabilities.AdapterScansDown,
418 .CommandQueueing = portExt->PortCapabilities.TaggedQueuing,
419 .AcceleratedTransfer = TRUE,
420 .BusType = BusTypeScsi, // FIXME
421 .BusMajorVersion = 2,
422 .BusMinorVersion = 0
423 };
424
425 // store returned length
426 Irp->IoStatus.Information = sizeof(STORAGE_ADAPTER_DESCRIPTOR_WIN8);
428
429completeIrp:
430 Irp->IoStatus.Status = status;
432 return status;
433}
434
435/**********************************************************************
436 * NAME INTERNAL
437 * ScsiPortDeviceControl
438 *
439 * DESCRIPTION
440 * Answer requests for device control calls
441 *
442 * RUN LEVEL
443 * PASSIVE_LEVEL
444 *
445 * ARGUMENTS
446 * Standard dispatch arguments
447 *
448 * RETURNS
449 * NTSTATUS
450 */
451
453NTAPI
456 _In_ PIRP Irp)
457{
459 PSCSI_PORT_COMMON_EXTENSION comExt = DeviceObject->DeviceExtension;
464
465 DPRINT("ScsiPortDeviceControl()\n");
466
467 Irp->IoStatus.Information = 0;
468
470 IoControlCode = Stack->Parameters.DeviceIoControl.IoControlCode;
471
472 switch (IoControlCode)
473 {
475 {
476 DPRINT(" IOCTL_STORAGE_QUERY_PROPERTY\n");
477
479 {
481 break;
482 }
483
484 if (comExt->IsFDO)
486 else
488 }
490 {
491 DPRINT(" IOCTL_SCSI_GET_ADDRESS\n");
492
493 if (comExt->IsFDO)
494 {
496 break;
497 }
498
499 PSCSI_ADDRESS address = Irp->AssociatedIrp.SystemBuffer;
500 if (!VerifyIrpOutBufferSize(Irp, sizeof(*address)))
501 {
503 break;
504 }
505
506 lunExt = DeviceObject->DeviceExtension;
507 portExt = comExt->LowerDevice->DeviceExtension;
508
509 address->Length = sizeof(SCSI_ADDRESS);
510 address->PortNumber = portExt->PortNumber;
511 address->PathId = lunExt->PathId;
512 address->TargetId = lunExt->TargetId;
513 address->Lun = lunExt->Lun;
514
515 Irp->IoStatus.Information = sizeof(SCSI_ADDRESS);
517 break;
518 }
520 {
521 DPRINT(" IOCTL_SCSI_GET_DUMP_POINTERS\n");
522
523 if (!comExt->IsFDO)
524 {
526 return IoCallDriver(comExt->LowerDevice, Irp);
527 }
528
529 PDUMP_POINTERS dumpPointers = Irp->AssociatedIrp.SystemBuffer;
530 if (!VerifyIrpOutBufferSize(Irp, sizeof(*dumpPointers)))
531 {
533 break;
534 }
535
536 dumpPointers->DeviceObject = DeviceObject;
537 /* More data.. ? */
538
540 Irp->IoStatus.Information = sizeof(DUMP_POINTERS);
541 break;
542 }
544 {
545 DPRINT(" IOCTL_SCSI_GET_CAPABILITIES\n");
546
547 if (!comExt->IsFDO)
548 {
550 break;
551 }
552
554 {
556 break;
557 }
558
559 portExt = DeviceObject->DeviceExtension;
560
561 RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,
562 &portExt->PortCapabilities,
563 sizeof(IO_SCSI_CAPABILITIES));
564
566 Irp->IoStatus.Information = sizeof(IO_SCSI_CAPABILITIES);
567 break;
568 }
570 {
571 DPRINT(" IOCTL_SCSI_GET_INQUIRY_DATA\n");
572
573 if (!comExt->IsFDO)
574 {
576 break;
577 }
578
579 /* Copy inquiry data to the port device extension */
580 status = SpiGetInquiryData(DeviceObject->DeviceExtension, Irp);
581 break;
582 }
584 DPRINT1("IOCTL_SCSI_MINIPORT unimplemented!\n");
586 break;
587
590 {
591 DPRINT(" IOCTL_SCSI_PASS_THROUGH%s\n",
593
594 if (comExt->IsFDO)
596 else
598 break;
599 }
600
603 /* ATA passthrough IOCTLs not supported by MS scsiport */
604 DPRINT1("ATA passthrough IOCTLs not supported: 0x%lX\n", IoControlCode);
606 break;
607
608 default:
609 DPRINT1("unknown ioctl code: 0x%lX\n", IoControlCode);
611 break;
612 }
613
614 /* Complete the request with the given status */
615 Irp->IoStatus.Status = status;
617
618 return status;
619}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
unsigned char UINT8
unsigned int UINT32
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define INQUIRYDATABUFFERSIZE
Definition: cdrw_hw.h:1113
Definition: bufpool.h:45
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR _In_ UCHAR Lun
Definition: classpnp.h:1315
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
LPWSTR Name
Definition: desk.c:124
#define TRUE
Definition: types.h:120
static NTSTATUS SpiGetInquiryData(_In_ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, _In_ PIRP Irp)
Definition: ioctl.c:19
static NTSTATUS FdoHandleQueryProperty(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: ioctl.c:343
static UINT32 GetFieldLength(_In_ PUCHAR Name, _In_ UINT32 MaxLength)
Definition: ioctl.c:125
static NTSTATUS FdoHandleScsiPassthrough(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: ioctl.c:317
static NTSTATUS PdoHandleScsiPassthrough(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: ioctl.c:293
static NTSTATUS PdoHandleQueryProperty(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: ioctl.c:148
NTSTATUS NTAPI ScsiPortDeviceControl(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
Definition: ioctl.c:454
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
GLuint address
Definition: glext.h:9393
#define ASSERT(a)
Definition: mode.c:44
#define _Inout_
Definition: no_sal2.h:162
#define _In_
Definition: no_sal2.h:158
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
Definition: ntbasedef.h:684
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define IOCTL_STORAGE_QUERY_PROPERTY
Definition: ntddstor.h:178
* PSTORAGE_DESCRIPTOR_HEADER
Definition: ntddstor.h:560
STORAGE_DESCRIPTOR_HEADER
Definition: ntddstor.h:560
@ BusTypeScsi
Definition: ntddstor.h:439
* PSTORAGE_DEVICE_DESCRIPTOR
Definition: ntddstor.h:576
@ StorageDeviceIdProperty
Definition: ntddstor.h:514
@ StorageAdapterProperty
Definition: ntddstor.h:513
@ StorageDeviceProperty
Definition: ntddstor.h:512
STORAGE_DEVICE_DESCRIPTOR
Definition: ntddstor.h:576
@ PropertyExistsQuery
Definition: ntddstor.h:506
@ PropertyStandardQuery
Definition: ntddstor.h:505
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IoCompleteRequest
Definition: irp.c:1240
#define IoCallDriver
Definition: irp.c:1225
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:476
#define STATUS_INVALID_PARAMETER_1
Definition: ntstatus.h:475
FORCEINLINE BOOLEAN VerifyIrpInBufferSize(_In_ PIRP Irp, _In_ SIZE_T Size)
Definition: partmgr.h:187
FORCEINLINE BOOLEAN VerifyIrpOutBufferSize(_In_ PIRP Irp, _In_ SIZE_T Size)
Definition: partmgr.h:172
#define IOCTL_SCSI_GET_DUMP_POINTERS
Definition: scsi_port.h:54
#define IOCTL_SCSI_PASS_THROUGH
Definition: scsi_port.h:47
#define IOCTL_SCSI_GET_ADDRESS
Definition: scsi_port.h:52
#define IOCTL_SCSI_GET_CAPABILITIES
Definition: scsi_port.h:50
struct _SCSI_ADAPTER_BUS_INFO SCSI_ADAPTER_BUS_INFO
#define IOCTL_SCSI_PASS_THROUGH_DIRECT
Definition: scsi_port.h:51
#define IOCTL_SCSI_MINIPORT
Definition: scsi_port.h:48
struct _SCSI_INQUIRY_DATA * PSCSI_INQUIRY_DATA
struct _SCSI_BUS_DATA SCSI_BUS_DATA
struct _SCSI_ADDRESS SCSI_ADDRESS
#define IOCTL_SCSI_GET_INQUIRY_DATA
Definition: scsi_port.h:49
struct _IO_SCSI_CAPABILITIES IO_SCSI_CAPABILITIES
struct _SCSI_ADAPTER_BUS_INFO * PSCSI_ADAPTER_BUS_INFO
struct _DUMP_POINTERS DUMP_POINTERS
struct _STORAGE_ADAPTER_DESCRIPTOR_WIN8 STORAGE_ADAPTER_DESCRIPTOR_WIN8
#define IOCTL_ATA_PASS_THROUGH_DIRECT
Definition: ntddscsi.h:41
#define IOCTL_ATA_PASS_THROUGH
Definition: ntddscsi.h:40
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define DPRINT
Definition: sndvol32.h:73
NTSTATUS SptiHandleScsiPassthru(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _In_ ULONG MaximumTransferLength, _In_ ULONG MaximumPhysicalPages)
Handler for the IOCTL_SCSI_PASS_THROUGH and IOCTL_SCSI_PASS_THROUGH_DIRECT requests.
Definition: sptilib.c:888
PSCSI_PORT_LUN_EXTENSION GetLunByPath(_In_ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, _In_ UCHAR PathId, _In_ UCHAR TargetId, _In_ UCHAR Lun)
Definition: pdo.c:68
IO_SCSI_CAPABILITIES PortCapabilities
Definition: scsiport.c:78
PVOID DeviceExtension
Definition: env_spec_w32.h:418
PVOID DeviceObject
Definition: ntddscsi.h:322
UCHAR CommandQueue
Definition: cdrw_hw.h:1125
UCHAR RemovableMedia
Definition: cdrw_hw.h:1119
UCHAR ProductId[16]
Definition: cdrw_hw.h:1133
UCHAR ProductRevisionLevel[4]
Definition: cdrw_hw.h:1134
UCHAR DeviceTypeModifier
Definition: cdrw_hw.h:1118
UCHAR VendorId[8]
Definition: cdrw_hw.h:1132
UCHAR DeviceType
Definition: cdrw_hw.h:1116
BOOLEAN AdapterScansDown
Definition: scsi_port.h:142
struct _IO_STACK_LOCATION::@1701::@1702 DeviceIoControl
union _IO_STACK_LOCATION::@1701 Parameters
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
SCSI_BUS_DATA BusData[1]
Definition: scsi_port.h:106
ULONG InquiryDataOffset
Definition: scsi_port.h:98
UCHAR NumberOfLogicalUnits
Definition: scsi_port.h:96
UCHAR InitiatorBusId
Definition: scsi_port.h:97
LIST_ENTRY LunsListHead
Definition: scsiport.h:187
UCHAR InquiryData[1]
Definition: scsi_port.h:119
ULONG NextInquiryDataOffset
Definition: scsi_port.h:118
ULONG InquiryDataLength
Definition: scsi_port.h:117
BOOLEAN DeviceClaimed
Definition: scsi_port.h:116
PDEVICE_OBJECT LowerDevice
Definition: scsiport.h:139
PDEVICE_OBJECT DeviceObject
Definition: scsiport.h:138
SCSI_PORT_COMMON_EXTENSION Common
Definition: scsiport.h:146
INQUIRYDATA InquiryData
Definition: scsiport.h:158
STORAGE_QUERY_TYPE QueryType
Definition: ntddstor.h:553
STORAGE_PROPERTY_ID PropertyId
Definition: ntddstor.h:552
Definition: ps.c:97
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
#define ALIGN_UP(size, type)
Definition: umtypes.h:91
_In_ ULONG TotalLength
Definition: usbdlib.h:158
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1699
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:325
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
#define IO_NO_INCREMENT
Definition: iotypes.h:598
const char * LPCSTR
Definition: xmlstorage.h:183
unsigned char UCHAR
Definition: xmlstorage.h:181