Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenclassp.h
Go to the documentation of this file.
00001 /*++ 00002 00003 Copyright (C) Microsoft Corporation, 1991 - 1999 00004 00005 Module Name: 00006 00007 classp.h 00008 00009 Abstract: 00010 00011 Private header file for classpnp.sys modules. This contains private 00012 structure and function declarations as well as constant values which do 00013 not need to be exported. 00014 00015 Author: 00016 00017 Environment: 00018 00019 kernel mode only 00020 00021 Notes: 00022 00023 00024 Revision History: 00025 00026 --*/ 00027 00028 #include <stddef.h> 00029 #include <stdarg.h> 00030 #include <ntddk.h> 00031 00032 #include <scsi.h> 00033 #include <wmidata.h> 00034 #include <classpnp.h> 00035 00036 #if CLASS_INIT_GUID 00037 #include <initguid.h> 00038 #endif 00039 00040 #include <mountdev.h> 00041 #include <ioevent.h> 00042 #include <pseh/pseh2.h> 00043 00044 #include "wmistr.h" 00045 00046 extern CLASSPNP_SCAN_FOR_SPECIAL_INFO ClassBadItems[]; 00047 00048 extern GUID ClassGuidQueryRegInfoEx; 00049 00050 00051 #define CLASSP_REG_SUBKEY_NAME (L"Classpnp") 00052 00053 #define CLASSP_REG_HACK_VALUE_NAME (L"HackMask") 00054 #define CLASSP_REG_MMC_DETECTION_VALUE_NAME (L"MMCDetectionState") 00055 #define CLASSP_REG_WRITE_CACHE_VALUE_NAME (L"WriteCacheEnableOverride") 00056 #define CLASSP_REG_PERF_RESTORE_VALUE_NAME (L"RestorePerfAtCount") 00057 #define CLASSP_REG_REMOVAL_POLICY_VALUE_NAME (L"UserRemovalPolicy") 00058 00059 #define CLASS_PERF_RESTORE_MINIMUM (0x10) 00060 #define CLASS_ERROR_LEVEL_1 (0x4) 00061 #define CLASS_ERROR_LEVEL_2 (0x8) 00062 00063 #define FDO_HACK_CANNOT_LOCK_MEDIA (0x00000001) 00064 #define FDO_HACK_GESN_IS_BAD (0x00000002) 00065 #define FDO_HACK_NO_SYNC_CACHE (0x00000004) 00066 00067 #define FDO_HACK_VALID_FLAGS (0x00000007) 00068 #define FDO_HACK_INVALID_FLAGS (~FDO_HACK_VALID_FLAGS) 00069 00070 /* 00071 * Lots of retries of synchronized SCSI commands that devices may not 00072 * even support really slows down the system (especially while booting). 00073 * (Even GetDriveCapacity may be failed on purpose if an external disk is powered off). 00074 * If a disk cannot return a small initialization buffer at startup 00075 * in two attempts (with delay interval) then we cannot expect it to return 00076 * data consistently with four retries. 00077 * So don't set the retry counts as high here as for data SRBs. 00078 * 00079 * If we find that these requests are failing consecutively, 00080 * despite the retry interval, on otherwise reliable media, 00081 * then we should either increase the retry interval for 00082 * that failure or (by all means) increase these retry counts as appropriate. 00083 */ 00084 #define NUM_LOCKMEDIAREMOVAL_RETRIES 1 00085 #define NUM_MODESENSE_RETRIES 1 00086 #define NUM_DRIVECAPACITY_RETRIES 1 00087 00088 00089 #define CLASS_FILE_OBJECT_EXTENSION_KEY 'eteP' 00090 #define CLASSP_VOLUME_VERIFY_CHECKED 0x34 00091 00092 #define CLASS_TAG_PRIVATE_DATA 'CPcS' 00093 #define CLASS_TAG_PRIVATE_DATA_FDO 'FPcS' 00094 #define CLASS_TAG_PRIVATE_DATA_PDO 'PPcS' 00095 00096 struct _MEDIA_CHANGE_DETECTION_INFO { 00097 00098 // 00099 // Mutex to synchronize enable/disable requests and media state changes 00100 // 00101 00102 KMUTEX MediaChangeMutex; 00103 00104 // 00105 // The current state of the media (present, not present, unknown) 00106 // protected by MediaChangeSynchronizationEvent 00107 // 00108 00109 MEDIA_CHANGE_DETECTION_STATE MediaChangeDetectionState; 00110 00111 // 00112 // This is a count of how many time MCD has been disabled. if it is 00113 // set to zero, then we'll poll the device for MCN events with the 00114 // then-current method (ie. TEST UNIT READY or GESN). this is 00115 // protected by MediaChangeMutex 00116 // 00117 00118 LONG MediaChangeDetectionDisableCount; 00119 00120 00121 // 00122 // The timer value to support media change events. This is a countdown 00123 // value used to determine when to poll the device for a media change. 00124 // The max value for the timer is 255 seconds. This is not protected 00125 // by an event -- simply InterlockedExchanged() as needed. 00126 // 00127 00128 LONG MediaChangeCountDown; 00129 00130 // 00131 // recent changes allowed instant retries of the MCN irp. Since this 00132 // could cause an infinite loop, keep a count of how many times we've 00133 // retried immediately so that we can catch if the count exceeds an 00134 // arbitrary limit. 00135 // 00136 00137 LONG MediaChangeRetryCount; 00138 00139 // 00140 // use GESN if it's available 00141 // 00142 00143 struct { 00144 BOOLEAN Supported; 00145 BOOLEAN HackEventMask; 00146 UCHAR EventMask; 00147 UCHAR NoChangeEventMask; 00148 PUCHAR Buffer; 00149 PMDL Mdl; 00150 ULONG BufferSize; 00151 } Gesn; 00152 00153 // 00154 // If this value is one, then the irp is currently in use. 00155 // If this value is zero, then the irp is available. 00156 // Use InterlockedCompareExchange() to set from "available" to "in use". 00157 // ASSERT that InterlockedCompareExchange() showed previous value of 00158 // "in use" when changing back to "available" state. 00159 // This also implicitly protects the MediaChangeSrb and SenseBuffer 00160 // 00161 00162 LONG MediaChangeIrpInUse; 00163 00164 // 00165 // Pointer to the irp to be used for media change detection. 00166 // protected by Interlocked MediaChangeIrpInUse 00167 // 00168 00169 PIRP MediaChangeIrp; 00170 00171 // 00172 // The srb for the media change detection. 00173 // protected by Interlocked MediaChangeIrpInUse 00174 // 00175 00176 SCSI_REQUEST_BLOCK MediaChangeSrb; 00177 PUCHAR SenseBuffer; 00178 ULONG SrbFlags; 00179 00180 // 00181 // Second timer to keep track of how long the media change IRP has been 00182 // in use. If this value exceeds the timeout (#defined) then we should 00183 // print out a message to the user and set the MediaChangeIrpLost flag 00184 // protected by using Interlocked() operations in ClasspSendMediaStateIrp, 00185 // the only routine which should modify this value. 00186 // 00187 00188 LONG MediaChangeIrpTimeInUse; 00189 00190 // 00191 // Set by CdRomTickHandler when we determine that the media change irp has 00192 // been lost 00193 // 00194 00195 BOOLEAN MediaChangeIrpLost; 00196 00197 }; 00198 00199 typedef enum { 00200 SimpleMediaLock, 00201 SecureMediaLock, 00202 InternalMediaLock 00203 } MEDIA_LOCK_TYPE, *PMEDIA_LOCK_TYPE; 00204 00205 typedef struct _FAILURE_PREDICTION_INFO { 00206 FAILURE_PREDICTION_METHOD Method; 00207 ULONG CountDown; // Countdown timer 00208 ULONG Period; // Countdown period 00209 00210 PIO_WORKITEM WorkQueueItem; 00211 00212 KEVENT Event; 00213 } FAILURE_PREDICTION_INFO, *PFAILURE_PREDICTION_INFO; 00214 00215 00216 00217 // 00218 // This struct must always fit within four PVOIDs of info, 00219 // as it uses the irp's "PVOID DriverContext[4]" to store 00220 // this info 00221 // 00222 typedef struct _CLASS_RETRY_INFO { 00223 struct _CLASS_RETRY_INFO *Next; 00224 } CLASS_RETRY_INFO, *PCLASS_RETRY_INFO; 00225 00226 00227 00228 typedef struct _CSCAN_LIST { 00229 00230 // 00231 // The current block which has an outstanding request. 00232 // 00233 00234 ULONGLONG BlockNumber; 00235 00236 // 00237 // The list of blocks past the CurrentBlock to which we're going to do 00238 // i/o. This list is maintained in sorted order. 00239 // 00240 00241 LIST_ENTRY CurrentSweep; 00242 00243 // 00244 // The list of blocks behind the current block for which we'll have to 00245 // wait until the next scan across the disk. This is kept as a stack, 00246 // the cost of sorting it is taken when it's moved over to be the 00247 // running list. 00248 // 00249 00250 LIST_ENTRY NextSweep; 00251 00252 } CSCAN_LIST, *PCSCAN_LIST; 00253 00254 // 00255 // add to the front of this structure to help prevent illegal 00256 // snooping by other utilities. 00257 // 00258 00259 00260 00261 typedef enum _CLASS_DETECTION_STATE { 00262 ClassDetectionUnknown = 0, 00263 ClassDetectionUnsupported = 1, 00264 ClassDetectionSupported = 2 00265 } CLASS_DETECTION_STATE, *PCLASS_DETECTION_STATE; 00266 00267 00268 typedef struct _CLASS_ERROR_LOG_DATA { 00269 LARGE_INTEGER TickCount; // Offset 0x00 00270 ULONG PortNumber; // Offset 0x08 00271 00272 UCHAR ErrorPaging : 1; // Offset 0x0c 00273 UCHAR ErrorRetried : 1; 00274 UCHAR ErrorUnhandled : 1; 00275 UCHAR ErrorReserved : 5; 00276 00277 UCHAR Reserved[3]; 00278 00279 SCSI_REQUEST_BLOCK Srb; // Offset 0x10 00280 00281 /* 00282 * We define the SenseData as the default length. 00283 * Since the sense data returned by the port driver may be longer, 00284 * SenseData must be at the end of this structure. 00285 * For our internal error log, we only log the default length. 00286 */ 00287 SENSE_DATA SenseData; // Offset 0x50 for x86 (or 0x68 for ia64) (ULONG32 Alignment required!) 00288 } CLASS_ERROR_LOG_DATA, *PCLASS_ERROR_LOG_DATA; 00289 00290 #define NUM_ERROR_LOG_ENTRIES 16 00291 00292 00293 00294 typedef struct _TRANSFER_PACKET { 00295 00296 LIST_ENTRY AllPktsListEntry; // entry in fdoData's static AllTransferPacketsList 00297 SINGLE_LIST_ENTRY SlistEntry; // for when in free list (use fast slist) 00298 00299 PIRP Irp; 00300 PDEVICE_OBJECT Fdo; 00301 00302 /* 00303 * This is the client IRP that this TRANSFER_PACKET is currently 00304 * servicing. 00305 */ 00306 PIRP OriginalIrp; 00307 BOOLEAN CompleteOriginalIrpWhenLastPacketCompletes; 00308 00309 /* 00310 * Stuff for retrying the transfer. 00311 */ 00312 ULONG NumRetries; 00313 KTIMER RetryTimer; 00314 KDPC RetryTimerDPC; 00315 ULONG RetryIntervalSec; 00316 00317 /* 00318 * Event for synchronizing the transfer (optional). 00319 * (Note that we can't have the event in the packet itself because 00320 * by the time a thread waits on an event the packet may have 00321 * been completed and re-issued. 00322 */ 00323 PKEVENT SyncEventPtr; 00324 00325 /* 00326 * Stuff for retrying during extreme low-memory stress 00327 * (when we retry 1 page at a time). 00328 */ 00329 BOOLEAN InLowMemRetry; 00330 PUCHAR LowMemRetry_remainingBufPtr; 00331 ULONG LowMemRetry_remainingBufLen; 00332 LARGE_INTEGER LowMemRetry_nextChunkTargetLocation; 00333 00334 /* 00335 * Fields used for cancelling the packet. 00336 */ 00337 // BOOLEAN Cancelled; 00338 // KEVENT CancelledEvent; 00339 00340 /* 00341 * We keep the buffer and length values here as well 00342 * as in the SRB because some miniports return 00343 * the transferred length in SRB.DataTransferLength, 00344 * and if the SRB failed we need that value again for the retry. 00345 * We don't trust the lower stack to preserve any of these values in the SRB. 00346 */ 00347 PUCHAR BufPtrCopy; 00348 ULONG BufLenCopy; 00349 LARGE_INTEGER TargetLocationCopy; 00350 00351 /* 00352 * This is a standard SCSI structure that receives a detailed 00353 * report about a SCSI error on the hardware. 00354 */ 00355 SENSE_DATA SrbErrorSenseData; 00356 00357 /* 00358 * This is the SRB block for this TRANSFER_PACKET. 00359 * For IOCTLs, the SRB block includes two DWORDs for 00360 * device object and ioctl code; so these must 00361 * immediately follow the SRB block. 00362 */ 00363 SCSI_REQUEST_BLOCK Srb; 00364 // ULONG SrbIoctlDevObj; // not handling ioctls yet 00365 // ULONG SrbIoctlCode; 00366 00367 } TRANSFER_PACKET, *PTRANSFER_PACKET; 00368 00369 /* 00370 * MIN_INITIAL_TRANSFER_PACKETS is the minimum number of packets that 00371 * we preallocate at startup for each device (we need at least one packet 00372 * to guarantee forward progress during memory stress). 00373 * MIN_WORKINGSET_TRANSFER_PACKETS is the number of TRANSFER_PACKETs 00374 * we allow to build up and remain for each device; 00375 * we _lazily_ work down to this number when they're not needed. 00376 * MAX_WORKINGSET_TRANSFER_PACKETS is the number of TRANSFER_PACKETs 00377 * that we _immediately_ reduce to when they are not needed. 00378 * 00379 * The absolute maximum number of packets that we will allocate is 00380 * whatever is required by the current activity, up to the memory limit; 00381 * as soon as stress ends, we snap down to MAX_WORKINGSET_TRANSFER_PACKETS; 00382 * we then lazily work down to MIN_WORKINGSET_TRANSFER_PACKETS. 00383 */ 00384 #define MIN_INITIAL_TRANSFER_PACKETS 1 00385 #define MIN_WORKINGSET_TRANSFER_PACKETS_Consumer 4 00386 #define MAX_WORKINGSET_TRANSFER_PACKETS_Consumer 64 00387 #define MIN_WORKINGSET_TRANSFER_PACKETS_Server 64 00388 #define MAX_WORKINGSET_TRANSFER_PACKETS_Server 1024 00389 #define MIN_WORKINGSET_TRANSFER_PACKETS_Enterprise 256 00390 #define MAX_WORKINGSET_TRANSFER_PACKETS_Enterprise 2048 00391 00392 00393 // 00394 // add to the front of this structure to help prevent illegal 00395 // snooping by other utilities. 00396 // 00397 struct _CLASS_PRIVATE_FDO_DATA { 00398 00399 // 00400 // this private structure allows us to 00401 // dynamically re-enable the perf benefits 00402 // lost due to transient error conditions. 00403 // in w2k, a reboot was required. :( 00404 // 00405 struct { 00406 ULONG OriginalSrbFlags; 00407 ULONG SuccessfulIO; 00408 ULONG ReEnableThreshhold; // 0 means never 00409 } Perf; 00410 00411 ULONG_PTR HackFlags; 00412 00413 STORAGE_HOTPLUG_INFO HotplugInfo; 00414 00415 // Legacy. Still used by obsolete legacy code. 00416 struct { 00417 LARGE_INTEGER Delta; // in ticks 00418 LARGE_INTEGER Tick; // when it should fire 00419 PCLASS_RETRY_INFO ListHead; // singly-linked list 00420 ULONG Granularity; // static 00421 KSPIN_LOCK Lock; // protective spin lock 00422 KDPC Dpc; // DPC routine object 00423 KTIMER Timer; // timer to fire DPC 00424 } Retry; 00425 00426 BOOLEAN TimerStarted; 00427 BOOLEAN LoggedTURFailureSinceLastIO; 00428 00429 // 00430 // privately allocated release queue irp 00431 // protected by fdoExtension->ReleaseQueueSpinLock 00432 // 00433 BOOLEAN ReleaseQueueIrpAllocated; 00434 PIRP ReleaseQueueIrp; 00435 00436 /* 00437 * Queues for TRANSFER_PACKETs that contextualize the IRPs and SRBs 00438 * that we send down to the port driver. 00439 * (The free list is an slist so that we can use fast 00440 * interlocked operations on it; but the relatively-static 00441 * AllTransferPacketsList list has to be 00442 * a doubly-linked list since we have to dequeue from the middle). 00443 */ 00444 LIST_ENTRY AllTransferPacketsList; 00445 SLIST_HEADER FreeTransferPacketsList; 00446 ULONG NumFreeTransferPackets; 00447 ULONG NumTotalTransferPackets; 00448 ULONG DbgPeakNumTransferPackets; 00449 00450 /* 00451 * Queue for deferred client irps 00452 */ 00453 LIST_ENTRY DeferredClientIrpList; 00454 00455 /* 00456 * Precomputed maximum transfer length for the hardware. 00457 */ 00458 ULONG HwMaxXferLen; 00459 00460 /* 00461 * SCSI_REQUEST_BLOCK template preconfigured with the constant values. 00462 * This is slapped into the SRB in the TRANSFER_PACKET for each transfer. 00463 */ 00464 SCSI_REQUEST_BLOCK SrbTemplate; 00465 00466 KSPIN_LOCK SpinLock; 00467 00468 /* 00469 * Circular array of timestamped logs of errors that occurred on this device. 00470 */ 00471 ULONG ErrorLogNextIndex; 00472 CLASS_ERROR_LOG_DATA ErrorLogs[NUM_ERROR_LOG_ENTRIES]; 00473 00474 }; 00475 00476 00477 #define MIN(a, b) ((a) < (b) ? (a) : (b)) 00478 #define MAX(a, b) ((a) > (b) ? (a) : (b)) 00479 00480 00481 #define NOT_READY_RETRY_INTERVAL 10 00482 #define MINIMUM_RETRY_UNITS ((LONGLONG)32) 00483 00484 00485 /* 00486 * Simple singly-linked-list queuing macros, with no synchronization. 00487 */ 00488 static inline VOID SimpleInitSlistHdr(SINGLE_LIST_ENTRY *SListHdr) 00489 { 00490 SListHdr->Next = NULL; 00491 } 00492 static inline VOID SimplePushSlist(SINGLE_LIST_ENTRY *SListHdr, SINGLE_LIST_ENTRY *SListEntry) 00493 { 00494 SListEntry->Next = SListHdr->Next; 00495 SListHdr->Next = SListEntry; 00496 } 00497 static inline SINGLE_LIST_ENTRY *SimplePopSlist(SINGLE_LIST_ENTRY *SListHdr) 00498 { 00499 SINGLE_LIST_ENTRY *sListEntry = SListHdr->Next; 00500 if (sListEntry){ 00501 SListHdr->Next = sListEntry->Next; 00502 sListEntry->Next = NULL; 00503 } 00504 return sListEntry; 00505 } 00506 static inline BOOLEAN SimpleIsSlistEmpty(SINGLE_LIST_ENTRY *SListHdr) 00507 { 00508 return (SListHdr->Next == NULL); 00509 } 00510 00511 NTSTATUS 00512 DriverEntry( 00513 IN PDRIVER_OBJECT DriverObject, 00514 IN PUNICODE_STRING RegistryPath 00515 ); 00516 00517 VOID 00518 ClassUnload( 00519 IN PDRIVER_OBJECT DriverObject 00520 ); 00521 00522 NTSTATUS 00523 ClassCreateClose( 00524 IN PDEVICE_OBJECT DeviceObject, 00525 IN PIRP Irp 00526 ); 00527 00528 NTSTATUS 00529 ClasspCreateClose( 00530 IN PDEVICE_OBJECT DeviceObject, 00531 IN PIRP Irp 00532 ); 00533 00534 VOID 00535 ClasspCleanupProtectedLocks( 00536 IN PFILE_OBJECT_EXTENSION FsContext 00537 ); 00538 00539 NTSTATUS 00540 ClasspEjectionControl( 00541 IN PDEVICE_OBJECT Fdo, 00542 IN PIRP Irp, 00543 IN MEDIA_LOCK_TYPE LockType, 00544 IN BOOLEAN Lock 00545 ); 00546 00547 NTSTATUS 00548 ClassReadWrite( 00549 IN PDEVICE_OBJECT DeviceObject, 00550 IN PIRP Irp 00551 ); 00552 00553 NTSTATUS 00554 ClassDeviceControlDispatch( 00555 PDEVICE_OBJECT DeviceObject, 00556 PIRP Irp 00557 ); 00558 00559 NTSTATUS 00560 ClassDeviceControl( 00561 PDEVICE_OBJECT DeviceObject, 00562 PIRP Irp 00563 ); 00564 00565 NTSTATUS 00566 ClassDispatchPnp( 00567 PDEVICE_OBJECT DeviceObject, 00568 PIRP Irp 00569 ); 00570 00571 NTSTATUS 00572 ClassPnpStartDevice( 00573 IN PDEVICE_OBJECT DeviceObject 00574 ); 00575 00576 NTSTATUS 00577 ClassInternalIoControl ( 00578 IN PDEVICE_OBJECT DeviceObject, 00579 IN PIRP Irp 00580 ); 00581 00582 NTSTATUS 00583 ClassShutdownFlush( 00584 IN PDEVICE_OBJECT DeviceObject, 00585 IN PIRP Irp 00586 ); 00587 00588 NTSTATUS 00589 ClassSystemControl( 00590 IN PDEVICE_OBJECT DeviceObject, 00591 IN PIRP Irp 00592 ); 00593 00594 // 00595 // Class internal routines 00596 // 00597 00598 NTSTATUS 00599 ClassAddDevice( 00600 IN PDRIVER_OBJECT DriverObject, 00601 IN OUT PDEVICE_OBJECT PhysicalDeviceObject 00602 ); 00603 00604 NTSTATUS 00605 ClasspSendSynchronousCompletion( 00606 IN PDEVICE_OBJECT DeviceObject, 00607 IN PIRP Irp, 00608 IN PVOID Context 00609 ); 00610 00611 VOID 00612 RetryRequest( 00613 PDEVICE_OBJECT DeviceObject, 00614 PIRP Irp, 00615 PSCSI_REQUEST_BLOCK Srb, 00616 BOOLEAN Associated, 00617 ULONG RetryInterval 00618 ); 00619 00620 NTSTATUS 00621 ClassIoCompletion( 00622 IN PDEVICE_OBJECT DeviceObject, 00623 IN PIRP Irp, 00624 IN PVOID Context 00625 ); 00626 00627 NTSTATUS 00628 ClassPnpQueryFdoRelations( 00629 IN PDEVICE_OBJECT Fdo, 00630 IN PIRP Irp 00631 ); 00632 00633 NTSTATUS 00634 ClassRetrieveDeviceRelations( 00635 IN PDEVICE_OBJECT Fdo, 00636 IN DEVICE_RELATION_TYPE RelationType, 00637 OUT PDEVICE_RELATIONS *DeviceRelations 00638 ); 00639 00640 NTSTATUS 00641 ClassGetPdoId( 00642 IN PDEVICE_OBJECT Pdo, 00643 IN BUS_QUERY_ID_TYPE IdType, 00644 IN PUNICODE_STRING IdString 00645 ); 00646 00647 NTSTATUS 00648 ClassQueryPnpCapabilities( 00649 IN PDEVICE_OBJECT PhysicalDeviceObject, 00650 IN PDEVICE_CAPABILITIES Capabilities 00651 ); 00652 00653 VOID 00654 ClasspStartIo( 00655 IN PDEVICE_OBJECT DeviceObject, 00656 IN PIRP Irp 00657 ); 00658 00659 NTSTATUS 00660 ClasspPagingNotificationCompletion( 00661 IN PDEVICE_OBJECT DeviceObject, 00662 IN PIRP Irp, 00663 IN PDEVICE_OBJECT RealDeviceObject 00664 ); 00665 00666 NTSTATUS 00667 ClasspMediaChangeCompletion( 00668 PDEVICE_OBJECT DeviceObject, 00669 PIRP Irp, 00670 PVOID Context 00671 ); 00672 00673 PFILE_OBJECT_EXTENSION 00674 ClasspGetFsContext( 00675 IN PCOMMON_DEVICE_EXTENSION CommonExtension, 00676 IN PFILE_OBJECT FileObject 00677 ); 00678 00679 NTSTATUS 00680 ClasspMcnControl( 00681 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, 00682 IN PIRP Irp, 00683 IN PSCSI_REQUEST_BLOCK Srb 00684 ); 00685 00686 VOID 00687 ClasspRegisterMountedDeviceInterface( 00688 IN PDEVICE_OBJECT DeviceObject 00689 ); 00690 00691 NTSTATUS 00692 ClasspDisableTimer( 00693 PDEVICE_OBJECT DeviceObject 00694 ); 00695 00696 NTSTATUS 00697 ClasspEnableTimer( 00698 PDEVICE_OBJECT DeviceObject 00699 ); 00700 00701 // 00702 // routines for dictionary list support 00703 // 00704 00705 VOID 00706 InitializeDictionary( 00707 IN PDICTIONARY Dictionary 00708 ); 00709 00710 BOOLEAN 00711 TestDictionarySignature( 00712 IN PDICTIONARY Dictionary 00713 ); 00714 00715 NTSTATUS 00716 AllocateDictionaryEntry( 00717 IN PDICTIONARY Dictionary, 00718 IN ULONGLONG Key, 00719 IN ULONG Size, 00720 IN ULONG Tag, 00721 OUT PVOID *Entry 00722 ); 00723 00724 PVOID 00725 GetDictionaryEntry( 00726 IN PDICTIONARY Dictionary, 00727 IN ULONGLONG Key 00728 ); 00729 00730 VOID 00731 FreeDictionaryEntry( 00732 IN PDICTIONARY Dictionary, 00733 IN PVOID Entry 00734 ); 00735 00736 00737 NTSTATUS 00738 ClasspAllocateReleaseRequest( 00739 IN PDEVICE_OBJECT Fdo 00740 ); 00741 00742 VOID 00743 ClasspFreeReleaseRequest( 00744 IN PDEVICE_OBJECT Fdo 00745 ); 00746 00747 NTSTATUS 00748 ClassReleaseQueueCompletion( 00749 IN PDEVICE_OBJECT DeviceObject, 00750 IN PIRP Irp, 00751 IN PVOID Context 00752 ); 00753 00754 VOID 00755 ClasspReleaseQueue( 00756 IN PDEVICE_OBJECT DeviceObject, 00757 IN PIRP ReleaseQueueIrp 00758 ); 00759 00760 VOID 00761 ClasspDisablePowerNotification( 00762 PFUNCTIONAL_DEVICE_EXTENSION FdoExtension 00763 ); 00764 00765 // 00766 // class power routines 00767 // 00768 00769 NTSTATUS 00770 ClassDispatchPower( 00771 IN PDEVICE_OBJECT DeviceObject, 00772 IN PIRP Irp 00773 ); 00774 00775 NTSTATUS 00776 ClassMinimalPowerHandler( 00777 IN PDEVICE_OBJECT DeviceObject, 00778 IN PIRP Irp 00779 ); 00780 00781 // 00782 // Child list routines 00783 // 00784 00785 VOID 00786 ClassAddChild( 00787 IN PFUNCTIONAL_DEVICE_EXTENSION Parent, 00788 IN PPHYSICAL_DEVICE_EXTENSION Child, 00789 IN BOOLEAN AcquireLock 00790 ); 00791 00792 PPHYSICAL_DEVICE_EXTENSION 00793 ClassRemoveChild( 00794 IN PFUNCTIONAL_DEVICE_EXTENSION Parent, 00795 IN PPHYSICAL_DEVICE_EXTENSION Child, 00796 IN BOOLEAN AcquireLock 00797 ); 00798 00799 VOID 00800 ClasspRetryDpcTimer( 00801 IN PCLASS_PRIVATE_FDO_DATA FdoData 00802 ); 00803 00804 VOID 00805 ClasspRetryRequestDpc( 00806 IN PKDPC Dpc, 00807 IN PDEVICE_OBJECT DeviceObject, 00808 IN PVOID Arg1, 00809 IN PVOID Arg2 00810 ); 00811 00812 VOID 00813 ClassFreeOrReuseSrb( 00814 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, 00815 IN PSCSI_REQUEST_BLOCK Srb 00816 ); 00817 00818 VOID 00819 ClassRetryRequest( 00820 IN PDEVICE_OBJECT SelfDeviceObject, 00821 IN PIRP Irp, 00822 IN LARGE_INTEGER TimeDelta100ns // in 100ns units 00823 ); 00824 00825 VOID 00826 ClasspBuildRequestEx( 00827 IN PFUNCTIONAL_DEVICE_EXTENSION Fdo, 00828 IN PIRP Irp, 00829 IN PSCSI_REQUEST_BLOCK Srb 00830 ); 00831 00832 NTSTATUS 00833 ClasspAllocateReleaseQueueIrp( 00834 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension 00835 ); 00836 00837 NTSTATUS 00838 ClasspInitializeGesn( 00839 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, 00840 IN PMEDIA_CHANGE_DETECTION_INFO Info 00841 ); 00842 00843 VOID 00844 ClasspSendNotification( 00845 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, 00846 IN const GUID * Guid, 00847 IN ULONG ExtraDataSize, 00848 IN PVOID ExtraData 00849 ); 00850 00851 VOID 00852 ClassSendEjectionNotification( 00853 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension 00854 ); 00855 00856 VOID 00857 ClasspScanForSpecialInRegistry( 00858 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension 00859 ); 00860 00861 VOID 00862 ClasspScanForClassHacks( 00863 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, 00864 IN ULONG_PTR Data 00865 ); 00866 00867 NTSTATUS 00868 ClasspInitializeHotplugInfo( 00869 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension 00870 ); 00871 00872 VOID 00873 ClasspPerfIncrementErrorCount( 00874 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension 00875 ); 00876 VOID 00877 ClasspPerfIncrementSuccessfulIo( 00878 IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension 00879 ); 00880 00881 00882 PTRANSFER_PACKET NewTransferPacket(PDEVICE_OBJECT Fdo); 00883 VOID DestroyTransferPacket(PTRANSFER_PACKET Pkt); 00884 VOID EnqueueFreeTransferPacket(PDEVICE_OBJECT Fdo, PTRANSFER_PACKET Pkt); 00885 PTRANSFER_PACKET DequeueFreeTransferPacket(PDEVICE_OBJECT Fdo, BOOLEAN AllocIfNeeded); 00886 VOID SetupReadWriteTransferPacket(PTRANSFER_PACKET pkt, PVOID Buf, ULONG Len, LARGE_INTEGER DiskLocation, PIRP OriginalIrp); 00887 VOID SubmitTransferPacket(PTRANSFER_PACKET Pkt); 00888 NTSTATUS TransferPktComplete(IN PDEVICE_OBJECT NullFdo, IN PIRP Irp, IN PVOID Context); 00889 VOID ServiceTransferRequest(PDEVICE_OBJECT Fdo, PIRP Irp); 00890 VOID TransferPacketRetryTimerDpc(IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2); 00891 BOOLEAN InterpretTransferPacketError(PTRANSFER_PACKET Pkt); 00892 BOOLEAN RetryTransferPacket(PTRANSFER_PACKET Pkt); 00893 VOID EnqueueDeferredClientIrp(PCLASS_PRIVATE_FDO_DATA FdoData, PIRP Irp); 00894 PIRP DequeueDeferredClientIrp(PCLASS_PRIVATE_FDO_DATA FdoData); 00895 VOID InitLowMemRetry(PTRANSFER_PACKET Pkt, PVOID BufPtr, ULONG Len, LARGE_INTEGER TargetLocation); 00896 BOOLEAN StepLowMemRetry(PTRANSFER_PACKET Pkt); 00897 VOID SetupEjectionTransferPacket(TRANSFER_PACKET *Pkt, BOOLEAN PreventMediaRemoval, PKEVENT SyncEventPtr, PIRP OriginalIrp); 00898 VOID SetupModeSenseTransferPacket(TRANSFER_PACKET *Pkt, PKEVENT SyncEventPtr, PVOID ModeSenseBuffer, UCHAR ModeSenseBufferLen, UCHAR PageMode, PIRP OriginalIrp); 00899 VOID SetupDriveCapacityTransferPacket(TRANSFER_PACKET *Pkt, PVOID ReadCapacityBuffer, ULONG ReadCapacityBufferLen, PKEVENT SyncEventPtr, PIRP OriginalIrp); 00900 PMDL BuildDeviceInputMdl(PVOID Buffer, ULONG BufferLen); 00901 VOID FreeDeviceInputMdl(PMDL Mdl); 00902 NTSTATUS InitializeTransferPackets(PDEVICE_OBJECT Fdo); 00903 VOID DestroyAllTransferPackets(PDEVICE_OBJECT Fdo); 00904 00905 00906 00907 00908 Generated on Mon May 28 2012 04:28:00 for ReactOS by
1.7.6.1
|