ReactOS  0.4.15-dev-1187-g119f102
debug.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DBGGETIOCTLSTR(_ioctl)   DbgGetIoctlStr(_ioctl)
 
#define DBGGETSCSIOPSTR(_pSrb)   DbgGetScsiOpStr(_pSrb)
 
#define DBGGETSRBSTATUSSTR(_pSrb)   DbgGetSrbStatusStr(_pSrb)
 
#define DBGGETSENSECODESTR(_pSrb)   DbgGetSenseCodeStr(_pSrb)
 
#define DBGGETADSENSECODESTR(_pSrb)   DbgGetAdditionalSenseCodeStr(_pSrb)
 
#define DBGGETADSENSEQUALIFIERSTR(_pSrb)   DbgGetAdditionalSenseCodeQualifierStr(_pSrb)
 
#define ClasspInitializeDebugGlobals()
 
#define SnapDiskStartup()
 
#define DBGCHECKRETURNEDPKT(_pkt)
 
#define DBGLOGSENDPACKET(_pkt)
 
#define DBGLOGRETURNPACKET(_pkt)
 
#define DBGLOGFLUSHINFO(_fdoData, _isIO, _isFUA, _isFlush)
 

Functions

charDbgGetIoctlStr (ULONG ioctl)
 
charDbgGetScsiOpStr (PSTORAGE_REQUEST_BLOCK_HEADER Srb)
 
charDbgGetSrbStatusStr (PSTORAGE_REQUEST_BLOCK_HEADER Srb)
 
charDbgGetSenseCodeStr (PSTORAGE_REQUEST_BLOCK_HEADER Srb)
 
charDbgGetAdditionalSenseCodeStr (PSTORAGE_REQUEST_BLOCK_HEADER Srb)
 
charDbgGetAdditionalSenseCodeQualifierStr (PSTORAGE_REQUEST_BLOCK_HEADER Srb)
 

Macro Definition Documentation

◆ ClasspInitializeDebugGlobals

#define ClasspInitializeDebugGlobals ( )

Definition at line 123 of file debug.h.

◆ DBGCHECKRETURNEDPKT

#define DBGCHECKRETURNEDPKT (   _pkt)

Definition at line 126 of file debug.h.

◆ DBGGETADSENSECODESTR

#define DBGGETADSENSECODESTR (   _pSrb)    DbgGetAdditionalSenseCodeStr(_pSrb)

Definition at line 29 of file debug.h.

◆ DBGGETADSENSEQUALIFIERSTR

#define DBGGETADSENSEQUALIFIERSTR (   _pSrb)    DbgGetAdditionalSenseCodeQualifierStr(_pSrb)

Definition at line 30 of file debug.h.

◆ DBGGETIOCTLSTR

#define DBGGETIOCTLSTR (   _ioctl)    DbgGetIoctlStr(_ioctl)

Definition at line 25 of file debug.h.

◆ DBGGETSCSIOPSTR

#define DBGGETSCSIOPSTR (   _pSrb)    DbgGetScsiOpStr(_pSrb)

Definition at line 26 of file debug.h.

◆ DBGGETSENSECODESTR

#define DBGGETSENSECODESTR (   _pSrb)    DbgGetSenseCodeStr(_pSrb)

Definition at line 28 of file debug.h.

◆ DBGGETSRBSTATUSSTR

#define DBGGETSRBSTATUSSTR (   _pSrb)    DbgGetSrbStatusStr(_pSrb)

Definition at line 27 of file debug.h.

◆ DBGLOGFLUSHINFO

#define DBGLOGFLUSHINFO (   _fdoData,
  _isIO,
  _isFUA,
  _isFlush 
)

Definition at line 129 of file debug.h.

◆ DBGLOGRETURNPACKET

#define DBGLOGRETURNPACKET (   _pkt)

Definition at line 128 of file debug.h.

◆ DBGLOGSENDPACKET

#define DBGLOGSENDPACKET (   _pkt)

Definition at line 127 of file debug.h.

◆ SnapDiskStartup

#define SnapDiskStartup ( )

Definition at line 124 of file debug.h.

Function Documentation

◆ DbgGetAdditionalSenseCodeQualifierStr()

char* DbgGetAdditionalSenseCodeQualifierStr ( PSTORAGE_REQUEST_BLOCK_HEADER  Srb)

