Initial work on the ATA IDENTIFY checks

Added the code needed to execute the ATA IDENTIFY command on a disk. Currently it dumps the data out via OutputDebugString.
This commit is contained in:
Graham Sutherland
2018-07-11 23:07:02 +01:00
parent 7c5868b331
commit 008934a3b4
8 changed files with 1143 additions and 1 deletions
+1
View File
@@ -77,6 +77,7 @@ int main(void)
exec_check(&disk_size_wmi, TEXT("Checking hard disk size using WMI "));
exec_check(&dizk_size_deviceiocontrol, TEXT("Checking hard disk size using DeviceIoControl "));
exec_check(&setupdi_diskdrive, TEXT("Checking SetupDi_diskdrive "));
exec_check(&ata_identify, TEXT("Checking ATA IDENTIFY command "));
exec_check(&mouse_movement, TEXT("Checking mouse movement "));
exec_check(&memory_space, TEXT("Checking memory space using GlobalMemoryStatusEx "));
exec_check(&disk_size_getdiskfreespace, TEXT("Checking disk size using GetDiskFreeSpaceEx "));
+376
View File
@@ -0,0 +1,376 @@
#pragma once
#include <windows.h>
#include <Winternl.h>
#include <WinIoCtl.h>
typedef struct _IDENTIFY_DEVICE_DATA {
struct {
USHORT Reserved1 : 1;
USHORT Retired3 : 1;
USHORT ResponseIncomplete : 1;
USHORT Retired2 : 3;
USHORT FixedDevice : 1;
USHORT RemovableMedia : 1;
USHORT Retired1 : 7;
USHORT DeviceType : 1;
} GeneralConfiguration;
USHORT NumCylinders;
USHORT SpecificConfiguration;
USHORT NumHeads;
USHORT Retired1[2];
USHORT NumSectorsPerTrack;
USHORT VendorUnique1[3];
UCHAR SerialNumber[20];
USHORT Retired2[2];
USHORT Obsolete1;
UCHAR FirmwareRevision[8];
UCHAR ModelNumber[40];
UCHAR MaximumBlockTransfer;
UCHAR VendorUnique2;
struct {
USHORT FeatureSupported : 1;
USHORT Reserved : 15;
} TrustedComputing;
struct {
UCHAR CurrentLongPhysicalSectorAlignment : 2;
UCHAR ReservedByte49 : 6;
UCHAR DmaSupported : 1;
UCHAR LbaSupported : 1;
UCHAR IordyDisable : 1;
UCHAR IordySupported : 1;
UCHAR Reserved1 : 1;
UCHAR StandybyTimerSupport : 1;
UCHAR Reserved2 : 2;
USHORT ReservedWord50;
} Capabilities;
USHORT ObsoleteWords51[2];
USHORT TranslationFieldsValid : 3;
USHORT Reserved3 : 5;
USHORT FreeFallControlSensitivity : 8;
USHORT NumberOfCurrentCylinders;
USHORT NumberOfCurrentHeads;
USHORT CurrentSectorsPerTrack;
ULONG CurrentSectorCapacity;
UCHAR CurrentMultiSectorSetting;
UCHAR MultiSectorSettingValid : 1;
UCHAR ReservedByte59 : 3;
UCHAR SanitizeFeatureSupported : 1;
UCHAR CryptoScrambleExtCommandSupported : 1;
UCHAR OverwriteExtCommandSupported : 1;
UCHAR BlockEraseExtCommandSupported : 1;
ULONG UserAddressableSectors;
USHORT ObsoleteWord62;
USHORT MultiWordDMASupport : 8;
USHORT MultiWordDMAActive : 8;
USHORT AdvancedPIOModes : 8;
USHORT ReservedByte64 : 8;
USHORT MinimumMWXferCycleTime;
USHORT RecommendedMWXferCycleTime;
USHORT MinimumPIOCycleTime;
USHORT MinimumPIOCycleTimeIORDY;
struct {
USHORT ZonedCapabilities : 2;
USHORT NonVolatileWriteCache : 1;
USHORT ExtendedUserAddressableSectorsSupported : 1;
USHORT DeviceEncryptsAllUserData : 1;
USHORT ReadZeroAfterTrimSupported : 1;
USHORT Optional28BitCommandsSupported : 1;
USHORT IEEE1667 : 1;
USHORT DownloadMicrocodeDmaSupported : 1;
USHORT SetMaxSetPasswordUnlockDmaSupported : 1;
USHORT WriteBufferDmaSupported : 1;
USHORT ReadBufferDmaSupported : 1;
USHORT DeviceConfigIdentifySetDmaSupported : 1;
USHORT LPSAERCSupported : 1;
USHORT DeterministicReadAfterTrimSupported : 1;
USHORT CFastSpecSupported : 1;
} AdditionalSupported;
USHORT ReservedWords70[5];
USHORT QueueDepth : 5;
USHORT ReservedWord75 : 11;
struct {
USHORT Reserved0 : 1;
USHORT SataGen1 : 1;
USHORT SataGen2 : 1;
USHORT SataGen3 : 1;
USHORT Reserved1 : 4;
USHORT NCQ : 1;
USHORT HIPM : 1;
USHORT PhyEvents : 1;
USHORT NcqUnload : 1;
USHORT NcqPriority : 1;
USHORT HostAutoPS : 1;
USHORT DeviceAutoPS : 1;
USHORT ReadLogDMA : 1;
USHORT Reserved2 : 1;
USHORT CurrentSpeed : 3;
USHORT NcqStreaming : 1;
USHORT NcqQueueMgmt : 1;
USHORT NcqReceiveSend : 1;
USHORT DEVSLPtoReducedPwrState : 1;
USHORT Reserved3 : 8;
} SerialAtaCapabilities;
struct {
USHORT Reserved0 : 1;
USHORT NonZeroOffsets : 1;
USHORT DmaSetupAutoActivate : 1;
USHORT DIPM : 1;
USHORT InOrderData : 1;
USHORT HardwareFeatureControl : 1;
USHORT SoftwareSettingsPreservation : 1;
USHORT NCQAutosense : 1;
USHORT DEVSLP : 1;
USHORT HybridInformation : 1;
USHORT Reserved1 : 6;
} SerialAtaFeaturesSupported;
struct {
USHORT Reserved0 : 1;
USHORT NonZeroOffsets : 1;
USHORT DmaSetupAutoActivate : 1;
USHORT DIPM : 1;
USHORT InOrderData : 1;
USHORT HardwareFeatureControl : 1;
USHORT SoftwareSettingsPreservation : 1;
USHORT DeviceAutoPS : 1;
USHORT DEVSLP : 1;
USHORT HybridInformation : 1;
USHORT Reserved1 : 6;
} SerialAtaFeaturesEnabled;
USHORT MajorRevision;
USHORT MinorRevision;
struct {
USHORT SmartCommands : 1;
USHORT SecurityMode : 1;
USHORT RemovableMediaFeature : 1;
USHORT PowerManagement : 1;
USHORT Reserved1 : 1;
USHORT WriteCache : 1;
USHORT LookAhead : 1;
USHORT ReleaseInterrupt : 1;
USHORT ServiceInterrupt : 1;
USHORT DeviceReset : 1;
USHORT HostProtectedArea : 1;
USHORT Obsolete1 : 1;
USHORT WriteBuffer : 1;
USHORT ReadBuffer : 1;
USHORT Nop : 1;
USHORT Obsolete2 : 1;
USHORT DownloadMicrocode : 1;
USHORT DmaQueued : 1;
USHORT Cfa : 1;
USHORT AdvancedPm : 1;
USHORT Msn : 1;
USHORT PowerUpInStandby : 1;
USHORT ManualPowerUp : 1;
USHORT Reserved2 : 1;
USHORT SetMax : 1;
USHORT Acoustics : 1;
USHORT BigLba : 1;
USHORT DeviceConfigOverlay : 1;
USHORT FlushCache : 1;
USHORT FlushCacheExt : 1;
USHORT WordValid83 : 2;
USHORT SmartErrorLog : 1;
USHORT SmartSelfTest : 1;
USHORT MediaSerialNumber : 1;
USHORT MediaCardPassThrough : 1;
USHORT StreamingFeature : 1;
USHORT GpLogging : 1;
USHORT WriteFua : 1;
USHORT WriteQueuedFua : 1;
USHORT WWN64Bit : 1;
USHORT URGReadStream : 1;
USHORT URGWriteStream : 1;
USHORT ReservedForTechReport : 2;
USHORT IdleWithUnloadFeature : 1;
USHORT WordValid : 2;
} CommandSetSupport;
struct {
USHORT SmartCommands : 1;
USHORT SecurityMode : 1;
USHORT RemovableMediaFeature : 1;
USHORT PowerManagement : 1;
USHORT Reserved1 : 1;
USHORT WriteCache : 1;
USHORT LookAhead : 1;
USHORT ReleaseInterrupt : 1;
USHORT ServiceInterrupt : 1;
USHORT DeviceReset : 1;
USHORT HostProtectedArea : 1;
USHORT Obsolete1 : 1;
USHORT WriteBuffer : 1;
USHORT ReadBuffer : 1;
USHORT Nop : 1;
USHORT Obsolete2 : 1;
USHORT DownloadMicrocode : 1;
USHORT DmaQueued : 1;
USHORT Cfa : 1;
USHORT AdvancedPm : 1;
USHORT Msn : 1;
USHORT PowerUpInStandby : 1;
USHORT ManualPowerUp : 1;
USHORT Reserved2 : 1;
USHORT SetMax : 1;
USHORT Acoustics : 1;
USHORT BigLba : 1;
USHORT DeviceConfigOverlay : 1;
USHORT FlushCache : 1;
USHORT FlushCacheExt : 1;
USHORT Resrved3 : 1;
USHORT Words119_120Valid : 1;
USHORT SmartErrorLog : 1;
USHORT SmartSelfTest : 1;
USHORT MediaSerialNumber : 1;
USHORT MediaCardPassThrough : 1;
USHORT StreamingFeature : 1;
USHORT GpLogging : 1;
USHORT WriteFua : 1;
USHORT WriteQueuedFua : 1;
USHORT WWN64Bit : 1;
USHORT URGReadStream : 1;
USHORT URGWriteStream : 1;
USHORT ReservedForTechReport : 2;
USHORT IdleWithUnloadFeature : 1;
USHORT Reserved4 : 2;
} CommandSetActive;
USHORT UltraDMASupport : 8;
USHORT UltraDMAActive : 8;
struct {
USHORT TimeRequired : 15;
USHORT ExtendedTimeReported : 1;
} NormalSecurityEraseUnit;
struct {
USHORT TimeRequired : 15;
USHORT ExtendedTimeReported : 1;
} EnhancedSecurityEraseUnit;
USHORT CurrentAPMLevel : 8;
USHORT ReservedWord91 : 8;
USHORT MasterPasswordID;
USHORT HardwareResetResult;
USHORT CurrentAcousticValue : 8;
USHORT RecommendedAcousticValue : 8;
USHORT StreamMinRequestSize;
USHORT StreamingTransferTimeDMA;
USHORT StreamingAccessLatencyDMAPIO;
ULONG StreamingPerfGranularity;
ULONG Max48BitLBA[2];
USHORT StreamingTransferTime;
USHORT DsmCap;
struct {
USHORT LogicalSectorsPerPhysicalSector : 4;
USHORT Reserved0 : 8;
USHORT LogicalSectorLongerThan256Words : 1;
USHORT MultipleLogicalSectorsPerPhysicalSector : 1;
USHORT Reserved1 : 2;
} PhysicalLogicalSectorSize;
USHORT InterSeekDelay;
USHORT WorldWideName[4];
USHORT ReservedForWorldWideName128[4];
USHORT ReservedForTlcTechnicalReport;
USHORT WordsPerLogicalSector[2];
struct {
USHORT ReservedForDrqTechnicalReport : 1;
USHORT WriteReadVerify : 1;
USHORT WriteUncorrectableExt : 1;
USHORT ReadWriteLogDmaExt : 1;
USHORT DownloadMicrocodeMode3 : 1;
USHORT FreefallControl : 1;
USHORT SenseDataReporting : 1;
USHORT ExtendedPowerConditions : 1;
USHORT Reserved0 : 6;
USHORT WordValid : 2;
} CommandSetSupportExt;
struct {
USHORT ReservedForDrqTechnicalReport : 1;
USHORT WriteReadVerify : 1;
USHORT WriteUncorrectableExt : 1;
USHORT ReadWriteLogDmaExt : 1;
USHORT DownloadMicrocodeMode3 : 1;
USHORT FreefallControl : 1;
USHORT SenseDataReporting : 1;
USHORT ExtendedPowerConditions : 1;
USHORT Reserved0 : 6;
USHORT Reserved1 : 2;
} CommandSetActiveExt;
USHORT ReservedForExpandedSupportandActive[6];
USHORT MsnSupport : 2;
USHORT ReservedWord127 : 14;
struct {
USHORT SecuritySupported : 1;
USHORT SecurityEnabled : 1;
USHORT SecurityLocked : 1;
USHORT SecurityFrozen : 1;
USHORT SecurityCountExpired : 1;
USHORT EnhancedSecurityEraseSupported : 1;
USHORT Reserved0 : 2;
USHORT SecurityLevel : 1;
USHORT Reserved1 : 7;
} SecurityStatus;
USHORT ReservedWord129[31];
struct {
USHORT MaximumCurrentInMA : 12;
USHORT CfaPowerMode1Disabled : 1;
USHORT CfaPowerMode1Required : 1;
USHORT Reserved0 : 1;
USHORT Word160Supported : 1;
} CfaPowerMode1;
USHORT ReservedForCfaWord161[7];
USHORT NominalFormFactor : 4;
USHORT ReservedWord168 : 12;
struct {
USHORT SupportsTrim : 1;
USHORT Reserved0 : 15;
} DataSetManagementFeature;
USHORT AdditionalProductID[4];
USHORT ReservedForCfaWord174[2];
USHORT CurrentMediaSerialNumber[30];
struct {
USHORT Supported : 1;
USHORT Reserved0 : 1;
USHORT WriteSameSuported : 1;
USHORT ErrorRecoveryControlSupported : 1;
USHORT FeatureControlSuported : 1;
USHORT DataTablesSuported : 1;
USHORT Reserved1 : 6;
USHORT VendorSpecific : 4;
} SCTCommandTransport;
USHORT ReservedWord207[2];
struct {
USHORT AlignmentOfLogicalWithinPhysical : 14;
USHORT Word209Supported : 1;
USHORT Reserved0 : 1;
} BlockAlignment;
USHORT WriteReadVerifySectorCountMode3Only[2];
USHORT WriteReadVerifySectorCountMode2Only[2];
struct {
USHORT NVCachePowerModeEnabled : 1;
USHORT Reserved0 : 3;
USHORT NVCacheFeatureSetEnabled : 1;
USHORT Reserved1 : 3;
USHORT NVCachePowerModeVersion : 4;
USHORT NVCacheFeatureSetVersion : 4;
} NVCacheCapabilities;
USHORT NVCacheSizeLSW;
USHORT NVCacheSizeMSW;
USHORT NominalMediaRotationRate;
USHORT ReservedWord218;
struct {
UCHAR NVCacheEstimatedTimeToSpinUpInSeconds;
UCHAR Reserved;
} NVCacheOptions;
USHORT WriteReadVerifySectorCountMode : 8;
USHORT ReservedWord220 : 8;
USHORT ReservedWord221;
struct {
USHORT MajorVersion : 12;
USHORT TransportType : 4;
} TransportMajorVersion;
USHORT TransportMinorVersion;
USHORT ReservedWord224[6];
ULONG ExtendedNumberOfUserAddressableSectors[2];
USHORT MinBlocksPerDownloadMicrocodeMode03;
USHORT MaxBlocksPerDownloadMicrocodeMode03;
USHORT ReservedWord236[19];
USHORT Signature : 8;
USHORT CheckSum : 8;
} IDENTIFY_DEVICE_DATA, *PIDENTIFY_DEVICE_DATA;
+729
View File
@@ -503,6 +503,735 @@ BOOL setupdi_diskdrive()
}
BOOL ata_identify() {
// this check requires admin privs
if (!IsElevated())
return FALSE;
HANDLE hDevice = CreateFile(_T("\\\\.\\PhysicalDrive0"),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
if (hDevice == INVALID_HANDLE_VALUE)
{
OutputDebugString(_T("Couldn't open PhysicalDrive0."));
return FALSE;
}
ATA_IDENTITY_BUFFER identityBuffer;
SecureZeroMemory(&identityBuffer, sizeof(ATA_IDENTITY_BUFFER));
identityBuffer.Request.AtaFlags = ATA_FLAGS_DATA_IN | ATA_FLAGS_DRDY_REQUIRED;
identityBuffer.Request.Length = sizeof(ATA_PASS_THROUGH_EX);
identityBuffer.Request.DataBufferOffset = offsetof(ATA_IDENTITY_BUFFER, Response);
identityBuffer.Request.DataTransferLength = sizeof(IDENTIFY_DEVICE_DATA);
identityBuffer.Request.TimeOutValue = 2;
identityBuffer.Request.CurrentTaskFile[6] = ID_CMD;
ULONG bytesRead;
if (!DeviceIoControl(
hDevice,
IOCTL_ATA_PASS_THROUGH,
&identityBuffer, sizeof(ATA_IDENTITY_BUFFER),
&identityBuffer, sizeof(ATA_IDENTITY_BUFFER),
&bytesRead, NULL))
{
OutputDebugString(_T("IDENTIFY IOCTL failed."));
return FALSE;
}
OutputDebugString(_T("Successfully executed IDENTIFY command."));
//SwapStringEndianA((char*)&identityBuffer.Response, sizeof(IDENTIFY_DEVICE_DATA));
SwapStringEndianA((char*)identityBuffer.Response.ModelNumber, 40);
SwapStringEndianA((char*)identityBuffer.Response.SerialNumber, 20);
SwapStringEndianA((char*)identityBuffer.Response.FirmwareRevision, 8);
//#ifdef _DEBUG
const int infoBufferLen = 4096;
wchar_t* infoBuffer = reinterpret_cast<wchar_t*>(calloc(infoBufferLen, sizeof(wchar_t)));
SecureZeroMemory(infoBuffer, sizeof(wchar_t) * infoBufferLen);
wnsprintf(infoBuffer, infoBufferLen, _T("Model: %.40S"), identityBuffer.Response.ModelNumber);
OutputDebugString(infoBuffer);
SecureZeroMemory(infoBuffer, sizeof(wchar_t) * infoBufferLen);
wnsprintf(infoBuffer, infoBufferLen, _T("Serial: %.20S"), identityBuffer.Response.SerialNumber);
OutputDebugString(infoBuffer);
SecureZeroMemory(infoBuffer, sizeof(wchar_t) * infoBufferLen);
wnsprintf(infoBuffer, infoBufferLen, _T("Firmware: %.8S"), identityBuffer.Response.FirmwareRevision);
OutputDebugString(infoBuffer);
SecureZeroMemory(infoBuffer, sizeof(wchar_t) * infoBufferLen);
wnsprintf(infoBuffer, infoBufferLen, _T("Sectors/track: %hu"), identityBuffer.Response.NumSectorsPerTrack);
OutputDebugString(infoBuffer);
//#endif
dump_response(identityBuffer);
return FALSE;
}
VOID dump_response(ATA_IDENTITY_BUFFER identityBuffer)
{
const int dbglen = 4096;
wchar_t* dbg = reinterpret_cast<wchar_t*>(calloc(dbglen, sizeof(wchar_t)));
wnsprintf(dbg, dbglen, _T("GeneralConfiguration.Reserved1 = %hu"), identityBuffer.Response.GeneralConfiguration.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("GeneralConfiguration.Retired3 = %hu"), identityBuffer.Response.GeneralConfiguration.Retired3);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("GeneralConfiguration.ResponseIncomplete = %hu"), identityBuffer.Response.GeneralConfiguration.ResponseIncomplete);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("GeneralConfiguration.Retired2 = %hu"), identityBuffer.Response.GeneralConfiguration.Retired2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("GeneralConfiguration.FixedDevice = %hu"), identityBuffer.Response.GeneralConfiguration.FixedDevice);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("GeneralConfiguration.RemovableMedia = %hu"), identityBuffer.Response.GeneralConfiguration.RemovableMedia);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("GeneralConfiguration.Retired1 = %hu"), identityBuffer.Response.GeneralConfiguration.Retired1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("GeneralConfiguration.DeviceType = %hu"), identityBuffer.Response.GeneralConfiguration.DeviceType);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NumCylinders = %hu"), identityBuffer.Response.NumCylinders);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SpecificConfiguration = %hu"), identityBuffer.Response.SpecificConfiguration);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NumHeads = %hu"), identityBuffer.Response.NumHeads);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Retired1 = %.2p"), identityBuffer.Response.Retired1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NumSectorsPerTrack = %hu"), identityBuffer.Response.NumSectorsPerTrack);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("VendorUnique1 = %.3p"), identityBuffer.Response.VendorUnique1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialNumber = %.20S"), identityBuffer.Response.SerialNumber);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Retired2 = %.2p"), identityBuffer.Response.Retired2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Obsolete1 = %hu"), identityBuffer.Response.Obsolete1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("FirmwareRevision = %.8S"), identityBuffer.Response.FirmwareRevision);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ModelNumber = %.40S"), identityBuffer.Response.ModelNumber);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MaximumBlockTransfer = %u"), identityBuffer.Response.MaximumBlockTransfer);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("VendorUnique2 = %u"), identityBuffer.Response.VendorUnique2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("TrustedComputing.FeatureSupported = %hu"), identityBuffer.Response.TrustedComputing.FeatureSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("TrustedComputing.Reserved = %hu"), identityBuffer.Response.TrustedComputing.Reserved);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.CurrentLongPhysicalSectorAlignment = %u"), identityBuffer.Response.Capabilities.CurrentLongPhysicalSectorAlignment);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.ReservedByte49 = %u"), identityBuffer.Response.Capabilities.ReservedByte49);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.DmaSupported = %u"), identityBuffer.Response.Capabilities.DmaSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.LbaSupported = %u"), identityBuffer.Response.Capabilities.LbaSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.IordyDisable = %u"), identityBuffer.Response.Capabilities.IordyDisable);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.IordySupported = %u"), identityBuffer.Response.Capabilities.IordySupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.Reserved1 = %u"), identityBuffer.Response.Capabilities.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.StandybyTimerSupport = %u"), identityBuffer.Response.Capabilities.StandybyTimerSupport);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.Reserved2 = %u"), identityBuffer.Response.Capabilities.Reserved2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Capabilities.ReservedWord50 = %hu"), identityBuffer.Response.Capabilities.ReservedWord50);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ObsoleteWords51 = %.2p"), identityBuffer.Response.ObsoleteWords51);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("TranslationFieldsValid = %hu"), identityBuffer.Response.TranslationFieldsValid);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Reserved3 = %hu"), identityBuffer.Response.Reserved3);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("FreeFallControlSensitivity = %hu"), identityBuffer.Response.FreeFallControlSensitivity);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NumberOfCurrentCylinders = %hu"), identityBuffer.Response.NumberOfCurrentCylinders);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NumberOfCurrentHeads = %hu"), identityBuffer.Response.NumberOfCurrentHeads);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CurrentSectorsPerTrack = %hu"), identityBuffer.Response.CurrentSectorsPerTrack);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CurrentSectorCapacity = %lu"), identityBuffer.Response.CurrentSectorCapacity);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CurrentMultiSectorSetting = %u"), identityBuffer.Response.CurrentMultiSectorSetting);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MultiSectorSettingValid = %u"), identityBuffer.Response.MultiSectorSettingValid);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedByte59 = %u"), identityBuffer.Response.ReservedByte59);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SanitizeFeatureSupported = %u"), identityBuffer.Response.SanitizeFeatureSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CryptoScrambleExtCommandSupported = %u"), identityBuffer.Response.CryptoScrambleExtCommandSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("OverwriteExtCommandSupported = %u"), identityBuffer.Response.OverwriteExtCommandSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("BlockEraseExtCommandSupported = %u"), identityBuffer.Response.BlockEraseExtCommandSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("UserAddressableSectors = %lu"), identityBuffer.Response.UserAddressableSectors);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ObsoleteWord62 = %hu"), identityBuffer.Response.ObsoleteWord62);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MultiWordDMASupport = %hu"), identityBuffer.Response.MultiWordDMASupport);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MultiWordDMAActive = %hu"), identityBuffer.Response.MultiWordDMAActive);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdvancedPIOModes = %hu"), identityBuffer.Response.AdvancedPIOModes);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedByte64 = %hu"), identityBuffer.Response.ReservedByte64);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MinimumMWXferCycleTime = %hu"), identityBuffer.Response.MinimumMWXferCycleTime);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("RecommendedMWXferCycleTime = %hu"), identityBuffer.Response.RecommendedMWXferCycleTime);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MinimumPIOCycleTime = %hu"), identityBuffer.Response.MinimumPIOCycleTime);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MinimumPIOCycleTimeIORDY = %hu"), identityBuffer.Response.MinimumPIOCycleTimeIORDY);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.ZonedCapabilities = %hu"), identityBuffer.Response.AdditionalSupported.ZonedCapabilities);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.NonVolatileWriteCache = %hu"), identityBuffer.Response.AdditionalSupported.NonVolatileWriteCache);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.ExtendedUserAddressableSectorsSupported = %hu"), identityBuffer.Response.AdditionalSupported.ExtendedUserAddressableSectorsSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.DeviceEncryptsAllUserData = %hu"), identityBuffer.Response.AdditionalSupported.DeviceEncryptsAllUserData);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.ReadZeroAfterTrimSupported = %hu"), identityBuffer.Response.AdditionalSupported.ReadZeroAfterTrimSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.Optional28BitCommandsSupported = %hu"), identityBuffer.Response.AdditionalSupported.Optional28BitCommandsSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.IEEE1667 = %hu"), identityBuffer.Response.AdditionalSupported.IEEE1667);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.DownloadMicrocodeDmaSupported = %hu"), identityBuffer.Response.AdditionalSupported.DownloadMicrocodeDmaSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.SetMaxSetPasswordUnlockDmaSupported = %hu"), identityBuffer.Response.AdditionalSupported.SetMaxSetPasswordUnlockDmaSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.WriteBufferDmaSupported = %hu"), identityBuffer.Response.AdditionalSupported.WriteBufferDmaSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.ReadBufferDmaSupported = %hu"), identityBuffer.Response.AdditionalSupported.ReadBufferDmaSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.DeviceConfigIdentifySetDmaSupported = %hu"), identityBuffer.Response.AdditionalSupported.DeviceConfigIdentifySetDmaSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.LPSAERCSupported = %hu"), identityBuffer.Response.AdditionalSupported.LPSAERCSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.DeterministicReadAfterTrimSupported = %hu"), identityBuffer.Response.AdditionalSupported.DeterministicReadAfterTrimSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalSupported.CFastSpecSupported = %hu"), identityBuffer.Response.AdditionalSupported.CFastSpecSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWords70 = %.5p"), identityBuffer.Response.ReservedWords70);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("QueueDepth = %hu"), identityBuffer.Response.QueueDepth);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord75 = %hu"), identityBuffer.Response.ReservedWord75);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.Reserved0 = %hu"), identityBuffer.Response.SerialAtaCapabilities.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.SataGen1 = %hu"), identityBuffer.Response.SerialAtaCapabilities.SataGen1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.SataGen2 = %hu"), identityBuffer.Response.SerialAtaCapabilities.SataGen2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.SataGen3 = %hu"), identityBuffer.Response.SerialAtaCapabilities.SataGen3);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.Reserved1 = %hu"), identityBuffer.Response.SerialAtaCapabilities.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.NCQ = %hu"), identityBuffer.Response.SerialAtaCapabilities.NCQ);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.HIPM = %hu"), identityBuffer.Response.SerialAtaCapabilities.HIPM);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.PhyEvents = %hu"), identityBuffer.Response.SerialAtaCapabilities.PhyEvents);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.NcqUnload = %hu"), identityBuffer.Response.SerialAtaCapabilities.NcqUnload);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.NcqPriority = %hu"), identityBuffer.Response.SerialAtaCapabilities.NcqPriority);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.HostAutoPS = %hu"), identityBuffer.Response.SerialAtaCapabilities.HostAutoPS);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.DeviceAutoPS = %hu"), identityBuffer.Response.SerialAtaCapabilities.DeviceAutoPS);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.ReadLogDMA = %hu"), identityBuffer.Response.SerialAtaCapabilities.ReadLogDMA);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.Reserved2 = %hu"), identityBuffer.Response.SerialAtaCapabilities.Reserved2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.CurrentSpeed = %hu"), identityBuffer.Response.SerialAtaCapabilities.CurrentSpeed);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.NcqStreaming = %hu"), identityBuffer.Response.SerialAtaCapabilities.NcqStreaming);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.NcqQueueMgmt = %hu"), identityBuffer.Response.SerialAtaCapabilities.NcqQueueMgmt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.NcqReceiveSend = %hu"), identityBuffer.Response.SerialAtaCapabilities.NcqReceiveSend);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.DEVSLPtoReducedPwrState = %hu"), identityBuffer.Response.SerialAtaCapabilities.DEVSLPtoReducedPwrState);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaCapabilities.Reserved3 = %hu"), identityBuffer.Response.SerialAtaCapabilities.Reserved3);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.Reserved0 = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.NonZeroOffsets = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.NonZeroOffsets);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.DmaSetupAutoActivate = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.DmaSetupAutoActivate);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.DIPM = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.DIPM);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.InOrderData = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.InOrderData);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.HardwareFeatureControl = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.HardwareFeatureControl);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.SoftwareSettingsPreservation = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.SoftwareSettingsPreservation);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.NCQAutosense = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.NCQAutosense);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.DEVSLP = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.DEVSLP);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.HybridInformation = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.HybridInformation);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesSupported.Reserved1 = %hu"), identityBuffer.Response.SerialAtaFeaturesSupported.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.Reserved0 = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.NonZeroOffsets = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.NonZeroOffsets);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.DmaSetupAutoActivate = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.DmaSetupAutoActivate);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.DIPM = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.DIPM);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.InOrderData = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.InOrderData);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.HardwareFeatureControl = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.HardwareFeatureControl);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.SoftwareSettingsPreservation = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.SoftwareSettingsPreservation);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.DeviceAutoPS = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.DeviceAutoPS);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.DEVSLP = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.DEVSLP);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.HybridInformation = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.HybridInformation);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SerialAtaFeaturesEnabled.Reserved1 = %hu"), identityBuffer.Response.SerialAtaFeaturesEnabled.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MajorRevision = %hu"), identityBuffer.Response.MajorRevision);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MinorRevision = %hu"), identityBuffer.Response.MinorRevision);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.SmartCommands = %hu"), identityBuffer.Response.CommandSetSupport.SmartCommands);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.SecurityMode = %hu"), identityBuffer.Response.CommandSetSupport.SecurityMode);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.RemovableMediaFeature = %hu"), identityBuffer.Response.CommandSetSupport.RemovableMediaFeature);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.PowerManagement = %hu"), identityBuffer.Response.CommandSetSupport.PowerManagement);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.Reserved1 = %hu"), identityBuffer.Response.CommandSetSupport.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.WriteCache = %hu"), identityBuffer.Response.CommandSetSupport.WriteCache);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.LookAhead = %hu"), identityBuffer.Response.CommandSetSupport.LookAhead);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.ReleaseInterrupt = %hu"), identityBuffer.Response.CommandSetSupport.ReleaseInterrupt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.ServiceInterrupt = %hu"), identityBuffer.Response.CommandSetSupport.ServiceInterrupt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.DeviceReset = %hu"), identityBuffer.Response.CommandSetSupport.DeviceReset);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.HostProtectedArea = %hu"), identityBuffer.Response.CommandSetSupport.HostProtectedArea);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.Obsolete1 = %hu"), identityBuffer.Response.CommandSetSupport.Obsolete1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.WriteBuffer = %hu"), identityBuffer.Response.CommandSetSupport.WriteBuffer);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.ReadBuffer = %hu"), identityBuffer.Response.CommandSetSupport.ReadBuffer);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.Nop = %hu"), identityBuffer.Response.CommandSetSupport.Nop);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.Obsolete2 = %hu"), identityBuffer.Response.CommandSetSupport.Obsolete2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.DownloadMicrocode = %hu"), identityBuffer.Response.CommandSetSupport.DownloadMicrocode);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.DmaQueued = %hu"), identityBuffer.Response.CommandSetSupport.DmaQueued);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.Cfa = %hu"), identityBuffer.Response.CommandSetSupport.Cfa);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.AdvancedPm = %hu"), identityBuffer.Response.CommandSetSupport.AdvancedPm);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.Msn = %hu"), identityBuffer.Response.CommandSetSupport.Msn);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.PowerUpInStandby = %hu"), identityBuffer.Response.CommandSetSupport.PowerUpInStandby);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.ManualPowerUp = %hu"), identityBuffer.Response.CommandSetSupport.ManualPowerUp);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.Reserved2 = %hu"), identityBuffer.Response.CommandSetSupport.Reserved2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.SetMax = %hu"), identityBuffer.Response.CommandSetSupport.SetMax);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.Acoustics = %hu"), identityBuffer.Response.CommandSetSupport.Acoustics);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.BigLba = %hu"), identityBuffer.Response.CommandSetSupport.BigLba);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.DeviceConfigOverlay = %hu"), identityBuffer.Response.CommandSetSupport.DeviceConfigOverlay);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.FlushCache = %hu"), identityBuffer.Response.CommandSetSupport.FlushCache);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.FlushCacheExt = %hu"), identityBuffer.Response.CommandSetSupport.FlushCacheExt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.WordValid83 = %hu"), identityBuffer.Response.CommandSetSupport.WordValid83);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.SmartErrorLog = %hu"), identityBuffer.Response.CommandSetSupport.SmartErrorLog);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.SmartSelfTest = %hu"), identityBuffer.Response.CommandSetSupport.SmartSelfTest);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.MediaSerialNumber = %hu"), identityBuffer.Response.CommandSetSupport.MediaSerialNumber);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.MediaCardPassThrough = %hu"), identityBuffer.Response.CommandSetSupport.MediaCardPassThrough);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.StreamingFeature = %hu"), identityBuffer.Response.CommandSetSupport.StreamingFeature);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.GpLogging = %hu"), identityBuffer.Response.CommandSetSupport.GpLogging);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.WriteFua = %hu"), identityBuffer.Response.CommandSetSupport.WriteFua);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.WriteQueuedFua = %hu"), identityBuffer.Response.CommandSetSupport.WriteQueuedFua);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.WWN64Bit = %hu"), identityBuffer.Response.CommandSetSupport.WWN64Bit);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.URGReadStream = %hu"), identityBuffer.Response.CommandSetSupport.URGReadStream);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.URGWriteStream = %hu"), identityBuffer.Response.CommandSetSupport.URGWriteStream);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.ReservedForTechReport = %hu"), identityBuffer.Response.CommandSetSupport.ReservedForTechReport);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.IdleWithUnloadFeature = %hu"), identityBuffer.Response.CommandSetSupport.IdleWithUnloadFeature);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupport.WordValid = %hu"), identityBuffer.Response.CommandSetSupport.WordValid);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.SmartCommands = %hu"), identityBuffer.Response.CommandSetActive.SmartCommands);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.SecurityMode = %hu"), identityBuffer.Response.CommandSetActive.SecurityMode);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.RemovableMediaFeature = %hu"), identityBuffer.Response.CommandSetActive.RemovableMediaFeature);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.PowerManagement = %hu"), identityBuffer.Response.CommandSetActive.PowerManagement);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Reserved1 = %hu"), identityBuffer.Response.CommandSetActive.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.WriteCache = %hu"), identityBuffer.Response.CommandSetActive.WriteCache);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.LookAhead = %hu"), identityBuffer.Response.CommandSetActive.LookAhead);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.ReleaseInterrupt = %hu"), identityBuffer.Response.CommandSetActive.ReleaseInterrupt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.ServiceInterrupt = %hu"), identityBuffer.Response.CommandSetActive.ServiceInterrupt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.DeviceReset = %hu"), identityBuffer.Response.CommandSetActive.DeviceReset);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.HostProtectedArea = %hu"), identityBuffer.Response.CommandSetActive.HostProtectedArea);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Obsolete1 = %hu"), identityBuffer.Response.CommandSetActive.Obsolete1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.WriteBuffer = %hu"), identityBuffer.Response.CommandSetActive.WriteBuffer);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.ReadBuffer = %hu"), identityBuffer.Response.CommandSetActive.ReadBuffer);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Nop = %hu"), identityBuffer.Response.CommandSetActive.Nop);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Obsolete2 = %hu"), identityBuffer.Response.CommandSetActive.Obsolete2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.DownloadMicrocode = %hu"), identityBuffer.Response.CommandSetActive.DownloadMicrocode);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.DmaQueued = %hu"), identityBuffer.Response.CommandSetActive.DmaQueued);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Cfa = %hu"), identityBuffer.Response.CommandSetActive.Cfa);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.AdvancedPm = %hu"), identityBuffer.Response.CommandSetActive.AdvancedPm);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Msn = %hu"), identityBuffer.Response.CommandSetActive.Msn);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.PowerUpInStandby = %hu"), identityBuffer.Response.CommandSetActive.PowerUpInStandby);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.ManualPowerUp = %hu"), identityBuffer.Response.CommandSetActive.ManualPowerUp);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Reserved2 = %hu"), identityBuffer.Response.CommandSetActive.Reserved2);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.SetMax = %hu"), identityBuffer.Response.CommandSetActive.SetMax);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Acoustics = %hu"), identityBuffer.Response.CommandSetActive.Acoustics);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.BigLba = %hu"), identityBuffer.Response.CommandSetActive.BigLba);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.DeviceConfigOverlay = %hu"), identityBuffer.Response.CommandSetActive.DeviceConfigOverlay);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.FlushCache = %hu"), identityBuffer.Response.CommandSetActive.FlushCache);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.FlushCacheExt = %hu"), identityBuffer.Response.CommandSetActive.FlushCacheExt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Resrved3 = %hu"), identityBuffer.Response.CommandSetActive.Resrved3);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Words119_120Valid = %hu"), identityBuffer.Response.CommandSetActive.Words119_120Valid);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.SmartErrorLog = %hu"), identityBuffer.Response.CommandSetActive.SmartErrorLog);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.SmartSelfTest = %hu"), identityBuffer.Response.CommandSetActive.SmartSelfTest);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.MediaSerialNumber = %hu"), identityBuffer.Response.CommandSetActive.MediaSerialNumber);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.MediaCardPassThrough = %hu"), identityBuffer.Response.CommandSetActive.MediaCardPassThrough);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.StreamingFeature = %hu"), identityBuffer.Response.CommandSetActive.StreamingFeature);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.GpLogging = %hu"), identityBuffer.Response.CommandSetActive.GpLogging);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.WriteFua = %hu"), identityBuffer.Response.CommandSetActive.WriteFua);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.WriteQueuedFua = %hu"), identityBuffer.Response.CommandSetActive.WriteQueuedFua);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.WWN64Bit = %hu"), identityBuffer.Response.CommandSetActive.WWN64Bit);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.URGReadStream = %hu"), identityBuffer.Response.CommandSetActive.URGReadStream);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.URGWriteStream = %hu"), identityBuffer.Response.CommandSetActive.URGWriteStream);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.ReservedForTechReport = %hu"), identityBuffer.Response.CommandSetActive.ReservedForTechReport);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.IdleWithUnloadFeature = %hu"), identityBuffer.Response.CommandSetActive.IdleWithUnloadFeature);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActive.Reserved4 = %hu"), identityBuffer.Response.CommandSetActive.Reserved4);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("UltraDMASupport = %hu"), identityBuffer.Response.UltraDMASupport);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("UltraDMAActive = %hu"), identityBuffer.Response.UltraDMAActive);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NormalSecurityEraseUnit.TimeRequired = %hu"), identityBuffer.Response.NormalSecurityEraseUnit.TimeRequired);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NormalSecurityEraseUnit.ExtendedTimeReported = %hu"), identityBuffer.Response.NormalSecurityEraseUnit.ExtendedTimeReported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("EnhancedSecurityEraseUnit.TimeRequired = %hu"), identityBuffer.Response.EnhancedSecurityEraseUnit.TimeRequired);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("EnhancedSecurityEraseUnit.ExtendedTimeReported = %hu"), identityBuffer.Response.EnhancedSecurityEraseUnit.ExtendedTimeReported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CurrentAPMLevel = %hu"), identityBuffer.Response.CurrentAPMLevel);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord91 = %hu"), identityBuffer.Response.ReservedWord91);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MasterPasswordID = %hu"), identityBuffer.Response.MasterPasswordID);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("HardwareResetResult = %hu"), identityBuffer.Response.HardwareResetResult);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CurrentAcousticValue = %hu"), identityBuffer.Response.CurrentAcousticValue);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("RecommendedAcousticValue = %hu"), identityBuffer.Response.RecommendedAcousticValue);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("StreamMinRequestSize = %hu"), identityBuffer.Response.StreamMinRequestSize);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("StreamingTransferTimeDMA = %hu"), identityBuffer.Response.StreamingTransferTimeDMA);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("StreamingAccessLatencyDMAPIO = %hu"), identityBuffer.Response.StreamingAccessLatencyDMAPIO);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("StreamingPerfGranularity = %lu"), identityBuffer.Response.StreamingPerfGranularity);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Max48BitLBA = %.2p"), identityBuffer.Response.Max48BitLBA);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("StreamingTransferTime = %hu"), identityBuffer.Response.StreamingTransferTime);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("DsmCap = %hu"), identityBuffer.Response.DsmCap);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("PhysicalLogicalSectorSize.LogicalSectorsPerPhysicalSector = %hu"), identityBuffer.Response.PhysicalLogicalSectorSize.LogicalSectorsPerPhysicalSector);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("PhysicalLogicalSectorSize.Reserved0 = %hu"), identityBuffer.Response.PhysicalLogicalSectorSize.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("PhysicalLogicalSectorSize.LogicalSectorLongerThan256Words = %hu"), identityBuffer.Response.PhysicalLogicalSectorSize.LogicalSectorLongerThan256Words);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("PhysicalLogicalSectorSize.MultipleLogicalSectorsPerPhysicalSector = %hu"), identityBuffer.Response.PhysicalLogicalSectorSize.MultipleLogicalSectorsPerPhysicalSector);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("PhysicalLogicalSectorSize.Reserved1 = %hu"), identityBuffer.Response.PhysicalLogicalSectorSize.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("InterSeekDelay = %hu"), identityBuffer.Response.InterSeekDelay);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("WorldWideName = %.4p"), identityBuffer.Response.WorldWideName);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedForWorldWideName128 = %.4p"), identityBuffer.Response.ReservedForWorldWideName128);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedForTlcTechnicalReport = %hu"), identityBuffer.Response.ReservedForTlcTechnicalReport);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("WordsPerLogicalSector = %.2p"), identityBuffer.Response.WordsPerLogicalSector);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.ReservedForDrqTechnicalReport = %hu"), identityBuffer.Response.CommandSetSupportExt.ReservedForDrqTechnicalReport);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.WriteReadVerify = %hu"), identityBuffer.Response.CommandSetSupportExt.WriteReadVerify);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.WriteUncorrectableExt = %hu"), identityBuffer.Response.CommandSetSupportExt.WriteUncorrectableExt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.ReadWriteLogDmaExt = %hu"), identityBuffer.Response.CommandSetSupportExt.ReadWriteLogDmaExt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.DownloadMicrocodeMode3 = %hu"), identityBuffer.Response.CommandSetSupportExt.DownloadMicrocodeMode3);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.FreefallControl = %hu"), identityBuffer.Response.CommandSetSupportExt.FreefallControl);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.SenseDataReporting = %hu"), identityBuffer.Response.CommandSetSupportExt.SenseDataReporting);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.ExtendedPowerConditions = %hu"), identityBuffer.Response.CommandSetSupportExt.ExtendedPowerConditions);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.Reserved0 = %hu"), identityBuffer.Response.CommandSetSupportExt.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetSupportExt.WordValid = %hu"), identityBuffer.Response.CommandSetSupportExt.WordValid);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.ReservedForDrqTechnicalReport = %hu"), identityBuffer.Response.CommandSetActiveExt.ReservedForDrqTechnicalReport);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.WriteReadVerify = %hu"), identityBuffer.Response.CommandSetActiveExt.WriteReadVerify);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.WriteUncorrectableExt = %hu"), identityBuffer.Response.CommandSetActiveExt.WriteUncorrectableExt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.ReadWriteLogDmaExt = %hu"), identityBuffer.Response.CommandSetActiveExt.ReadWriteLogDmaExt);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.DownloadMicrocodeMode3 = %hu"), identityBuffer.Response.CommandSetActiveExt.DownloadMicrocodeMode3);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.FreefallControl = %hu"), identityBuffer.Response.CommandSetActiveExt.FreefallControl);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.SenseDataReporting = %hu"), identityBuffer.Response.CommandSetActiveExt.SenseDataReporting);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.ExtendedPowerConditions = %hu"), identityBuffer.Response.CommandSetActiveExt.ExtendedPowerConditions);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.Reserved0 = %hu"), identityBuffer.Response.CommandSetActiveExt.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CommandSetActiveExt.Reserved1 = %hu"), identityBuffer.Response.CommandSetActiveExt.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedForExpandedSupportandActive = %.6p"), identityBuffer.Response.ReservedForExpandedSupportandActive);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MsnSupport = %hu"), identityBuffer.Response.MsnSupport);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord127 = %hu"), identityBuffer.Response.ReservedWord127);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SecurityStatus.SecuritySupported = %hu"), identityBuffer.Response.SecurityStatus.SecuritySupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SecurityStatus.SecurityEnabled = %hu"), identityBuffer.Response.SecurityStatus.SecurityEnabled);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SecurityStatus.SecurityLocked = %hu"), identityBuffer.Response.SecurityStatus.SecurityLocked);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SecurityStatus.SecurityFrozen = %hu"), identityBuffer.Response.SecurityStatus.SecurityFrozen);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SecurityStatus.SecurityCountExpired = %hu"), identityBuffer.Response.SecurityStatus.SecurityCountExpired);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SecurityStatus.EnhancedSecurityEraseSupported = %hu"), identityBuffer.Response.SecurityStatus.EnhancedSecurityEraseSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SecurityStatus.Reserved0 = %hu"), identityBuffer.Response.SecurityStatus.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SecurityStatus.SecurityLevel = %hu"), identityBuffer.Response.SecurityStatus.SecurityLevel);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SecurityStatus.Reserved1 = %hu"), identityBuffer.Response.SecurityStatus.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord129 = %.31p"), identityBuffer.Response.ReservedWord129);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CfaPowerMode1.MaximumCurrentInMA = %hu"), identityBuffer.Response.CfaPowerMode1.MaximumCurrentInMA);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CfaPowerMode1.CfaPowerMode1Disabled = %hu"), identityBuffer.Response.CfaPowerMode1.CfaPowerMode1Disabled);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CfaPowerMode1.CfaPowerMode1Required = %hu"), identityBuffer.Response.CfaPowerMode1.CfaPowerMode1Required);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CfaPowerMode1.Reserved0 = %hu"), identityBuffer.Response.CfaPowerMode1.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CfaPowerMode1.Word160Supported = %hu"), identityBuffer.Response.CfaPowerMode1.Word160Supported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedForCfaWord161 = %.7p"), identityBuffer.Response.ReservedForCfaWord161);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NominalFormFactor = %hu"), identityBuffer.Response.NominalFormFactor);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord168 = %hu"), identityBuffer.Response.ReservedWord168);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("DataSetManagementFeature.SupportsTrim = %hu"), identityBuffer.Response.DataSetManagementFeature.SupportsTrim);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("DataSetManagementFeature.Reserved0 = %hu"), identityBuffer.Response.DataSetManagementFeature.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("AdditionalProductID = %.4p"), identityBuffer.Response.AdditionalProductID);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedForCfaWord174 = %.2p"), identityBuffer.Response.ReservedForCfaWord174);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CurrentMediaSerialNumber = %.30p"), identityBuffer.Response.CurrentMediaSerialNumber);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SCTCommandTransport.Supported = %hu"), identityBuffer.Response.SCTCommandTransport.Supported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SCTCommandTransport.Reserved0 = %hu"), identityBuffer.Response.SCTCommandTransport.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SCTCommandTransport.WriteSameSuported = %hu"), identityBuffer.Response.SCTCommandTransport.WriteSameSuported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SCTCommandTransport.ErrorRecoveryControlSupported = %hu"), identityBuffer.Response.SCTCommandTransport.ErrorRecoveryControlSupported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SCTCommandTransport.FeatureControlSuported = %hu"), identityBuffer.Response.SCTCommandTransport.FeatureControlSuported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SCTCommandTransport.DataTablesSuported = %hu"), identityBuffer.Response.SCTCommandTransport.DataTablesSuported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SCTCommandTransport.Reserved1 = %hu"), identityBuffer.Response.SCTCommandTransport.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("SCTCommandTransport.VendorSpecific = %hu"), identityBuffer.Response.SCTCommandTransport.VendorSpecific);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord207 = %.2p"), identityBuffer.Response.ReservedWord207);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("BlockAlignment.AlignmentOfLogicalWithinPhysical = %hu"), identityBuffer.Response.BlockAlignment.AlignmentOfLogicalWithinPhysical);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("BlockAlignment.Word209Supported = %hu"), identityBuffer.Response.BlockAlignment.Word209Supported);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("BlockAlignment.Reserved0 = %hu"), identityBuffer.Response.BlockAlignment.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("WriteReadVerifySectorCountMode3Only = %.2p"), identityBuffer.Response.WriteReadVerifySectorCountMode3Only);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("WriteReadVerifySectorCountMode2Only = %.2p"), identityBuffer.Response.WriteReadVerifySectorCountMode2Only);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheCapabilities.NVCachePowerModeEnabled = %hu"), identityBuffer.Response.NVCacheCapabilities.NVCachePowerModeEnabled);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheCapabilities.Reserved0 = %hu"), identityBuffer.Response.NVCacheCapabilities.Reserved0);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheCapabilities.NVCacheFeatureSetEnabled = %hu"), identityBuffer.Response.NVCacheCapabilities.NVCacheFeatureSetEnabled);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheCapabilities.Reserved1 = %hu"), identityBuffer.Response.NVCacheCapabilities.Reserved1);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheCapabilities.NVCachePowerModeVersion = %hu"), identityBuffer.Response.NVCacheCapabilities.NVCachePowerModeVersion);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheCapabilities.NVCacheFeatureSetVersion = %hu"), identityBuffer.Response.NVCacheCapabilities.NVCacheFeatureSetVersion);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheSizeLSW = %hu"), identityBuffer.Response.NVCacheSizeLSW);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheSizeMSW = %hu"), identityBuffer.Response.NVCacheSizeMSW);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NominalMediaRotationRate = %hu"), identityBuffer.Response.NominalMediaRotationRate);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord218 = %hu"), identityBuffer.Response.ReservedWord218);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheOptions.NVCacheEstimatedTimeToSpinUpInSeconds = %u"), identityBuffer.Response.NVCacheOptions.NVCacheEstimatedTimeToSpinUpInSeconds);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("NVCacheOptions.Reserved = %u"), identityBuffer.Response.NVCacheOptions.Reserved);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("WriteReadVerifySectorCountMode = %hu"), identityBuffer.Response.WriteReadVerifySectorCountMode);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord220 = %hu"), identityBuffer.Response.ReservedWord220);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord221 = %hu"), identityBuffer.Response.ReservedWord221);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("TransportMajorVersion.MajorVersion = %hu"), identityBuffer.Response.TransportMajorVersion.MajorVersion);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("TransportMajorVersion.TransportType = %hu"), identityBuffer.Response.TransportMajorVersion.TransportType);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("TransportMinorVersion = %hu"), identityBuffer.Response.TransportMinorVersion);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord224 = %.6p"), identityBuffer.Response.ReservedWord224);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ExtendedNumberOfUserAddressableSectors = %.2p"), identityBuffer.Response.ExtendedNumberOfUserAddressableSectors);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MinBlocksPerDownloadMicrocodeMode03 = %hu"), identityBuffer.Response.MinBlocksPerDownloadMicrocodeMode03);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("MaxBlocksPerDownloadMicrocodeMode03 = %hu"), identityBuffer.Response.MaxBlocksPerDownloadMicrocodeMode03);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("ReservedWord236 = %.19p"), identityBuffer.Response.ReservedWord236);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("Signature = %hu"), identityBuffer.Response.Signature);
OutputDebugString(dbg);
wnsprintf(dbg, dbglen, _T("CheckSum = %hu"), identityBuffer.Response.CheckSum);
OutputDebugString(dbg);
}
/*
Check if there is any mouse movement in the sandbox.
*/
+11 -1
View File
@@ -5,6 +5,8 @@
#include <winioctl.h> // IOCTL
#include <intrin.h> // cpuid()
#include <locale.h> // 64-bit wchar atoi
#include <ntddscsi.h> // ATA/SCSI IOCTL structs
#include "ATA.h" // ATA structures
#include <powrprof.h> // check_power_modes()
#pragma comment(lib, "powrprof.lib")
@@ -16,6 +18,12 @@
#include "../Shared/Utils.h"
#include "../Shared/VersionHelpers.h"
struct ATA_IDENTITY_BUFFER
{
ATA_PASS_THROUGH_EX Request;
IDENTIFY_DEVICE_DATA Response;
};
VOID loaded_dlls();
BOOL NumberOfProcessors();
BOOL idt_trick();
@@ -37,4 +45,6 @@ BOOL model_computer_system_wmi();
BOOL manufacturer_computer_system_wmi();
BOOL current_temperature_acpi_wmi();
BOOL process_id_processor_wmi();
BOOL power_capabilities();
BOOL power_capabilities();
BOOL ata_identify();
VOID dump_response(ATA_IDENTITY_BUFFER identityBuffer);
+20
View File
@@ -847,4 +847,24 @@ PBYTE get_system_firmware(_In_ DWORD signature, _In_ DWORD table, _Out_ PDWORD p
*pBufferSize = resultBufferSize;
return firmwareTable;
}
VOID SwapStringEndianA(char* buffer, size_t len)
{
for (size_t i = 0; i < len; i += 2)
{
char tmp = buffer[i + 1];
buffer[i + 1] = buffer[i];
buffer[i] = tmp;
}
}
VOID SwapStringEndianW(wchar_t* buffer, size_t len)
{
for (size_t i = 0; i < len; i += 2)
{
wchar_t tmp = buffer[i + 1];
buffer[i + 1] = buffer[i];
buffer[i] = tmp;
}
}
+2
View File
@@ -39,6 +39,8 @@ BOOL IsElevated();
BOOL find_str_in_data(PBYTE needle, size_t needleLen, PBYTE haystack, size_t haystackLen);
UINT enum_system_firmware_tables(_In_ DWORD FirmwareTableProviderSignature, _Out_ PVOID pFirmwareTableBuffer, _In_ DWORD BufferSize);
PBYTE get_system_firmware(_In_ DWORD signature, _In_ DWORD table, _Out_ PDWORD pBufferSize);
VOID SwapStringEndianA(char* buffer, size_t len);
VOID SwapStringEndianW(wchar_t* buffer, size_t len);
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, x)
#define FREE(x) HeapFree(GetProcessHeap(), 0, x)
+1
View File
@@ -247,6 +247,7 @@
<ClInclude Include="Anti Debug\WriteWatch.h" />
<ClInclude Include="Anti Dump\ErasePEHeaderFromMemory.h" />
<ClInclude Include="Anti Dump\SizeOfImage.h" />
<ClInclude Include="Anti VM\ATA.h" />
<ClInclude Include="Anti VM\Generic.h" />
<ClInclude Include="Anti VM\Parallels.h" />
<ClInclude Include="Anti VM\Qemu.h" />
+3
View File
@@ -399,6 +399,9 @@
<ClInclude Include="Anti VM\VirtualPC.h">
<Filter>Anti VM / Emulation\Header</Filter>
</ClInclude>
<ClInclude Include="Anti VM\ATA.h">
<Filter>Anti VM / Emulation\Header</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<MASM Include="Anti Debug\int2d_x64.asm">