ReactOS  0.4.14-dev-552-g2fad488
classp.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (C) Microsoft Corporation, 1991 - 1999
4 
5 Module Name:
6 
7  classp.h
8 
9 Abstract:
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 
15 Author:
16 
17 Environment:
18 
19  kernel mode only
20 
21 Notes:
22 
23 
24 Revision History:
25 
26 --*/
27 
28 #ifndef _CLASSPNP_PCH_
29 #define _CLASSPNP_PCH_
30 
31 #include <ntddk.h>
32 #include <classpnp.h>
33 #include <ioevent.h>
34 #include <pseh/pseh2.h>
35 
37 
39 
40 
41 #define CLASSP_REG_SUBKEY_NAME (L"Classpnp")
42 
43 #define CLASSP_REG_HACK_VALUE_NAME (L"HackMask")
44 #define CLASSP_REG_MMC_DETECTION_VALUE_NAME (L"MMCDetectionState")
45 #define CLASSP_REG_WRITE_CACHE_VALUE_NAME (L"WriteCacheEnableOverride")
46 #define CLASSP_REG_PERF_RESTORE_VALUE_NAME (L"RestorePerfAtCount")
47 #define CLASSP_REG_REMOVAL_POLICY_VALUE_NAME (L"UserRemovalPolicy")
48 
49 #define CLASS_PERF_RESTORE_MINIMUM (0x10)
50 #define CLASS_ERROR_LEVEL_1 (0x4)
51 #define CLASS_ERROR_LEVEL_2 (0x8)
52 
53 #define FDO_HACK_CANNOT_LOCK_MEDIA (0x00000001)
54 #define FDO_HACK_GESN_IS_BAD (0x00000002)
55 #define FDO_HACK_NO_SYNC_CACHE (0x00000004)
56 
57 #define FDO_HACK_VALID_FLAGS (0x00000007)
58 #define FDO_HACK_INVALID_FLAGS (~FDO_HACK_VALID_FLAGS)
59 
60 /*
61  * Lots of retries of synchronized SCSI commands that devices may not
62  * even support really slows down the system (especially while booting).
63  * (Even GetDriveCapacity may be failed on purpose if an external disk is powered off).
64  * If a disk cannot return a small initialization buffer at startup
65  * in two attempts (with delay interval) then we cannot expect it to return
66  * data consistently with four retries.
67  * So don't set the retry counts as high here as for data SRBs.
68  *
69  * If we find that these requests are failing consecutively,
70  * despite the retry interval, on otherwise reliable media,
71  * then we should either increase the retry interval for
72  * that failure or (by all means) increase these retry counts as appropriate.
73  */
74 #define NUM_LOCKMEDIAREMOVAL_RETRIES 1
75 #define NUM_MODESENSE_RETRIES 1
76 #define NUM_DRIVECAPACITY_RETRIES 1
77 
78 
79 #define CLASS_FILE_OBJECT_EXTENSION_KEY 'eteP'
80 #define CLASSP_VOLUME_VERIFY_CHECKED 0x34
81 
82 #define CLASS_TAG_PRIVATE_DATA 'CPcS'
83 #define CLASS_TAG_PRIVATE_DATA_FDO 'FPcS'
84 #define CLASS_TAG_PRIVATE_DATA_PDO 'PPcS'
85 
87 
88  //
89  // Mutex to synchronize enable/disable requests and media state changes
90  //
91 
93 
94  //
95  // The current state of the media (present, not present, unknown)
96  // protected by MediaChangeSynchronizationEvent
97  //
98 
100 
101  //
102  // This is a count of how many time MCD has been disabled. if it is
103  // set to zero, then we'll poll the device for MCN events with the
104  // then-current method (ie. TEST UNIT READY or GESN). this is
105  // protected by MediaChangeMutex
106  //
107 
109 
110 
111  //
112  // The timer value to support media change events. This is a countdown
113  // value used to determine when to poll the device for a media change.
114  // The max value for the timer is 255 seconds. This is not protected
115  // by an event -- simply InterlockedExchanged() as needed.
116  //
117 
119 
120  //
121  // recent changes allowed instant retries of the MCN irp. Since this
122  // could cause an infinite loop, keep a count of how many times we've
123  // retried immediately so that we can catch if the count exceeds an
124  // arbitrary limit.
125  //
126 
128 
129  //
130  // use GESN if it's available
131  //
132 
133  struct {
141  } Gesn;
142 
143  //
144  // If this value is one, then the irp is currently in use.
145  // If this value is zero, then the irp is available.
146  // Use InterlockedCompareExchange() to set from "available" to "in use".
147  // ASSERT that InterlockedCompareExchange() showed previous value of
148  // "in use" when changing back to "available" state.
149  // This also implicitly protects the MediaChangeSrb and SenseBuffer
150  //
151 
153 
154  //
155  // Pointer to the irp to be used for media change detection.
156  // protected by Interlocked MediaChangeIrpInUse
157  //
158 
160 
161  //
162  // The srb for the media change detection.
163  // protected by Interlocked MediaChangeIrpInUse
164  //
165 
169 
170  //
171  // Second timer to keep track of how long the media change IRP has been
172  // in use. If this value exceeds the timeout (#defined) then we should
173  // print out a message to the user and set the MediaChangeIrpLost flag
174  // protected by using Interlocked() operations in ClasspSendMediaStateIrp,
175  // the only routine which should modify this value.
176  //
177 
179 
180  //
181  // Set by CdRomTickHandler when we determine that the media change irp has
182  // been lost
183  //
184 
186 
187 };
188 
189 typedef enum {
194 
195 typedef struct _FAILURE_PREDICTION_INFO {
197  ULONG CountDown; // Countdown timer
198  ULONG Period; // Countdown period
199 
201 
204 
205 
206 
207 //
208 // This struct must always fit within four PVOIDs of info,
209 // as it uses the irp's "PVOID DriverContext[4]" to store
210 // this info
211 //
212 typedef struct _CLASS_RETRY_INFO {
215 
216 
217 
218 typedef struct _CSCAN_LIST {
219 
220  //
221  // The current block which has an outstanding request.
222  //
223 
225 
226  //
227  // The list of blocks past the CurrentBlock to which we're going to do
228  // i/o. This list is maintained in sorted order.
229  //
230 
232 
233  //
234  // The list of blocks behind the current block for which we'll have to
235  // wait until the next scan across the disk. This is kept as a stack,
236  // the cost of sorting it is taken when it's moved over to be the
237  // running list.
238  //
239 
241 
243 
244 //
245 // add to the front of this structure to help prevent illegal
246 // snooping by other utilities.
247 //
248 
249 
250 
256 
257 
258 typedef struct _CLASS_ERROR_LOG_DATA {
259  LARGE_INTEGER TickCount; // Offset 0x00
260  ULONG PortNumber; // Offset 0x08
261 
262  UCHAR ErrorPaging : 1; // Offset 0x0c
266 
268 
269  SCSI_REQUEST_BLOCK Srb; // Offset 0x10
270 
271  /*
272  * We define the SenseData as the default length.
273  * Since the sense data returned by the port driver may be longer,
274  * SenseData must be at the end of this structure.
275  * For our internal error log, we only log the default length.
276  */
277  SENSE_DATA SenseData; // Offset 0x50 for x86 (or 0x68 for ia64) (ULONG32 Alignment required!)
279 
280 #define NUM_ERROR_LOG_ENTRIES 16
281 
282 
283 
284 typedef struct _TRANSFER_PACKET {
285 
286  SLIST_ENTRY SlistEntry; // for when in free list (use fast slist)
287  LIST_ENTRY AllPktsListEntry; // entry in fdoData's static AllTransferPacketsList
288 
291 
292  /*
293  * This is the client IRP that this TRANSFER_PACKET is currently
294  * servicing.
295  */
298 
299  /*
300  * Stuff for retrying the transfer.
301  */
306 
307  /*
308  * Event for synchronizing the transfer (optional).
309  * (Note that we can't have the event in the packet itself because
310  * by the time a thread waits on an event the packet may have
311  * been completed and re-issued.
312  */
314 
315  /*
316  * Stuff for retrying during extreme low-memory stress
317  * (when we retry 1 page at a time).
318  */
323 
324  /*
325  * Fields used for cancelling the packet.
326  */
327  // BOOLEAN Cancelled;
328  // KEVENT CancelledEvent;
329 
330  /*
331  * We keep the buffer and length values here as well
332  * as in the SRB because some miniports return
333  * the transferred length in SRB.DataTransferLength,
334  * and if the SRB failed we need that value again for the retry.
335  * We don't trust the lower stack to preserve any of these values in the SRB.
336  */
340 
341  /*
342  * This is a standard SCSI structure that receives a detailed
343  * report about a SCSI error on the hardware.
344  */
346 
347  /*
348  * This is the SRB block for this TRANSFER_PACKET.
349  * For IOCTLs, the SRB block includes two DWORDs for
350  * device object and ioctl code; so these must
351  * immediately follow the SRB block.
352  */
354  // ULONG SrbIoctlDevObj; // not handling ioctls yet
355  // ULONG SrbIoctlCode;
356 
358 
359 /*
360  * MIN_INITIAL_TRANSFER_PACKETS is the minimum number of packets that
361  * we preallocate at startup for each device (we need at least one packet
362  * to guarantee forward progress during memory stress).
363  * MIN_WORKINGSET_TRANSFER_PACKETS is the number of TRANSFER_PACKETs
364  * we allow to build up and remain for each device;
365  * we _lazily_ work down to this number when they're not needed.
366  * MAX_WORKINGSET_TRANSFER_PACKETS is the number of TRANSFER_PACKETs
367  * that we _immediately_ reduce to when they are not needed.
368  *
369  * The absolute maximum number of packets that we will allocate is
370  * whatever is required by the current activity, up to the memory limit;
371  * as soon as stress ends, we snap down to MAX_WORKINGSET_TRANSFER_PACKETS;
372  * we then lazily work down to MIN_WORKINGSET_TRANSFER_PACKETS.
373  */
374 #define MIN_INITIAL_TRANSFER_PACKETS 1
375 #define MIN_WORKINGSET_TRANSFER_PACKETS_Consumer 4
376 #define MAX_WORKINGSET_TRANSFER_PACKETS_Consumer 64
377 #define MIN_WORKINGSET_TRANSFER_PACKETS_Server 64
378 #define MAX_WORKINGSET_TRANSFER_PACKETS_Server 1024
379 #define MIN_WORKINGSET_TRANSFER_PACKETS_Enterprise 256
380 #define MAX_WORKINGSET_TRANSFER_PACKETS_Enterprise 2048
381 
382 
383 //
384 // add to the front of this structure to help prevent illegal
385 // snooping by other utilities.
386 //
388 
389  //
390  // this private structure allows us to
391  // dynamically re-enable the perf benefits
392  // lost due to transient error conditions.
393  // in w2k, a reboot was required. :(
394  //
395  struct {
398  ULONG ReEnableThreshold; // 0 means never
399  } Perf;
400 
402 
404 
405  // Legacy. Still used by obsolete legacy code.
406  struct {
407  LARGE_INTEGER Delta; // in ticks
408  LARGE_INTEGER Tick; // when it should fire
409  PCLASS_RETRY_INFO ListHead; // singly-linked list
410  ULONG Granularity; // static
411  KSPIN_LOCK Lock; // protective spin lock
412  KDPC Dpc; // DPC routine object
413  KTIMER Timer; // timer to fire DPC
414  } Retry;
415 
418 
419  //
420  // privately allocated release queue irp
421  // protected by fdoExtension->ReleaseQueueSpinLock
422  //
425 
426  /*
427  * Queues for TRANSFER_PACKETs that contextualize the IRPs and SRBs
428  * that we send down to the port driver.
429  * (The free list is an slist so that we can use fast
430  * interlocked operations on it; but the relatively-static
431  * AllTransferPacketsList list has to be
432  * a doubly-linked list since we have to dequeue from the middle).
433  */
439 
440  /*
441  * Queue for deferred client irps
442  */
444 
445  /*
446  * Precomputed maximum transfer length for the hardware.
447  */
449 
450  /*
451  * SCSI_REQUEST_BLOCK template preconfigured with the constant values.
452  * This is slapped into the SRB in the TRANSFER_PACKET for each transfer.
453  */
455 
457 
458  /*
459  * Circular array of timestamped logs of errors that occurred on this device.
460  */
463 
464 };
465 
466 
467 #define MIN(a, b) ((a) < (b) ? (a) : (b))
468 #define MAX(a, b) ((a) > (b) ? (a) : (b))
469 
470 
471 #define NOT_READY_RETRY_INTERVAL 10
472 #define MINIMUM_RETRY_UNITS ((LONGLONG)32)
473 
474 
475 /*
476  * Simple singly-linked-list queuing macros, with no synchronization.
477  */
478 static inline VOID SimpleInitSlistHdr(SLIST_ENTRY *SListHdr)
479 {
480  SListHdr->Next = NULL;
481 }
482 static inline VOID SimplePushSlist(SLIST_ENTRY *SListHdr, SLIST_ENTRY *SListEntry)
483 {
484  SListEntry->Next = SListHdr->Next;
485  SListHdr->Next = SListEntry;
486 }
487 static inline SLIST_ENTRY *SimplePopSlist(SLIST_ENTRY *SListHdr)
488 {
489  SLIST_ENTRY *sListEntry = SListHdr->Next;
490  if (sListEntry){
491  SListHdr->Next = sListEntry->Next;
492  sListEntry->Next = NULL;
493  }
494  return sListEntry;
495 }
496 static inline BOOLEAN SimpleIsSlistEmpty(SLIST_ENTRY *SListHdr)
497 {
498  return (SListHdr->Next == NULL);
499 }
500 
501 DRIVER_INITIALIZE DriverEntry;
502 
503 DRIVER_UNLOAD ClassUnload;
504 
506 
507 NTSTATUS
508 NTAPI
511  IN PIRP Irp
512  );
513 
514 VOID
515 NTAPI
518  );
519 
520 NTSTATUS
521 NTAPI
523  IN PDEVICE_OBJECT Fdo,
524  IN PIRP Irp,
525  IN MEDIA_LOCK_TYPE LockType,
526  IN BOOLEAN Lock
527  );
528 
530 
532 
534 
535 NTSTATUS
536 NTAPI
539  );
540 
541 NTSTATUS
542 NTAPI
545  IN PIRP Irp
546  );
547 
549 
550 //
551 // Class internal routines
552 //
553 
554 DRIVER_ADD_DEVICE ClassAddDevice;
555 
556 IO_COMPLETION_ROUTINE ClasspSendSynchronousCompletion;
557 
558 VOID
559 NTAPI
562  PIRP Irp,
564  BOOLEAN Associated,
565  ULONG RetryInterval
566  );
567 
568 NTSTATUS
569 NTAPI
572  IN PIRP Irp,
574  );
575 
576 NTSTATUS
577 NTAPI
579  IN PDEVICE_OBJECT Fdo,
580  IN PIRP Irp
581  );
582 
583 NTSTATUS
584 NTAPI
586  IN PDEVICE_OBJECT Fdo,
587  IN DEVICE_RELATION_TYPE RelationType,
588  OUT PDEVICE_RELATIONS *DeviceRelations
589  );
590 
591 NTSTATUS
592 NTAPI
597  );
598 
599 NTSTATUS
600 NTAPI
604  );
605 
606 DRIVER_STARTIO ClasspStartIo;
607 
608 NTSTATUS
609 NTAPI
612  IN PIRP Irp,
614  );
615 
616 NTSTATUS
617 NTAPI
620  PIRP Irp,
621  PVOID Context
622  );
623 
625 NTAPI
627  IN PCOMMON_DEVICE_EXTENSION CommonExtension,
629  );
630 
631 NTSTATUS
632 NTAPI
635  IN PIRP Irp,
637  );
638 
639 VOID
640 NTAPI
643  );
644 
645 NTSTATUS
646 NTAPI
649  );
650 
651 NTSTATUS
652 NTAPI
655  );
656 
657 //
658 // routines for dictionary list support
659 //
660 
661 VOID
662 NTAPI
664  IN PDICTIONARY Dictionary
665  );
666 
667 BOOLEAN
668 NTAPI
670  IN PDICTIONARY Dictionary
671  );
672 
673 NTSTATUS
674 NTAPI
676  IN PDICTIONARY Dictionary,
677  IN ULONGLONG Key,
678  IN ULONG Size,
679  IN ULONG Tag,
680  OUT PVOID *Entry
681  );
682 
683 PVOID
684 NTAPI
686  IN PDICTIONARY Dictionary,
688  );
689 
690 VOID
691 NTAPI
693  IN PDICTIONARY Dictionary,
694  IN PVOID Entry
695  );
696 
697 
698 NTSTATUS
699 NTAPI
701  IN PDEVICE_OBJECT Fdo
702  );
703 
704 VOID
705 NTAPI
707  IN PDEVICE_OBJECT Fdo
708  );
709 
710 IO_COMPLETION_ROUTINE ClassReleaseQueueCompletion;
711 
712 VOID
713 NTAPI
716  IN PIRP ReleaseQueueIrp
717  );
718 
719 VOID
720 NTAPI
723 );
724 
725 //
726 // class power routines
727 //
728 
730 
731 NTSTATUS
732 NTAPI
735  IN PIRP Irp
736  );
737 
738 //
739 // Child list routines
740 //
741 
742 VOID
743 NTAPI
747  IN BOOLEAN AcquireLock
748  );
749 
751 NTAPI
755  IN BOOLEAN AcquireLock
756  );
757 
758 VOID
759 NTAPI
762  );
763 
764 KDEFERRED_ROUTINE ClasspRetryRequestDpc;
765 
766 VOID
767 NTAPI
771  );
772 
773 VOID
774 NTAPI
776  IN PDEVICE_OBJECT SelfDeviceObject,
777  IN PIRP Irp,
778  IN LARGE_INTEGER TimeDelta100ns // in 100ns units
779  );
780 
781 VOID
782 NTAPI
785  IN PIRP Irp,
787  );
788 
789 NTSTATUS
790 NTAPI
793  );
794 
795 NTSTATUS
796 NTAPI
800  );
801 
802 VOID
803 NTAPI
806  IN const GUID * Guid,
808  IN PVOID ExtraData
809  );
810 
811 VOID
812 NTAPI
815  );
816 
817 VOID
818 NTAPI
821  );
822 
823 VOID
824 NTAPI
828  );
829 
830 NTSTATUS
831 NTAPI
834  );
835 
836 VOID
837 NTAPI
840  );
841 VOID
842 NTAPI
845  );
846 
860 VOID NTAPI InitLowMemRetry(PTRANSFER_PACKET Pkt, PVOID BufPtr, ULONG Len, LARGE_INTEGER TargetLocation);
862 VOID NTAPI SetupEjectionTransferPacket(TRANSFER_PACKET *Pkt, BOOLEAN PreventMediaRemoval, PKEVENT SyncEventPtr, PIRP OriginalIrp);
863 VOID NTAPI SetupModeSenseTransferPacket(TRANSFER_PACKET *Pkt, PKEVENT SyncEventPtr, PVOID ModeSenseBuffer, UCHAR ModeSenseBufferLen, UCHAR PageMode, PIRP OriginalIrp);
864 VOID NTAPI SetupDriveCapacityTransferPacket(TRANSFER_PACKET *Pkt, PVOID ReadCapacityBuffer, ULONG ReadCapacityBufferLen, PKEVENT SyncEventPtr, PIRP OriginalIrp);
869 
870 #include "debug.h"
871 
872 #endif /* _CLASSPNP_PCH_ */
_Inout_ PLIST_ENTRY _In_ PVOID FsContext
Definition: fltkernel.h:2239
static VOID SimpleInitSlistHdr(SLIST_ENTRY *SListHdr)
Definition: classp.h:478
PFILE_OBJECT_EXTENSION NTAPI ClasspGetFsContext(IN PCOMMON_DEVICE_EXTENSION CommonExtension, IN PFILE_OBJECT FileObject)
Definition: create.c:969
#define IN
Definition: typedefs.h:38
enum _MEDIA_CHANGE_DETECTION_STATE MEDIA_CHANGE_DETECTION_STATE
SCSI_REQUEST_BLOCK MediaChangeSrb
Definition: classp.h:166
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
MEDIA_LOCK_TYPE
Definition: classp.h:189
IO_COMPLETION_ROUTINE ClasspSendSynchronousCompletion
Definition: classp.h:556
#define NUM_ERROR_LOG_ENTRIES
Definition: classp.h:280
DRIVER_DISPATCH ClassDispatchPnp
Definition: classp.h:533
_In_ PDEVICE_OBJECT Pdo
Definition: classpnp.h:301
VOID NTAPI ClasspScanForSpecialInRegistry(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: class.c:9101
VOID NTAPI ClasspCleanupProtectedLocks(IN PFILE_OBJECT_EXTENSION FsContext)
Definition: create.c:298
DRIVER_DISPATCH ClassCreateClose
Definition: classp.h:505
static VOID SimplePushSlist(SLIST_ENTRY *SListHdr, SLIST_ENTRY *SListEntry)
Definition: classp.h:482
VOID NTAPI FreeDeviceInputMdl(PMDL Mdl)
Definition: utils.c:509
VOID NTAPI ClassRetryRequest(IN PDEVICE_OBJECT SelfDeviceObject, IN PIRP Irp, IN LARGE_INTEGER TimeDelta100ns)
Definition: class.c:8780
struct _CLASS_RETRY_INFO CLASS_RETRY_INFO
_In_ const GUID _In_ ULONG ExtraDataSize
Definition: classpnp.h:1236
LARGE_INTEGER TickCount
Definition: classp.h:259
_In_ PIRP Irp
Definition: csq.h:116
enum _CLASS_DETECTION_STATE * PCLASS_DETECTION_STATE
_In_ BUS_QUERY_ID_TYPE _In_ PUNICODE_STRING IdString
Definition: classpnp.h:357
unsigned char * PUCHAR
Definition: retypes.h:3
VOID NTAPI EnqueueDeferredClientIrp(PCLASS_PRIVATE_FDO_DATA FdoData, PIRP Irp)
Definition: clntirp.c:31
NTSTATUS NTAPI ClasspEjectionControl(IN PDEVICE_OBJECT Fdo, IN PIRP Irp, IN MEDIA_LOCK_TYPE LockType, IN BOOLEAN Lock)
Definition: create.c:449
VOID NTAPI ClasspRetryDpcTimer(IN PCLASS_PRIVATE_FDO_DATA FdoData)
Definition: class.c:8913
LONG NTSTATUS
Definition: precomp.h:26
static BOOLEAN SimpleIsSlistEmpty(SLIST_ENTRY *SListHdr)
Definition: classp.h:496
NTSTATUS NTAPI ClasspMcnControl(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PIRP Irp, IN PSCSI_REQUEST_BLOCK Srb)
Definition: autorun.c:2890
SENSE_DATA SenseData
Definition: classp.h:277
struct _FAILURE_PREDICTION_INFO FAILURE_PREDICTION_INFO
KSPIN_LOCK SpinLock
Definition: classp.h:456
DRIVER_DISPATCH ClassSystemControl
Definition: classp.h:548
struct _MEDIA_CHANGE_DETECTION_INFO::@1013 Gesn
BOOLEAN LoggedTURFailureSinceLastIO
Definition: classp.h:417
IO_COMPLETION_ROUTINE ClassReleaseQueueCompletion
Definition: classp.h:710
ULONG NumTotalTransferPackets
Definition: classp.h:437
SCSI_REQUEST_BLOCK Srb
Definition: classp.h:353
NTSTATUS NTAPI ClassIoCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
Definition: class2.c:4730
struct _CLASS_ERROR_LOG_DATA CLASS_ERROR_LOG_DATA
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical 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:728
LIST_ENTRY AllPktsListEntry
Definition: classp.h:287
BOOLEAN ReleaseQueueIrpAllocated
Definition: classp.h:423
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1122
LIST_ENTRY AllTransferPacketsList
Definition: classp.h:434
PUCHAR LowMemRetry_remainingBufPtr
Definition: classp.h:320
KDPC RetryTimerDPC
Definition: classp.h:304
VOID NTAPI ClasspRegisterMountedDeviceInterface(IN PDEVICE_OBJECT DeviceObject)
Definition: class.c:7569
VOID NTAPI SubmitTransferPacket(PTRANSFER_PACKET Pkt)
Definition: xferpkt.c:460
ULONG NumRetries
Definition: classp.h:302
ULONG DbgPeakNumTransferPackets
Definition: classp.h:438
FAILURE_PREDICTION_METHOD Method
Definition: classp.h:196
DRIVER_ADD_DEVICE ClassAddDevice
Definition: classp.h:554
LARGE_INTEGER TargetLocationCopy
Definition: classp.h:339
STORAGE_HOTPLUG_INFO HotplugInfo
Definition: classp.h:403
NTSTATUS NTAPI AllocateDictionaryEntry(IN PDICTIONARY Dictionary, IN ULONGLONG Key, IN ULONG Size, IN ULONG Tag, OUT PVOID *Entry)
Definition: dictlib.c:60
struct TraceInfo Info
ULONG RetryIntervalSec
Definition: classp.h:305
NTSTATUS NTAPI ClassPnpQueryFdoRelations(IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
Definition: class.c:6551
PIRP NTAPI DequeueDeferredClientIrp(PCLASS_PRIVATE_FDO_DATA FdoData)
Definition: clntirp.c:45
uint32_t ULONG_PTR
Definition: typedefs.h:63
static SLIST_ENTRY * SimplePopSlist(SLIST_ENTRY *SListHdr)
Definition: classp.h:487
struct _CLASS_PRIVATE_FDO_DATA::@1015 Retry
PIO_WORKITEM WorkQueueItem
Definition: classp.h:200
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID NTAPI DestroyTransferPacket(PTRANSFER_PACKET Pkt)
Definition: xferpkt.c:192
_CLASS_DETECTION_STATE
Definition: classp.h:251
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
VOID NTAPI EnqueueFreeTransferPacket(PDEVICE_OBJECT Fdo, PTRANSFER_PACKET Pkt)
Definition: xferpkt.c:217
long LONG
Definition: pedump.c:60
struct _CLASS_RETRY_INFO * PCLASS_RETRY_INFO
PDEVICE_OBJECT Fdo
Definition: classp.h:290
VOID NTAPI ClasspPerfIncrementSuccessfulIo(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: utils.c:385
NTSTATUS NTAPI ClasspDisableTimer(PDEVICE_OBJECT DeviceObject)
Definition: autorun.c:3285
VOID NTAPI ClasspBuildRequestEx(IN PFUNCTIONAL_DEVICE_EXTENSION Fdo, IN PIRP Irp, IN PSCSI_REQUEST_BLOCK Srb)
Definition: obsolete.c:503
PTRANSFER_PACKET NTAPI DequeueFreeTransferPacket(PDEVICE_OBJECT Fdo, BOOLEAN AllocIfNeeded)
Definition: xferpkt.c:322
unsigned char BOOLEAN
static GUID * Guid
Definition: apphelp.c:93
smooth NULL
Definition: ftsmooth.c:416
DRIVER_STARTIO ClasspStartIo
Definition: classp.h:606
VOID NTAPI DestroyAllTransferPackets(PDEVICE_OBJECT Fdo)
Definition: xferpkt.c:134
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
Definition: bufpool.h:45
NTSTATUS NTAPI ClasspPagingNotificationCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PDEVICE_OBJECT RealDeviceObject)
struct _CLASS_ERROR_LOG_DATA * PCLASS_ERROR_LOG_DATA
PMDL NTAPI BuildDeviceInputMdl(PVOID Buffer, ULONG BufferLen)
Definition: utils.c:480
DRIVER_DISPATCH ClassReadWrite
Definition: classp.h:529
BOOLEAN InLowMemRetry
Definition: classp.h:319
SCSI_REQUEST_BLOCK Srb
Definition: classp.h:269
BOOLEAN NTAPI StepLowMemRetry(PTRANSFER_PACKET Pkt)
Definition: retry.c:304
_In_ BUS_QUERY_ID_TYPE IdType
Definition: classpnp.h:357
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
VOID NTAPI ClasspFreeReleaseRequest(IN PDEVICE_OBJECT Fdo)
Definition: class.c:8098
NTSTATUS NTAPI InitializeTransferPackets(PDEVICE_OBJECT Fdo)
Definition: xferpkt.c:43
NTSTATUS NTAPI ClasspInitializeGesn(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PMEDIA_CHANGE_DETECTION_INFO Info)
Definition: autorun.c:1668
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
LIST_ENTRY DeferredClientIrpList
Definition: classp.h:443
LARGE_INTEGER LowMemRetry_nextChunkTargetLocation
Definition: classp.h:322
LARGE_INTEGER Tick
Definition: classp.h:408
MEDIA_CHANGE_DETECTION_STATE MediaChangeDetectionState
Definition: classp.h:99
struct _CSCAN_LIST * PCSCAN_LIST
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
BOOLEAN NTAPI RetryTransferPacket(PTRANSFER_PACKET Pkt)
Definition: retry.c:180
VOID NTAPI InitLowMemRetry(PTRANSFER_PACKET Pkt, PVOID BufPtr, ULONG Len, LARGE_INTEGER TargetLocation)
Definition: retry.c:286
_In_ LARGE_INTEGER _In_opt_ PKDPC Dpc
Definition: kefuncs.h:524
PIRP OriginalIrp
Definition: classp.h:296
DRIVER_DISPATCH ClassDispatchPower
Definition: classp.h:729
VOID NTAPI ServiceTransferRequest(PDEVICE_OBJECT Fdo, PIRP Irp)
Definition: class.c:2246
VOID NTAPI ClassAddChild(IN PFUNCTIONAL_DEVICE_EXTENSION Parent, IN PPHYSICAL_DEVICE_EXTENSION Child, IN BOOLEAN AcquireLock)
Definition: class.c:8566
enum _CLASS_DETECTION_STATE CLASS_DETECTION_STATE
NTSTATUS NTAPI ClasspInitializeHotplugInfo(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: class.c:8964
NTSTATUS NTAPI ClasspCreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: create.c:125
uint64_t ULONGLONG
Definition: typedefs.h:65
enum MEDIA_LOCK_TYPE * PMEDIA_LOCK_TYPE
ULONG_PTR HackFlags
Definition: classp.h:401
DRIVER_UNLOAD ClassUnload
Definition: classp.h:503
struct _TRANSFER_PACKET * PTRANSFER_PACKET
#define Len
Definition: deflate.h:82
PVOID NTAPI GetDictionaryEntry(IN PDICTIONARY Dictionary, IN ULONGLONG Key)
Definition: dictlib.c:139
* PFILE_OBJECT
Definition: iotypes.h:1955
VOID NTAPI ClasspSendNotification(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN const GUID *Guid, IN ULONG ExtraDataSize, IN PVOID ExtraData)
Definition: autorun.c:173
NTSTATUS NTAPI ClasspAllocateReleaseRequest(IN PDEVICE_OBJECT Fdo)
Definition: class.c:8062
GUID ClassGuidQueryRegInfoEx
Definition: data.c:43
_In_opt_ PVPB _In_ PDEVICE_OBJECT RealDeviceObject
Definition: iofuncs.h:1499
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID NTAPI ClasspPerfIncrementErrorCount(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: utils.c:333
PCLASS_RETRY_INFO ListHead
Definition: classp.h:409
struct _CLASS_PRIVATE_FDO_DATA::@1014 Perf
struct _CLASS_RETRY_INFO * Next
Definition: classp.h:213
Definition: ketypes.h:687
struct _CSCAN_LIST CSCAN_LIST
VOID NTAPI ClassSendEjectionNotification(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
Definition: autorun.c:139
Definition: typedefs.h:117
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
PKEVENT SyncEventPtr
Definition: classp.h:313
VOID NTAPI ClassFreeOrReuseSrb(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PSCSI_REQUEST_BLOCK Srb)
Definition: obsolete.c:824
KDEFERRED_ROUTINE ClasspRetryRequestDpc
Definition: classp.h:764
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
DRIVER_INITIALIZE DriverEntry
Definition: classp.h:501
DRIVER_DISPATCH(nfs41_FsdDispatch)
ULONGLONG BlockNumber
Definition: classp.h:224
KTIMER RetryTimer
Definition: classp.h:303
* PDEVICE_CAPABILITIES
Definition: iotypes.h:928
LIST_ENTRY CurrentSweep
Definition: classp.h:231
CLASSPNP_SCAN_FOR_SPECIAL_INFO ClassBadItems[]
Definition: data.c:34
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
LIST_ENTRY NextSweep
Definition: classp.h:240
NTSTATUS NTAPI ClasspAllocateReleaseQueueIrp(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
struct _TRANSFER_PACKET TRANSFER_PACKET
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
LARGE_INTEGER Delta
Definition: classp.h:407
SENSE_DATA SrbErrorSenseData
Definition: classp.h:345
VOID NTAPI InitializeDictionary(IN PDICTIONARY Dictionary)
Definition: dictlib.c:39
VOID NTAPI SetupReadWriteTransferPacket(PTRANSFER_PACKET pkt, PVOID Buf, ULONG Len, LARGE_INTEGER DiskLocation, PIRP OriginalIrp)
Definition: xferpkt.c:372
ULONG LowMemRetry_remainingBufLen
Definition: classp.h:321
SCSI_REQUEST_BLOCK SrbTemplate
Definition: classp.h:454
SLIST_HEADER FreeTransferPacketsList
Definition: classp.h:435
VOID NTAPI ClasspDisablePowerNotification(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
NTSTATUS NTAPI ClassRetrieveDeviceRelations(IN PDEVICE_OBJECT Fdo, IN DEVICE_RELATION_TYPE RelationType, OUT PDEVICE_RELATIONS *DeviceRelations)
Definition: class.c:6709
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
NTSTATUS NTAPI ClassPnpStartDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: class.c:1265
VOID NTAPI ClasspReleaseQueue(IN PDEVICE_OBJECT DeviceObject, IN PIRP ReleaseQueueIrp)
Definition: class.c:8269
NTSTATUS NTAPI ClasspMediaChangeCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
ULONG NumFreeTransferPackets
Definition: classp.h:436
FAILURE_PREDICTION_METHOD
Definition: classpnp.h:229
DRIVER_DISPATCH ClassDeviceControlDispatch
Definition: classp.h:531
VOID NTAPI SetupEjectionTransferPacket(TRANSFER_PACKET *Pkt, BOOLEAN PreventMediaRemoval, PKEVENT SyncEventPtr, PIRP OriginalIrp)
Definition: xferpkt.c:716
VOID NTAPI TransferPacketRetryTimerDpc(IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: retry.c:277
VOID NTAPI SetupDriveCapacityTransferPacket(TRANSFER_PACKET *Pkt, PVOID ReadCapacityBuffer, ULONG ReadCapacityBufferLen, PKEVENT SyncEventPtr, PIRP OriginalIrp)
Definition: xferpkt.c:808
#define SLIST_ENTRY(type)
Definition: queue.h:102
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
PUCHAR BufPtrCopy
Definition: classp.h:337
#define OUT
Definition: typedefs.h:39
NTSTATUS NTAPI TransferPktComplete(IN PDEVICE_OBJECT NullFdo, IN PIRP Irp, IN PVOID Context)
Definition: xferpkt.c:502
unsigned int ULONG
Definition: retypes.h:1
SLIST_ENTRY SlistEntry
Definition: classp.h:286
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical 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 ACPI_HANDLE Child
Definition: acpixf.h:728
NTSTATUS NTAPI ClassMinimalPowerHandler(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: power.c:1302
NTSTATUS NTAPI ClassQueryPnpCapabilities(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PDEVICE_CAPABILITIES Capabilities)
Definition: class.c:6863
VOID NTAPI FreeDictionaryEntry(IN PDICTIONARY Dictionary, IN PVOID Entry)
Definition: dictlib.c:171
NTSTATUS NTAPI ClasspEnableTimer(PDEVICE_OBJECT DeviceObject)
Definition: autorun.c:3234
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
VOID NTAPI RetryRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, PSCSI_REQUEST_BLOCK Srb, BOOLEAN Associated, ULONG RetryInterval)
Definition: obsolete.c:340
VOID NTAPI SetupModeSenseTransferPacket(TRANSFER_PACKET *Pkt, PKEVENT SyncEventPtr, PVOID ModeSenseBuffer, UCHAR ModeSenseBufferLen, UCHAR PageMode, PIRP OriginalIrp)
Definition: xferpkt.c:759
struct _FAILURE_PREDICTION_INFO * PFAILURE_PREDICTION_INFO
PPHYSICAL_DEVICE_EXTENSION NTAPI ClassRemoveChild(IN PFUNCTIONAL_DEVICE_EXTENSION Parent, IN PPHYSICAL_DEVICE_EXTENSION Child, IN BOOLEAN AcquireLock)
Definition: class.c:8628
CLASS_ERROR_LOG_DATA ErrorLogs[NUM_ERROR_LOG_ENTRIES]
Definition: classp.h:462
BOOLEAN NTAPI TestDictionarySignature(IN PDICTIONARY Dictionary)
Definition: dictlib.c:51
base of all file and directory entries
Definition: entries.h:82
PTRANSFER_PACKET NTAPI NewTransferPacket(PDEVICE_OBJECT Fdo)
Definition: xferpkt.c:152
NTSTATUS NTAPI ClassGetPdoId(IN PDEVICE_OBJECT Pdo, IN BUS_QUERY_ID_TYPE IdType, IN PUNICODE_STRING IdString)
Definition: class.c:6824
BOOLEAN NTAPI InterpretTransferPacketError(PTRANSFER_PACKET Pkt)
Definition: retry.c:34
ULONG BufLenCopy
Definition: classp.h:338
NTSTATUS NTAPI ClassShutdownFlush(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:5613
BOOLEAN CompleteOriginalIrpWhenLastPacketCompletes
Definition: classp.h:297
VOID NTAPI ClasspScanForClassHacks(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN ULONG_PTR Data)
Definition: class.c:9083
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:675