Definition at line 882 of file debug.c.

883  {
884  char *adSenseCodeQualStr = "?";
885 
886  if (Srb->SrbStatus & SRB_STATUS_AUTOSENSE_VALID){
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  }
#define SCSI_SENSEQ_FORMAT_IN_PROGRESS
Definition: cdrw_hw.h:1316
#define SCSI_SENSEQ_STATE_CHANGE_INPUT
Definition: scsi.h:878
FORCEINLINE UCHAR SrbGetSenseInfoBufferLength(_In_ PVOID Srb)
Definition: srbhelper.h:638
#define SCSI_SENSEQ_INCOMPATIBLE_FORMAT
Definition: cdrw_hw.h:1323
#define SCSI_SENSEQ_MEDIUM_REMOVAL
Definition: scsi.h:879
#define SRB_STATUS_AUTOSENSE_VALID
Definition: srb.h:379
#define SCSI_ADSENSE_COPY_PROTECTION_FAILURE
Definition: scsi.h:694
#define SCSI_SENSEQ_READ_OF_SCRAMBLED_SECTOR_WITHOUT_AUTHENTICATION
Definition: cdrw_hw.h:1393
#define SCSI_SENSEQ_BEGINNING_OF_MEDIA_DETECTED
Definition: cdrw_hw.h:1441
#define SCSI_SENSEQ_END_OF_MEDIA_DETECTED
Definition: cdrw_hw.h:1440
#define SCSI_SENSE_OPTIONS_FIXED_FORMAT_IF_UNKNOWN_FORMAT_INDICATED
Definition: scsi.h:3839
#define SCSI_ADSENSE_LUN_NOT_READY
Definition: cdrw_hw.h:1218
#define SCSI_SENSEQ_REBUILD_IN_PROGRESS
Definition: scsi.h:727
#define SCSI_SENSEQ_RECALCULATION_IN_PROGRESS
Definition: scsi.h:728
#define SCSI_ADSENSE_OPERATOR_REQUEST
Definition: scsi.h:691
#define SCSI_ADSENSE_NO_SENSE
Definition: cdrw_hw.h:1207
#define SCSI_SENSEQ_SETMARK_DETECTED
Definition: cdrw_hw.h:1439
#define SCSI_SENSEQ_MANUAL_INTERVENTION_REQUIRED
Definition: cdrw_hw.h:1315
#define SCSI_SENSEQ_SOURCE_EMPTY
Definition: scsi.h:812
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define SCSI_SENSEQ_MEDIA_CODE_MISMATCHED_TO_LOGICAL_UNIT
Definition: cdrw_hw.h:1394
#define SCSI_SENSEQ_ILLEGAL_ELEMENT_ADDR
Definition: scsi.h:787
#define SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS
Definition: cdrw_hw.h:1318
#define SCSI_ADSENSE_ILLEGAL_BLOCK
Definition: cdrw_hw.h:1264
#define SCSI_SENSEQ_BECOMING_READY
Definition: cdrw_hw.h:1313
#define SCSI_ADSENSE_INVALID_MEDIA
Definition: cdrw_hw.h:1220
#define SCSI_SENSEQ_OPERATION_IN_PROGRESS
Definition: cdrw_hw.h:1317
#define SCSI_SENSEQ_KEY_NOT_ESTABLISHED
Definition: cdrw_hw.h:1392
unsigned char UCHAR
Definition: xmlstorage.h:181
#define SCSI_SENSEQ_UNKNOWN_FORMAT
Definition: cdrw_hw.h:1322
#define SCSI_SENSEQ_KEY_NOT_PRESENT
Definition: cdrw_hw.h:1391
#define SCSI_SENSEQ_CAUSE_NOT_REPORTABLE
Definition: cdrw_hw.h:1312
#define SCSI_SENSEQ_INCOMPATIBLE_MEDIA_INSTALLED
Definition: cdrw_hw.h:1321
#define SCSI_SENSEQ_INIT_COMMAND_REQUIRED
Definition: cdrw_hw.h:1314
#define SCSI_SENSEQ_CLEANING_CARTRIDGE_INSTALLED
Definition: cdrw_hw.h:1324
#define SCSI_ADSENSE_POSITION_ERROR
Definition: cdrw_hw.h:1222
FORCEINLINE PVOID SrbGetSenseInfoBuffer(_In_ PVOID Srb)
Definition: srbhelper.h:619
#define SCSI_SENSEQ_AUTHENTICATION_FAILURE
Definition: cdrw_hw.h:1390
#define SCSI_SENSEQ_WRITE_PROTECT_ENABLE
Definition: scsi.h:880
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
#define MAKE_CASE(ioctlCode)
#define SCSI_SENSEQ_DESTINATION_FULL
Definition: scsi.h:811
#define SCSI_SENSEQ_WRITE_PROTECT_DISABLE
Definition: scsi.h:881
#define SCSI_SENSEQ_FILEMARK_DETECTED
Definition: cdrw_hw.h:1438
#define SCSI_SENSEQ_LOGICAL_UNIT_RESET_COUNT_ERROR
Definition: cdrw_hw.h:1395
BOOLEAN validSense
Definition: scsi.h:4018
#define NT_ASSERT
Definition: rtlfuncs.h:3312

◆ DbgGetAdditionalSenseCodeStr()

char* DbgGetAdditionalSenseCodeStr ( PSTORAGE_REQUEST_BLOCK_HEADER  Srb)

Definition at line 826 of file debug.c.

827  {
828  char *adSenseCodeStr = "?";
829 
830  if (Srb->SrbStatus & SRB_STATUS_AUTOSENSE_VALID){
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  }
#define SCSI_ADSENSE_WRITE_PROTECT
Definition: cdrw_hw.h:1268
FORCEINLINE UCHAR SrbGetSenseInfoBufferLength(_In_ PVOID Srb)
Definition: srbhelper.h:638
#define SRB_STATUS_AUTOSENSE_VALID
Definition: srb.h:379
#define SCSI_ADSENSE_COPY_PROTECTION_FAILURE
Definition: scsi.h:694
#define SCSI_ADSENSE_MUSIC_AREA
Definition: cdrw_hw.h:1282
#define SCSI_ADSENSE_DATA_AREA
Definition: cdrw_hw.h:1283
#define SCSI_SENSE_OPTIONS_FIXED_FORMAT_IF_UNKNOWN_FORMAT_INDICATED
Definition: scsi.h:3839
#define SCSI_ADSENSE_LUN_NOT_READY
Definition: cdrw_hw.h:1218
#define SCSI_ADSENSE_VOLUME_OVERFLOW
Definition: cdrw_hw.h:1284
#define SCSI_ADSENSE_OPERATOR_REQUEST
Definition: scsi.h:691
#define SCSI_ADSENSE_REC_DATA_NOECC
Definition: cdrw_hw.h:1211
#define SCSI_ADSENSE_NO_SENSE
Definition: cdrw_hw.h:1207
#define SCSI_ADSENSE_NO_MEDIA_IN_DEVICE
Definition: cdrw_hw.h:1221
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define SCSI_ADSENSE_SEEK_ERROR
Definition: cdrw_hw.h:1232
#define SCSI_ADSENSE_ILLEGAL_BLOCK
Definition: cdrw_hw.h:1264
#define SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED
Definition: scsi.h:692
#define SCSI_ADSENSE_VENDOR_UNIQUE
Definition: cdrw_hw.h:1281
#define SCSI_ADSENSE_INVALID_MEDIA
Definition: cdrw_hw.h:1220
#define SCSI_ADSENSE_REC_DATA_ECC
Definition: cdrw_hw.h:1212
unsigned char UCHAR
Definition: xmlstorage.h:181
#define SCSI_ADSENSE_BUS_RESET
Definition: cdrw_hw.h:1289
#define SCSI_ADSENSE_POSITION_ERROR
Definition: cdrw_hw.h:1222
FORCEINLINE PVOID SrbGetSenseInfoBuffer(_In_ PVOID Srb)
Definition: srbhelper.h:619
#define SCSI_ADSENSE_INVALID_LUN
Definition: cdrw_hw.h:1266
#define SCSI_ADSENSE_TRACK_ERROR
Definition: cdrw_hw.h:1231
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
#define SCSI_ADSENSE_ILLEGAL_COMMAND
Definition: cdrw_hw.h:1263
#define MAKE_CASE(ioctlCode)
#define SCSI_ADSENSE_INVALID_CDB
Definition: cdrw_hw.h:1265
BOOLEAN validSense
Definition: scsi.h:4018
#define SCSI_ADSENSE_MEDIUM_CHANGED
Definition: cdrw_hw.h:1288
#define NT_ASSERT
Definition: rtlfuncs.h:3312

◆ DbgGetIoctlStr()

char* DbgGetIoctlStr ( ULONG  ioctl)

Definition at line 571 of file debug.c.

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  }
#define IOCTL_STORAGE_MCN_CONTROL
Definition: ntddstor.h:128
#define IOCTL_STORAGE_MEDIA_REMOVAL
Definition: ntddstor.h:104
#define IOCTL_STORAGE_PERSISTENT_RESERVE_OUT
Definition: ntddstor.h:172
#define IOCTL_STORAGE_RESET_DEVICE
Definition: ntddstor.h:140
#define IOCTL_STORAGE_GET_HOTPLUG_INFO
Definition: imports.h:238
#define IOCTL_STORAGE_FIND_NEW_DEVICES
Definition: ntddstor.h:122
#define ioctl
Definition: wintirpc.h:60
#define IOCTL_STORAGE_EJECTION_CONTROL
Definition: ntddstor.h:125
#define IOCTL_STORAGE_RELEASE
Definition: ntddstor.h:119
#define IOCTL_STORAGE_EJECT_MEDIA
Definition: ntddstor.h:107
#define IOCTL_STORAGE_GET_DEVICE_NUMBER
Definition: ntddstor.h:143
#define IOCTL_STORAGE_RESERVE
Definition: ntddstor.h:116
#define IOCTL_STORAGE_CHECK_VERIFY
Definition: ntddstor.h:98
#define OBSOLETE_IOCTL_STORAGE_RESET_BUS
Definition: ntddstor.h:160
#define IOCTL_STORAGE_QUERY_PROPERTY
Definition: ntddstor.h:178
#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX
Definition: cdrw_usr.h:190
#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER
Definition: ntddstor.h:151
#define OBSOLETE_IOCTL_STORAGE_RESET_DEVICE
Definition: ntddstor.h:163
#define IOCTL_STORAGE_PERSISTENT_RESERVE_IN
Definition: ntddstor.h:169
#define IOCTL_STORAGE_LOAD_MEDIA2
Definition: ntddk_ex.h:210
#define IOCTL_STORAGE_CHECK_VERIFY2
Definition: ntddk_ex.h:212
#define IOCTL_STORAGE_RESET_BUS
Definition: ntddstor.h:137
#define IOCTL_STORAGE_PREDICT_FAILURE
Definition: ntddstor.h:146
#define IOCTL_STORAGE_GET_MEDIA_TYPES
Definition: ntddstor.h:131
#define IOCTL_STORAGE_LOAD_MEDIA
Definition: ntddstor.h:110
#define MAKE_CASE(ioctlCode)

◆ DbgGetScsiOpStr()

char* DbgGetScsiOpStr ( PSTORAGE_REQUEST_BLOCK_HEADER  Srb)

Definition at line 609 of file debug.c.

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  }
#define SCSIOP_SEARCH_DATA_LOW
Definition: cdrw_hw.h:915
#define SCSIOP_READ_TOC
Definition: cdrw_hw.h:927
#define SCSIOP_RESERVE_UNIT
Definition: cdrw_hw.h:892
#define SCSIOP_MOVE_MEDIUM
Definition: scsi.h:380
#define SCSIOP_SEARCH_DATA_EQUAL
Definition: cdrw_hw.h:914
#define SCSIOP_PLAY_TRACK_RELATIVE
Definition: cdrw_hw.h:933
#define SCSIOP_SYNCHRONIZE_CACHE
Definition: cdrw_hw.h:918
#define SCSIOP_READ_SUB_CHANNEL
Definition: cdrw_hw.h:926
#define SCSIOP_PERSISTENT_RESERVE_IN
Definition: scsi.h:329
#define SCSIOP_SEEK
Definition: cdrw_hw.h:908
#define SCSIOP_WRITE_DATA_BUFF
Definition: cdrw_hw.h:922
#define SCSIOP_RESERVE_TRACK_RZONE
Definition: scsi.h:317
#define SCSIOP_GET_EVENT_STATUS
Definition: cdrw_hw.h:934
#define SCSIOP_RELEASE_UNIT
Definition: cdrw_hw.h:893
#define SCSIOP_MODE_SENSE
Definition: cdrw_hw.h:896
#define SCSIOP_SPACE
Definition: cdrw_hw.h:887
#define SCSIOP_REQUEST_VOL_ELEMENT
Definition: scsi.h:400
#define SCSIOP_PLAY_AUDIO
Definition: cdrw_hw.h:929
Definition: cdrw_hw.h:28
#define SCSIOP_SEND_KEY
Definition: cdrw_hw.h:951
#define SCSIOP_TEST_UNIT_READY
Definition: cdrw_hw.h:866
#define SCSIOP_REPORT_KEY
Definition: cdrw_hw.h:952
#define SCSIOP_CHANGE_DEFINITION
Definition: cdrw_hw.h:924
#define SCSIOP_SYNCHRONIZE_CACHE16
Definition: scsi.h:355
#define SCSIOP_LOAD_UNLOAD_SLOT
Definition: cdrw_hw.h:954
FORCEINLINE PCDB SrbGetCdb(_In_ PVOID Srb)
Definition: srbhelper.h:583
#define SCSIOP_WRITE16
Definition: scsi.h:915
#define SCSIOP_SEND_OPC_INFORMATION
Definition: scsi.h:318
#define SCSIOP_READ_BLOCK_LIMITS
Definition: cdrw_hw.h:872
#define SCSIOP_READ_BUFFER_CAPACITY
Definition: cdrw_hw.h:948
#define SCSIOP_ERASE
Definition: cdrw_hw.h:895
#define SCSIOP_SEND_CUE_SHEET
Definition: cdrw_hw.h:949
#define SCSIOP_PLAY_TRACK_INDEX
Definition: cdrw_hw.h:932
#define SCSIOP_REWIND
Definition: cdrw_hw.h:868
#define SCSIOP_SLEW_PRINT
Definition: cdrw_hw.h:881
#define SCSIOP_READ_CD_MSF
Definition: cdrw_hw.h:964
#define SCSIOP_INIT_ELEMENT_RANGE
Definition: scsi.h:419
#define SCSIOP_READ
Definition: cdrw_hw.h:905
#define SCSIOP_READ16
Definition: scsi.h:914
#define SCSIOP_SEND_VOLUME_TAG
Definition: scsi.h:402
#define SCSIOP_RECEIVE
Definition: cdrw_hw.h:875
#define SCSIOP_STOP_PLAY_SCAN
Definition: cdrw_hw.h:938
#define SCSIOP_SEND
Definition: cdrw_hw.h:878
#define SCSIOP_WRITE
Definition: cdrw_hw.h:906
#define SCSIOP_MODE_SENSE10
Definition: cdrw_hw.h:946
#define SCSIOP_READ_FORMATTED_CAPACITY
Definition: scsi.h:273
#define SCSIOP_FLUSH_BUFFER
Definition: cdrw_hw.h:886
#define SCSIOP_READ_HEADER
Definition: cdrw_hw.h:928
#define SCSIOP_READ_DATA_BUFF
Definition: cdrw_hw.h:923
#define SCSIOP_INQUIRY
Definition: cdrw_hw.h:888
#define SCSIOP_VERIFY16
Definition: scsi.h:916
#define SCSIOP_READ_TRACK_INFORMATION
Definition: scsi.h:315
#define SCSIOP_READ_REVERSE
Definition: cdrw_hw.h:884
#define SCSIOP_REPORT_LUNS
Definition: scsi.h:921
#define SCSIOP_PLAY_AUDIO_MSF
Definition: cdrw_hw.h:931
#define SCSIOP_SET_CD_SPEED
Definition: cdrw_hw.h:965
#define SCSIOP_SEARCH_DATA_HIGH
Definition: cdrw_hw.h:913
#define SCSIOP_READ_DISK_INFORMATION
Definition: scsi.h:313
#define SCSIOP_VERIFY
Definition: cdrw_hw.h:912
#define SCSIOP_SCAN_CD
Definition: scsi.h:407
#define SCSIOP_READ_CAPACITY16
Definition: scsi.h:364
#define SCSIOP_MEDIUM_REMOVAL
Definition: cdrw_hw.h:902
#define SCSIOP_FORMAT_UNIT
Definition: cdrw_hw.h:871
#define SCSIOP_RECOVER_BUF_DATA
Definition: cdrw_hw.h:890
#define SCSIOP_WRITE_VERIFY
Definition: cdrw_hw.h:911
#define SCSIOP_RECEIVE_DIAGNOSTIC
Definition: cdrw_hw.h:900
#define SCSIOP_MECHANISM_STATUS
Definition: cdrw_hw.h:966
#define SCSIOP_PAUSE_RESUME
Definition: cdrw_hw.h:935
#define SCSIOP_READ_POSITION
Definition: cdrw_hw.h:917
#define SCSIOP_REQUEST_BLOCK_ADDR
Definition: cdrw_hw.h:869
#define SCSIOP_BLANK
Definition: cdrw_hw.h:950
struct _CDB::_CDB6GENERIC CDB6GENERIC
#define SCSIOP_PERSISTENT_RESERVE_OUT
Definition: scsi.h:330
#define SCSIOP_SEEK_BLOCK
Definition: cdrw_hw.h:882
#define SCSIOP_GET_CONFIGURATION
Definition: cdrw_hw.h:930
#define SCSIOP_COPY_COMPARE
Definition: cdrw_hw.h:920
#define SCSIOP_INIT_ELEMENT_STATUS
Definition: scsi.h:241
#define SCSIOP_READ_CAPACITY
Definition: cdrw_hw.h:904
#define SCSIOP_READ_DVD_STRUCTURE
Definition: cdrw_hw.h:960
#define SCSIOP_LOG_SELECT
Definition: cdrw_hw.h:936
#define SCSIOP_READ_CD
Definition: cdrw_hw.h:967
#define SCSIOP_REQUEST_SENSE
Definition: cdrw_hw.h:870
#define SCSIOP_COMPARE
Definition: cdrw_hw.h:919
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
#define SCSIOP_SET_READ_AHEAD
Definition: cdrw_hw.h:955
#define MAKE_CASE(ioctlCode)
#define SCSIOP_SET_LIMITS
Definition: cdrw_hw.h:916
#define SCSIOP_PLAY_CD
Definition: scsi.h:411
#define SCSIOP_MODE_SELECT10
Definition: cdrw_hw.h:943
#define SCSIOP_READ_ELEMENT_STATUS
Definition: scsi.h:405
#define SCSIOP_CLOSE_TRACK_SESSION
Definition: cdrw_hw.h:947
#define SCSIOP_VERIFY6
Definition: cdrw_hw.h:889
#define SCSIOP_START_STOP_UNIT
Definition: cdrw_hw.h:897
#define SCSIOP_SEND_DIAGNOSTIC
Definition: cdrw_hw.h:901
#define SCSIOP_SEND_DVD_STRUCTURE
Definition: cdrw_hw.h:969
#define SCSIOP_COPY
Definition: cdrw_hw.h:894
#define SCSIOP_LOG_SENSE
Definition: cdrw_hw.h:937
#define SCSIOP_MODE_SELECT
Definition: cdrw_hw.h:891
#define SCSIOP_PARTITION
Definition: cdrw_hw.h:883

