線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2729
推到 Plurk!
推到 Facebook!

DeviceIoControl( )可以選擇讀取硬碟某個磁區的內容嗎

尚未結案
bosswang919
一般會員


發表:5
回覆:4
積分:1
註冊:2004-09-08

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-11-04 10:46:56 IP:202.39.xxx.xxx 未訂閱
在 hDevice = CreateFile("\\\\.\\PhysicalDrive0", // drive to open 0|GENERIC_READ, // no access to the drive FILE_SHARE_READ | // share mode FILE_SHARE_WRITE, NULL, // default security attributes OPEN_EXISTING, // disposition 0, // file attributes NULL); // do not copy file attributes 之後 DeviceIoControl( )可以選擇讀取硬碟某個磁區的內容嗎 DeviceIoControl( hDevice, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, pdg, sizeof(*pdg), &junk, (LPOVERLAPPED) NULL); 之中的 IOCTL_DISK_GET_DRIVE_GEOMETRY 可以是其他硬碟的參數 但是有其他的參數可以直接讀取某個磁區的內容嗎
bosswang919
一般會員


發表:5
回覆:4
積分:1
註冊:2004-09-08

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-11-04 10:57:21 IP:202.39.xxx.xxx 未訂閱
小弟找到以下參數,不知道其功用是否跟 SetFilePointer(hFile, bytNumOffset , &dwSet , FILE_BEGIN); 的意義類似請各位大大不吝指教 The IOCTL_DISK_REASSIGN_BLOCKS DeviceIoControl operation directs the disk device to map one or more blocks to its spare-block pool. dwIoControlCode = IOCTL_DISK_REASSIGN_BLOCKS; // operation code lpInBuffer; // address of input buffer nInBufferSize; // size of input buffer lpOutBuffer = NULL; // address of output buffer; not used; must be NULL nOutBufferSize = 0; // size of output buffer; not used; must be zero lpBytesReturned; // address of actual bytes of output
blk5743
高階會員


發表:34
回覆:371
積分:236
註冊:2003-11-17

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-11-04 14:04:46 IP:61.66.xxx.xxx 未訂閱
請參考 BCB】【問題】想多了解有關用程式讀取、控制PCI介面......請各位前輩幫忙 http://delphi.ktop.com.tw/topic.php?topic_id=27077
kopin
一般會員


發表:1
回覆:2
積分:0
註冊:2005-03-01

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-03-04 14:03:34 IP:59.120.xxx.xxx 未訂閱
最近剛好我也對這個主題有興趣 我所了解的是DeviceIoControl是無法直接access HDD sector(不知道正不正確) 必須使用其他的function:SetFilePointer() , 以及ReadFile() (在Win2000, XP之下) 1. 先使用SetFilePointer 設定要access 的sector ex: SetFilePointer(hDevice,512*SecNum,0,FILE_BEGIN); 2. 再利用ReadFile 讀取sector 到你指定的Buffer ex: bResult=ReadFile(hDevice,Buf,512,&dwRet,NULL); 同樣的, 如要寫入HDD, 則可使用WriteFile() 來完成
harrypp
中階會員


發表:7
回覆:124
積分:61
註冊:2006-08-31

發送簡訊給我
#5 引用回覆 回覆 發表時間:2006-08-31 13:07:59 IP:210.202.xxx.xxx 未訂閱
請參考我相關文章回覆的部分
http://delphi.ktop.com.tw/board.php?cid=168&fid=917&tid=78041
系統時間:2024-07-03 0:13:28
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!