最近硬盘问题总是不断,拿去换了几个每次都说是新的结果一用就出问题...妈的奸商居然奸到我头上了,于是写个查ID的工具,看看还出问题还说换新的是不是给我新的!-_-#!!
代码基本上是网上抄得-_-#,结构太复杂,所以只能是边参考边敲代码了
主程序代码:
代码基本上是网上抄得-_-#,结构太复杂,所以只能是边参考边敲代码了
主程序代码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#include <windows.h>
#include "HardID.h"
void CopyRight()
{
cout<<"/**************************************"<<" "
<<" HardDisk ID GetClass "<<" "
<<" Writen By Red_angelX 2007.3.23 "<<" "
<<"**************************************/"<<endl;
}
char* ConvertToString(DWORD diskdata [256], int firstIndex, int lastIndex)
{
static char string [1024];
int index = 0;
int position = 0;
// each integer has two characters stored in it backwards
for (index = firstIndex; index <= lastIndex; index++)
{
// get high byte for 1st character
string [position] = (char) (diskdata [index] / 256);
position++;
// get low byte for 2nd character
string [position] = (char) (diskdata [index] % 256);
position++;
}
// end the string
string [position] = '';
// cut off the trailing blanks
for (index = position - 1; index > 0 && ' ' == string [index]; index--)
string [index] = '';
return string;
}
//Print Out The Result
void PrintInfo(int drive,DWORD diskdata[256])
{
char string1 [1024];
__int64 sectors = 0;
int bytes = 0;
cout<<"Drive"<<drive<<" : "<<ConvertToString(diskdata, 27, 46)<<endl;
cout<<"Serial Number : "<<ConvertToString (diskdata, 10, 19)<<endl;
cout<<"Revision Number :"<<ConvertToString (diskdata, 23, 26)<<endl;
char* str_HardDesk_Form = new char[256];
switch (drive / 2)
{
case 0: str_HardDesk_Form ="Primary Controller";
break;
case 1: str_HardDesk_Form ="Secondary Controller";
break;
case 2: str_HardDesk_Form ="Tertiary Controller";
break;
case 3: str_HardDesk_Form ="Quaternary Controller";
break;
}
cout<<"Primary : "<<str_HardDesk_Form<<endl;
char* str_Controller = new char[256];
switch (drive % 2)
{
case 0: str_Controller ="Master drive";
break;
case 1: str_Controller ="Slave drive";
break;
}
cout<<"Control Is "<<str_Controller<<endl;
char* str_HardDeskType = new char[256];
if (diskdata [0] & 0x0080)
str_HardDeskType ="Removable";
else if (diskdata [0] & 0x0040)
str_HardDeskType ="Fixed";
else str_HardDeskType ="Unknown";
cout<<"Drive Type : "<<str_HardDeskType<<endl;
cout<<"Buffer Size : "<<diskdata [21] * 512 / 1024 / 1024<<"M"<<endl;
if (diskdata [83] & 0x400)
sectors = diskdata [103] * 65536I64 * 65536I64 * 65536I64 +
diskdata [102] * 65536I64 * 65536I64 +
diskdata [101] * 65536I64 +
diskdata [100];
else
sectors = diskdata [61] * 65536 + diskdata [60];
// there are 512 bytes in a sector
bytes = sectors * 512 / 1024 / 1024 /1024;
cout<<"Disk Size : "<<bytes<<"G"<<endl;
}
int DoIDENTIFY(HANDLE hPhysicalDriveIOCTL, SENDCMDINPARAMS* pSCIP,
SENDCMDOUTPARAMS* pSCOP, BYTE bIDCmd, BYTE bDriveNum,
PDWORD lpcbBytesReturned)
{
// Set up data structures for IDENTIFY command.
pSCIP->cBufferSize = IDENTIFY_BUFFER_SIZE;
pSCIP->irDriveRegs.bFeaturesReg = 0;
pSCIP->irDriveRegs.bSectorCountReg = 1;
pSCIP->irDriveRegs.bSectorNumberReg = 1;
pSCIP->irDriveRegs.bCylLowReg = 0;
pSCIP->irDriveRegs.bCylHighReg = 0;
// Compute the drive number.
pSCIP->irDriveRegs.bDriveHeadReg = 0xA0 | ((bDriveNum & 1) << 4);
// The command can either be IDE identify or ATAPI identify.
pSCIP->irDriveRegs.bCommandReg = bIDCmd;
pSCIP->bDriveNumber = bDriveNum;
pSCIP->cBufferSize = IDENTIFY_BUFFER_SIZE;
return( DeviceIoControl (hPhysicalDriveIOCTL, DFP_RECEIVE_DRIVE_DATA,
(LPVOID) pSCIP,
sizeof(SENDCMDINPARAMS) - 1,
(LPVOID) pSCOP,
sizeof(SENDCMDOUTPARAMS) + IDENTIFY_BUFFER_SIZE - 1,
lpcbBytesReturned, NULL) );
}
void ReadDriverInfo9X()
{
cout<<"Your OS is Win9X"<<endl;
HANDLE VxDHandle = 0;
pt_IdeDInfo pOutBufVxD = 0;
DWORD lpBytesReturned = 0;
SetPriorityClass(GetCurrentProcess(),REALTIME_PRIORITY_CLASS);
rt_IdeDInfo info;
pOutBufVxD = &info;
memset(&info,0,sizeof(info));
// 1. Try to load the VxD
VxDHandle = CreateFile ("\\.\IDE21201.VXD", 0, 0, 0,
0, FILE_FLAG_DELETE_ON_CLOSE, 0);
if(VxDHandle != INVALID_HANDLE_VALUE)
{
// 2. Run VxD function
DeviceIoControl (VxDHandle, m_cVxDFunctionIdesDInfo,
0, 0, pOutBufVxD, sizeof(pt_IdeDInfo), &lpBytesReturned, 0);
// 3. Unload VxD
CloseHandle (VxDHandle);
}
for(int i=0;i<8;i++)
{
if((pOutBufVxD->DiskExists[i]) && (pOutBufVxD->IDEExists[i/2]))
{
DWORD diskinfo [256];
for (int j = 0; j < 256; j++)
diskinfo [j] = pOutBufVxD -> DisksRawInfo [i * 256 + j];
PrintInfo (i, diskinfo);
}
}
}
void ReadDriverInfoNT()
{
cout<<"Your OS is WinNT"<<endl;
for(int drive=0;drive<MAX_IDE_DRIVERS;drive++)
{
HANDLE hPhysicalDriverIOCTL = 0;
char drivename[256];
sprintf(drivename,"\\.\PhysicalDrive%d",drive);
hPhysicalDriverIOCTL = CreateFile(drivename,GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL,OPEN_EXISTING, 0, NULL);
if(hPhysicalDriverIOCTL != INVALID_HANDLE_VALUE)
{
GETVERSIONOUTPARAMS VersionParams;
DWORD cbBytesReturned = 0;
memset(&VersionParams,0,sizeof(GETVERSIONOUTPARAMS));
DeviceIoControl(hPhysicalDriverIOCTL,DFP_GET_VERSION,NULL,0,&VersionParams,sizeof(VersionParams),&cbBytesReturned,NULL);
if(VersionParams.bIDEDeviceMap > 0)
{
BYTE bIDCmd = 0;
SENDCMDINPARAMS scip;
BYTE IdOutCmd[sizeof(SENDCMDINPARAMS)+IDENTIFY_BUFFER_SIZE-1];
bIDCmd = (VersionParams.bIDEDeviceMap >> drive & 0x10) ?
IDE_ATAPI_IDENTIFY : IDE_ATA_IDENTIFY;
memset(&scip,0,sizeof(scip));
memset(IdOutCmd,0,sizeof(IdOutCmd));
if(DoIDENTIFY(hPhysicalDriverIOCTL,&scip,(PSENDCMDOUTPARAMS)&IdOutCmd,
bIDCmd,(BYTE)drive,&cbBytesReturned))
{
DWORD diskdata[256];
USHORT *pIdSector = (USHORT *)
((PSENDCMDOUTPARAMS) IdOutCmd) -> bBuffer;
for(int m=0;m<256;m++)
{
diskdata[m] = pIdSector[m];
}
PrintInfo(drive,diskdata);
}
}
}
CloseHandle(hPhysicalDriverIOCTL);
}
}
int main(int argc,char **argv)
{
CopyRight();
//Get Win Version
OSVERSIONINFO version;
memset(&version,0,sizeof(OSVERSIONINFO));
version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&version);
if(version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
{
ReadDriverInfo9X();
}
else if(version.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
ReadDriverInfoNT();
}
else
{
cout<<"这个程序能在Dos下运行吗?"<<endl;
}
system("pause");
}
定义和结构体#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#include <windows.h>
#include "HardID.h"
void CopyRight()
{
cout<<"/**************************************"<<" "
<<" HardDisk ID GetClass "<<" "
<<" Writen By Red_angelX 2007.3.23 "<<" "
<<"**************************************/"<<endl;
}
char* ConvertToString(DWORD diskdata [256], int firstIndex, int lastIndex)
{
static char string [1024];
int index = 0;
int position = 0;
// each integer has two characters stored in it backwards
for (index = firstIndex; index <= lastIndex; index++)
{
// get high byte for 1st character
string [position] = (char) (diskdata [index] / 256);
position++;
// get low byte for 2nd character
string [position] = (char) (diskdata [index] % 256);
position++;
}
// end the string
string [position] = '';
// cut off the trailing blanks
for (index = position - 1; index > 0 && ' ' == string [index]; index--)
string [index] = '';
return string;
}
//Print Out The Result
void PrintInfo(int drive,DWORD diskdata[256])
{
char string1 [1024];
__int64 sectors = 0;
int bytes = 0;
cout<<"Drive"<<drive<<" : "<<ConvertToString(diskdata, 27, 46)<<endl;
cout<<"Serial Number : "<<ConvertToString (diskdata, 10, 19)<<endl;
cout<<"Revision Number :"<<ConvertToString (diskdata, 23, 26)<<endl;
char* str_HardDesk_Form = new char[256];
switch (drive / 2)
{
case 0: str_HardDesk_Form ="Primary Controller";
break;
case 1: str_HardDesk_Form ="Secondary Controller";
break;
case 2: str_HardDesk_Form ="Tertiary Controller";
break;
case 3: str_HardDesk_Form ="Quaternary Controller";
break;
}
cout<<"Primary : "<<str_HardDesk_Form<<endl;
char* str_Controller = new char[256];
switch (drive % 2)
{
case 0: str_Controller ="Master drive";
break;
case 1: str_Controller ="Slave drive";
break;
}
cout<<"Control Is "<<str_Controller<<endl;
char* str_HardDeskType = new char[256];
if (diskdata [0] & 0x0080)
str_HardDeskType ="Removable";
else if (diskdata [0] & 0x0040)
str_HardDeskType ="Fixed";
else str_HardDeskType ="Unknown";
cout<<"Drive Type : "<<str_HardDeskType<<endl;
cout<<"Buffer Size : "<<diskdata [21] * 512 / 1024 / 1024<<"M"<<endl;
if (diskdata [83] & 0x400)
sectors = diskdata [103] * 65536I64 * 65536I64 * 65536I64 +
diskdata [102] * 65536I64 * 65536I64 +
diskdata [101] * 65536I64 +
diskdata [100];
else
sectors = diskdata [61] * 65536 + diskdata [60];
// there are 512 bytes in a sector
bytes = sectors * 512 / 1024 / 1024 /1024;
cout<<"Disk Size : "<<bytes<<"G"<<endl;
}
int DoIDENTIFY(HANDLE hPhysicalDriveIOCTL, SENDCMDINPARAMS* pSCIP,
SENDCMDOUTPARAMS* pSCOP, BYTE bIDCmd, BYTE bDriveNum,
PDWORD lpcbBytesReturned)
{
// Set up data structures for IDENTIFY command.
pSCIP->cBufferSize = IDENTIFY_BUFFER_SIZE;
pSCIP->irDriveRegs.bFeaturesReg = 0;
pSCIP->irDriveRegs.bSectorCountReg = 1;
pSCIP->irDriveRegs.bSectorNumberReg = 1;
pSCIP->irDriveRegs.bCylLowReg = 0;
pSCIP->irDriveRegs.bCylHighReg = 0;
// Compute the drive number.
pSCIP->irDriveRegs.bDriveHeadReg = 0xA0 | ((bDriveNum & 1) << 4);
// The command can either be IDE identify or ATAPI identify.
pSCIP->irDriveRegs.bCommandReg = bIDCmd;
pSCIP->bDriveNumber = bDriveNum;
pSCIP->cBufferSize = IDENTIFY_BUFFER_SIZE;
return( DeviceIoControl (hPhysicalDriveIOCTL, DFP_RECEIVE_DRIVE_DATA,
(LPVOID) pSCIP,
sizeof(SENDCMDINPARAMS) - 1,
(LPVOID) pSCOP,
sizeof(SENDCMDOUTPARAMS) + IDENTIFY_BUFFER_SIZE - 1,
lpcbBytesReturned, NULL) );
}
void ReadDriverInfo9X()
{
cout<<"Your OS is Win9X"<<endl;
HANDLE VxDHandle = 0;
pt_IdeDInfo pOutBufVxD = 0;
DWORD lpBytesReturned = 0;
SetPriorityClass(GetCurrentProcess(),REALTIME_PRIORITY_CLASS);
rt_IdeDInfo info;
pOutBufVxD = &info;
memset(&info,0,sizeof(info));
// 1. Try to load the VxD
VxDHandle = CreateFile ("\\.\IDE21201.VXD", 0, 0, 0,
0, FILE_FLAG_DELETE_ON_CLOSE, 0);
if(VxDHandle != INVALID_HANDLE_VALUE)
{
// 2. Run VxD function
DeviceIoControl (VxDHandle, m_cVxDFunctionIdesDInfo,
0, 0, pOutBufVxD, sizeof(pt_IdeDInfo), &lpBytesReturned, 0);
// 3. Unload VxD
CloseHandle (VxDHandle);
}
for(int i=0;i<8;i++)
{
if((pOutBufVxD->DiskExists[i]) && (pOutBufVxD->IDEExists[i/2]))
{
DWORD diskinfo [256];
for (int j = 0; j < 256; j++)
diskinfo [j] = pOutBufVxD -> DisksRawInfo [i * 256 + j];
PrintInfo (i, diskinfo);
}
}
}
void ReadDriverInfoNT()
{
cout<<"Your OS is WinNT"<<endl;
for(int drive=0;drive<MAX_IDE_DRIVERS;drive++)
{
HANDLE hPhysicalDriverIOCTL = 0;
char drivename[256];
sprintf(drivename,"\\.\PhysicalDrive%d",drive);
hPhysicalDriverIOCTL = CreateFile(drivename,GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL,OPEN_EXISTING, 0, NULL);
if(hPhysicalDriverIOCTL != INVALID_HANDLE_VALUE)
{
GETVERSIONOUTPARAMS VersionParams;
DWORD cbBytesReturned = 0;
memset(&VersionParams,0,sizeof(GETVERSIONOUTPARAMS));
DeviceIoControl(hPhysicalDriverIOCTL,DFP_GET_VERSION,NULL,0,&VersionParams,sizeof(VersionParams),&cbBytesReturned,NULL);
if(VersionParams.bIDEDeviceMap > 0)
{
BYTE bIDCmd = 0;
SENDCMDINPARAMS scip;
BYTE IdOutCmd[sizeof(SENDCMDINPARAMS)+IDENTIFY_BUFFER_SIZE-1];
bIDCmd = (VersionParams.bIDEDeviceMap >> drive & 0x10) ?
IDE_ATAPI_IDENTIFY : IDE_ATA_IDENTIFY;
memset(&scip,0,sizeof(scip));
memset(IdOutCmd,0,sizeof(IdOutCmd));
if(DoIDENTIFY(hPhysicalDriverIOCTL,&scip,(PSENDCMDOUTPARAMS)&IdOutCmd,
bIDCmd,(BYTE)drive,&cbBytesReturned))
{
DWORD diskdata[256];
USHORT *pIdSector = (USHORT *)
((PSENDCMDOUTPARAMS) IdOutCmd) -> bBuffer;
for(int m=0;m<256;m++)
{
diskdata[m] = pIdSector[m];
}
PrintInfo(drive,diskdata);
}
}
}
CloseHandle(hPhysicalDriverIOCTL);
}
}
int main(int argc,char **argv)
{
CopyRight();
//Get Win Version
OSVERSIONINFO version;
memset(&version,0,sizeof(OSVERSIONINFO));
version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&version);
if(version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
{
ReadDriverInfo9X();
}
else if(version.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
ReadDriverInfoNT();
}
else
{
cout<<"这个程序能在Dos下运行吗?"<<endl;
}
system("pause");
}
#define MAX_IDE_DRIVERS 4
#define IDENTIFY_BUFFER_SIZE 512
#define m_cVxDFunctionIdesDInfo 1
#define SENDIDLENGTH sizeof (SENDCMDOUTPARAMS) + IDENTIFY_BUFFER_SIZE
#define IDE_ATAPI_IDENTIFY 0xA1 // Returns ID sector for ATAPI.
#define IDE_ATA_IDENTIFY 0xEC // Returns ID sector for ATA.
// GETVERSIONOUTPARAMS contains the data returned from the
// Get Driver Version function.
typedef struct _GETVERSIONOUTPARAMS
{
BYTE bVersion; // Binary driver version.
BYTE bRevision; // Binary driver revision.
BYTE bReserved; // Not used.
BYTE bIDEDeviceMap; // Bit map of IDE devices.
DWORD fCapabilities; // Bit mask of driver capabilities.
DWORD dwReserved[4]; // For future use.
}GETVERSIONOUTPARAMS, *PGETVERSIONOUTPARAMS, *LPGETVERSIONOUTPARAMS;
// IDE registers
typedef struct _IDEREGS
{
BYTE bFeaturesReg; // Used for specifying SMART "commands".
BYTE bSectorCountReg; // IDE sector count register
BYTE bSectorNumberReg; // IDE sector number register
BYTE bCylLowReg; // IDE low order cylinder value
BYTE bCylHighReg; // IDE high order cylinder value
BYTE bDriveHeadReg; // IDE drive/head register
BYTE bCommandReg; // Actual IDE command.
BYTE bReserved; // reserved for future use. Must be zero.
}IDEREGS, *PIDEREGS, *LPIDEREGS;
// SENDCMDINPARAMS contains the input parameters for the
// Send Command to Drive function.
typedef struct _SENDCMDINPARAMS
{
DWORD cBufferSize; // Buffer size in bytes
IDEREGS irDriveRegs; // Structure with drive register values.
BYTE bDriveNumber; // Physical drive number to send
// command to (0,1,2,3).
BYTE bReserved[3]; // Reserved for future expansion.
DWORD dwReserved[4]; // For future use.
BYTE bBuffer[1]; // Input buffer.
}SENDCMDINPARAMS, *PSENDCMDINPARAMS, *LPSENDCMDINPARAMS;
// IOCTL commands
#define DFP_GET_VERSION 0x00074080
#define DFP_SEND_DRIVE_COMMAND 0x0007c084
#define DFP_RECEIVE_DRIVE_DATA 0x0007c088
#define FILE_DEVICE_SCSI 0x0000001b
#define IOCTL_SCSI_MINIPORT_IDENTIFY ((FILE_DEVICE_SCSI << 16) + 0x0501)
#define IOCTL_SCSI_MINIPORT 0x0004D008 // see NTDDSCSI.H for definition
// Status returned from driver
typedef struct _DRIVERSTATUS
{
BYTE bDriverError; // Error code from driver, or 0 if no error.
BYTE bIDEStatus; // Contents of IDE Error register.
// Only valid when bDriverError is SMART_IDE_ERROR.
BYTE bReserved[2]; // Reserved for future expansion.
DWORD dwReserved[2]; // Reserved for future expansion.
} DRIVERSTATUS, *PDRIVERSTATUS, *LPDRIVERSTATUS;
// Structure returned by PhysicalDrive IOCTL for several commands
typedef struct _SENDCMDOUTPARAMS
{
DWORD cBufferSize; // Size of bBuffer in bytes
DRIVERSTATUS DriverStatus; // Driver status structure.
BYTE bBuffer[1]; // Buffer of arbitrary length in which to store the data read from the // drive.
} SENDCMDOUTPARAMS, *PSENDCMDOUTPARAMS, *LPSENDCMDOUTPARAMS;
// (* Output Bbuffer for the VxD (rt_IdeDinfo record) *)
typedef struct _rt_IdeDInfo_
{
BYTE IDEExists[4];
BYTE DiskExists[8];
WORD DisksRawInfo[8*256];
} rt_IdeDInfo, *pt_IdeDInfo;
// (* IdeDinfo "data fields" *)
typedef struct _rt_DiskInfo_
{
BOOL DiskExists;
BOOL ATAdevice;
BOOL RemovableDevice;
WORD TotLogCyl;
WORD TotLogHeads;
WORD TotLogSPT;
char SerialNumber[20];
char FirmwareRevision[8];
char ModelNumber[40];
WORD CurLogCyl;
WORD CurLogHeads;
WORD CurLogSPT;
} rt_DiskInfo;
运行结果:#define IDENTIFY_BUFFER_SIZE 512
#define m_cVxDFunctionIdesDInfo 1
#define SENDIDLENGTH sizeof (SENDCMDOUTPARAMS) + IDENTIFY_BUFFER_SIZE
#define IDE_ATAPI_IDENTIFY 0xA1 // Returns ID sector for ATAPI.
#define IDE_ATA_IDENTIFY 0xEC // Returns ID sector for ATA.
// GETVERSIONOUTPARAMS contains the data returned from the
// Get Driver Version function.
typedef struct _GETVERSIONOUTPARAMS
{
BYTE bVersion; // Binary driver version.
BYTE bRevision; // Binary driver revision.
BYTE bReserved; // Not used.
BYTE bIDEDeviceMap; // Bit map of IDE devices.
DWORD fCapabilities; // Bit mask of driver capabilities.
DWORD dwReserved[4]; // For future use.
}GETVERSIONOUTPARAMS, *PGETVERSIONOUTPARAMS, *LPGETVERSIONOUTPARAMS;
// IDE registers
typedef struct _IDEREGS
{
BYTE bFeaturesReg; // Used for specifying SMART "commands".
BYTE bSectorCountReg; // IDE sector count register
BYTE bSectorNumberReg; // IDE sector number register
BYTE bCylLowReg; // IDE low order cylinder value
BYTE bCylHighReg; // IDE high order cylinder value
BYTE bDriveHeadReg; // IDE drive/head register
BYTE bCommandReg; // Actual IDE command.
BYTE bReserved; // reserved for future use. Must be zero.
}IDEREGS, *PIDEREGS, *LPIDEREGS;
// SENDCMDINPARAMS contains the input parameters for the
// Send Command to Drive function.
typedef struct _SENDCMDINPARAMS
{
DWORD cBufferSize; // Buffer size in bytes
IDEREGS irDriveRegs; // Structure with drive register values.
BYTE bDriveNumber; // Physical drive number to send
// command to (0,1,2,3).
BYTE bReserved[3]; // Reserved for future expansion.
DWORD dwReserved[4]; // For future use.
BYTE bBuffer[1]; // Input buffer.
}SENDCMDINPARAMS, *PSENDCMDINPARAMS, *LPSENDCMDINPARAMS;
// IOCTL commands
#define DFP_GET_VERSION 0x00074080
#define DFP_SEND_DRIVE_COMMAND 0x0007c084
#define DFP_RECEIVE_DRIVE_DATA 0x0007c088
#define FILE_DEVICE_SCSI 0x0000001b
#define IOCTL_SCSI_MINIPORT_IDENTIFY ((FILE_DEVICE_SCSI << 16) + 0x0501)
#define IOCTL_SCSI_MINIPORT 0x0004D008 // see NTDDSCSI.H for definition
// Status returned from driver
typedef struct _DRIVERSTATUS
{
BYTE bDriverError; // Error code from driver, or 0 if no error.
BYTE bIDEStatus; // Contents of IDE Error register.
// Only valid when bDriverError is SMART_IDE_ERROR.
BYTE bReserved[2]; // Reserved for future expansion.
DWORD dwReserved[2]; // Reserved for future expansion.
} DRIVERSTATUS, *PDRIVERSTATUS, *LPDRIVERSTATUS;
// Structure returned by PhysicalDrive IOCTL for several commands
typedef struct _SENDCMDOUTPARAMS
{
DWORD cBufferSize; // Size of bBuffer in bytes
DRIVERSTATUS DriverStatus; // Driver status structure.
BYTE bBuffer[1]; // Buffer of arbitrary length in which to store the data read from the // drive.
} SENDCMDOUTPARAMS, *PSENDCMDOUTPARAMS, *LPSENDCMDOUTPARAMS;
// (* Output Bbuffer for the VxD (rt_IdeDinfo record) *)
typedef struct _rt_IdeDInfo_
{
BYTE IDEExists[4];
BYTE DiskExists[8];
WORD DisksRawInfo[8*256];
} rt_IdeDInfo, *pt_IdeDInfo;
// (* IdeDinfo "data fields" *)
typedef struct _rt_DiskInfo_
{
BOOL DiskExists;
BOOL ATAdevice;
BOOL RemovableDevice;
WORD TotLogCyl;
WORD TotLogHeads;
WORD TotLogSPT;
char SerialNumber[20];
char FirmwareRevision[8];
char ModelNumber[40];
WORD CurLogCyl;
WORD CurLogHeads;
WORD CurLogSPT;
} rt_DiskInfo;
/**************************************
HardDisk ID GetClass
Writen By Red_angelX 2007.3.23
**************************************/
Your OS is WinNT
Drive0 : Maxtor 6V080E0
Serial Number : V22PVCWG
Revision Number :VA111900
Primary : Primary Controller
Control Is Master drive
Drive Type : Fixed
Buffer Size : 8M
Disk Size : 76G
请按任意键继续. . .
源文件下载HardDisk ID GetClass
Writen By Red_angelX 2007.3.23
**************************************/
Your OS is WinNT
Drive0 : Maxtor 6V080E0
Serial Number : V22PVCWG
Revision Number :VA111900
Primary : Primary Controller
Control Is Master drive
Drive Type : Fixed
Buffer Size : 8M
Disk Size : 76G
请按任意键继续. . .