◆ DbgGetSenseCodeStr()

char* DbgGetSenseCodeStr ( PSTORAGE_REQUEST_BLOCK_HEADER  Srb)

Definition at line 777 of file debug.c.

778  {
779  char *senseCodeStr = "?";
780 
781  if (Srb->SrbStatus & SRB_STATUS_AUTOSENSE_VALID){
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  }
FORCEINLINE UCHAR SrbGetSenseInfoBufferLength(_In_ PVOID Srb)
Definition: srbhelper.h:638
#define SCSI_SENSE_UNIQUE
Definition: cdrw_hw.h:1196
#define SRB_STATUS_AUTOSENSE_VALID
Definition: srb.h:379
#define SCSI_SENSE_EQUAL
Definition: cdrw_hw.h:1199
#define SCSI_SENSE_MISCOMPARE
Definition: cdrw_hw.h:1201
#define SCSI_SENSE_OPTIONS_FIXED_FORMAT_IF_UNKNOWN_FORMAT_INDICATED
Definition: scsi.h:3839
#define SCSI_SENSE_NOT_READY
Definition: cdrw_hw.h:1189
#define SCSI_SENSE_MEDIUM_ERROR
Definition: cdrw_hw.h:1190
#define SCSI_SENSE_VOL_OVERFLOW
Definition: cdrw_hw.h:1200
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define SCSI_SENSE_BLANK_CHECK
Definition: cdrw_hw.h:1195
#define SCSI_SENSE_HARDWARE_ERROR
Definition: cdrw_hw.h:1191
unsigned char UCHAR
Definition: xmlstorage.h:181
#define SCSI_SENSE_COPY_ABORTED
Definition: cdrw_hw.h:1197
#define SCSI_SENSE_RECOVERED_ERROR
Definition: cdrw_hw.h:1188
#define SCSI_SENSE_ABORTED_COMMAND
Definition: cdrw_hw.h:1198
#define SCSI_SENSE_NO_SENSE
Definition: cdrw_hw.h:1187
FORCEINLINE PVOID SrbGetSenseInfoBuffer(_In_ PVOID Srb)
Definition: srbhelper.h:619
#define SCSI_SENSE_RESERVED
Definition: cdrw_hw.h:1202
#define SCSI_SENSE_DATA_PROTECT
Definition: cdrw_hw.h:1194
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
#define SCSI_SENSE_ILLEGAL_REQUEST
Definition: cdrw_hw.h:1192
#define MAKE_CASE(ioctlCode)
#define SCSI_SENSE_UNIT_ATTENTION
Definition: cdrw_hw.h:1193
BOOLEAN validSense
Definition: scsi.h:4018
#define NT_ASSERT
Definition: rtlfuncs.h:3312

◆ DbgGetSrbStatusStr()

char* DbgGetSrbStatusStr ( PSTORAGE_REQUEST_BLOCK_HEADER  Srb)

Definition at line 722 of file debug.c.

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  }
#define SRB_STATUS_INVALID_REQUEST
Definition: srb.h:338
#define SRB_STATUS_BUS_RESET
Definition: srb.h:345
#define SRB_STATUS_ABORT_FAILED
Definition: srb.h:335
#define SRB_STATUS_REQUEST_FLUSHED
Definition: srb.h:353
#define SRB_STATUS_COMMAND_TIMEOUT
Definition: srb.h:343
#define SRB_STATUS_MESSAGE_REJECTED
Definition: srb.h:344
#define SRB_STATUS_NO_DEVICE
Definition: srb.h:340
#define SRB_STATUS_PHASE_SEQUENCE_FAILURE
Definition: srb.h:351
#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH
Definition: srb.h:352
#define SRB_STATUS_INVALID_TARGET_ID
Definition: srb.h:355
#define SRB_STATUS_ERROR
Definition: srb.h:336
#define SRB_STATUS_REQUEST_SENSE_FAILED
Definition: srb.h:347
#define SRB_STATUS_PARITY_ERROR
Definition: srb.h:346
#define SRB_STATUS_PENDING
Definition: srb.h:332
#define SRB_STATUS_NO_HBA
Definition: srb.h:348
#define SRB_STATUS_ABORTED
Definition: srb.h:334
#define SRB_STATUS_BUSY
Definition: srb.h:337
#define SRB_STATUS_BAD_FUNCTION
Definition: srb.h:356
#define SRB_STATUS_ERROR_RECOVERY
Definition: srb.h:357
#define SRB_STATUS_NOT_POWERED
Definition: srb.h:358
#define SRB_STATUS_DATA_OVERRUN
Definition: srb.h:349
#define SRB_STATUS_INTERNAL_ERROR
Definition: srb.h:365
#define SRB_STATUS_SELECTION_TIMEOUT
Definition: srb.h:342
#define SRB_STATUS_INVALID_LUN
Definition: srb.h:354
#define SRB_STATUS_TIMEOUT
Definition: srb.h:341
#define SRB_STATUS_UNEXPECTED_BUS_FREE
Definition: srb.h:350
#define SRB_STATUS_SUCCESS
Definition: srb.h:333
#define SRB_STATUS_INVALID_PATH_ID
Definition: srb.h:339
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
#define MAKE_CASE(ioctlCode)