91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 7KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發布日期: 2021-07-29
  • 語言: C/C++
  • 標簽: C++??

資源簡介

內含獲取硬盤信息的主要源代碼,附帶一個可視化相關的工具(win7需要以管理員身份運行) PS:本資源為網絡資源,非本人原創

資源截圖

代碼片段和文件信息

//?MyDiskInfo.cpp:?implementation?of?the?CMyDiskInfo?class.
//
//////////////////////////////////////////////////////////////////////

#include?“stdafx.h“
#include?“DiskInfo.h“
#include?“MyDiskInfo.h“

#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif

const?WORD?IDE_ATAPI_IDENTIFY?=?0xA1;???//?讀取ATAPI設備的命令
const?WORD?IDE_ATA_IDENTIFY???=?0xEC;???//?讀取ATA設備的命令

#define?_WIN32_WINNT?0x0400
#include?“winioctl.h“

//#include?“NTDDSCSI.h“
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMyDiskInfo::CMyDiskInfo()
{

}

CMyDiskInfo::~CMyDiskInfo()
{

}

BOOL?__fastcall?DoIdentify(?HANDLE?hPhysicalDriveIOCTL?
PSENDCMDINPARAMS?pSCIP
PSENDCMDOUTPARAMS?pSCOP?
BYTE?btIDCmd?
BYTE?btDriveNum
PDWORD?pdwBytesReturned)
{
????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;

????pSCIP->irDriveRegs.bDriveHeadReg?=?(btDriveNum?&?1)???0xB0?:?0xA0;
????pSCIP->irDriveRegs.bCommandReg?=?btIDCmd;
????pSCIP->bDriveNumber?=?btDriveNum;
????pSCIP->cBufferSize?=?IDENTIFY_BUFFER_SIZE;

????return?DeviceIoControl( hPhysicalDriveIOCTL?
SMART_RCV_DRIVE_DATA
(LPVOID)pSCIP
sizeof(SENDCMDINPARAMS)?-?1
(LPVOID)pSCOP
sizeof(SENDCMDOUTPARAMS)?+?IDENTIFY_BUFFER_SIZE?-?1
pdwBytesReturned?NULL);
}

char?*__fastcall?ConvertToString(DWORD?dwDiskData[256]?int?nFirstIndex?int?nLastIndex)
{
static?char?szResBuf[1024];
char?ss[256];
int?nIndex?=?0;
int?nPosition?=?0;

for(nIndex?=?nFirstIndex;?nIndex?<=?nLastIndex;?nIndex++)
{
ss[nPosition]?=?(char)(dwDiskData[nIndex]?/?256);
nPosition++;

//?Get?low?BYTE?for?2nd?character
ss[nPosition]?=?(char)(dwDiskData[nIndex]?%?256);
nPosition++;
}

//?End?the?string
ss[nPosition]?=?‘\0‘;

int?i?index=0;
for(i=0;?i {
if(ss[i]==0?||?ss[i]==32) continue;
szResBuf[index]=ss[i];
index++;
}
szResBuf[index]=0;

return?szResBuf;
}

int?CMyDiskInfo::GetDiskInfo(int?driver)
{
CString?sFilePath;
sFilePath.Format(“\\\\.\\PHYSICALDRIVE%d“?driver);

HANDLE?hFile?=?INVALID_HANDLE_VALUE;
hFile?=?::CreateFile(sFilePath?
GENERIC_READ?|?GENERIC_WRITE?
FILE_SHARE_READ?|?FILE_SHARE_WRITE?
NULL?OPEN_EXISTING
0?NULL);
if?(hFile?==?INVALID_HANDLE_VALUE) return?-1;

DWORD?dwBytesReturned;
GETVERSIONINPARAMS?gvopVersionParams;
DeviceIoControl(hFile?
SMART_GET_VERSION
NULL?
0?
&gvopVersionParams
sizeof(gvopVersionParams)
&dwBytesReturned?NULL);

if(gvopVersionParams.bIDEDeviceMap?<=?0) r

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????28672??2005-12-01?02:15??DiskInfo.exe
?????文件?????????612??2005-12-01?02:16??MyDiskInfo.h
?????文件????????3983??2005-12-01?02:16??MyDiskInfo.cpp

評論

共有 條評論