ReactOS 0.4.15-dev-8417-gb6b82fe
debug.c
Go to the documentation of this file.
1/*++
2
3Copyright (C) Microsoft Corporation, 1991 - 2010
4
5Module Name:
6
7 debug.c
8
9Abstract:
10
11 CLASSPNP debug code and data
12
13Environment:
14
15 kernel mode only
16
17Notes:
18
19
20Revision History:
21
22--*/
23
24
25#include "classp.h"
26#include "debug.h"
27
28#ifdef DEBUG_USE_WPP
29#include "debug.tmh"
30#endif
31
32#if DBG
33
34 //
35 // default to not breaking in for lost irps, five minutes before we even
36 // bother checking for lost irps, using standard debug print macros, and
37 // using a 64k debug print buffer
38 //
39
40 #ifndef CLASS_GLOBAL_BREAK_ON_LOST_IRPS
41 #error "CLASS_GLOBAL_BREAK_ON_LOST_IRPS undefined"
42 #define CLASS_GLOBAL_BREAK_ON_LOST_IRPS 0
43 #endif // CLASS_GLOBAL_BREAK_ON_LOST_IRPS
44
45 #ifndef CLASS_GLOBAL_SECONDS_TO_WAIT_FOR_SYNCHRONOUS_SRB
46 #error "CLASS_GLOBAL_SECONDS_TO_WAIT_FOR_SYNCHRONOUS_SRB undefined"
47 #define CLASS_GLOBAL_SECONDS_TO_WAIT_FOR_SYNCHRONOUS_SRB 300
48 #endif // CLASS_GLOBAL_SECONDS_TO_WAIT_FOR_SYNCHRONOUS_SRB
49
50 #ifndef CLASS_GLOBAL_BUFFERED_DEBUG_PRINT
51 #error "CLASS_GLOBAL_BUFFERED_DEBUG_PRINT undefined"
52 #define CLASS_GLOBAL_BUFFERED_DEBUG_PRINT 0
53 #endif // CLASS_GLOBAL_BUFFERED_DEBUG_PRINT
54
55 #ifndef CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFER_SIZE
56 #error "CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFER_SIZE undefined"
57 #define CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFER_SIZE 512
58 #endif // CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFER_SIZE
59
60 #ifndef CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS
61 #error "CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS undefined"
62 #define CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS 512
63 #endif // CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS
64
65#ifdef _MSC_VER
66 #pragma data_seg("NONPAGE")
67#endif
68
69
70
71 CLASSPNP_GLOBALS ClasspnpGlobals;
72
73 //
74 // the low sixteen bits are used to see if the debug level is high enough
75 // the high sixteen bits are used to singly enable debug levels 1-16
76 //
77 LONG ClassDebug = 0x00000000;
78
79 BOOLEAN DebugTrapOnWarn = FALSE;
80
81 //
82 // Used to track callers when we receive an access and the disk
83 // is powered down.
84 //
85 ULONG DiskSpinupIndex = 0;
86 DISK_SPINUP_TRACES DiskSpinupTraces[NUMBER_OF_DISK_SPINUP_TRACES];
87
89 {
90 KIRQL irql;
91
92 if (InterlockedCompareExchange(&ClasspnpGlobals.Initializing, 1, 0) == 0) {
93
94 KeInitializeSpinLock(&ClasspnpGlobals.SpinLock);
95
96 KeAcquireSpinLock(&ClasspnpGlobals.SpinLock, &irql);
97
98 TracePrint((TRACE_LEVEL_INFORMATION, TRACE_FLAG_INIT, "CLASSPNP.SYS => Initializing ClasspnpGlobals...\n"));
99
100 ClasspnpGlobals.Buffer = NULL;
101 ClasspnpGlobals.Index = (ULONG)-1;
102 ClasspnpGlobals.BreakOnLostIrps = CLASS_GLOBAL_BREAK_ON_LOST_IRPS;
103 ClasspnpGlobals.EachBufferSize = CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFER_SIZE;
104 ClasspnpGlobals.NumberOfBuffers = CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS;
105 ClasspnpGlobals.SecondsToWaitForIrps = CLASS_GLOBAL_SECONDS_TO_WAIT_FOR_SYNCHRONOUS_SRB;
106
107 //
108 // this should be the last item set
109 //
110
111 ClasspnpGlobals.UseBufferedDebugPrint = CLASS_GLOBAL_BUFFERED_DEBUG_PRINT;
112
113 KeReleaseSpinLock(&ClasspnpGlobals.SpinLock, irql);
114
115 InterlockedExchange(&ClasspnpGlobals.Initialized, 1);
116
117 }
118 }
119
120 /*++////////////////////////////////////////////////////////////////////////////
121
122 ClassDebugPrint()
123
124 Routine Description:
125
126 Debug print for all class drivers, NOOP on FRE versions.
127 Allows printing to a debug buffer (with auto fallback to kdprint) by
128 properly setting the Globals in classpnp on CHK versions.
129
130 Arguments:
131
132 Debug print level, or from 0 to 3 for legacy drivers.
133
134 Return Value:
135
136 None
137
138 --*/
139 VOID ClassDebugPrint(_In_ CLASS_DEBUG_LEVEL DebugPrintLevel, _In_z_ PCCHAR DebugMessage, ...)
140 {
141 va_list ap;
142 va_start(ap, DebugMessage);
143
144 if ((DebugPrintLevel <= (ClassDebug & 0x0000ffff)) ||
145 ((1 << (DebugPrintLevel + 15)) & ClassDebug)) {
146
147 if (ClasspnpGlobals.UseBufferedDebugPrint &&
148 ClasspnpGlobals.Buffer == NULL) {
149
150 //
151 // this double-check prevents always taking
152 // a spinlock just to ensure we have a buffer
153 //
154
155 KIRQL irql;
156
157 KeAcquireSpinLock(&ClasspnpGlobals.SpinLock, &irql);
158 if (ClasspnpGlobals.Buffer == NULL) {
159
161 if (NT_SUCCESS(
162 RtlSIZETMult(ClasspnpGlobals.NumberOfBuffers,
163 ClasspnpGlobals.EachBufferSize,
164 &bufferSize))) {
165
167 "ClassDebugPrint: Allocating %x bytes for "
168 "classdebugprint buffer\n", (ULONG)bufferSize);
169 ClasspnpGlobals.Index = (ULONG)-1;
170 ClasspnpGlobals.Buffer =
171 ExAllocatePoolWithTag(NonPagedPoolNx, bufferSize, 'bDcS');
173 "ClassDebugPrint: Allocated buffer at %p\n",
174 ClasspnpGlobals.Buffer);
175
176 if (ClasspnpGlobals.Buffer) {
177 RtlZeroMemory(ClasspnpGlobals.Buffer, bufferSize);
178 }
179 }
180
181 }
182 KeReleaseSpinLock(&ClasspnpGlobals.SpinLock, irql);
183
184 }
185
186 if (ClasspnpGlobals.UseBufferedDebugPrint &&
187 ClasspnpGlobals.Buffer != NULL) {
188
189 //
190 // we never free the buffer, so once it exists,
191 // we can just print to it with immunity
192 //
193
194 ULONG index;
197 index = InterlockedIncrement((volatile LONG *)&ClasspnpGlobals.Index);
198 index %= ClasspnpGlobals.NumberOfBuffers;
199 index *= (ULONG)ClasspnpGlobals.EachBufferSize;
200
201 buffer = ClasspnpGlobals.Buffer;
202 buffer += index;
203
204 RtlZeroMemory(buffer, ClasspnpGlobals.EachBufferSize);
205
206 status = RtlStringCchVPrintfA((NTSTRSAFE_PSTR)buffer, ClasspnpGlobals.EachBufferSize, DebugMessage, ap);
207 if (!NT_SUCCESS(status))
208 {
209 *buffer = 0; // force-null on failure
210 }
211
212 } else {
213
214 //
215 // either we could not allocate a buffer for debug prints
216 // or buffered debug prints are disabled
217 //
218
220
221 }
222
223 }
224
225 va_end(ap);
226
227 }
228
229
230 /*
231 * DbgCheckReturnedPkt
232 *
233 * Check a completed TRANSFER_PACKET for all sorts of error conditions
234 * and warn/trap appropriately.
235 */
236 VOID DbgCheckReturnedPkt(TRANSFER_PACKET *Pkt)
237 {
239
243 NT_ASSERT(!Pkt->Irp->CancelRoutine);
244
245 if (SRB_STATUS(Pkt->Srb->SrbStatus) == SRB_STATUS_PENDING){
246 TracePrint((TRACE_LEVEL_ERROR, TRACE_FLAG_RW, "SRB completed with status PENDING in packet %ph: (op=%s srbstat=%s(%xh), irpstat=%xh)",
247 Pkt,
250 (ULONG)Pkt->Srb->SrbStatus,
252 }
253 else if (SRB_STATUS(Pkt->Srb->SrbStatus) == SRB_STATUS_SUCCESS){
254 /*
255 * Make sure SRB and IRP status match.
256 */
258 TracePrint((TRACE_LEVEL_WARNING, TRACE_FLAG_RW, "SRB and IRP status don't match in packet %ph: (op=%s srbstat=%s(%xh), irpstat=%xh)",
259 Pkt,
262 (ULONG)Pkt->Srb->SrbStatus,
264 }
265
267 TracePrint((TRACE_LEVEL_ERROR, TRACE_FLAG_RW, "SRB and IRP result transfer lengths don't match in succeeded packet %ph: (op=%s, SrbStatus=%s, Srb.DataTransferLength=%xh, Irp->IoStatus.Information=%Ixh).",
268 Pkt,
273 }
274 }
275 else {
277 TracePrint((TRACE_LEVEL_WARNING, TRACE_FLAG_RW, "SRB and IRP status don't match in packet %ph: (op=%s srbstat=%s(%xh), irpstat=%xh)",
278 Pkt,
281 (ULONG)Pkt->Srb->SrbStatus,
283 }
284 TracePrint((TRACE_LEVEL_WARNING, TRACE_FLAG_RW, "Packet %ph failed (op=%s srbstat=%s(%xh), irpstat=%xh, sense=%s/%s/%s)",
285 Pkt,
288 (ULONG)Pkt->Srb->SrbStatus,
293
294 /*
295 * If the SRB failed with underrun or overrun, then the actual
296 * transferred length should be returned in both SRB and IRP.
297 * (SRB's only have an error status for overrun, so it's overloaded).
298 */
299 if ((SRB_STATUS(Pkt->Srb->SrbStatus) == SRB_STATUS_DATA_OVERRUN) &&
301 TracePrint((TRACE_LEVEL_ERROR, TRACE_FLAG_RW, "SRB and IRP result transfer lengths don't match in failed packet %ph: (op=%s, SrbStatus=%s, Srb.DataTransferLength=%xh, Irp->IoStatus.Information=%Ixh).",
302 Pkt,
307 }
308 }
309
310 /*
311 * If the port driver returned STATUS_INSUFFICIENT_RESOURCES,
312 * make sure this is also the InternalStatus in the SRB so that we process it correctly.
313 */
317 }
318
319 /*
320 * Some miniport drivers have been caught changing the SCSI operation
321 * code in the SRB. This is absolutely disallowed as it breaks our error handling.
322 */
323 switch (pCdb->CDB10.OperationCode){
327 case SCSIOP_READ:
328 case SCSIOP_WRITE:
331 case SCSIOP_READ16:
332 case SCSIOP_WRITE16:
333 break;
334 default:
335 TracePrint((TRACE_LEVEL_ERROR, TRACE_FLAG_RW, "Miniport illegally changed Srb.Cdb.OperationCode in packet %ph failed (op=%s srbstat=%s(%xh), irpstat=%xh, sense=%s/%s/%s)",
336 Pkt,
339 (ULONG)Pkt->Srb->SrbStatus,
344 break;
345 }
346
347 }
348
349
350 VOID DbgLogSendPacket(TRANSFER_PACKET *Pkt)
351 {
353 PCLASS_PRIVATE_FDO_DATA fdoData = fdoExt->PrivateFdoData;
354 KIRQL oldIrql;
355
356 if (Pkt->OriginalIrp){
357 Pkt->DbgOriginalIrpCopy = *Pkt->OriginalIrp;
358 if (Pkt->OriginalIrp->MdlAddress){
359 Pkt->DbgMdlCopy = *Pkt->OriginalIrp->MdlAddress;
360 }
361 }
362
363 KeQueryTickCount(&Pkt->DbgTimeSent);
364 Pkt->DbgTimeReturned.QuadPart = 0L;
365
366 KeAcquireSpinLock(&fdoData->SpinLock, &oldIrql);
367 fdoData->DbgPacketLogs[fdoData->DbgPacketLogNextIndex] = *Pkt;
368 fdoData->DbgPacketLogNextIndex++;
369 fdoData->DbgPacketLogNextIndex %= DBG_NUM_PACKET_LOG_ENTRIES;
370 KeReleaseSpinLock(&fdoData->SpinLock, oldIrql);
371 }
372
373 VOID DbgLogReturnPacket(TRANSFER_PACKET *Pkt)
374 {
376 PCLASS_PRIVATE_FDO_DATA fdoData = fdoExt->PrivateFdoData;
377 KIRQL oldIrql;
378
379 KeQueryTickCount(&Pkt->DbgTimeReturned);
380
381 #if 0
382 // ISSUE: there are some problems with this check (e.g. multiproc), so don't include it yet
383 if (Pkt->OriginalIrp){
384 /*
385 * No one should have touched the original irp while the packet was outstanding,
386 * except for a couple fields that we ourselves update during the transfer
387 * or that are allowed to change;
388 * make those couple fields the same and then to a bytewise compare
389 */
390 ULONG lenSame;
391
392 Pkt->DbgOriginalIrpCopy.IoStatus.Status = Pkt->OriginalIrp->IoStatus.Status;
393 Pkt->DbgOriginalIrpCopy.IoStatus.Information = Pkt->OriginalIrp->IoStatus.Information;
394 Pkt->DbgOriginalIrpCopy.Tail.Overlay.DriverContext[0] = Pkt->OriginalIrp->Tail.Overlay.DriverContext[0];
395 Pkt->DbgOriginalIrpCopy.ThreadListEntry = Pkt->OriginalIrp->ThreadListEntry;
396 Pkt->DbgOriginalIrpCopy.Cancel = Pkt->OriginalIrp->Cancel;
397
398 lenSame = (ULONG)RtlCompareMemory(Pkt->OriginalIrp, &Pkt->DbgOriginalIrpCopy, sizeof(IRP));
399 NT_ASSERT(lenSame == sizeof(IRP));
400 }
401 #endif
402
403 KeAcquireSpinLock(&fdoData->SpinLock, &oldIrql);
404 fdoData->DbgPacketLogs[fdoData->DbgPacketLogNextIndex] = *Pkt;
405 fdoData->DbgPacketLogNextIndex++;
406 fdoData->DbgPacketLogNextIndex %= DBG_NUM_PACKET_LOG_ENTRIES;
407 KeReleaseSpinLock(&fdoData->SpinLock, oldIrql);
408 }
409
410
411 /*++////////////////////////////////////////////////////////////////////////////
412
413 DbgSafeInc()
414
415 Routine Description:
416
417 Safely increments a ULONG. If the increment would result in an overflow,
418 the value is unchanged.
419
420 Arguments:
421
422 A pointer to the value to be incremented.
423
424 --*/
425 static VOID DbgSafeInc(PULONG pValue)
426 {
427 ULONG incrementResult;
428 if(NT_SUCCESS(RtlULongAdd(*pValue, 1, &incrementResult))) {
429 *pValue = incrementResult;
430 } else {
431 //
432 // Leave *pValue unchanged (i.e. at ULONG_MAX).
433 //
434 }
435 }
436
437 VOID DbgLogFlushInfo(PCLASS_PRIVATE_FDO_DATA FdoData, BOOLEAN IsIO, BOOLEAN IsFUA, BOOLEAN IsFlush)
438 {
439
440 /*
441 * Reset all FUA/Flush logging fields.
442 */
443 if (FdoData->DbgInitFlushLogging){
444 FdoData->DbgNumIORequests = 0;
445 FdoData->DbgNumFUAs = 0;
446 FdoData->DbgNumFlushes = 0;
447 FdoData->DbgIOsSinceFUA = 0;
448 FdoData->DbgIOsSinceFlush = 0;
449 FdoData->DbgAveIOsToFUA = 0;
450 FdoData->DbgAveIOsToFlush = 0;
451 FdoData->DbgMaxIOsToFUA = 0;
452 FdoData->DbgMaxIOsToFlush = 0;
453 FdoData->DbgMinIOsToFUA = 0xffffffff;
454 FdoData->DbgMinIOsToFlush = 0xffffffff;
455 FdoData->DbgInitFlushLogging = FALSE;
456 }
457
458 //
459 // Using DbgSafeInc for all increments (instead of ++) guarantees
460 // that there will be no overflow hence no division by 0. All counters
461 // are capped at ULONG_MAX.
462 //
463
464 if (IsIO){
465 DbgSafeInc(&FdoData->DbgNumIORequests);
466 DbgSafeInc(&FdoData->DbgIOsSinceFlush);
467 if (IsFUA){
468 if (FdoData->DbgNumFUAs > 0){
469 FdoData->DbgMinIOsToFUA = min(FdoData->DbgMinIOsToFUA, FdoData->DbgIOsSinceFUA);
470 }
471 DbgSafeInc(&FdoData->DbgNumFUAs);
472 FdoData->DbgAveIOsToFUA = FdoData->DbgNumIORequests/FdoData->DbgNumFUAs;
473 FdoData->DbgIOsSinceFUA = 0;
474 }
475 else {
476 DbgSafeInc(&FdoData->DbgIOsSinceFUA);
477 FdoData->DbgMaxIOsToFUA = max(FdoData->DbgMaxIOsToFUA, FdoData->DbgIOsSinceFUA);
478 }
479 FdoData->DbgMaxIOsToFlush = max(FdoData->DbgMaxIOsToFlush, FdoData->DbgIOsSinceFlush);
480 }
481 else if (IsFlush){
482 if (FdoData->DbgNumFlushes > 0){
483 FdoData->DbgMinIOsToFlush = min(FdoData->DbgMinIOsToFlush, FdoData->DbgIOsSinceFlush);
484 }
485 DbgSafeInc(&FdoData->DbgNumFlushes);
486 FdoData->DbgAveIOsToFlush = FdoData->DbgNumIORequests/FdoData->DbgNumFlushes;
487 FdoData->DbgIOsSinceFlush = 0;
488 }
489
490 }
491
492
493 /*++////////////////////////////////////////////////////////////////////////////
494
495 SnapDiskStartup()
496
497 Routine Description:
498
499 This function will attempt to record the caller responsible for spinning
500 up the disk.
501
502 Arguments:
503
504 NONE.
505
506 Return Value:
507
508 NONE.
509
510 --*/
511 VOID
513 VOID
514 )
515 {
516 ULONG Index;
517 PDISK_SPINUP_TRACES Entry;
518 LARGE_INTEGER SpinUpTime;
519
520#ifdef _MSC_VER
521#pragma warning(push)
522#pragma warning(disable:4210) // nonstandard extension used : function given file scope
523#endif
525 _In_ ULONG FramesToSkip,
527 _Out_writes_to_(FramesToCapture, return) PVOID * BackTrace,
529#ifdef _MSC_VER
530#pragma warning(pop)
531#endif
532
533 //
534 // Grab the current count, then mod it so that it
535 // becomes an index into the DiskSpinupTraces array.
536 //
537 Index = InterlockedIncrement( (volatile LONG *)&DiskSpinupIndex );
538 Index = Index & (NUMBER_OF_DISK_SPINUP_TRACES - 1);
539 Entry = &DiskSpinupTraces[Index];
540
541 //
542 // Timestamp the instance.
543 //
544 KeQueryTickCount(&SpinUpTime);
545 SpinUpTime.QuadPart = (SpinUpTime.QuadPart * KeQueryTimeIncrement())/(10000000);
546
547
548 //
549 // Ask the kernel to read back up our stack by
550 // DISK_SPINUP_BACKTRACE_LENGTH frames.
551 //
552 Entry->TimeStamp.QuadPart = SpinUpTime.QuadPart;
553 RtlZeroMemory( &Entry->StackTrace[0], DISK_SPINUP_BACKTRACE_LENGTH * sizeof(PVOID) );
554 RtlCaptureStackBackTrace( 5, // stacks to skip
555 DISK_SPINUP_BACKTRACE_LENGTH, // buffer size
556 Entry->StackTrace,
557 &Index );
558 }
559
560#else
561
562 // We have to keep this in the retail build for legacy.
563 VOID ClassDebugPrint(_In_ CLASS_DEBUG_LEVEL DebugPrintLevel, _In_z_ PCCHAR DebugMessage, ...)
564 {
565 UNREFERENCED_PARAMETER(DebugPrintLevel);
566 UNREFERENCED_PARAMETER(DebugMessage);
567 }
568
569#endif
570
572 {
573 char *ioctlStr = "?";
574
575 switch (ioctl){
576
577 #undef MAKE_CASE
578 #define MAKE_CASE(ioctlCode) case ioctlCode: ioctlStr = #ioctlCode; break;
579
604 }
605
606 return ioctlStr;
607 }
608
610 {
611 PCDB pCdb = SrbGetCdb(Srb);
612 char *scsiOpStr = "?";
613
614 if (pCdb) {
615
616 switch (pCdb->CDB6GENERIC.OperationCode){
617
618 #undef MAKE_CASE
619 #define MAKE_CASE(scsiOpCode) case scsiOpCode: scsiOpStr = #scsiOpCode; break;
620
622 MAKE_CASE(SCSIOP_REWIND) // aka SCSIOP_REZERO_UNIT
627 MAKE_CASE(SCSIOP_INIT_ELEMENT_STATUS) // aka SCSIOP_REASSIGN_BLOCKS
628 MAKE_CASE(SCSIOP_RECEIVE) // aka SCSIOP_READ6
629 MAKE_CASE(SCSIOP_SEND) // aka SCSIOP_WRITE6, SCSIOP_PRINT
630 MAKE_CASE(SCSIOP_SLEW_PRINT) // aka SCSIOP_SEEK6, SCSIOP_TRACK_SELECT
634 MAKE_CASE(SCSIOP_FLUSH_BUFFER) // aka SCSIOP_WRITE_FILEMARKS
645 MAKE_CASE(SCSIOP_START_STOP_UNIT) // aka SCSIOP_STOP_PRINT, SCSIOP_LOAD_UNLOAD
653 MAKE_CASE(SCSIOP_SEEK) // aka SCSIOP_LOCATE, SCSIOP_POSITION_TO_ELEMENT
696 MAKE_CASE(SCSIOP_LOAD_UNLOAD_SLOT) // aka SCSIOP_EXCHANGE_MEDIUM
715 }
716 }
717
718 return scsiOpStr;
719 }
720
721
723 {
724 char *srbStatStr = "?";
725
726 switch (Srb->SrbStatus){
727
728 #undef MAKE_CASE
729 #define MAKE_CASE(srbStat) \
730 case srbStat: \
731 srbStatStr = #srbStat; \
732 break; \
733 case srbStat|SRB_STATUS_QUEUE_FROZEN: \
734 srbStatStr = #srbStat "|SRB_STATUS_QUEUE_FROZEN"; \
735 break; \
736 case srbStat|SRB_STATUS_AUTOSENSE_VALID: \
737 srbStatStr = #srbStat "|SRB_STATUS_AUTOSENSE_VALID"; \
738 break; \
739 case srbStat|SRB_STATUS_QUEUE_FROZEN|SRB_STATUS_AUTOSENSE_VALID: \
740 srbStatStr = #srbStat "|SRB_STATUS_QUEUE_FROZEN|SRB_STATUS_AUTOSENSE_VALID"; \
741 break;
742
771 }
772
773 return srbStatStr;
774 }
775
776
778 {
779 char *senseCodeStr = "?";
780
782
783 PVOID senseData;
784 UCHAR senseCode;
786
787 senseData = SrbGetSenseInfoBuffer(Srb);
788 NT_ASSERT(senseData);
789
790 validSense = ScsiGetSenseKeyAndCodes(senseData,
793 &senseCode,
794 NULL,
795 NULL);
796 if (validSense) {
797 switch (senseCode){
798
799 #undef MAKE_CASE
800 #define MAKE_CASE(snsCod) case snsCod: senseCodeStr = #snsCod; break;
801
818 }
819 }
820 }
821
822 return senseCodeStr;
823 }
824
825
827 {
828 char *adSenseCodeStr = "?";
829
831 PVOID senseData;
832 UCHAR adSenseCode;
834
835 senseData = SrbGetSenseInfoBuffer(Srb);
836 NT_ASSERT(senseData);
837
838 validSense = ScsiGetSenseKeyAndCodes(senseData,
841 NULL,
842 &adSenseCode,
843 NULL);
844
845 if (validSense) {
846 switch (adSenseCode){
847
848 #undef MAKE_CASE
849 #define MAKE_CASE(adSnsCod) case adSnsCod: adSenseCodeStr = #adSnsCod; break;
850
861 MAKE_CASE(SCSI_ADSENSE_WRITE_PROTECT) // aka SCSI_ADWRITE_PROTECT
874 }
875 }
876 }
877
878 return adSenseCodeStr;
879 }
880
881
883 {
884 char *adSenseCodeQualStr = "?";
885
887 PVOID senseData;
888 UCHAR adSenseCode;
889 UCHAR adSenseCodeQual;
891
892 senseData = SrbGetSenseInfoBuffer(Srb);
893 NT_ASSERT(senseData);
894
895 validSense = ScsiGetSenseKeyAndCodes(senseData,
898 NULL,
899 &adSenseCode,
900 &adSenseCodeQual);
901 if (validSense) {
902 switch (adSenseCode){
903
904 #undef MAKE_CASE
905 #define MAKE_CASE(adSnsCodQual) case adSnsCodQual: adSenseCodeQualStr = #adSnsCodQual; break;
906
908 switch (adSenseCodeQual){
918 }
919 break;
921 switch (adSenseCodeQual){
926 }
927 break;
929 switch (adSenseCodeQual){
931 }
932 break;
934 switch (adSenseCodeQual){
937 }
938 break;
940 switch (adSenseCodeQual){
945 }
946 break;
948 switch (adSenseCodeQual){
953 }
954 break;
956 switch (adSenseCodeQual){
963 }
964 break;
965 }
966 }
967 }
968
969 return adSenseCodeQualStr;
970 }
971
972
unsigned char BOOLEAN
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedExchange
Definition: armddk.h:54
NTSYSAPI ULONG NTAPI vDbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ PCCH Format, _In_ va_list ap)
#define DPFLTR_ERROR_LEVEL
Definition: main.cpp:32
LONG NTSTATUS
Definition: precomp.h:26
#define index(s, c)
Definition: various.h:29
#define NTSYSAPI
Definition: ntoskrnl.h:12
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:989
#define SCSI_ADSENSE_ILLEGAL_BLOCK
Definition: cdrw_hw.h:1264
#define SCSIOP_PARTITION
Definition: cdrw_hw.h:883
#define SCSIOP_PLAY_AUDIO
Definition: cdrw_hw.h:929
#define SCSI_ADSENSE_LUN_NOT_READY
Definition: cdrw_hw.h:1218
#define SCSIOP_LOAD_UNLOAD_SLOT
Definition: cdrw_hw.h:954
#define SCSIOP_SEND_DIAGNOSTIC
Definition: cdrw_hw.h:901
#define SCSIOP_MODE_SENSE10
Definition: cdrw_hw.h:946
#define SCSIOP_PLAY_TRACK_RELATIVE
Definition: cdrw_hw.h:933
#define SCSIOP_READ_REVERSE
Definition: cdrw_hw.h:884
#define SCSI_ADSENSE_VENDOR_UNIQUE
Definition: cdrw_hw.h:1281
#define SCSI_SENSEQ_MANUAL_INTERVENTION_REQUIRED
Definition: cdrw_hw.h:1315
#define SCSI_SENSE_NO_SENSE
Definition: cdrw_hw.h:1187
#define SCSI_SENSEQ_CLEANING_CARTRIDGE_INSTALLED
Definition: cdrw_hw.h:1324
#define SCSIOP_GET_EVENT_STATUS
Definition: cdrw_hw.h:934
#define SCSIOP_READ_CD
Definition: cdrw_hw.h:967
#define SCSI_SENSEQ_OPERATION_IN_PROGRESS
Definition: cdrw_hw.h:1317
#define SCSI_SENSEQ_INCOMPATIBLE_FORMAT
Definition: cdrw_hw.h:1323
#define SCSIOP_COPY
Definition: cdrw_hw.h:894
#define SCSIOP_RECOVER_BUF_DATA
Definition: cdrw_hw.h:890
#define SCSIOP_SEARCH_DATA_HIGH
Definition: cdrw_hw.h:913
#define SCSI_SENSEQ_AUTHENTICATION_FAILURE
Definition: cdrw_hw.h:1390
#define SCSIOP_WRITE_VERIFY
Definition: cdrw_hw.h:911
#define SCSIOP_INQUIRY
Definition: cdrw_hw.h:888
#define SCSI_SENSEQ_END_OF_MEDIA_DETECTED
Definition: cdrw_hw.h:1440
#define SCSIOP_REWIND
Definition: cdrw_hw.h:868
#define SCSIOP_REQUEST_SENSE
Definition: cdrw_hw.h:870
#define SCSI_ADSENSE_SEEK_ERROR
Definition: cdrw_hw.h:1232
#define SCSIOP_PLAY_AUDIO_MSF
Definition: cdrw_hw.h:931
#define SCSIOP_READ_SUB_CHANNEL
Definition: cdrw_hw.h:926
#define SCSI_SENSE_RESERVED
Definition: cdrw_hw.h:1202
#define SCSI_SENSE_UNIQUE
Definition: cdrw_hw.h:1196
#define SCSIOP_CHANGE_DEFINITION
Definition: cdrw_hw.h:924
#define SCSI_SENSEQ_SETMARK_DETECTED
Definition: cdrw_hw.h:1439
#define SCSIOP_SEEK
Definition: cdrw_hw.h:908
#define SCSIOP_GET_CONFIGURATION
Definition: cdrw_hw.h:930
#define SCSIOP_TEST_UNIT_READY
Definition: cdrw_hw.h:866
#define SCSIOP_PLAY_TRACK_INDEX
Definition: cdrw_hw.h:932
#define SCSIOP_SEND_CUE_SHEET
Definition: cdrw_hw.h:949
#define SCSI_ADSENSE_REC_DATA_NOECC
Definition: cdrw_hw.h:1211
#define SCSIOP_COPY_COMPARE
Definition: cdrw_hw.h:920
#define SCSI_SENSE_COPY_ABORTED
Definition: cdrw_hw.h:1197
#define SCSI_ADSENSE_INVALID_LUN
Definition: cdrw_hw.h:1266
#define SCSI_ADSENSE_POSITION_ERROR
Definition: cdrw_hw.h:1222
#define SCSI_SENSE_DATA_PROTECT
Definition: cdrw_hw.h:1194
#define SCSIOP_READ_TOC
Definition: cdrw_hw.h:927
#define SCSI_ADSENSE_INVALID_CDB
Definition: cdrw_hw.h:1265
#define SCSI_ADSENSE_WRITE_PROTECT
Definition: cdrw_hw.h:1268
#define SCSI_ADSENSE_MUSIC_AREA
Definition: cdrw_hw.h:1282
#define SCSI_ADSENSE_TRACK_ERROR
Definition: cdrw_hw.h:1231
#define SCSIOP_RELEASE_UNIT
Definition: cdrw_hw.h:893
#define SCSIOP_MEDIUM_REMOVAL
Definition: cdrw_hw.h:902
#define SCSIOP_SET_READ_AHEAD
Definition: cdrw_hw.h:955
#define SCSI_SENSEQ_KEY_NOT_ESTABLISHED
Definition: cdrw_hw.h:1392
#define SCSI_SENSE_MEDIUM_ERROR
Definition: cdrw_hw.h:1190
#define SCSI_SENSEQ_READ_OF_SCRAMBLED_SECTOR_WITHOUT_AUTHENTICATION
Definition: cdrw_hw.h:1393
#define SCSIOP_ERASE
Definition: cdrw_hw.h:895
#define SCSIOP_SEND_DVD_STRUCTURE
Definition: cdrw_hw.h:969
#define SCSIOP_FORMAT_UNIT
Definition: cdrw_hw.h:871
#define SCSIOP_PAUSE_RESUME
Definition: cdrw_hw.h:935
#define SCSI_ADSENSE_ILLEGAL_COMMAND
Definition: cdrw_hw.h:1263
#define SCSI_SENSEQ_UNKNOWN_FORMAT
Definition: cdrw_hw.h:1322
#define SCSIOP_SPACE
Definition: cdrw_hw.h:887
#define SCSIOP_WRITE_DATA_BUFF
Definition: cdrw_hw.h:922
#define SCSIOP_VERIFY6
Definition: cdrw_hw.h:889
#define SCSIOP_READ_CAPACITY
Definition: cdrw_hw.h:904
#define SCSIOP_FLUSH_BUFFER
Definition: cdrw_hw.h:886
#define SCSIOP_RECEIVE
Definition: cdrw_hw.h:875
#define SCSIOP_WRITE
Definition: cdrw_hw.h:906
#define SCSIOP_READ_HEADER
Definition: cdrw_hw.h:928
#define SCSI_SENSEQ_FILEMARK_DETECTED
Definition: cdrw_hw.h:1438
#define SCSIOP_MECHANISM_STATUS
Definition: cdrw_hw.h:966
#define SCSIOP_SEARCH_DATA_EQUAL
Definition: cdrw_hw.h:914
#define SCSIOP_CLOSE_TRACK_SESSION
Definition: cdrw_hw.h:947
#define SCSIOP_READ_DATA_BUFF
Definition: cdrw_hw.h:923
#define SCSI_SENSEQ_MEDIA_CODE_MISMATCHED_TO_LOGICAL_UNIT
Definition: cdrw_hw.h:1394
#define SCSIOP_READ_POSITION
Definition: cdrw_hw.h:917
#define SCSI_SENSEQ_CAUSE_NOT_REPORTABLE
Definition: cdrw_hw.h:1312
#define SCSIOP_VERIFY
Definition: cdrw_hw.h:912
#define SCSI_SENSEQ_KEY_NOT_PRESENT
Definition: cdrw_hw.h:1391
#define SCSIOP_RESERVE_UNIT
Definition: cdrw_hw.h:892
#define SCSI_ADSENSE_REC_DATA_ECC
Definition: cdrw_hw.h:1212
#define SCSIOP_BLANK
Definition: cdrw_hw.h:950
#define SCSI_SENSEQ_BECOMING_READY
Definition: cdrw_hw.h:1313
#define SCSI_ADSENSE_INVALID_MEDIA
Definition: cdrw_hw.h:1220
#define SCSIOP_SEND_KEY
Definition: cdrw_hw.h:951
#define SCSIOP_READ_BUFFER_CAPACITY
Definition: cdrw_hw.h:948
#define SCSI_SENSE_ILLEGAL_REQUEST
Definition: cdrw_hw.h:1192
#define SCSIOP_REPORT_KEY
Definition: cdrw_hw.h:952
#define SCSI_SENSEQ_LOGICAL_UNIT_RESET_COUNT_ERROR
Definition: cdrw_hw.h:1395
#define SCSIOP_MODE_SENSE
Definition: cdrw_hw.h:896
#define SCSI_SENSE_EQUAL
Definition: cdrw_hw.h:1199
#define SCSI_ADSENSE_NO_SENSE
Definition: cdrw_hw.h:1207
#define SCSI_SENSE_UNIT_ATTENTION
Definition: cdrw_hw.h:1193
#define SCSI_ADSENSE_NO_MEDIA_IN_DEVICE
Definition: cdrw_hw.h:1221
#define SCSI_SENSE_MISCOMPARE
Definition: cdrw_hw.h:1201
#define SCSIOP_STOP_PLAY_SCAN
Definition: cdrw_hw.h:938
#define SCSIOP_READ_BLOCK_LIMITS
Definition: cdrw_hw.h:872
#define SCSI_SENSEQ_INIT_COMMAND_REQUIRED
Definition: cdrw_hw.h:1314
#define SCSI_ADSENSE_DATA_AREA
Definition: cdrw_hw.h:1283
#define SCSIOP_RECEIVE_DIAGNOSTIC
Definition: cdrw_hw.h:900
#define SCSIOP_READ_DVD_STRUCTURE
Definition: cdrw_hw.h:960
#define SCSIOP_SLEW_PRINT
Definition: cdrw_hw.h:881
#define SCSI_SENSEQ_INCOMPATIBLE_MEDIA_INSTALLED
Definition: cdrw_hw.h:1321
#define SCSI_ADSENSE_MEDIUM_CHANGED
Definition: cdrw_hw.h:1288
#define SCSIOP_SEARCH_DATA_LOW
Definition: cdrw_hw.h:915
#define SCSIOP_READ_CD_MSF
Definition: cdrw_hw.h:964
#define SCSI_SENSE_VOL_OVERFLOW
Definition: cdrw_hw.h:1200
#define SCSIOP_SEEK_BLOCK
Definition: cdrw_hw.h:882
#define SCSIOP_COMPARE
Definition: cdrw_hw.h:919
#define SCSIOP_SEND
Definition: cdrw_hw.h:878
#define SCSIOP_START_STOP_UNIT
Definition: cdrw_hw.h:897
#define SCSIOP_SET_LIMITS
Definition: cdrw_hw.h:916
#define SCSI_SENSE_BLANK_CHECK
Definition: cdrw_hw.h:1195
#define SCSI_SENSE_HARDWARE_ERROR
Definition: cdrw_hw.h:1191
#define SCSI_ADSENSE_VOLUME_OVERFLOW
Definition: cdrw_hw.h:1284
#define SCSIOP_SET_CD_SPEED
Definition: cdrw_hw.h:965
#define SCSI_SENSE_RECOVERED_ERROR
Definition: cdrw_hw.h:1188
#define SCSIOP_MODE_SELECT10
Definition: cdrw_hw.h:943
#define SCSIOP_READ
Definition: cdrw_hw.h:905
#define SCSIOP_REQUEST_BLOCK_ADDR
Definition: cdrw_hw.h:869
#define SCSIOP_MODE_SELECT
Definition: cdrw_hw.h:891
#define SCSI_SENSEQ_BEGINNING_OF_MEDIA_DETECTED
Definition: cdrw_hw.h:1441
#define SCSI_SENSE_NOT_READY
Definition: cdrw_hw.h:1189
#define SCSIOP_LOG_SELECT
Definition: cdrw_hw.h:936
#define SCSI_SENSE_ABORTED_COMMAND
Definition: cdrw_hw.h:1198
#define SCSI_ADSENSE_BUS_RESET
Definition: cdrw_hw.h:1289
#define SCSI_SENSEQ_FORMAT_IN_PROGRESS
Definition: cdrw_hw.h:1316
#define SCSIOP_SYNCHRONIZE_CACHE
Definition: cdrw_hw.h:918
#define SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS
Definition: cdrw_hw.h:1318
#define SCSIOP_LOG_SENSE
Definition: cdrw_hw.h:937
#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX
Definition: cdrw_usr.h:190
_In_ PTRANSFER_PACKET Pkt
Definition: classp.h:1754
#define DBG_NUM_PACKET_LOG_ENTRIES
Definition: classp.h:487
FORCEINLINE PCDB ClasspTransferPacketGetCdb(_In_ PTRANSFER_PACKET Pkt)
Definition: classp.h:2445
enum _CLASS_DEBUG_LEVEL CLASS_DEBUG_LEVEL
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
@ DPFLTR_CLASSPNP_ID
Definition: dpfilter.h:36
KIRQL irql
Definition: wave.h:1
char * DbgGetScsiOpStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:609
char * DbgGetAdditionalSenseCodeStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:826
#define MAKE_CASE(ioctlCode)
char * DbgGetSenseCodeStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:777
char * DbgGetAdditionalSenseCodeQualifierStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:882
char * DbgGetIoctlStr(ULONG ioctl)
Definition: debug.c:571
VOID ClassDebugPrint(_In_ CLASS_DEBUG_LEVEL DebugPrintLevel, _In_z_ PCCHAR DebugMessage,...)
Definition: debug.c:563
char * DbgGetSrbStatusStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:722
#define DBGGETSCSIOPSTR(_pSrb)
Definition: debug.h:26
#define DBGGETADSENSECODESTR(_pSrb)
Definition: debug.h:29
#define ClasspInitializeDebugGlobals()
Definition: debug.h:123
#define DBGGETADSENSEQUALIFIERSTR(_pSrb)
Definition: debug.h:30
#define DBGGETSRBSTATUSSTR(_pSrb)
Definition: debug.h:27
#define DBGGETSENSECODESTR(_pSrb)
Definition: debug.h:28
#define SnapDiskStartup()
Definition: debug.h:124
#define SCSIOP_READ16
Definition: scsi.h:914
#define SCSIOP_REPORT_LUNS
Definition: scsi.h:921
#define SCSIOP_VERIFY16
Definition: scsi.h:916
#define SCSIOP_WRITE16
Definition: scsi.h:915
#define SRB_STATUS_INVALID_LUN
Definition: srb.h:362
#define SRB_STATUS_REQUEST_FLUSHED
Definition: srb.h:361
#define SRB_STATUS_PHASE_SEQUENCE_FAILURE
Definition: srb.h:359
#define SRB_STATUS_NO_HBA
Definition: srb.h:356
#define SRB_STATUS_BUS_RESET
Definition: srb.h:353
#define SRB_STATUS_INVALID_TARGET_ID
Definition: srb.h:363
#define SRB_STATUS_NOT_POWERED
Definition: srb.h:366
#define SRB_STATUS_UNEXPECTED_BUS_FREE
Definition: srb.h:358
#define SRB_STATUS_DATA_OVERRUN
Definition: srb.h:357
#define SRB_STATUS_ABORTED
Definition: srb.h:342
#define SRB_STATUS_PENDING
Definition: srb.h:340
#define SRB_STATUS_INVALID_PATH_ID
Definition: srb.h:347
#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH
Definition: srb.h:360
#define SRB_STATUS_TIMEOUT
Definition: srb.h:349
#define SRB_STATUS_AUTOSENSE_VALID
Definition: srb.h:387
#define SRB_STATUS_ERROR_RECOVERY
Definition: srb.h:365
#define SRB_STATUS_MESSAGE_REJECTED
Definition: srb.h:352
#define SRB_STATUS_ERROR
Definition: srb.h:344
#define SRB_STATUS_ABORT_FAILED
Definition: srb.h:343
#define SRB_STATUS_SELECTION_TIMEOUT
Definition: srb.h:350
#define SRB_STATUS_BAD_FUNCTION
Definition: srb.h:364
#define SRB_STATUS(Status)
Definition: srb.h:389
#define SRB_STATUS_INTERNAL_ERROR
Definition: srb.h:373
#define SRB_STATUS_COMMAND_TIMEOUT
Definition: srb.h:351
#define SRB_STATUS_PARITY_ERROR
Definition: srb.h:354
#define SRB_STATUS_BUSY
Definition: srb.h:345
#define SRB_STATUS_REQUEST_SENSE_FAILED
Definition: srb.h:355
#define SRB_STATUS_NO_DEVICE
Definition: srb.h:348
#define SRB_STATUS_SUCCESS
Definition: srb.h:341
#define SRB_STATUS_INVALID_REQUEST
Definition: srb.h:346
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
#define IOCTL_STORAGE_CHECK_VERIFY2
Definition: ntddk_ex.h:212
#define IOCTL_STORAGE_LOAD_MEDIA2
Definition: ntddk_ex.h:210
PWCHAR pValue
_In_ ULONG FramesToCapture
_In_ ULONG _Out_opt_ PULONG BackTraceHash
size_t bufferSize
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
#define InterlockedCompareExchange
Definition: interlocked.h:104
#define IOCTL_STORAGE_GET_HOTPLUG_INFO
Definition: imports.h:238
#define min(a, b)
Definition: monoChain.cc:55
#define _Out_opt_
Definition: ms_sal.h:346
#define _In_z_
Definition: ms_sal.h:313
#define _In_
Definition: ms_sal.h:308
#define _Out_writes_to_(size, count)
Definition: ms_sal.h:355
#define DPFLTR_INFO_LEVEL
Definition: kdtypes.h:33
NTSYSAPI ULONG __cdecl DbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ _Printf_format_string_ PCSTR Format,...)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IOCTL_STORAGE_QUERY_PROPERTY
Definition: ntddstor.h:178
#define IOCTL_STORAGE_RELEASE
Definition: ntddstor.h:119
#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER
Definition: ntddstor.h:151
#define IOCTL_STORAGE_GET_DEVICE_NUMBER
Definition: ntddstor.h:143
#define IOCTL_STORAGE_CHECK_VERIFY
Definition: ntddstor.h:98
#define IOCTL_STORAGE_PERSISTENT_RESERVE_IN
Definition: ntddstor.h:169
#define IOCTL_STORAGE_PERSISTENT_RESERVE_OUT
Definition: ntddstor.h:172
#define IOCTL_STORAGE_LOAD_MEDIA
Definition: ntddstor.h:110
#define IOCTL_STORAGE_RESERVE
Definition: ntddstor.h:116
#define IOCTL_STORAGE_GET_MEDIA_TYPES
Definition: ntddstor.h:131
#define OBSOLETE_IOCTL_STORAGE_RESET_BUS
Definition: ntddstor.h:160
#define IOCTL_STORAGE_RESET_DEVICE
Definition: ntddstor.h:140
#define IOCTL_STORAGE_PREDICT_FAILURE
Definition: ntddstor.h:146
#define IOCTL_STORAGE_FIND_NEW_DEVICES
Definition: ntddstor.h:122
#define IOCTL_STORAGE_RESET_BUS
Definition: ntddstor.h:137
#define IOCTL_STORAGE_MCN_CONTROL
Definition: ntddstor.h:128
#define IOCTL_STORAGE_EJECT_MEDIA
Definition: ntddstor.h:107
#define IOCTL_STORAGE_EJECTION_CONTROL
Definition: ntddstor.h:125
#define OBSOLETE_IOCTL_STORAGE_RESET_DEVICE
Definition: ntddstor.h:163
#define IOCTL_STORAGE_MEDIA_REMOVAL
Definition: ntddstor.h:104
ULONG NTAPI KeQueryTimeIncrement(VOID)
Definition: clock.c:153
_Null_terminated_ char * NTSTRSAFE_PSTR
Definition: ntstrsafe.h:56
NTSTRSAFEAPI RtlStringCchVPrintfA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, _In_ va_list argList)
Definition: ntstrsafe.h:984
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define SCSI_SENSEQ_STATE_CHANGE_INPUT
Definition: scsi.h:878
#define SCSI_ADSENSE_COPY_PROTECTION_FAILURE
Definition: scsi.h:694
#define SCSI_SENSEQ_RECALCULATION_IN_PROGRESS
Definition: scsi.h:728
#define SCSIOP_MOVE_MEDIUM
Definition: scsi.h:380
#define SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED
Definition: scsi.h:692
#define SCSIOP_SEND_OPC_INFORMATION
Definition: scsi.h:318
#define SCSIOP_RESERVE_TRACK_RZONE
Definition: scsi.h:317
#define SCSIOP_INIT_ELEMENT_STATUS
Definition: scsi.h:241
#define SCSIOP_SEND_VOLUME_TAG
Definition: scsi.h:402
#define SCSIOP_READ_TRACK_INFORMATION
Definition: scsi.h:315
#define SCSI_SENSE_OPTIONS_FIXED_FORMAT_IF_UNKNOWN_FORMAT_INDICATED
Definition: scsi.h:3839
#define SCSIOP_PLAY_CD
Definition: scsi.h:411
#define SCSI_SENSEQ_WRITE_PROTECT_DISABLE
Definition: scsi.h:881
#define SCSI_SENSEQ_ILLEGAL_ELEMENT_ADDR
Definition: scsi.h:787
#define SCSIOP_READ_FORMATTED_CAPACITY
Definition: scsi.h:273
#define SCSIOP_READ_DISK_INFORMATION
Definition: scsi.h:313
#define SCSI_SENSEQ_REBUILD_IN_PROGRESS
Definition: scsi.h:727
#define SCSIOP_PERSISTENT_RESERVE_IN
Definition: scsi.h:329
#define SCSI_SENSEQ_MEDIUM_REMOVAL
Definition: scsi.h:879
#define SCSIOP_INIT_ELEMENT_RANGE
Definition: scsi.h:419
#define SCSIOP_SYNCHRONIZE_CACHE16
Definition: scsi.h:355
#define SCSIOP_READ_ELEMENT_STATUS
Definition: scsi.h:405
#define SCSI_SENSEQ_SOURCE_EMPTY
Definition: scsi.h:812
#define SCSI_ADSENSE_OPERATOR_REQUEST
Definition: scsi.h:691
#define SCSIOP_READ_CAPACITY16
Definition: scsi.h:364
#define SCSIOP_SCAN_CD
Definition: scsi.h:407
#define SCSI_SENSEQ_DESTINATION_FULL
Definition: scsi.h:811
#define SCSIOP_PERSISTENT_RESERVE_OUT
Definition: scsi.h:330
#define SCSI_SENSEQ_WRITE_PROTECT_ENABLE
Definition: scsi.h:880
BOOLEAN validSense
Definition: scsi.h:4018
#define SCSIOP_REQUEST_VOL_ELEMENT
Definition: scsi.h:400
struct SRB_ALIGN _STORAGE_REQUEST_BLOCK_HEADER * PSTORAGE_REQUEST_BLOCK_HEADER
#define KeQueryTickCount(CurrentCount)
Definition: ke.h:43
FORCEINLINE PVOID SrbGetDataBuffer(_In_ PVOID Srb)
Definition: srbhelper.h:728
FORCEINLINE PVOID SrbGetSenseInfoBuffer(_In_ PVOID Srb)
Definition: srbhelper.h:619
FORCEINLINE ULONG SrbGetSystemStatus(_In_ PVOID Srb)
Definition: srbhelper.h:1000
FORCEINLINE UCHAR SrbGetSenseInfoBufferLength(_In_ PVOID Srb)
Definition: srbhelper.h:638
FORCEINLINE ULONG SrbGetDataTransferLength(_In_ PVOID Srb)
Definition: srbhelper.h:765
FORCEINLINE PVOID SrbGetOriginalRequest(_In_ PVOID Srb)
Definition: srbhelper.h:693
#define TRACE_LEVEL_WARNING
Definition: storswtr.h:28
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
base of all file and directory entries
Definition: entries.h:83
KSPIN_LOCK SpinLock
Definition: classp.h:795
PVOID DeviceExtension
Definition: env_spec_w32.h:418
IO_STATUS_BLOCK IoStatus
UCHAR SrbStatus
Definition: srb.h:251
PSTORAGE_REQUEST_BLOCK_HEADER Srb
Definition: classp.h:580
ULONG BufLenCopy
Definition: classp.h:563
PIRP OriginalIrp
Definition: classp.h:509
PDEVICE_OBJECT Fdo
Definition: classp.h:503
PUCHAR BufPtrCopy
Definition: classp.h:562
Definition: ps.c:97
#define max(a, b)
Definition: svc.c:63
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
Definition: cdrw_hw.h:28
struct _CDB::_CDB10 CDB10
struct _CDB::_CDB6GENERIC CDB6GENERIC
LONGLONG QuadPart
Definition: typedefs.h:114
#define SrbGetCdb(srb)
Definition: usbstor.h:18
_In_ WDFCOLLECTION _In_ ULONG Index
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
#define ioctl
Definition: wintirpc.h:60
#define NT_ASSERT
Definition: rtlfuncs.h:3310
NTSYSAPI USHORT NTAPI RtlCaptureStackBackTrace(_In_ ULONG FramesToSkip, _In_ ULONG FramesToCapture, _Out_writes_to_(FramesToCapture, return) PVOID *BackTrace, _Out_opt_ PULONG BackTraceHash)
unsigned char UCHAR
Definition: xmlstorage.h:181