ReactOS 0.4.15-dev-5667-ged97270
classp.h
Go to the documentation of this file.
1/*++
2
3Copyright (C) Microsoft Corporation, 1991 - 2010
4
5Module Name:
6
7 classp.h
8
9Abstract:
10
11 Private header file for classpnp.sys modules. This contains private
12 structure and function declarations as well as constant values which do
13 not need to be exported.
14
15Author:
16
17Environment:
18
19 kernel mode only
20
21Notes:
22
23
24Revision History:
25
26--*/
27
28#define RTL_USE_AVL_TABLES 0
29
30#include <stddef.h>
31#include <stdarg.h>
32#include <stdlib.h>
33
34#include <ntddk.h>
35
36#ifdef __REACTOS__
37#include <pseh/pseh2.h>
38#endif
39
40#include <scsi.h>
41
42#include <wmidata.h>
43#include <classpnp.h>
44#include <storduid.h>
45
46#if CLASS_INIT_GUID
47#include <initguid.h>
48#endif
49
50#include <mountdev.h>
51#include <ioevent.h>
52#include <ntstrsafe.h>
53#include <ntintsafe.h>
54
55#include <wdmguid.h>
56
57#if (NTDDI_VERSION >= NTDDI_WIN8)
58
59#include <ntpoapi.h>
60
61#include <srbhelper.h>
62
63#endif
64
65#ifdef __REACTOS__
66#undef MdlMappingNoExecute
67#define MdlMappingNoExecute 0
68#define NonPagedPoolNx NonPagedPool
69#define NonPagedPoolNxCacheAligned NonPagedPoolCacheAligned
70#undef POOL_NX_ALLOCATION
71#define POOL_NX_ALLOCATION 0
72#endif
73
74//
75// Set component ID for DbgPrintEx calls
76//
77#ifndef DEBUG_COMP_ID
78#define DEBUG_COMP_ID DPFLTR_CLASSPNP_ID
79#endif
80
81//
82// Include header file and setup GUID for tracing
83//
84#include <storswtr.h>
85#define WPP_GUID_CLASSPNP (FA8DE7C4, ACDE, 4443, 9994, C4E2359A9EDB)
86#ifndef WPP_CONTROL_GUIDS
87#define WPP_CONTROL_GUIDS WPP_CONTROL_GUIDS_NORMAL_FLAGS(WPP_GUID_CLASSPNP)
88#endif
89
90/*
91 * IA64 requires 8-byte alignment for pointers, but the IA64 NT kernel expects 16-byte alignment
92 */
93#ifdef _WIN64
94 #define PTRALIGN DECLSPEC_ALIGN(16)
95#else
96 #define PTRALIGN
97#endif
98
99
101
106
108
109
110#define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I)))
111
112#define CLASSP_REG_SUBKEY_NAME (L"Classpnp")
113
114#define CLASSP_REG_HACK_VALUE_NAME (L"HackMask")
115#define CLASSP_REG_MMC_DETECTION_VALUE_NAME (L"MMCDetectionState")
116#define CLASSP_REG_WRITE_CACHE_VALUE_NAME (L"WriteCacheEnableOverride")
117#define CLASSP_REG_PERF_RESTORE_VALUE_NAME (L"RestorePerfAtCount")
118#define CLASSP_REG_REMOVAL_POLICY_VALUE_NAME (L"UserRemovalPolicy")
119#define CLASSP_REG_IDLE_INTERVAL_NAME (L"IdleInterval")
120#define CLASSP_REG_IDLE_ACTIVE_MAX (L"IdleOutstandingIoMax")
121#define CLASSP_REG_IDLE_PRIORITY_SUPPORTED (L"IdlePrioritySupported")
122#define CLASSP_REG_ACCESS_ALIGNMENT_NOT_SUPPORTED (L"AccessAlignmentQueryNotSupported")
123#define CLASSP_REG_DISBALE_IDLE_POWER_NAME (L"DisableIdlePowerManagement")
124#define CLASSP_REG_IDLE_TIMEOUT_IN_SECONDS (L"IdleTimeoutInSeconds")
125#define CLASSP_REG_DISABLE_D3COLD (L"DisableD3Cold")
126#define CLASSP_REG_QERR_OVERRIDE_MODE (L"QERROverrideMode")
127#define CLASSP_REG_LEGACY_ERROR_HANDLING (L"LegacyErrorHandling")
128#define CLASSP_REG_COPY_OFFLOAD_MAX_TARGET_DURATION (L"CopyOffloadMaxTargetDuration")
129
130#define CLASS_PERF_RESTORE_MINIMUM (0x10)
131#define CLASS_ERROR_LEVEL_1 (0x4)
132#define CLASS_ERROR_LEVEL_2 (0x8)
133#define CLASS_MAX_INTERLEAVE_PER_CRITICAL_IO (0x4)
134
135#define FDO_HACK_CANNOT_LOCK_MEDIA (0x00000001)
136#define FDO_HACK_GESN_IS_BAD (0x00000002)
137#define FDO_HACK_NO_SYNC_CACHE (0x00000004)
138#define FDO_HACK_NO_RESERVE6 (0x00000008)
139#define FDO_HACK_GESN_IGNORE_OPCHANGE (0x00000010)
140
141#define FDO_HACK_VALID_FLAGS (0x0000001F)
142#define FDO_HACK_INVALID_FLAGS (~FDO_HACK_VALID_FLAGS)
143
144/*
145 * Lots of retries of synchronized SCSI commands that devices may not
146 * even support really slows down the system (especially while booting).
147 * (Even GetDriveCapacity may be failed on purpose if an external disk is powered off).
148 * If a disk cannot return a small initialization buffer at startup
149 * in two attempts (with delay interval) then we cannot expect it to return
150 * data consistently with four retries.
151 * So don't set the retry counts as high here as for data SRBs.
152 *
153 * If we find that these requests are failing consecutively,
154 * despite the retry interval, on otherwise reliable media,
155 * then we should either increase the retry interval for
156 * that failure or (by all means) increase these retry counts as appropriate.
157 */
158#define NUM_LOCKMEDIAREMOVAL_RETRIES 1
159#define NUM_MODESENSE_RETRIES 1
160#define NUM_MODESELECT_RETRIES 1
161#define NUM_DRIVECAPACITY_RETRIES 1
162#define NUM_THIN_PROVISIONING_RETRIES 32
163
164#if (NTDDI_VERSION >= NTDDI_WINBLUE)
165
166//
167// New code should use the MAXIMUM_RETRIES value.
168//
169#define NUM_IO_RETRIES MAXIMUM_RETRIES
170#define LEGACY_NUM_IO_RETRIES 8
171
172#else
173
174/*
175 * We retry failed I/O requests at 1-second intervals.
176 * In the case of a failure due to bus reset, we want to make sure that we retry after the allowable
177 * reset time. For SCSI, the allowable reset time is 5 seconds. ScsiPort queues requests during
178 * a bus reset, which should cause us to retry after the reset is over; but the requests queued in
179 * the miniport are failed all the way back to us immediately. In any event, in order to make
180 * extra sure that our retries span the allowable reset time, we should retry more than 5 times.
181 */
182#define NUM_IO_RETRIES 8
183
184#endif // NTDDI_VERSION >= NTDDI_WINBLUE
185
186#define CLASS_FILE_OBJECT_EXTENSION_KEY 'eteP'
187#define CLASSP_VOLUME_VERIFY_CHECKED 0x34
188
189#define CLASS_TAG_PRIVATE_DATA 'CPcS'
190#define CLASS_TAG_SENSE2 '2ScS'
191#define CLASS_TAG_WORKING_SET 'sWcS'
192#define CLASSPNP_POOL_TAG_GENERIC 'pCcS'
193#define CLASSPNP_POOL_TAG_TOKEN_OPERATION 'oTcS'
194#define CLASSPNP_POOL_TAG_SRB 'rScS'
195#define CLASSPNP_POOL_TAG_VPD 'pVcS'
196#define CLASSPNP_POOL_TAG_LOG_MESSAGE 'mlcS'
197#define CLASSPNP_POOL_TAG_ADDITIONAL_DATA 'DAcS'
198#define CLASSPNP_POOL_TAG_FIRMWARE 'wFcS'
199
200//
201// Macros related to Token Operation commands
202//
203#define MAX_LIST_IDENTIFIER MAXULONG
204#define NUM_POPULATE_TOKEN_RETRIES 1
205#define NUM_WRITE_USING_TOKEN_RETRIES 2
206#define NUM_RECEIVE_TOKEN_INFORMATION_RETRIES 2
207#define MAX_TOKEN_OPERATION_PARAMETER_DATA_LENGTH MAXUSHORT
208#define MAX_RECEIVE_TOKEN_INFORMATION_PARAMETER_DATA_LENGTH MAXULONG
209#define MAX_TOKEN_TRANSFER_SIZE MAXULONGLONG
210#define MAX_NUMBER_BLOCKS_PER_BLOCK_DEVICE_RANGE_DESCRIPTOR MAXULONG
211#define DEFAULT_MAX_TARGET_DURATION 4 // 4sec
212#define DEFAULT_MAX_NUMBER_BYTES_PER_SYNC_WRITE_USING_TOKEN (64ULL * 1024 * 1024) // 64MB
213#define MAX_NUMBER_BYTES_PER_SYNC_WRITE_USING_TOKEN (256ULL * 1024 * 1024) // 256MB
214#define MIN_TOKEN_LIST_IDENTIFIERS 256
215#define MAX_TOKEN_LIST_IDENTIFIERS MAXULONG
216#define MAX_NUMBER_BLOCK_DEVICE_DESCRIPTORS 64
217
218#define REG_DISK_CLASS_CONTROL L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Control\\DISK"
219#define REG_MAX_LIST_IDENTIFIER_VALUE L"MaximumListIdentifier"
220
221#define VPD_PAGE_HEADER_SIZE 0x04
222
223
224//
225// Number of times to retry get LBA status in case of an error
226// that can be caused by VPD data change
227//
228
229#define GET_LBA_STATUS_RETRY_COUNT_MAX (2)
230
232extern volatile ULONG TokenOperationListIdentifier;
233
240
241//
242// Definitions from ntos\rtl\time.c
243//
244
246#define SHIFT10000 13
247
248//
249// Constant to help wih various time conversions
250//
251#define CONST_MSECS_PER_SEC 1000
252
253#define Convert100nsToMilliseconds(LARGE_INTEGER) \
254 ( \
255 RtlExtendedMagicDivide((LARGE_INTEGER), Magic10000, SHIFT10000) \
256 )
257
258#define ConvertMillisecondsTo100ns(MILLISECONDS) ( \
259 RtlExtendedIntegerMultiply ((MILLISECONDS), 10000) \
260 )
261
262typedef struct _MEDIA_CHANGE_DETECTION_INFO {
263
264 //
265 // Mutex to synchronize enable/disable requests and media state changes
266 //
267
269
270 //
271 // The current state of the media (present, not present, unknown)
272 // protected by MediaChangeSynchronizationEvent
273 //
274
276
277 //
278 // This is a count of how many time MCD has been disabled. if it is
279 // set to zero, then we'll poll the device for MCN events with the
280 // then-current method (ie. TEST UNIT READY or GESN). this is
281 // protected by MediaChangeMutex
282 //
283
285
286
287 //
288 // The timer value to support media change events. This is a countdown
289 // value used to determine when to poll the device for a media change.
290 // The max value for the timer is 255 seconds. This is not protected
291 // by an event -- simply InterlockedExchanged() as needed.
292 //
293
295
296 //
297 // recent changes allowed instant retries of the MCN irp. Since this
298 // could cause an infinite loop, keep a count of how many times we've
299 // retried immediately so that we can catch if the count exceeds an
300 // arbitrary limit.
301 //
302
304
305 //
306 // use GESN if it's available
307 //
308
309 struct {
315 PMDL Mdl;
318
319 //
320 // If this value is one, then the irp is currently in use.
321 // If this value is zero, then the irp is available.
322 // Use InterlockedCompareExchange() to set from "available" to "in use".
323 // ASSERT that InterlockedCompareExchange() showed previous value of
324 // "in use" when changing back to "available" state.
325 // This also implicitly protects the MediaChangeSrb and SenseBuffer
326 //
327
329
330 //
331 // Pointer to the irp to be used for media change detection.
332 // protected by Interlocked MediaChangeIrpInUse
333 //
334
336
337 //
338 // The srb for the media change detection.
339 // protected by Interlocked MediaChangeIrpInUse
340 //
341
342#if (NTDDI_VERSION >= NTDDI_WIN8)
343 union {
348#else
350#endif
353
354 //
355 // Second timer to keep track of how long the media change IRP has been
356 // in use. If this value exceeds the timeout (#defined) then we should
357 // print out a message to the user and set the MediaChangeIrpLost flag
358 // protected by using Interlocked() operations in ClasspSendMediaStateIrp,
359 // the only routine which should modify this value.
360 //
361
363
364 //
365 // Set by CdRomTickHandler when we determine that the media change irp has
366 // been lost
367 //
368
370
371 //
372 // Buffer size of SenseBuffer
373 //
375
377
378typedef enum {
383
386 ULONG CountDown; // Countdown timer
387 ULONG Period; // Countdown period
388
390
392
393 //
394 // Timestamp of last time the failure prediction info was queried.
395 //
397
399
400
401
402//
403// This struct must always fit within four PVOIDs of info,
404// as it uses the irp's "PVOID DriverContext[4]" to store
405// this info
406//
407typedef struct _CLASS_RETRY_INFO {
410
411typedef struct _CSCAN_LIST {
412
413 //
414 // The current block which has an outstanding request.
415 //
416
418
419 //
420 // The list of blocks past the CurrentBlock to which we're going to do
421 // i/o. This list is maintained in sorted order.
422 //
423
425
426 //
427 // The list of blocks behind the current block for which we'll have to
428 // wait until the next scan across the disk. This is kept as a stack,
429 // the cost of sorting it is taken when it's moved over to be the
430 // running list.
431 //
432
434
436
437//
438// add to the front of this structure to help prevent illegal
439// snooping by other utilities.
440//
441
442
443
449
450#if _MSC_VER >= 1600
451#pragma warning(push)
452#pragma warning(disable:4214) // bit field types other than int
453#endif
454//
455// CLASS_ERROR_LOG_DATA will still use SCSI_REQUEST_BLOCK even
456// when using extended SRB as an extended SRB is too large to
457// fit into. Should revisit this code once classpnp starts to
458// use greater than 16 byte CDB.
459//
460typedef struct _CLASS_ERROR_LOG_DATA {
461 LARGE_INTEGER TickCount; // Offset 0x00
462 ULONG PortNumber; // Offset 0x08
463
464 UCHAR ErrorPaging : 1; // Offset 0x0c
468
470
471 SCSI_REQUEST_BLOCK Srb; // Offset 0x10
472
473 /*
474 * We define the SenseData as the default length.
475 * Since the sense data returned by the port driver may be longer,
476 * SenseData must be at the end of this structure.
477 * For our internal error log, we only log the default length.
478 */
479 SENSE_DATA SenseData; // Offset 0x50 for x86 (or 0x68 for ia64) (ULONG32 Alignment required!)
480
482#if _MSC_VER >= 1600
483#pragma warning(pop)
484#endif
485
486#define NUM_ERROR_LOG_ENTRIES 16
487#define DBG_NUM_PACKET_LOG_ENTRIES (64*2) // 64 send&receive's
488
489#if (NTDDI_VERSION >= NTDDI_WIN8)
490typedef
494 );
495#endif
496
497typedef struct _TRANSFER_PACKET {
498
499 LIST_ENTRY AllPktsListEntry; // entry in fdoData's static AllTransferPacketsList
500 SLIST_ENTRY SlistEntry; // for when in free list (use fast slist)
501
504
505 /*
506 * This is the client IRP that this TRANSFER_PACKET is currently
507 * servicing.
508 */
511
512 /*
513 * Stuff for retrying the transfer.
514 */
515#if (NTDDI_VERSION >= NTDDI_WINBLUE)
516 UCHAR NumRetries; // Total number of retries remaining.
517 UCHAR NumThinProvisioningRetries; //Number of retries carried out so far for a request failed with THIN_PROVISIONING_SOFT_THRESHOLD_ERROR
518 UCHAR NumIoTimeoutRetries; // Number of retries remaining for a timed-out request.
519 UCHAR TimedOut; // Indicates if this packet has timed-out.
520#else
522#endif
525
527 LONGLONG RetryIn100nsUnits;
528
529 /*
530 * Event for synchronizing the transfer (optional).
531 * (Note that we can't have the event in the packet itself because
532 * by the time a thread waits on an event the packet may have
533 * been completed and re-issued.
534 */
536
537 /*
538 * Stuff for retrying during extreme low-memory stress
539 * (when we retry 1 page at a time).
540 * NOTE: These fields are also used for StartIO-based
541 * class drivers, even when not in low memory conditions.
542 */
543 BOOLEAN DriverUsesStartIO; // if this is set, then the below low-mem flags are always used
548
549 /*
550 * Fields used for cancelling the packet.
551 */
552 // BOOLEAN Cancelled;
553 // KEVENT CancelledEvent;
554
555 /*
556 * We keep the buffer and length values here as well
557 * as in the SRB because some miniports return
558 * the transferred length in SRB.DataTransferLength,
559 * and if the SRB failed we need that value again for the retry.
560 * We don't trust the lower stack to preserve any of these values in the SRB.
561 */
565
566 /*
567 * This is a standard SCSI structure that receives a detailed
568 * report about a SCSI error on the hardware.
569 */
571
572 /*
573 * This is the SRB block for this TRANSFER_PACKET.
574 * For IOCTLs, the SRB block includes two DWORDs for
575 * device object and ioctl code; so these must
576 * immediately follow the SRB block.
577 */
578
579#if (NTDDI_VERSION >= NTDDI_WIN8)
581#else
583#endif
584 // ULONG SrbIoctlDevObj; // not handling ioctls yet
585 // ULONG SrbIoctlCode;
586
587 #if DBG
588 LARGE_INTEGER DbgTimeSent;
589 LARGE_INTEGER DbgTimeReturned;
590 ULONG DbgPktId;
591 IRP DbgOriginalIrpCopy;
592 MDL DbgMdlCopy;
593 #endif
594
597
599
600 // The time at which this request was sent to port driver.
602
603#if (NTDDI_VERSION >= NTDDI_WIN8)
604 // ActivityId that is associated with the IRP that this transfer packet services.
606
607 // If non-NULL, called at packet completion with this context.
612#endif
614
615/*
616 * MIN_INITIAL_TRANSFER_PACKETS is the minimum number of packets that
617 * we preallocate at startup for each device (we need at least one packet
618 * to guarantee forward progress during memory stress).
619 * MIN_WORKINGSET_TRANSFER_PACKETS is the number of TRANSFER_PACKETs
620 * we allow to build up and remain for each device;
621 * we _lazily_ work down to this number when they're not needed.
622 * MAX_WORKINGSET_TRANSFER_PACKETS is the number of TRANSFER_PACKETs
623 * that we _immediately_ reduce to when they are not needed.
624 *
625 * The absolute maximum number of packets that we will allocate is
626 * whatever is required by the current activity, up to the memory limit;
627 * as soon as stress ends, we snap down to MAX_WORKINGSET_TRANSFER_PACKETS;
628 * we then lazily work down to MIN_WORKINGSET_TRANSFER_PACKETS.
629 */
630#define MIN_INITIAL_TRANSFER_PACKETS 1
631#define MIN_WORKINGSET_TRANSFER_PACKETS_Client 16
632#define MAX_WORKINGSET_TRANSFER_PACKETS_Client 32
633#define MIN_WORKINGSET_TRANSFER_PACKETS_Server_UpperBound 256
634#define MIN_WORKINGSET_TRANSFER_PACKETS_Server_LowerBound 32
635#define MAX_WORKINGSET_TRANSFER_PACKETS_Server 1024
636#define MIN_WORKINGSET_TRANSFER_PACKETS_SPACES 512
637#define MAX_WORKINGSET_TRANSFER_PACKETS_SPACES 2048
638#define MAX_OUTSTANDING_IO_PER_LUN_DEFAULT 16
639#define MAX_CLEANUP_TRANSFER_PACKETS_AT_ONCE 8192
640
641
642
643typedef struct _PNL_SLIST_HEADER {
649
650//
651// !!! WARNING !!!
652// DO NOT use the following structure in code outside of classpnp
653// as structure will not be guaranteed between OS versions.
654//
655// add to the front of this structure to help prevent illegal
656// snooping by other utilities.
657//
659
660 //
661 // The amount of time allowed for a target to complete a copy offload
662 // operation, in seconds. Default is 4s, but it can be modified via
663 // registry key.
664 //
666
667
668#if (NTDDI_VERSION >= NTDDI_WIN8)
669
670 //
671 // Periodic timer for polling for media change detection, failure prediction
672 // and class tick function.
673 //
674
675#if (NTDDI_VERSION >= NTDDI_WINBLUE)
678#else
680 KDPC TickTimerDpc;
681#endif // (NTDDI_VERSION >= NTDDI_WINBLUE)
682
683 //
684 // Power related and release queue SRBs
685 //
686 union {
690
691 union {
695
696#endif
697
699
700 /*
701 * Flag to detect recursion caused by devices
702 * reporting different capacity per each request
703 */
705
706 //
707 // Local equivalents of MinWorkingSetTransferPackets and MaxWorkingSetTransferPackets.
708 // These values are initialized by the global equivalents but are then adjusted as
709 // requested by the class driver.
710 //
713
714#if DBG
715
716 ULONG MaxOutstandingIOPerLUN;
717
718#endif
719
720 /*
721 * Entry in static list used by debug extension to quickly find all class FDOs.
722 */
724
725 //
726 // this private structure allows us to
727 // dynamically re-enable the perf benefits
728 // lost due to transient error conditions.
729 // in w2k, a reboot was required. :(
730 //
731 struct {
734 ULONG ReEnableThreshhold; // 0 means never
736
738
740
741 // Legacy. Still used by obsolete legacy code.
742 struct {
743 LARGE_INTEGER Delta; // in ticks
744 LARGE_INTEGER Tick; // when it should fire
745 PCLASS_RETRY_INFO ListHead; // singly-linked list
747 KSPIN_LOCK Lock; // protective spin lock
748 KDPC Dpc; // DPC routine object
749 KTIMER Timer; // timer to fire DPC
751
755
756 //
757 // privately allocated release queue irp
758 // protected by fdoExtension->ReleaseQueueSpinLock
759 //
762
763 /*
764 * Queues for TRANSFER_PACKETs that contextualize the IRPs and SRBs
765 * that we send down to the port driver.
766 * (The free list is an slist so that we can use fast
767 * interlocked operations on it; but the relatively-static
768 * AllTransferPacketsList list has to be
769 * a doubly-linked list since we have to dequeue from the middle).
770 */
773
774 /*
775 * Queue for deferred client irps
776 */
778
779 /*
780 * Precomputed maximum transfer length for the hardware.
781 */
783
784 /*
785 * SCSI_REQUEST_BLOCK template preconfigured with the constant values.
786 * This is slapped into the SRB in the TRANSFER_PACKET for each transfer.
787 */
788
789#if (NTDDI_VERSION >= NTDDI_WIN8)
791#else
793#endif
794
796
797 /*
798 * For non-removable media, we read the drive capacity at start time and cache it.
799 * This is so that ReadDriveCapacity failures at runtime (e.g. due to memory stress)
800 * don't cause I/O on the paging disk to start failing.
801 */
804
805 //
806 // Idle priority support flag
807 //
809
810 //
811 // Tick timer enabled
812 //
814
816
817 /*
818 * Circular array of timestamped logs of errors that occurred on this device.
819 */
822
823 //
824 // Number of outstanding critical Io requests from Mm
825 //
827
828 //
829 // Maximum number of normal Io requests that can be interleaved with the critical ones
830 //
832
833 //
834 // The timestamp when entering throttle mode
835 //
837
838 //
839 // The timestamp when exiting throttle mode
840 //
842
843 //
844 // The longest time ever spent in throttle mode
845 //
847
848 #if DBG
849 ULONG DbgMaxPktId;
850
851 /*
852 * Logging fields for ForceUnitAccess and Flush
853 */
854 BOOLEAN DbgInitFlushLogging; // must reset this to 1 for each logging session
855 ULONG DbgNumIORequests;
856 ULONG DbgNumFUAs; // num I/O requests with ForceUnitAccess bit set
857 ULONG DbgNumFlushes; // num SRB_FUNCTION_FLUSH_QUEUE
858 ULONG DbgIOsSinceFUA;
859 ULONG DbgIOsSinceFlush;
860 ULONG DbgAveIOsToFUA; // average number of I/O requests between FUAs
861 ULONG DbgAveIOsToFlush; // ...
862 ULONG DbgMaxIOsToFUA;
863 ULONG DbgMaxIOsToFlush;
864 ULONG DbgMinIOsToFUA;
865 ULONG DbgMinIOsToFlush;
866
867 /*
868 * Debug log of previously sent packets (including retries).
869 */
870 ULONG DbgPacketLogNextIndex;
872 #endif
873
874 //
875 // Spin lock for low priority I/O list
876 //
878
879 //
880 // Queue for low priority I/O
881 //
883
884 //
885 // Timer for low priority I/O
886 //
888
889 //
890 // DPC for low priority I/O
891 //
893
894#if (NTDDI_VERSION >= NTDDI_WIN8)
895
896 //
897 // Time (ms) since the completion of the last non-idle request before the
898 // first idle request should be issued. Due to the coarseness of the idle
899 // timer frequency, some variability in the idle interval will be tolerated
900 // such that it is the desired idle interval on average.
901 //
903
904 //
905 // Max number of active idle requests.
906 //
908
909#endif
910
911 //
912 // Idle duration required to process idle request
913 // to avoid starvation
914 //
916
917 //
918 // Idle I/O count
919 //
921
922 //
923 // Flag to indicate timer status
924 //
926
927 //
928 // Time when the Idle timer was started
929 //
931
932 //
933 // Normal priority I/O time
934 //
936
937 //
938 // Time when the last IO of any priority completed.
939 //
941
942 //
943 // Count of active normal priority I/O
944 //
946
947 //
948 // Count of active idle priority I/O
949 //
951
952 //
953 // Support for class drivers to extend
954 // the interpret sense information routine
955 // and retry history per-packet. Copy of
956 // values in driver extension.
957 //
959
960 //
961 // power process parameters. they work closely with CLASS_POWER_CONTEXT structure.
962 //
965
966 //
967 // Indicates legacy error handling should be used.
968 // This means:
969 // - Max number of retries for an IO request is 8 (instead of 4).
970 //
972
973 //
974 // Maximum number of retries allowed for IO requests for this device.
975 //
977
978 //
979 // Disable All Throttling in case of Error
980 //
982
983};
984
985//
986// !!! WARNING !!!
987// DO NOT use the following structure in code outside of classpnp
988// as structure will not be guaranteed between OS versions.
989//
990// EX_RUNDOWN_REF_CACHE_AWARE is variable size and follows
991// RemoveLockFailAcquire. EX_RUNDOWN_REF_CACHE_AWARE must be part
992// of the device extension allocation to avoid issues with a device
993// that has been PNP remove but still has outstanding references.
994// In this case, the removed object may still receive incoming requests.
995//
996// There are code dependencies on the structure layout. To minimize
997// code changes, new fields to _CLASS_PRIVATE_COMMON_DATA should be
998// added based on the following guidance.
999// - Fixed size: beginning of _CLASS_PRIVATE_COMMON_DATA
1000// - Variable size: at the end of _CLASS_PRIVATE_COMMON_DATA after the
1001// last variable size field.
1002//
1003
1005
1006 //
1007 // Cacheaware rundown lock reference
1008 //
1009
1011
1012 //
1013 // N.B. EX_RUNDOWN_REF_CACHE_AWARE begins with a pointer-sized item that is
1014 // accessed interlocked, and must be aligned on ARM platforms. In order
1015 // for this to work on ARM64, an additional 32-bit slot must be allocated.
1016 //
1017
1018#if defined(_WIN64)
1019 LONG Align;
1020#endif
1021
1022 // EX_RUNDOWN_REF_CACHE_AWARE (variable size) follows
1023
1024};
1025
1026//
1027// Verify that the size of _CLASS_PRIVATE_COMMON_DATA is pointer size aligned
1028// to ensure the EX_RUNDOWN_REF_CACHE_AWARE following it is properly aligned.
1029//
1030
1031C_ASSERT((sizeof(struct _CLASS_PRIVATE_COMMON_DATA) % sizeof(PVOID)) == 0);
1032
1037
1039
1041
1042 //
1043 // Upper offload read DSM irp.
1044 //
1045
1047
1048 //
1049 // A pseudo-irp is used despite the operation being async. This is in
1050 // contrast to normal read and write, which let TransferPktComplete()
1051 // complete the upper IRP directly. Offload requests are enough different
1052 // that it makes more sense to let them manage their own async steps with
1053 // minimal help from TransferPktComplete() (just a continuation function
1054 // call during TransferPktComplete()).
1055 //
1056
1058
1059 //
1060 // The offload read context tracks one packet in flight at a time - it'll be
1061 // the POPULATE TOKEN packet first, then RECEIVE ROD TOKEN INFORMATION.
1062 //
1063 // This field exists only for debug purposes.
1064 //
1065
1067
1069
1071
1073
1075
1076 //
1077 // Total sectors that the operation is attempting to process.
1078 //
1079
1081
1082 //
1083 // Total sectors actually processed.
1084 //
1085
1087
1088 //
1089 // Total upper request size in bytes.
1090 //
1091
1093
1094 //
1095 // Just a cached copy of what was in the transfer packet.
1096 //
1097
1099
1100 //
1101 // Pointer into the token part of the SCSI buffer (the buffer immediately
1102 // after this struct), for easy reference.
1103 //
1104
1106
1107 // The SCSI buffer (in/out buffer, not CDB) for the commands immediately
1108 // follows this struct, so no need to have a field redundantly pointing to
1109 // the buffer.
1111
1112
1114
1116
1118
1121
1123
1128
1131
1134
1136
1138
1142
1144
1145 //
1146 // Per-WUT (WRITE USING TOKEN), not overall.
1147 //
1148
1151
1153
1155
1156 //
1157 // Just a cached copy of what was in the transfer packet.
1158 //
1159
1161
1163
1165
1166
1177
1183
1184
1185#define QERR_SET_ZERO_ODX_OR_TP_ONLY 0
1186#define QERR_SET_ZERO_ALWAYS 1
1187#define QERR_SET_ZERO_NEVER 2
1188
1189
1190#define MIN(a, b) ((a) < (b) ? (a) : (b))
1191#define MAX(a, b) ((a) > (b) ? (a) : (b))
1192
1193
1194#define NOT_READY_RETRY_INTERVAL 10
1195#define MINIMUM_RETRY_UNITS ((LONGLONG)32)
1196#define MODE_PAGE_DATA_SIZE 192
1197
1198#define CLASS_IDLE_INTERVAL_MIN 12 // 12 milliseconds
1199#define CLASS_IDLE_INTERVAL 12 // 12 milliseconds
1200#define CLASS_STARVATION_INTERVAL 500 // 500 milliseconds
1201
1202//
1203// Value of 50 milliseconds in 100 nanoseconds units
1204//
1205#define FIFTY_MS_IN_100NS_UNITS 50 * 100
1206
1207
1208/*
1209 * Simple singly-linked-list queuing macros, with no synchronization.
1210 */
1212{
1213 SListHdr->Next = NULL;
1214}
1216{
1217 SListEntry->Next = SListHdr->Next;
1218 SListHdr->Next = SListEntry;
1219}
1221{
1222 SINGLE_LIST_ENTRY *sListEntry = SListHdr->Next;
1223 if (sListEntry){
1224 SListHdr->Next = sListEntry->Next;
1225 sListEntry->Next = NULL;
1226 }
1227 return sListEntry;
1228}
1230{
1231 return (SListHdr->Next == NULL);
1232}
1233
1235BOOLEAN
1238 PIRP Irp
1239 )
1240{
1241#ifndef __REACTOS__
1243 return ((ioPriority <= IoPriorityLow) && (FdoData->IdlePrioritySupported == TRUE));
1244#else
1245 return (FdoData->IdlePrioritySupported == TRUE);
1246#endif
1247}
1248
1250VOID
1252 PIRP Irp,
1254 )
1255{
1256#ifndef __REACTOS__
1257// truncation is not an issue for this use case
1258// nonstandard extension used is not an issue for this use case
1259#pragma warning(suppress:4305; suppress:4213)
1260 ((BOOLEAN)Irp->Tail.Overlay.DriverContext[1]) = Idle;
1261#else
1262 ((PULONG_PTR)Irp->Tail.Overlay.DriverContext)[1] = Idle;
1263#endif
1264}
1265
1267BOOLEAN
1269 PIRP Irp
1270 )
1271{
1272#ifdef _MSC_VER
1273#pragma warning(suppress:4305) // truncation is not an issue for this use case
1274#endif
1275 return ((BOOLEAN)Irp->Tail.Overlay.DriverContext[1]);
1276}
1277
1281 VOID
1282 )
1283{
1284 LARGE_INTEGER currentTime;
1285
1286#ifndef __REACTOS__
1287 currentTime.QuadPart = KeQueryUnbiasedInterruptTimePrecise((ULONG64*)&currentTime.QuadPart);
1288#else
1289 currentTime = KeQueryPerformanceCounter(NULL);
1290#endif
1291
1292 return currentTime;
1293}
1294
1298 ULONGLONG TimeDiff
1299 )
1300{
1301 TimeDiff /= (10 * 1000);
1302
1303 return TimeDiff;
1304}
1305
1307BOOLEAN
1310 )
1311{
1312 return SupportInfo->LBProvisioningData.LBPU;
1313}
1314
1316BOOLEAN
1319 )
1320{
1321 //
1322 // We only support thinly provisioned devices that also support UNMAP.
1323 //
1324 if (SupportInfo->LBProvisioningData.ProvisioningType == PROVISIONING_TYPE_THIN &&
1325 SupportInfo->LBProvisioningData.LBPU == TRUE)
1326 {
1327 return TRUE;
1328 }
1329
1330 return FALSE;
1331}
1332
1334BOOLEAN
1337 )
1338{
1339 if ( (FdoExtension->MiniportDescriptor != NULL) &&
1340 (FdoExtension->MiniportDescriptor->Portdriver == StoragePortCodeSetSCSIport) ) {
1341 return TRUE;
1342 }
1343
1344 return FALSE;
1345}
1346
1347
1348ULONG
1351 _In_ ULONG BytesPerBlockInBigEndian
1352 );
1353
1354DRIVER_INITIALIZE DriverEntry;
1355
1356DRIVER_UNLOAD ClassUnload;
1357
1361
1365 IN PIRP Irp
1366 );
1367
1368VOID
1371 );
1372
1376 IN PIRP Irp,
1379 );
1380
1384
1387
1390
1394 );
1395
1399
1402
1403
1404//
1405// Class internal routines
1406//
1407
1408DRIVER_ADD_DEVICE ClassAddDevice;
1409
1411
1412VOID
1415 PIRP Irp,
1417 BOOLEAN Associated,
1418 LONGLONG TimeDelta100ns
1419 );
1420
1424 IN PIRP Irp,
1426 );
1427
1431 IN PIRP Irp
1432 );
1433
1438 OUT PDEVICE_RELATIONS *DeviceRelations
1439 );
1440
1446 );
1447
1452 );
1453
1454DRIVER_STARTIO ClasspStartIo;
1455
1459 IN PIRP Irp,
1461 );
1462
1466 PIRP Irp,
1468 );
1469
1473 IN PIRP Irp,
1475 );
1476
1477VOID
1480 );
1481
1482VOID
1485 );
1486
1487VOID
1490 );
1491
1495);
1496
1497VOID
1500);
1501
1502#if (NTDDI_VERSION >= NTDDI_WINBLUE)
1503BOOLEAN
1506);
1507#endif
1508
1512 PIRP Irp
1513 );
1514
1527
1528VOID
1531 );
1532
1536 _In_ PIRP Irp,
1538 );
1539
1540//
1541// routines for dictionary list support
1542//
1543
1544VOID
1546 IN PDICTIONARY Dictionary
1547 );
1548
1549BOOLEAN
1551 IN PDICTIONARY Dictionary
1552 );
1553
1556 IN PDICTIONARY Dictionary,
1558 IN ULONG Size,
1559 IN ULONG Tag,
1560 OUT PVOID *Entry
1561 );
1562
1563PVOID
1565 IN PDICTIONARY Dictionary,
1567 );
1568
1569VOID
1571 IN PDICTIONARY Dictionary,
1572 IN PVOID Entry
1573 );
1574
1575
1579 );
1580
1581VOID
1584 );
1585
1586IO_COMPLETION_ROUTINE ClassReleaseQueueCompletion;
1587
1588VOID
1591 IN PIRP ReleaseQueueIrp
1592 );
1593
1594VOID
1597);
1598
1599//
1600// class power routines
1601//
1602
1605
1607NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
1610 IN PIRP Irp
1611 );
1612
1617 );
1618
1619POWER_SETTING_CALLBACK ClasspPowerSettingCallback;
1620
1621//
1622// Child list routines
1623//
1624
1625VOID
1630 );
1631
1637 );
1638
1639VOID
1642 );
1643
1644KDEFERRED_ROUTINE ClasspRetryRequestDpc;
1645
1646VOID
1650 );
1651
1652VOID
1654 IN PDEVICE_OBJECT SelfDeviceObject,
1655 IN PIRP Irp,
1656 _In_ _In_range_(0,MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) // this is 100 seconds; already an assert in classpnp based on this
1657 IN LONGLONG TimeDelta100ns // in 100ns units
1658 );
1659
1660VOID
1663 _In_ PIRP Irp,
1665 );
1666
1670 );
1671
1675 );
1676
1681 );
1682
1683VOID
1686 );
1687
1688VOID
1691 );
1692
1693VOID
1694NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
1698 );
1699
1703 );
1704
1705VOID
1708 );
1709VOID
1712 );
1713
1714IO_WORKITEM_ROUTINE ClasspUpdateDiskProperties;
1715
1717PTRANSFER_PACKET NewTransferPacket(PDEVICE_OBJECT Fdo);
1724IO_COMPLETION_ROUTINE TransferPktComplete;
1735VOID SetupModeSenseTransferPacket(TRANSFER_PACKET *Pkt, PKEVENT SyncEventPtr, PVOID ModeSenseBuffer, UCHAR ModeSenseBufferLen, UCHAR PageMode, UCHAR SubPage, PIRP OriginalIrp, UCHAR PageControl);
1736VOID SetupModeSelectTransferPacket(TRANSFER_PACKET *Pkt, PKEVENT SyncEventPtr, PVOID ModeSelectBuffer, UCHAR ModeSelectBufferLen, BOOLEAN SavePages, PIRP OriginalIrp);
1747
1751VOID
1752ClasspSetupPopulateTokenTransferPacket(
1753 _In_ __drv_aliasesMem POFFLOAD_READ_CONTEXT OffloadReadContext,
1756 _In_reads_bytes_(Length) PUCHAR PopulateTokenBuffer,
1759 );
1760
1764VOID
1765ClasspSetupReceivePopulateTokenInformationTransferPacket(
1766 _In_ POFFLOAD_READ_CONTEXT OffloadReadContext,
1769 _In_reads_bytes_(Length) PUCHAR ReceivePopulateTokenInformationBuffer,
1772 );
1773
1777VOID
1778ClasspSetupWriteUsingTokenTransferPacket(
1779 _In_ __drv_aliasesMem POFFLOAD_WRITE_CONTEXT OffloadWriteContext,
1782 _In_reads_bytes_(Length) PUCHAR WriteUsingTokenBuffer,
1785 );
1786
1790VOID
1791ClasspSetupReceiveWriteUsingTokenInformationTransferPacket(
1792 _In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext,
1795 _In_reads_bytes_(Length) PUCHAR ReceiveWriteUsingTokenInformationBuffer,
1798 );
1799
1802 _In_reads_bytes_(Length) PCHAR ModeSenseBuffer,
1806 );
1807
1811 _In_reads_bytes_(Length) PCHAR ModeSelectBuffer,
1813 _In_ BOOLEAN SavePages
1814 );
1815
1818 _In_ PIRP Irp,
1820 );
1821
1824 _In_ PIRP Irp,
1826 );
1827
1830 _In_ PIRP Irp,
1832 );
1833
1837 );
1838
1842 );
1843
1847 _In_ ULONG SrbSize,
1848 _Out_ PCLASS_VPD_B0_DATA BlockLimitsData
1849 );
1850
1853 _In_ PIRP Irp,
1855 );
1856
1861 );
1862
1865 _In_ PIRP Irp,
1868 );
1869
1874 );
1875
1878 _In_ PCLASS_VPD_B0_DATA BlockLimitsData,
1880 _In_ ULONGLONG LengthInBytes,
1882 _Inout_ PULONG DsmOutputLength,
1884 _In_ BOOLEAN ConsolidateableBlocksOnly,
1885 _In_ ULONG OutputVersion,
1886 _Out_ PBOOLEAN BlockLimitsDataMayHaveChanged
1887 );
1888
1891 );
1892
1895 );
1896
1899 );
1900
1903 );
1904
1906
1907VOID
1910 _In_ ULONG SenseBufferSize,
1911 _In_ PVOID SenseData,
1912 _In_ UCHAR SrbStatus,
1913 _In_ UCHAR ScsiStatus,
1915 _In_ ULONG CdbLength,
1918 );
1919
1920VOID
1923 );
1924
1925
1928ClasspGetMaximumTokenListIdentifier(
1932 );
1933
1936ClasspGetCopyOffloadMaxDuration(
1940 );
1941
1946ClasspDeviceCopyOffloadProperty(
1950 );
1951
1956ClasspValidateOffloadSupported(
1958 _In_ PIRP Irp
1959 );
1960
1965ClasspValidateOffloadInputParameters(
1967 _In_ PIRP Irp
1968 );
1969
1974 _In_ ULONG ServiceAction,
1975 _Inout_ PULONG CommandBufferLength,
1976 _Out_opt_ PULONG TokenOperationBufferLength,
1977 _Out_opt_ PULONG ReceiveTokenInformationBufferLength
1978 );
1979
1984 _In_ ULONG ServiceAction,
1985 _In_ ULONG MaxParameterBufferLength,
1986 _Out_ PULONG MaxBlockDescriptorsCount,
1987 _Out_ PULONGLONG MaxBlockDescriptorsLength
1988 );
1989
1993VOID
1994ClasspConvertDataSetRangeToBlockDescr(
2003 );
2004
2010 );
2011
2012
2014PUCHAR
2016 _In_reads_(Length) PUCHAR HexBuffer,
2018 _Inout_ PULONG UpdateLength
2019 );
2020
2022BOOLEAN
2024 _In_ ULONG CurrentStatus
2025 )
2026{
2027 BOOLEAN operationCompleted = FALSE;
2028
2029 switch (CurrentStatus) {
2033 case OPERATION_TERMINATED: {
2034
2035 operationCompleted = TRUE;
2036 }
2037 }
2038
2039 return operationCompleted;
2040}
2041
2043BOOLEAN
2045 _In_ PCDB Cdb
2046 )
2047{
2048 BOOLEAN tokenOperation = FALSE;
2049
2050 if (Cdb) {
2051 ULONG opCode = Cdb->AsByte[0];
2052 ULONG serviceAction = Cdb->AsByte[1];
2053
2054 if ((opCode == SCSIOP_POPULATE_TOKEN && serviceAction == SERVICE_ACTION_POPULATE_TOKEN) ||
2055 (opCode == SCSIOP_WRITE_USING_TOKEN && serviceAction == SERVICE_ACTION_WRITE_USING_TOKEN)) {
2056
2057 tokenOperation = TRUE;
2058 }
2059 }
2060
2061 return tokenOperation;
2062}
2063
2065BOOLEAN
2067 _In_ PCDB Cdb
2068 )
2069{
2070 BOOLEAN receiveTokenInformation = FALSE;
2071
2072 if (Cdb) {
2073 ULONG opCode = Cdb->AsByte[0];
2074 ULONG serviceAction = Cdb->AsByte[1];
2075
2077
2078 receiveTokenInformation = TRUE;
2079 }
2080 }
2081
2082 return receiveTokenInformation;
2083}
2084
2086BOOLEAN
2088 _In_ PCDB Cdb
2089 )
2090{
2092
2093 return offloadCommand;
2094}
2095
2096extern LIST_ENTRY AllFdosList;
2097
2098
2099VOID
2102 );
2103
2107 _Out_ PBOOLEAN IsPortable
2108 );
2109
2110VOID
2113 );
2114
2118 );
2119
2120
2124ClassDetermineTokenOperationCommandSupport(
2126 );
2127
2132 );
2133
2138ClassDeviceProcessOffloadRead(
2140 _In_ PIRP Irp,
2142 );
2143
2148ClassDeviceProcessOffloadWrite(
2150 _In_ PIRP Irp,
2152 );
2153
2158ClasspServicePopulateTokenTransferRequest(
2160 _In_ PIRP Irp
2161 );
2162
2164VOID
2166 _In_ POFFLOAD_READ_CONTEXT OffloadReadContext
2167 );
2168
2173ClasspServiceWriteUsingTokenTransferRequest(
2175 _In_ PIRP Irp
2176 );
2177
2179VOID
2181 _In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext
2182 );
2183
2184VOID
2187 _In_ PIRP Irp,
2188 _In_ NTSTATUS CompletionStatus
2189 );
2190
2191VOID
2193 _In_ __drv_freesMem(mem) POFFLOAD_READ_CONTEXT OffloadReadContext
2194 );
2195
2196VOID
2198 _In_ POFFLOAD_READ_CONTEXT OffloadReadContext,
2199 _In_ NTSTATUS CompletionStatus
2200 );
2201
2202// PCONTINUATION_ROUTINE
2203VOID
2206 );
2207
2208// PCONTINUATION_ROUTINE
2209VOID
2212 );
2213
2214VOID
2216 _In_ __drv_aliasesMem POFFLOAD_WRITE_CONTEXT OffloadWriteContext
2217 );
2218
2219VOID
2221 _In_ __drv_freesMem(mem) POFFLOAD_WRITE_CONTEXT OffloadWriteContext
2222 );
2223
2224VOID
2226 _In_ __drv_freesMem(Mem) POFFLOAD_WRITE_CONTEXT OffloadWriteContext,
2227 _In_ NTSTATUS CompletionCausingStatus
2228 );
2229
2230VOID
2232 _In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext,
2233 _In_ NTSTATUS CompletionCausingStatus
2234 );
2235
2236VOID
2239 );
2240
2241VOID
2243 _In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext
2244 );
2245
2249 _In_ BOOLEAN ForceQuery
2250 );
2251
2255 _In_ BOOLEAN ForceQuery,
2256 _Out_ PCLASS_VPD_B0_DATA BlockLimitsData,
2257 _Out_ PULONG GenerationCount
2258 );
2259
2263 _In_ PREAD_CAPACITY16_DATA ReadCapacity16Data
2264 );
2265
2270 );
2271
2277 );
2278
2283 _In_ PIRP Irp
2284 );
2285
2288ClasspPowerActivateDevice(
2290 );
2291
2294ClasspPowerIdleDevice(
2296 );
2297
2298IO_WORKITEM_ROUTINE ClassLogThresholdEvent;
2299
2303 _In_ NTSTATUS IoErrorCode
2304 );
2305
2307
2311 PIRP Irp
2312 );
2313
2314VOID
2317 );
2318
2322 PIRP Irp
2323 );
2324
2325VOID
2328 ULONG HistoryCount
2329 );
2330#define HISTORYINITIALIZERETRYLOGS(_packet) \
2331 { \
2332 if (_packet->RetryHistory != NULL) \
2333 { \
2334 HistoryInitializeRetryLogs( \
2335 _packet->RetryHistory, \
2336 _packet->RetryHistory->TotalHistoryCount \
2337 ); \
2338 } \
2339 }
2340
2341VOID
2344 );
2345#define HISTORYLOGSENDPACKET(_packet) \
2346 { \
2347 if (_packet->RetryHistory != NULL) { \
2348 HistoryLogSendPacket(_packet); \
2349 } \
2350 }
2351
2352VOID
2355 );
2356
2357#define HISTORYLOGRETURNEDPACKET(_packet) \
2358 { \
2359 if (_packet->RetryHistory != NULL) { \
2360 HistoryLogReturnedPacket(_packet); \
2361 } \
2362 }
2363
2364BOOLEAN
2374 LONGLONG * RetryIn100nsUnits
2375 );
2376
2377BOOLEAN
2379 _In_opt_z_ PCHAR StringToMatch,
2381 );
2382
2383
2384
2385#define TRACKING_FORWARD_PROGRESS_PATH1 (0x00000001)
2386#define TRACKING_FORWARD_PROGRESS_PATH2 (0x00000002)
2387#define TRACKING_FORWARD_PROGRESS_PATH3 (0x00000004)
2388
2389
2390VOID
2393 );
2394
2395VOID
2398 );
2399
2400RTL_GENERIC_COMPARE_ROUTINE RemoveTrackingCompareRoutine;
2401
2402RTL_GENERIC_ALLOCATE_ROUTINE RemoveTrackingAllocateRoutine;
2403
2404RTL_GENERIC_FREE_ROUTINE RemoveTrackingFreeRoutine;
2405
2406#if (NTDDI_VERSION >= NTDDI_WIN8)
2407
2408typedef PVOID
2411 );
2412
2413PVOID
2416 );
2417
2418
2422 _In_ USHORT AddressType,
2425 _In_ ULONG NumSrbExData,
2426 ...
2427 );
2428
2432 _In_ USHORT AddressType,
2434 _In_ ULONG NumSrbExData,
2435 ...
2436 );
2437
2438VOID
2442 );
2443
2447 )
2448{
2449 return SrbGetCdb(Pkt->Srb);
2450}
2451
2452//
2453// This inline function calculates number of retries already happened till now for known operation codes
2454// and set the out parameter - TimesAlreadyRetried with the value, returns True
2455//
2456// For unknown operation codes this function will return false and will set TimesAlreadyRetried with zero
2457//
2461 _In_ PCDB Cdb,
2462 _Out_ PULONG TimesAlreadyRetried
2463 )
2464{
2466 PCLASS_PRIVATE_FDO_DATA fdoData = fdoExtension->PrivateFdoData;
2467
2468 if (Cdb->MEDIA_REMOVAL.OperationCode == SCSIOP_MEDIUM_REMOVAL)
2469 {
2470 *TimesAlreadyRetried = NUM_LOCKMEDIAREMOVAL_RETRIES - Pkt->NumRetries;
2471 }
2472 else if ((Cdb->MODE_SENSE.OperationCode == SCSIOP_MODE_SENSE) ||
2473 (Cdb->MODE_SENSE.OperationCode == SCSIOP_MODE_SENSE10))
2474 {
2475 *TimesAlreadyRetried = NUM_MODESENSE_RETRIES - Pkt->NumRetries;
2476 }
2477 else if ((Cdb->CDB10.OperationCode == SCSIOP_READ_CAPACITY) ||
2478 (Cdb->CDB16.OperationCode == SCSIOP_READ_CAPACITY16))
2479 {
2480 *TimesAlreadyRetried = NUM_DRIVECAPACITY_RETRIES - Pkt->NumRetries;
2481 }
2482 else if (IS_SCSIOP_READWRITE(Cdb->CDB10.OperationCode))
2483 {
2484 *TimesAlreadyRetried = fdoData->MaxNumberOfIoRetries - Pkt->NumRetries;
2485 }
2486 else if (Cdb->TOKEN_OPERATION.OperationCode == SCSIOP_POPULATE_TOKEN &&
2488 {
2489 *TimesAlreadyRetried = NUM_POPULATE_TOKEN_RETRIES - Pkt->NumRetries;
2490 }
2491 else if (Cdb->TOKEN_OPERATION.OperationCode == SCSIOP_WRITE_USING_TOKEN &&
2493 {
2494 *TimesAlreadyRetried = NUM_WRITE_USING_TOKEN_RETRIES - Pkt->NumRetries;
2495 }
2497 {
2498 *TimesAlreadyRetried = NUM_RECEIVE_TOKEN_INFORMATION_RETRIES - Pkt->NumRetries;
2499 }
2500
2501 else
2502 {
2503 *TimesAlreadyRetried = 0;
2504 return FALSE;
2505 }
2506
2507
2508 return TRUE;
2509}
2510
2511
2515 )
2516{
2517 return SrbGetSenseInfoBuffer(Pkt->Srb);
2518}
2519
2523 )
2524{
2526}
2527
2528
2532 _In_ PIRP Irp
2533 )
2534{
2535 if (Srb->Function == SRB_FUNCTION_STORAGE_REQUEST_BLOCK)
2536 {
2537 ((PSTORAGE_REQUEST_BLOCK)Srb)->MiniportContext = (PVOID)Irp;
2538 }
2539 else
2540 {
2541 ((PSCSI_REQUEST_BLOCK)Srb)->SrbExtension = (PVOID)Irp;
2542 }
2543}
2544
2546BOOLEAN
2550 )
2551{
2554 (SrbGetSenseInfoBuffer(Srb) != FdoExtension->SenseData))
2555 );
2556}
2557
2559VOID
2563 )
2564{
2568
2573 return;
2574}
2575
2576#endif //NTDDI_WIN8
2577
2578BOOLEAN
2581 );
2582
2584ULONG
2587 _In_ ULONG OffsetInBytes,
2588 _In_ ULONG BaseStructureSizeInBytes
2589 )
2590/*++
2591
2592Routine Description:
2593
2594 This routine returns the maximum size of a buffer that starts at a given offset,
2595 based on the size of the containing structure.
2596
2597Arguments:
2598
2599 BaseAddress - The base address of the structure. The offset is computed relative to this.
2600
2601 OffsetInBytes - (BaseAddress + OffsetInBytes) points to the beginning of the buffer.
2602
2603 BaseStructureSizeInBytes - The size of the structure which contains the buffer.
2604
2605Return Value:
2606
2607 max(BaseStructureSizeInBytes - OffsetInBytes, 0). If any operations wrap around,
2608 the return value is 0.
2609
2610--*/
2611
2612{
2613
2614 ULONG_PTR offsetAddress = ((ULONG_PTR)BaseAddress + OffsetInBytes);
2615
2616 if (offsetAddress < (ULONG_PTR)BaseAddress) {
2617 //
2618 // This means BaseAddress + OffsetInBytes > ULONG_PTR_MAX.
2619 //
2620 return 0;
2621 }
2622
2623 if (OffsetInBytes > BaseStructureSizeInBytes) {
2624 return 0;
2625 }
2626
2627 return BaseStructureSizeInBytes - OffsetInBytes;
2628}
2629
2630
2631BOOLEAN
2634 );
2635
2637BOOLEAN
2640 )
2641{
2642 return ((Status == STATUS_NOT_SUPPORTED) ||
2646}
2647
2648#if defined(__REACTOS__) && (NTDDI_VERSION >= NTDDI_WINBLUE)
2650BOOLEAN
2651ClasspSrbTimeOutStatus (
2653 )
2654{
2655 UCHAR srbStatus = SrbGetSrbStatus(Srb);
2656 return ((srbStatus == SRB_STATUS_BUS_RESET) ||
2657 (srbStatus == SRB_STATUS_TIMEOUT) ||
2658 (srbStatus == SRB_STATUS_COMMAND_TIMEOUT) ||
2659 (srbStatus == SRB_STATUS_ABORTED));
2660}
2661#endif
2662
2667 );
2668
2674 );
2675
2681 );
2682
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
LONG NTSTATUS
Definition: precomp.h:26
VOID History(INT dir, LPTSTR commandline)
Definition: history.c:326
#define _Dispatch_type_(a)
Definition: btrfs_drv.h:204
#define __drv_aliasesMem
Definition: btrfs_drv.h:203
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
_In_ PFCB _In_ LONGLONG StartingOffset
Definition: cdprocs.h:291
_In_ size_t _In_ UCHAR PageMode
Definition: cdrom.h:1326
#define IS_SCSIOP_READWRITE(opCode)
Definition: cdrom.h:803
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG _In_ BOOLEAN _In_opt_ WDFREQUEST OriginalRequest
Definition: cdrom.h:994
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG _In_ BOOLEAN WriteToDevice
Definition: cdrom.h:992
_In_ PREAD_CAPACITY_DATA ReadCapacityBuffer
Definition: cdrom.h:1103
_In_z_ PCHAR TargetString
Definition: cdrom.h:954
#define TEST_FLAG(Flags, Bit)
Definition: cdrom.h:1495
_In_ WDFREQUEST _In_ MEDIA_LOCK_TYPE LockType
Definition: cdrom.h:1335
_In_ ULONG _In_ UCHAR _In_ UCHAR PageControl
Definition: cdrom.h:1319
#define MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS
Definition: cdromp.h:50
enum _MEDIA_CHANGE_DETECTION_STATE MEDIA_CHANGE_DETECTION_STATE
MEDIA_LOCK_TYPE
Definition: cdromp.h:288
#define SCSIOP_MODE_SENSE10
Definition: cdrw_hw.h:946
#define SCSIOP_MEDIUM_REMOVAL
Definition: cdrw_hw.h:902
#define SCSIOP_READ_CAPACITY
Definition: cdrw_hw.h:904
#define SCSIOP_MODE_SENSE
Definition: cdrw_hw.h:896
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
Definition: bufpool.h:45
VOID CleanupTransferPacketToWorkingSetSize(_In_ PDEVICE_OBJECT Fdo, _In_ BOOLEAN LimitNumPktToDelete, _In_ ULONG Node)
Definition: xferpkt.c:1615
VOID ClassQueueResourceExhaustionEventWorker(_In_ PDEVICE_OBJECT DeviceObject)
Definition: utils.c:5528
NTSTATUS InitializeStorageRequestBlock(_Inout_bytecount_(ByteSize) PSTORAGE_REQUEST_BLOCK Srb, _In_ USHORT AddressType, _In_ ULONG ByteSize, _In_ ULONG NumSrbExData,...)
Definition: srblib.c:206
NTSTATUS ClasspDeviceLBProvisioningProperty(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:2894
struct _OPCODE_SENSE_DATA_IO_LOG_MESSAGE_CONTEXT_HEADER * POPCODE_SENSE_DATA_IO_LOG_MESSAGE_CONTEXT_HEADER
GUID ClassGuidSrbSupport
Definition: data.c:218
_IRQL_requires_same_ NTSTATUS ClasspGetTokenOperationDescriptorLimits(_In_ PDEVICE_OBJECT Fdo, _In_ ULONG ServiceAction, _In_ ULONG MaxParameterBufferLength, _Out_ PULONG MaxBlockDescriptorsCount, _Out_ PULONGLONG MaxBlockDescriptorsLength)
Definition: utils.c:7472
IO_WORKITEM_ROUTINE ClassLogResourceExhaustionEvent
Definition: classp.h:2306
#define NUM_WRITE_USING_TOKEN_RETRIES
Definition: classp.h:205
FORCEINLINE ULONGLONG ClasspTimeDiffToMs(ULONGLONG TimeDiff)
Definition: classp.h:1297
BOOLEAN StepLowMemRetry(PTRANSFER_PACKET Pkt)
Definition: retry.c:706
FORCEINLINE VOID ClasspMarkIrpAsIdle(PIRP Irp, BOOLEAN Idle)
Definition: classp.h:1251
BOOLEAN ClasspUpdateTimerNoWakeTolerance(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:3653
_In_z_ PWSTR _Out_ PULONG MaximumListIdentifier
Definition: classp.h:1932
VOID NTAPI ClasspScanForClassHacks(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN ULONG_PTR Data)
Definition: class.c:12634
FORCEINLINE BOOLEAN ClasspIsTokenOperationComplete(_In_ ULONG CurrentStatus)
Definition: classp.h:2023
NTSTATUS ClasspWriteCacheProperty(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:1199
NTSTATUS ClasspDeviceTrimProcess(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ PGUID ActivityId, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:3476
struct _CLASS_RETRY_INFO * PCLASS_RETRY_INFO
_IRQL_requires_same_ VOID ClasspReceiveWriteUsingTokenInformation(_In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext)
Definition: class.c:15937
VOID ClasspZeroQERR(_In_ PDEVICE_OBJECT DeviceObject)
Definition: utils.c:7938
VOID ClassQueueCapacityChangedEventWorker(_In_ PDEVICE_OBJECT DeviceObject)
Definition: utils.c:5637
VOID ClasspQueueLogIOEventWithContextWorker(_In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG SenseBufferSize, _In_ PVOID SenseData, _In_ UCHAR SrbStatus, _In_ UCHAR ScsiStatus, _In_ ULONG ErrorCode, _In_ ULONG CdbLength, _In_opt_ PCDB Cdb, _In_opt_ PTRANSFER_PACKET Pkt)
Definition: utils.c:6010
NTSTATUS ClassPnpStartDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: class.c:1819
struct _OFFLOAD_WRITE_CONTEXT OFFLOAD_WRITE_CONTEXT
_In_ PTRANSFER_PACKET _In_ ULONG _In_ PIRP OriginalIrp
Definition: classp.h:1757
NTSTATUS ClasspAllocatePowerProcessIrp(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
_IRQL_requires_same_ NTSTATUS ClasspStorageEventNotification(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
Definition: utils.c:7826
VOID ClasspFreeDeviceMdl(PMDL Mdl)
Definition: utils.c:615
NTSTATUS ClasspMediaChangeCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
FORCEINLINE VOID SimpleInitSlistHdr(SINGLE_LIST_ENTRY *SListHdr)
Definition: classp.h:1211
VOID HistoryLogSendPacket(TRANSFER_PACKET *Pkt)
Definition: history.c:45
NTSTATUS ClassDeviceHwFirmwareDownloadProcess(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:8541
NTSTATUS ClassGetPdoId(IN PDEVICE_OBJECT Pdo, IN BUS_QUERY_ID_TYPE IdType, IN PUNICODE_STRING IdString)
Definition: class.c:10151
PIRP DequeueDeferredClientIrp(PDEVICE_OBJECT Fdo)
Definition: clntirp.c:113
NTSTATUS NTAPI ClassMinimalPowerHandler(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: power.c:1890
_In_ PVOID _Inout_ PULONG _In_ ULONG MaxBlockDescrCount
Definition: classp.h:1998
VOID ClasspContinueOffloadWrite(_In_ __drv_aliasesMem POFFLOAD_WRITE_CONTEXT OffloadWriteContext)
Definition: class.c:15187
NTSTATUS ClasspDeviceGetLBAStatus(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:3861
VOID SetupModeSenseTransferPacket(TRANSFER_PACKET *Pkt, PKEVENT SyncEventPtr, PVOID ModeSenseBuffer, UCHAR ModeSenseBufferLen, UCHAR PageMode, UCHAR SubPage, PIRP OriginalIrp, UCHAR PageControl)
Definition: xferpkt.c:1365
FORCEINLINE BOOLEAN ClasspIsOffloadDataTransferCommand(_In_ PCDB Cdb)
Definition: classp.h:2087
NTSTATUS CreateStorageRequestBlock(_Inout_ PSTORAGE_REQUEST_BLOCK *Srb, _In_ USHORT AddressType, _In_opt_ PSRB_ALLOCATE_ROUTINE AllocateRoutine, _Inout_opt_ ULONG *ByteSize, _In_ ULONG NumSrbExData,...)
Definition: srblib.c:249
NTSTATUS ClassIoCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
struct _OFFLOAD_READ_CONTEXT OFFLOAD_READ_CONTEXT
FORCEINLINE BOOLEAN ClasspSupportsUnmap(_In_ PCLASS_FUNCTION_SUPPORT_INFO SupportInfo)
Definition: classp.h:1308
NTSTATUS ClasspRefreshFunctionSupportInfo(_Inout_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ BOOLEAN ForceQuery)
Definition: class.c:16395
_In_ PTRANSFER_PACKET _In_ ULONG _In_ PIRP _In_ ULONG ListIdentifier
Definition: classp.h:1759
NTSTATUS ClasspInitializeTimer(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:3737
CLASSPNP_SCAN_FOR_SPECIAL_INFO ClassBadItems[]
Definition: data.c:43
FORCEINLINE LARGE_INTEGER ClasspGetCurrentTime(VOID)
Definition: classp.h:1280
VOID FreeDeviceInputMdl(PMDL Mdl)
Definition: utils.c:622
NTSTATUS ClasspPersistentReserve(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:6211
_In_ PTRANSFER_PACKET Pkt
Definition: classp.h:1754
DRIVER_ADD_DEVICE ClassAddDevice
Definition: classp.h:1408
NTSTATUS InterpretReadCapacity16Data(_Inout_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ PREAD_CAPACITY16_DATA ReadCapacity16Data)
Definition: utils.c:1517
FORCEINLINE SINGLE_LIST_ENTRY * SimplePopSlist(SINGLE_LIST_ENTRY *SListHdr)
Definition: classp.h:1220
VOID ClasspFreeReleaseRequest(IN PDEVICE_OBJECT Fdo)
Definition: class.c:11525
ULONG ClasspCalculateLogicalSectorSize(_In_ PDEVICE_OBJECT Fdo, _In_ ULONG BytesPerBlockInBigEndian)
Definition: utils.c:1483
VOID RetryRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, PSCSI_REQUEST_BLOCK Srb, BOOLEAN Associated, LONGLONG TimeDelta100ns)
Definition: obsolete.c:359
NTSTATUS ClasspBlockLimitsDataSnapshot(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ BOOLEAN ForceQuery, _Out_ PCLASS_VPD_B0_DATA BlockLimitsData, _Out_ PULONG GenerationCount)
Definition: class.c:16504
VOID ClasspInitializeIdleTimer(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: clntirp.c:175
_IRQL_requires_same_ PUCHAR ClasspBinaryToAscii(_In_reads_(Length) PUCHAR HexBuffer, _In_ ULONG Length, _Inout_ PULONG UpdateLength)
Definition: utils.c:7717
struct _IO_RETRIED_LOG_MESSAGE_CONTEXT IO_RETRIED_LOG_MESSAGE_CONTEXT
VOID ClasspCompleteOffloadRead(_In_ POFFLOAD_READ_CONTEXT OffloadReadContext, _In_ NTSTATUS CompletionStatus)
Definition: class.c:14255
VOID ClasspPerfIncrementSuccessfulIo(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: utils.c:486
NTSTATUS ClasspDuidQueryProperty(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: utils.c:997
LIST_ENTRY AllFdosList
Definition: data.c:29
PVOID ScreenStateNotificationHandle
Definition: class.c:124
VOID(* PCONTINUATION_ROUTINE)(_In_ PVOID Context)
Definition: classp.h:492
IO_COMPLETION_ROUTINE TransferPktComplete
Definition: classp.h:1724
struct _FAILURE_PREDICTION_INFO * PFAILURE_PREDICTION_INFO
VOID ClasspCompleteOffloadWrite(_In_ __drv_freesMem(Mem) POFFLOAD_WRITE_CONTEXT OffloadWriteContext, _In_ NTSTATUS CompletionCausingStatus)
Definition: class.c:15788
VOID EnqueueFreeTransferPacket(PDEVICE_OBJECT Fdo, __drv_aliasesMem PTRANSFER_PACKET Pkt)
Definition: xferpkt.c:529
IO_WORKITEM_ROUTINE_EX CleanupTransferPacketToWorkingSetSizeWorker
Definition: classp.h:1745
DRIVER_STARTIO ClasspStartIo
Definition: classp.h:1454
NTSTATUS ClasspLogSystemEventWithDeviceNumber(_In_ PDEVICE_OBJECT DeviceObject, _In_ NTSTATUS IoErrorCode)
Definition: utils.c:5354
DRIVER_INITIALIZE DriverEntry
Definition: classp.h:1354
NTSTATUS ClassQueryPnpCapabilities(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PDEVICE_CAPABILITIES Capabilities)
Definition: class.c:10192
VOID InitializeDictionary(IN PDICTIONARY Dictionary)
Definition: dictlib.c:58
NTSTATUS InitializeTransferPackets(PDEVICE_OBJECT Fdo)
Definition: xferpkt.c:45
NTSTATUS ClasspAccessAlignmentProperty(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:1700
BOOLEAN ClasspIsThinProvisioningError(_In_ PSCSI_REQUEST_BLOCK _Srb)
Definition: utils.c:9127
struct _OFFLOAD_WRITE_CONTEXT * POFFLOAD_WRITE_CONTEXT
struct _CSCAN_LIST CSCAN_LIST
KDEFERRED_ROUTINE TransferPacketRetryTimerDpc
Definition: classp.h:1727
IO_COMPLETION_ROUTINE ClassReleaseQueueCompletion
Definition: classp.h:1586
VOID ClasspDisablePowerNotification(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
NTSTATUS ClasspAllocateReleaseRequest(IN PDEVICE_OBJECT Fdo)
Definition: class.c:11489
BOOLEAN RetryTransferPacket(PTRANSFER_PACKET Pkt)
Definition: retry.c:453
BOOLEAN TestDictionarySignature(IN PDICTIONARY Dictionary)
Definition: dictlib.c:70
struct _PNL_SLIST_HEADER * PPNL_SLIST_HEADER
struct _IO_RETRIED_LOG_MESSAGE_CONTEXT * PIO_RETRIED_LOG_MESSAGE_CONTEXT
ULONG MaxTokenOperationListIdentifier
Definition: class.c:107
_Inout_ PIRP _Inout_ PSCSI_REQUEST_BLOCK Srb
Definition: classp.h:1950
VOID FreeDictionaryEntry(IN PDICTIONARY Dictionary, IN PVOID Entry)
Definition: dictlib.c:189
IO_WORKITEM_ROUTINE ClassLogThresholdEvent
Definition: classp.h:2298
PTRANSFER_PACKET DequeueFreeTransferPacket(PDEVICE_OBJECT Fdo, BOOLEAN AllocIfNeeded)
Definition: xferpkt.c:656
VOID ClasspUninitializeRemoveTracking(_In_ PDEVICE_OBJECT DeviceObject)
Definition: lock.c:529
VOID ClasspReceiveWriteUsingTokenInformationDone(_In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext, _In_ NTSTATUS CompletionCausingStatus)
Definition: class.c:15695
DRIVER_UNLOAD ClassUnload
Definition: classp.h:1356
VOID ClasspReceiveWriteUsingTokenInformationTransferPacketDone(_In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext)
Definition: class.c:16071
NTSTATUS ClasspModeSelect(_In_ PDEVICE_OBJECT Fdo, _In_reads_bytes_(Length) PCHAR ModeSelectBuffer, _In_ ULONG Length, _In_ BOOLEAN SavePages)
Definition: class.c:6919
FORCEINLINE ULONG ClasspGetMaxUsableBufferLengthFromOffset(_In_ PVOID BaseAddress, _In_ ULONG OffsetInBytes, _In_ ULONG BaseStructureSizeInBytes)
Definition: classp.h:2585
GUID ClassGuidSenseInfo2
Definition: data.c:216
GUID ClassGuidWorkingSet
Definition: data.c:217
struct _OFFLOAD_READ_CONTEXT * POFFLOAD_READ_CONTEXT
GUID ClassGuidQueryRegInfoEx
Definition: data.c:215
FORCEINLINE BOOLEAN ClasspLowerLayerNotSupport(_In_ NTSTATUS Status)
Definition: classp.h:2638
FORCEINLINE BOOLEAN SimpleIsSlistEmpty(SINGLE_LIST_ENTRY *SListHdr)
Definition: classp.h:1229
#define NUM_DRIVECAPACITY_RETRIES
Definition: classp.h:161
VOID SetupDriveCapacityTransferPacket(TRANSFER_PACKET *Pkt, PVOID ReadCapacityBuffer, ULONG ReadCapacityBufferLen, PKEVENT SyncEventPtr, PIRP OriginalIrp, BOOLEAN Use16ByteCdb)
Definition: xferpkt.c:1480
FORCEINLINE BOOLEAN ClasspIsObsoletePortDriver(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: classp.h:1335
_IRQL_requires_same_ NTSTATUS ClasspGetTokenOperationCommandBufferLength(_In_ PDEVICE_OBJECT Fdo, _In_ ULONG ServiceAction, _Inout_ PULONG CommandBufferLength, _Out_opt_ PULONG TokenOperationBufferLength, _Out_opt_ PULONG ReceiveTokenInformationBufferLength)
Definition: utils.c:7356
FORCEINLINE BOOLEAN ClasspIsIdleRequest(PIRP Irp)
Definition: classp.h:1268
VOID ClasspCleanupProtectedLocks(IN PFILE_OBJECT_EXTENSION FsContext)
Definition: create.c:296
struct _CLASS_RETRY_INFO CLASS_RETRY_INFO
enum _CLASS_DETECTION_STATE CLASS_DETECTION_STATE
ULONG ClassMaxInterleavePerCriticalIo
Definition: class.c:88
NTSTATUS ClasspMcnControl(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PIRP Irp, IN PSCSI_REQUEST_BLOCK Srb)
Definition: autorun.c:3276
VOID DestroyAllTransferPackets(PDEVICE_OBJECT Fdo)
Definition: xferpkt.c:288
VOID ClasspGetInquiryVpdSupportInfo(_Inout_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: class.c:12914
PMDL ClasspBuildDeviceMdl(PVOID Buffer, ULONG BufferLen, BOOLEAN WriteToDevice)
Definition: utils.c:582
VOID DestroyTransferPacket(_In_ __drv_freesMem(mem) PTRANSFER_PACKET Pkt)
Definition: xferpkt.c:500
FORCEINLINE VOID SimplePushSlist(SINGLE_LIST_ENTRY *SListHdr, SINGLE_LIST_ENTRY *SListEntry)
Definition: classp.h:1215
#define NUM_LOCKMEDIAREMOVAL_RETRIES
Definition: classp.h:158
ULONG ClasspModeSense(_In_ PDEVICE_OBJECT Fdo, _In_reads_bytes_(Length) PCHAR ModeSenseBuffer, _In_ ULONG Length, _In_ UCHAR PageMode, _In_ UCHAR PageControl)
Definition: class.c:6681
#define DBG_NUM_PACKET_LOG_ENTRIES
Definition: classp.h:487
VOID EnqueueDeferredClientIrp(PDEVICE_OBJECT Fdo, PIRP Irp)
Definition: clntirp.c:78
_In_ PVOID _Inout_ PULONG _In_ ULONG _Inout_ PULONG _In_ ULONGLONG _Inout_ PDEVICE_DATA_SET_RANGE _Inout_ PULONGLONG TotalSectorsProcessed
Definition: classp.h:2003
NTSTATUS ClasspDeviceGetLBProvisioningVPDPage(_In_ PDEVICE_OBJECT DeviceObject, _Inout_opt_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:2350
struct _FAILURE_PREDICTION_INFO FAILURE_PREDICTION_INFO
VOID SetupModeSelectTransferPacket(TRANSFER_PACKET *Pkt, PKEVENT SyncEventPtr, PVOID ModeSelectBuffer, UCHAR ModeSelectBufferLen, BOOLEAN SavePages, PIRP OriginalIrp)
Definition: xferpkt.c:1425
VOID ClasspScanForSpecialInRegistry(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: class.c:12651
KGUARDED_MUTEX IdlePowerFDOListMutex
Definition: class.c:114
NTSTATUS ClasspDeviceGetBlockDeviceCharacteristicsVPDPage(_In_ PFUNCTIONAL_DEVICE_EXTENSION fdoExtension, _In_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:2072
NTSTATUS AllocateDictionaryEntry(IN PDICTIONARY Dictionary, IN ULONGLONG Key, IN ULONG Size, IN ULONG Tag, OUT PVOID *Entry)
IO_WORKITEM_ROUTINE ClasspLogIOEventWithContext
Definition: classp.h:1905
_In_ PVOID BlockDescr
Definition: classp.h:1996
FORCEINLINE BOOLEAN ClasspIsThinProvisioned(_In_ PCLASS_FUNCTION_SUPPORT_INFO SupportInfo)
Definition: classp.h:1317
NTSTATUS ClasspGetLBProvisioningInfo(_Inout_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: class.c:13087
RTL_GENERIC_FREE_ROUTINE RemoveTrackingFreeRoutine
Definition: classp.h:2404
NTSTATUS ClasspInitializeGesn(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PMEDIA_CHANGE_DETECTION_INFO Info)
Definition: autorun.c:1990
VOID ClasspBuildRequestEx(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ PIRP Irp, _In_ __drv_aliasesMem PSCSI_REQUEST_BLOCK Srb)
Definition: obsolete.c:537
NTSTATUS ClassDeviceHwFirmwareGetInfoProcess(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: utils.c:8366
#define NUM_ERROR_LOG_ENTRIES
Definition: classp.h:486
VOID ClassRetryRequest(IN PDEVICE_OBJECT SelfDeviceObject, IN PIRP Irp, _In_ _In_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) IN LONGLONG TimeDelta100ns)
Definition: class.c:12317
NTSTATUS ClasspPagingNotificationCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PDEVICE_OBJECT RealDeviceObject)
struct _TRANSFER_PACKET * PTRANSFER_PACKET
NTSTATUS ClasspCreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: create.c:123
struct _CSCAN_LIST * PCSCAN_LIST
_IRQL_requires_same_ VOID ClasspReceivePopulateTokenInformation(_In_ POFFLOAD_READ_CONTEXT OffloadReadContext)
Definition: class.c:14374
VOID ClasspWriteUsingTokenTransferPacketDone(_In_ PVOID Context)
Definition: class.c:15519
NTSTATUS ClasspPriorityHint(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: utils.c:6480
VOID ClasspCompleteIdleRequest(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: clntirp.c:713
NTSTATUS ClasspDeviceGetLBAStatusWorker(_In_ PDEVICE_OBJECT DeviceObject, _In_ PCLASS_VPD_B0_DATA BlockLimitsData, _In_ ULONGLONG StartingOffset, _In_ ULONGLONG LengthInBytes, _Out_ PDEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT DsmOutput, _Inout_ PULONG DsmOutputLength, _Inout_ PSCSI_REQUEST_BLOCK Srb, _In_ BOOLEAN ConsolidateableBlocksOnly, _In_ ULONG OutputVersion, _Out_ PBOOLEAN BlockLimitsDataMayHaveChanged)
Definition: utils.c:4079
BOOLEAN ClasspMyStringMatches(_In_opt_z_ PCHAR StringToMatch, _In_z_ PCHAR TargetString)
Definition: utils.c:51
NTSTATUS ClasspDeviceSeekPenaltyProperty(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:2172
KDEFERRED_ROUTINE ClasspRetryRequestDpc
Definition: classp.h:1644
VOID ClassAddChild(_In_ PFUNCTIONAL_DEVICE_EXTENSION Parent, _In_ PPHYSICAL_DEVICE_EXTENSION Child, _In_ BOOLEAN AcquireLock)
Definition: class.c:12058
NTSTATUS ClasspIsPortable(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _Out_ PBOOLEAN IsPortable)
Definition: class.c:8837
_IRQL_requires_same_ NTSTATUS ClasspGetBlockDeviceTokenLimitsInfo(_Inout_ PDEVICE_OBJECT DeviceObject)
Definition: class.c:13220
NTSTATUS SubmitTransferPacket(PTRANSFER_PACKET Pkt)
Definition: xferpkt.c:850
NTSTATUS ClasspDeviceTrimProperty(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:2730
FORCEINLINE PVOID ClasspTransferPacketGetSenseInfoBuffer(_In_ PTRANSFER_PACKET Pkt)
Definition: classp.h:2513
FORCEINLINE BOOLEAN ClasspIsReceiveTokenInformation(_In_ PCDB Cdb)
Definition: classp.h:2066
VOID HistoryLogReturnedPacket(TRANSFER_PACKET *Pkt)
Definition: history.c:83
ULONG DiskIdleTimeoutInMS
Definition: class.c:132
FORCEINLINE BOOLEAN ClasspIsIdleRequestSupported(PCLASS_PRIVATE_FDO_DATA FdoData, PIRP Irp)
Definition: classp.h:1236
struct _OPCODE_SENSE_DATA_IO_LOG_MESSAGE_CONTEXT_HEADER OPCODE_SENSE_DATA_IO_LOG_MESSAGE_CONTEXT_HEADER
VOID ClasspEnableTimer(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:3857
NTSTATUS ClasspEjectionControl(IN PDEVICE_OBJECT Fdo, IN PIRP Irp, IN MEDIA_LOCK_TYPE LockType, IN BOOLEAN Lock)
Definition: create.c:474
PMDL BuildDeviceInputMdl(PVOID Buffer, ULONG BufferLen)
Definition: utils.c:609
VOID ClasspInitializeRemoveTracking(_In_ PDEVICE_OBJECT DeviceObject)
Definition: lock.c:500
VOID ClasspRegisterMountedDeviceInterface(IN PDEVICE_OBJECT DeviceObject)
Definition: class.c:10970
NTSTATUS ServiceTransferRequest(PDEVICE_OBJECT Fdo, PIRP Irp, BOOLEAN PostToDpc)
Definition: class.c:3341
FORCEINLINE BOOLEAN PORT_ALLOCATED_SENSE_EX(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: classp.h:2547
RTL_GENERIC_ALLOCATE_ROUTINE RemoveTrackingAllocateRoutine
Definition: classp.h:2402
_In_ PVOID _Inout_ PULONG _In_ ULONG _Inout_ PULONG _In_ ULONGLONG MaxLbaCount
Definition: classp.h:2000
VOID TransferPacketQueueRetryDpc(PTRANSFER_PACKET Pkt)
Definition: retry.c:604
PVOID(* PSRB_ALLOCATE_ROUTINE)(_In_ CLONG ByteSize)
Definition: classp.h:2409
enum MEDIA_LOCK_TYPE * PMEDIA_LOCK_TYPE
VOID ClassFreeOrReuseSrb(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN __drv_freesMem(mem) PSCSI_REQUEST_BLOCK Srb)
Definition: obsolete.c:882
FORCEINLINE VOID ClasspSrbSetOriginalIrp(_In_ PSTORAGE_REQUEST_BLOCK_HEADER Srb, _In_ PIRP Irp)
Definition: classp.h:2530
VOID ClassSendEjectionNotification(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:155
_IRQL_requires_same_ NTSTATUS ClasspEnableIdlePower(_In_ PDEVICE_OBJECT DeviceObject)
Definition: power.c:2550
PTRANSFER_PACKET DequeueFreeTransferPacketEx(_In_ PDEVICE_OBJECT Fdo, _In_ BOOLEAN AllocIfNeeded, _In_ ULONG Node)
Definition: xferpkt.c:661
VOID ClasspReceivePopulateTokenInformationTransferPacketDone(_In_ PVOID Context)
Definition: class.c:14504
FORCEINLINE BOOLEAN ClasspIsTokenOperation(_In_ PCDB Cdb)
Definition: classp.h:2044
#define NUM_RECEIVE_TOKEN_INFORMATION_RETRIES
Definition: classp.h:206
VOID ClassQueueThresholdEventWorker(_In_ PDEVICE_OBJECT DeviceObject)
Definition: utils.c:5471
VOID InitLowMemRetry(PTRANSFER_PACKET Pkt, PVOID BufPtr, ULONG Len, LARGE_INTEGER TargetLocation)
Definition: retry.c:670
_In_z_ PWSTR _Out_ PULONG MaxDuration
Definition: classp.h:1940
struct _IDLE_POWER_FDO_LIST_ENTRY * PIDLE_POWER_FDO_LIST_ENTRY
NTSTATUS ClassPnpQueryFdoRelations(IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
Definition: class.c:9843
#define NUM_MODESENSE_RETRIES
Definition: classp.h:159
struct _MEDIA_CHANGE_DETECTION_INFO MEDIA_CHANGE_DETECTION_INFO
CONST LARGE_INTEGER Magic10000
Definition: class.c:89
_CLASS_DETECTION_STATE
Definition: classp.h:444
@ ClassDetectionUnknown
Definition: classp.h:445
@ ClassDetectionUnsupported
Definition: classp.h:446
@ ClassDetectionSupported
Definition: classp.h:447
VOID ClasspDeleteTimer(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:3798
NTSTATUS ClasspDeviceGetBlockLimitsVPDPage(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _Inout_bytecount_(SrbSize) PSCSI_REQUEST_BLOCK Srb, _In_ ULONG SrbSize, _Out_ PCLASS_VPD_B0_DATA BlockLimitsData)
Definition: utils.c:2521
struct _MEDIA_CHANGE_DETECTION_INFO * PMEDIA_CHANGE_DETECTION_INFO
PPHYSICAL_DEVICE_EXTENSION ClassRemoveChild(IN PFUNCTIONAL_DEVICE_EXTENSION Parent, IN PPHYSICAL_DEVICE_EXTENSION Child, IN BOOLEAN AcquireLock)
Definition: class.c:12119
VOID ClasspRetryDpcTimer(IN PCLASS_PRIVATE_FDO_DATA FdoData)
Definition: class.c:12457
VOID ClasspCompleteOffloadRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ NTSTATUS CompletionStatus)
Definition: class.c:13632
BOOLEAN InterpretTransferPacketError(PTRANSFER_PACKET Pkt)
Definition: retry.c:40
FORCEINLINE BOOLEAN ClasspTransferPacketGetNumberOfRetriesDone(_In_ PTRANSFER_PACKET Pkt, _In_ PCDB Cdb, _Out_ PULONG TimesAlreadyRetried)
Definition: classp.h:2459
VOID SetupReadWriteTransferPacket(PTRANSFER_PACKET pkt, PVOID Buf, ULONG Len, LARGE_INTEGER DiskLocation, PIRP OriginalIrp)
Definition: xferpkt.c:718
FORCEINLINE PCDB ClasspTransferPacketGetCdb(_In_ PTRANSFER_PACKET Pkt)
Definition: classp.h:2445
IO_WORKITEM_ROUTINE ClasspUpdateDiskProperties
Definition: classp.h:1714
struct _TRANSFER_PACKET TRANSFER_PACKET
VOID ClassQueueProvisioningTypeChangedEventWorker(_In_ PDEVICE_OBJECT DeviceObject)
Definition: utils.c:5726
VOID ClasspPopulateTokenTransferPacketDone(_In_ PVOID Context)
Definition: class.c:14166
#define NUM_POPULATE_TOKEN_RETRIES
Definition: classp.h:204
struct _CLASS_ERROR_LOG_DATA * PCLASS_ERROR_LOG_DATA
FORCEINLINE VOID FREE_PORT_ALLOCATED_SENSE_BUFFER_EX(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: classp.h:2560
NTSTATUS ClasspAllocateReleaseQueueIrp(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
struct _PNL_SLIST_HEADER PNL_SLIST_HEADER
volatile ULONG TokenOperationListIdentifier
Definition: class.c:108
VOID ClasspCleanupOffloadWriteContext(_In_ __drv_freesMem(mem) POFFLOAD_WRITE_CONTEXT OffloadWriteContext)
Definition: class.c:15902
NTSTATUS ClassReadCapacity16(_Inout_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:1568
NTSTATUS ClassDeviceGetLBProvisioningResources(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:5087
enum _CLASS_DETECTION_STATE * PCLASS_DETECTION_STATE
NTSTATUS ClasspEnqueueIdleRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: clntirp.c:576
NTSTATUS ClassDeviceHwFirmwareActivateProcess(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:8902
VOID ClasspPerfIncrementErrorCount(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: utils.c:432
IO_COMPLETION_ROUTINE ClasspSendSynchronousCompletion
Definition: classp.h:1410
struct _IDLE_POWER_FDO_LIST_ENTRY IDLE_POWER_FDO_LIST_ENTRY
RTL_GENERIC_COMPARE_ROUTINE RemoveTrackingCompareRoutine
Definition: classp.h:2400
VOID ClassInitializeDispatchTables(PCLASS_DRIVER_EXTENSION DriverExtension)
Definition: dispatch.c:38
VOID InterpretCapacityData(PDEVICE_OBJECT Fdo, PREAD_CAPACITY_DATA_EX ReadCapacityData)
Definition: class.c:2640
NTSTATUS ClassRetrieveDeviceRelations(IN PDEVICE_OBJECT Fdo, IN DEVICE_RELATION_TYPE RelationType, OUT PDEVICE_RELATIONS *DeviceRelations)
Definition: class.c:10005
VOID ClasspConvertToScsiRequestBlock(_Out_ PSCSI_REQUEST_BLOCK Srb, _In_ PSTORAGE_REQUEST_BLOCK SrbEx)
Definition: utils.c:6559
_In_ PVOID _Inout_ PULONG CurrentBlockDescrIndex
Definition: classp.h:1997
VOID ClasspDisableTimer(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:3956
VOID SetupEjectionTransferPacket(TRANSFER_PACKET *Pkt, BOOLEAN PreventMediaRemoval, PKEVENT SyncEventPtr, PIRP OriginalIrp)
Definition: xferpkt.c:1315
PVOID PowerSettingNotificationHandle
Definition: class.c:119
BOOLEAN InterpretSenseInfoWithoutHistory(_In_ PDEVICE_OBJECT Fdo, _In_opt_ PIRP OriginalRequest, _In_ PSCSI_REQUEST_BLOCK Srb, UCHAR MajorFunctionCode, ULONG IoDeviceCode, ULONG PreviousRetryCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIn100nsUnits)
Definition: class.c:12844
_In_ PVOID _Inout_ PULONG _In_ ULONG _Inout_ PULONG _In_ ULONGLONG _Inout_ PDEVICE_DATA_SET_RANGE DataSetRange
Definition: classp.h:2001
BOOLEAN ClasspScreenOff
Definition: autorun.c:124
BOOLEAN ClasspFailurePredictionPeriodMissed(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:4391
NTSTATUS ClasspInitializeHotplugInfo(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: class.c:12507
MEDIA_LOCK_TYPE
Definition: classp.h:378
@ SimpleMediaLock
Definition: classp.h:379
@ InternalMediaLock
Definition: classp.h:381
@ SecureMediaLock
Definition: classp.h:380
VOID HistoryInitializeRetryLogs(_Out_ PSRB_HISTORY History, ULONG HistoryCount)
Definition: history.c:36
VOID ClasspCleanupOffloadReadContext(_In_ __drv_freesMem(mem) POFFLOAD_READ_CONTEXT OffloadReadContext)
Definition: class.c:14335
PVOID GetDictionaryEntry(IN PDICTIONARY Dictionary, IN ULONGLONG Key)
Definition: dictlib.c:157
_In_ PVOID _Inout_ PULONG _In_ ULONG _Inout_ PULONG CurrentLbaCount
Definition: classp.h:1999
struct _CLASS_ERROR_LOG_DATA CLASS_ERROR_LOG_DATA
VOID ClasspReleaseQueue(IN PDEVICE_OBJECT DeviceObject, IN PIRP ReleaseQueueIrp)
Definition: class.c:11743
FORCEINLINE UCHAR ClasspTransferPacketGetSenseInfoBufferLength(_In_ PTRANSFER_PACKET Pkt)
Definition: classp.h:2521
NTSTATUS ClasspDeviceMediaTypeProperty(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
Definition: utils.c:1917
LIST_ENTRY IdlePowerFDOList
Definition: class.c:113
PVOID DefaultStorageRequestBlockAllocateRoutine(_In_ CLONG ByteSize)
Definition: srblib.c:28
POWER_SETTING_CALLBACK ClasspPowerSettingCallback
Definition: classp.h:1619
_In_ BUS_QUERY_ID_TYPE IdType
Definition: classpnp.h:374
FORCEINLINE UCHAR GET_FDO_EXTENSON_SENSE_DATA_LENGTH(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: classpnp.h:1437
#define CLASS_SRBEX_NO_SRBEX_DATA_BUFFER_SIZE
Definition: classpnp.h:696
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR MajorFunctionCode
Definition: classpnp.h:484
#define CLASS_SRBEX_SCSI_CDB16_BUFFER_SIZE
Definition: classpnp.h:695
_In_ BUS_QUERY_ID_TYPE _In_ PUNICODE_STRING IdString
Definition: classpnp.h:375
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR _In_ ULONG IoDeviceCode
Definition: classpnp.h:485
FAILURE_PREDICTION_METHOD
Definition: classpnp.h:233
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR _In_ ULONG _In_ ULONG PreviousRetryCount
Definition: classpnp.h:486
NTSTATUS NTAPI ClassSystemControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: classwmi.c:221
_In_ PIRP Irp
Definition: csq.h:116
#define Len
Definition: deflate.h:82
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
NTSTATUS NTAPI ClassReadWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:2431
NTSTATUS NTAPI ClassDeviceControlDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: class.c:7258
NTSTATUS NTAPI ClassDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:894
NTSTATUS NTAPI ClassShutdownFlush(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:8773
NTSTATUS NTAPI ClassCreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: create.c:57
NTSTATUS NTAPI ClassGlobalDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:73
NTSTATUS NTAPI ClassDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: power.c:105
#define ULONG_PTR
Definition: config.h:101
#define SRB_STATUS_BUS_RESET
Definition: srb.h:353
#define SRB_FLAGS_FREE_SENSE_BUFFER
Definition: srb.h:406
#define SRB_STATUS_ABORTED
Definition: srb.h:342
#define SRB_STATUS_TIMEOUT
Definition: srb.h:349
#define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE
Definition: srb.h:413
struct _SCSI_REQUEST_BLOCK * PSCSI_REQUEST_BLOCK
#define SRB_STATUS_COMMAND_TIMEOUT
Definition: srb.h:351
@ FdoExtension
Definition: precomp.h:48
#define _IRQL_requires_same_
Definition: driverspecs.h:232
#define __drv_freesMem(kind)
Definition: driverspecs.h:271
#define _IRQL_requires_min_(irql)
Definition: driverspecs.h:231
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
#define __drv_allocatesMem(kind)
Definition: driverspecs.h:256
#define _IRQL_requires_(irql)
Definition: driverspecs.h:229
int Align(int arg)
Definition: ehframes.cpp:89
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
_Inout_ PLIST_ENTRY _In_ PVOID FsContext
Definition: fltkernel.h:2239
pPkgPnp m_DeviceInterfaceLock AcquireLock(pFxDriverGlobals)
Status
Definition: gdiplustypes.h:25
LARGE_INTEGER NTAPI KeQueryPerformanceCounter(IN PLARGE_INTEGER PerformanceFreq)
Definition: timer.c:138
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
#define C_ASSERT(e)
Definition: intsafe.h:73
unsigned __int64 ULONG64
Definition: imports.h:198
#define _Out_opt_
Definition: ms_sal.h:346
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Inout_
Definition: ms_sal.h:378
#define _In_z_
Definition: ms_sal.h:313
#define _In_opt_z_
Definition: ms_sal.h:314
#define _Deref_out_range_(lb, ub)
Definition: ms_sal.h:575
#define _Inout_opt_
Definition: ms_sal.h:379
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define _Inout_bytecount_(size)
Definition: ms_sal.h:936
#define _In_range_(lb, ub)
Definition: ms_sal.h:571
#define _In_reads_(size)
Definition: ms_sal.h:319
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
DRIVER_DISPATCH(nfs41_FsdDispatch)
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:383
#define DECLSPEC_CACHEALIGN
Definition: ntbasedef.h:264
@ Idle
Definition: ntdd8042.h:62
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
@ StoragePortCodeSetSCSIport
Definition: ntddstor.h:620
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define STATUS_INVALID_PARAMETER_1
Definition: ntstatus.h:475
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
#define CONST
Definition: pedump.c:81
#define BOOLEAN
Definition: pedump.c:73
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
_In_opt_ WDFREQUEST _In_ ULONG _In_ BOOLEAN _In_ PCDB Cdb
Definition: scratch.h:159
#define SERVICE_ACTION_POPULATE_TOKEN
Definition: scsi.h:442
#define SCSIOP_RECEIVE_ROD_TOKEN_INFORMATION
Definition: scsi.h:343
#define SERVICE_ACTION_RECEIVE_TOKEN_INFORMATION
Definition: scsi.h:447
#define PROVISIONING_TYPE_THIN
Definition: scsi.h:2590
@ OPERATION_COMPLETED_WITH_SUCCESS
Definition: scsi.h:3652
@ OPERATION_COMPLETED_WITH_ERROR
Definition: scsi.h:3653
@ OPERATION_COMPLETED_WITH_RESIDUAL_DATA
Definition: scsi.h:3654
@ OPERATION_TERMINATED
Definition: scsi.h:3657
#define SCSIOP_POPULATE_TOKEN
Definition: scsi.h:340
#define SCSIOP_WRITE_USING_TOKEN
Definition: scsi.h:341
#define SERVICE_ACTION_WRITE_USING_TOKEN
Definition: scsi.h:443
#define SCSIOP_READ_CAPACITY16
Definition: scsi.h:364
#define SRB_FUNCTION_STORAGE_REQUEST_BLOCK
Definition: srb.h:99
* PSTORAGE_REQUEST_BLOCK
Definition: srb.h:652
STORAGE_REQUEST_BLOCK
Definition: srb.h:652
struct SRB_ALIGN _STORAGE_REQUEST_BLOCK_HEADER * PSTORAGE_REQUEST_BLOCK_HEADER
FORCEINLINE VOID SrbClearSrbFlags(_In_ PVOID Srb, _In_ ULONG Flags)
Definition: srbhelper.h:982
FORCEINLINE UCHAR SrbGetSrbStatus(_In_ PVOID Srb)
Definition: srbhelper.h:1330
FORCEINLINE VOID SrbSetSenseInfoBufferLength(_In_ PVOID Srb, _In_ UCHAR SenseInfoBufferLength)
Definition: srbhelper.h:675
FORCEINLINE ULONG SrbGetSrbFlags(_In_ PVOID Srb)
Definition: srbhelper.h:927
FORCEINLINE VOID SrbSetSenseInfoBuffer(_In_ PVOID Srb, _In_opt_ PVOID SenseInfoBuffer)
Definition: srbhelper.h:657
FORCEINLINE PVOID SrbGetSenseInfoBuffer(_In_ PVOID Srb)
Definition: srbhelper.h:619
FORCEINLINE UCHAR SrbGetSenseInfoBufferLength(_In_ PVOID Srb)
Definition: srbhelper.h:638
base of all file and directory entries
Definition: entries.h:83
SENSE_DATA SenseData
Definition: classp.h:479
LARGE_INTEGER TickCount
Definition: classp.h:461
SCSI_REQUEST_BLOCK Srb
Definition: classp.h:471
UCHAR PowerSrbBuffer[CLASS_SRBEX_SCSI_CDB16_BUFFER_SIZE]
Definition: classp.h:688
LARGE_INTEGER AntiStarvationStartTime
Definition: classp.h:930
LARGE_INTEGER LastIoCompletionTime
Definition: classp.h:940
BOOLEAN TickTimerEnabled
Definition: classp.h:813
LIST_ENTRY IdleIrpList
Definition: classp.h:882
STORAGE_REQUEST_BLOCK SrbEx
Definition: classp.h:687
BOOLEAN IsCachedDriveCapDataValid
Definition: classp.h:803
BOOLEAN IdlePrioritySupported
Definition: classp.h:808
ULONG MaxInterleavedNormalIo
Definition: classp.h:831
KSPIN_LOCK IdleListLock
Definition: classp.h:877
ULONG LocalMinWorkingSetTransferPackets
Definition: classp.h:711
LIST_ENTRY AllFdosListEntry
Definition: classp.h:723
ULONG MaxPowerOperationRetryCount
Definition: classp.h:963
ULONG LocalMaxWorkingSetTransferPackets
Definition: classp.h:712
LARGE_INTEGER Tick
Definition: classp.h:744
ULONG UpdateDiskPropertiesWorkItemActive
Definition: classp.h:704
UCHAR MaxNumberOfIoRetries
Definition: classp.h:976
STORAGE_HOTPLUG_INFO HotplugInfo
Definition: classp.h:739
BOOLEAN LegacyErrorHandling
Definition: classp.h:971
LIST_ENTRY DeferredClientIrpList
Definition: classp.h:777
LARGE_INTEGER LongestThrottlePeriod
Definition: classp.h:846
PSTORAGE_REQUEST_BLOCK_HEADER SrbTemplate
Definition: classp.h:790
ULONG_PTR HackFlags
Definition: classp.h:737
PCLASS_INTERPRET_SENSE_INFO2 InterpretSenseInfo
Definition: classp.h:958
PEX_TIMER TickTimer
Definition: classp.h:676
LARGE_INTEGER Delta
Definition: classp.h:743
READ_CAPACITY_DATA_EX LastKnownDriveCapacityData
Definition: classp.h:802
BOOLEAN TimerInitialized
Definition: classp.h:752
USHORT StarvationDuration
Definition: classp.h:915
struct _CLASS_PRIVATE_FDO_DATA::@1035 Retry
ULONG CopyOffloadMaxTargetDuration
Definition: classp.h:665
PPNL_SLIST_HEADER FreeTransferPacketsLists
Definition: classp.h:772
LARGE_INTEGER ThrottleStartTime
Definition: classp.h:836
union _CLASS_PRIVATE_FDO_DATA::@1032 PowerSrb
ULONG NumHighPriorityPagingIo
Definition: classp.h:826
BOOLEAN LoggedSYNCFailure
Definition: classp.h:754
KSPIN_LOCK SpinLock
Definition: classp.h:795
struct _CLASS_PRIVATE_FDO_DATA::@1034 Perf
LARGE_INTEGER LastNonIdleIoTime
Definition: classp.h:935
LONGLONG CurrentNoWakeTolerance
Definition: classp.h:677
LARGE_INTEGER ThrottleStopTime
Definition: classp.h:841
UCHAR ReleaseQueueSrbBuffer[CLASS_SRBEX_NO_SRBEX_DATA_BUFFER_SIZE]
Definition: classp.h:693
BOOLEAN ReleaseQueueIrpAllocated
Definition: classp.h:760
BOOLEAN LoggedTURFailureSinceLastIO
Definition: classp.h:753
BOOLEAN DisableThrottling
Definition: classp.h:981
BOOLEAN ReservedBoolean
Definition: classp.h:815
CLASS_ERROR_LOG_DATA ErrorLogs[NUM_ERROR_LOG_ENTRIES]
Definition: classp.h:821
union _CLASS_PRIVATE_FDO_DATA::@1033 ReleaseQueueSrb
LIST_ENTRY AllTransferPacketsList
Definition: classp.h:771
PCLASS_RETRY_INFO ListHead
Definition: classp.h:745
struct _CLASS_RETRY_INFO * Next
Definition: classp.h:408
LIST_ENTRY CurrentSweep
Definition: classp.h:424
LIST_ENTRY NextSweep
Definition: classp.h:433
ULONGLONG BlockNumber
Definition: classp.h:417
PVOID DeviceExtension
Definition: env_spec_w32.h:418
PIO_WORKITEM WorkQueueItem
Definition: classp.h:389
FAILURE_PREDICTION_METHOD Method
Definition: classp.h:385
LARGE_INTEGER LastFailurePredictionQueryTime
Definition: classp.h:396
Definition: classp.h:1033
LIST_ENTRY ListEntry
Definition: classp.h:1034
PDEVICE_OBJECT Fdo
Definition: classp.h:1035
OPCODE_SENSE_DATA_IO_LOG_MESSAGE_CONTEXT_HEADER ContextHeader
Definition: classp.h:1179
Definition: ketypes.h:687
Definition: typedefs.h:120
UCHAR SrbExBuffer[CLASS_SRBEX_SCSI_CDB16_BUFFER_SIZE]
Definition: classp.h:346
SCSI_REQUEST_BLOCK Srb
Definition: classp.h:344
STORAGE_REQUEST_BLOCK SrbEx
Definition: classp.h:345
MEDIA_CHANGE_DETECTION_STATE MediaChangeDetectionState
Definition: classp.h:275
struct _MEDIA_CHANGE_DETECTION_INFO::@1028 Gesn
SCSI_REQUEST_BLOCK MediaChangeSrb
Definition: cdromp.h:250
ULONG ReceiveTokenInformationBufferLength
Definition: classp.h:1074
PTRANSFER_PACKET Pkt
Definition: classp.h:1066
SCSI_REQUEST_BLOCK Srb
Definition: classp.h:1098
ULONGLONG TotalSectorsToProcess
Definition: classp.h:1080
ULONGLONG TotalSectorsProcessed
Definition: classp.h:1086
ULONGLONG EntireXferLen
Definition: classp.h:1092
PDEVICE_OBJECT Fdo
Definition: classp.h:1040
ULONGLONG OperationStartTime
Definition: classp.h:1162
PDEVICE_MANAGE_DATA_SET_ATTRIBUTES DsmAttributes
Definition: classp.h:1124
ULONGLONG TotalRequestSizeSectors
Definition: classp.h:1120
ULONGLONG DataSetRangeByteOffset
Definition: classp.h:1141
ULONGLONG TotalSectorsProcessedSuccessfully
Definition: classp.h:1139
PDEVICE_DATA_SET_RANGE DataSetRanges
Definition: classp.h:1125
ULONGLONG EntireXferLen
Definition: classp.h:1119
BOOLEAN TokenInvalidated
Definition: classp.h:1154
ULONGLONG LogicalBlockOffset
Definition: classp.h:1127
ULONG ReceiveTokenInformationBufferLength
Definition: classp.h:1133
PDEVICE_DSM_OFFLOAD_WRITE_PARAMETERS OffloadWriteParameters
Definition: classp.h:1126
SCSI_REQUEST_BLOCK Srb
Definition: classp.h:1160
PDEVICE_OBJECT Fdo
Definition: classp.h:1115
ULONGLONG MaxLbaCount
Definition: classp.h:1130
PTRANSFER_PACKET Pkt
Definition: classp.h:1143
ULONGLONG TotalSectorsToProcess
Definition: classp.h:1149
ULONGLONG TotalSectorsProcessed
Definition: classp.h:1150
ULONG DbgPeakNumTransferPackets
Definition: classp.h:647
DECLSPEC_CACHEALIGN SLIST_HEADER SListHeader
Definition: classp.h:644
DECLSPEC_CACHEALIGN ULONG NumFreeTransferPackets
Definition: classp.h:645
ULONG NumTotalTransferPackets
Definition: classp.h:646
Definition: ntbasedef.h:628
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:629
UCHAR NumRetries
Definition: classp.h:516
LARGE_INTEGER TargetLocationCopy
Definition: classp.h:564
PSTORAGE_REQUEST_BLOCK_HEADER Srb
Definition: classp.h:580
PUCHAR LowMemRetry_remainingBufPtr
Definition: classp.h:545
SLIST_ENTRY SlistEntry
Definition: classp.h:500
LARGE_INTEGER LowMemRetry_nextChunkTargetLocation
Definition: classp.h:547
SENSE_DATA_EX SrbErrorSenseData
Definition: classp.h:570
UCHAR NumIoTimeoutRetries
Definition: classp.h:518
BOOLEAN UsePartialMdl
Definition: classp.h:595
UCHAR NumThinProvisioningRetries
Definition: classp.h:517
PMDL PartialMdl
Definition: classp.h:596
ULONG BufLenCopy
Definition: classp.h:563
KDPC RetryTimerDPC
Definition: classp.h:524
ULONGLONG RequestStartTime
Definition: classp.h:601
PIRP OriginalIrp
Definition: classp.h:509
BOOLEAN DriverUsesStartIO
Definition: classp.h:543
PSRB_HISTORY RetryHistory
Definition: classp.h:598
BOOLEAN CompleteOriginalIrpWhenLastPacketCompletes
Definition: classp.h:510
ULONGLONG TransferCount
Definition: classp.h:610
PVOID ContinuationContext
Definition: classp.h:609
PDEVICE_OBJECT Fdo
Definition: classp.h:503
ULONG AllocateNode
Definition: classp.h:611
UCHAR TimedOut
Definition: classp.h:519
ULONG LowMemRetry_remainingBufLen
Definition: classp.h:546
KTIMER RetryTimer
Definition: classp.h:523
PKEVENT SyncEventPtr
Definition: classp.h:535
BOOLEAN InLowMemRetry
Definition: classp.h:544
_Field_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG RetryIn100nsUnits
GUID ActivityId
Definition: classp.h:605
PUCHAR BufPtrCopy
Definition: classp.h:562
LIST_ENTRY AllPktsListEntry
Definition: classp.h:499
PCONTINUATION_ROUTINE ContinuationRoutine
Definition: classp.h:608
Definition: mem.c:156
#define SLIST_ENTRY(type)
Definition: queue.h:102
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG_PTR
Definition: typedefs.h:65
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
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
uint64_t ULONGLONG
Definition: typedefs.h:67
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
ULONG CLONG
Definition: umtypes.h:126
Definition: cdrw_hw.h:28
struct _CDB::_CDB10 CDB10
struct _CDB::_MEDIA_REMOVAL MEDIA_REMOVAL
UCHAR AsByte[16]
Definition: scsi.h:1988
struct _CDB::_TOKEN_OPERATION TOKEN_OPERATION
struct _CDB::_MODE_SENSE MODE_SENSE
struct _CDB::_CDB16 CDB16
LONGLONG QuadPart
Definition: typedefs.h:114
Definition: dlist.c:348
#define SrbGetCdb(srb)
Definition: usbstor.h:17
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ DEVICE_RELATION_TYPE RelationType
Definition: wdfdevice.h:1059
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536
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
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
#define FORCEINLINE
Definition: wdftypes.h:67
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_In_ PCEVENT_DESCRIPTOR _In_opt_ LPCGUID ActivityId
Definition: wmifuncs.h:120
struct _EX_TIMER * PEX_TIMER
Definition: extypes.h:291
NTKRNLVISTAAPI IO_PRIORITY_HINT NTAPI IoGetIoPriorityHint(_In_ PIRP Irp)
Definition: io.c:123
_In_opt_ PVPB _In_ PDEVICE_OBJECT RealDeviceObject
Definition: iofuncs.h:1504
#define IRP_MJ_SCSI
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
@ IoPriorityLow
Definition: iotypes.h:1232
#define IRP_MJ_SYSTEM_CONTROL
#define IRP_MJ_FLUSH_BUFFERS
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
enum _IO_PRIORITY_HINT IO_PRIORITY_HINT
#define IRP_MJ_SHUTDOWN
#define IRP_MJ_POWER
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
MDL
Definition: mmtypes.h:117
#define NT_ASSERT
Definition: rtlfuncs.h:3310
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine
Definition: rtlfuncs.h:1089
_IRQL_requires_same_ _In_ CLONG ByteSize
Definition: rtltypes.h:393
unsigned char UCHAR
Definition: xmlstorage.h:181