Click here to Skip to main content
15,927,744 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CListCtrl - Still Not Working... Pin
Michael Dunn8-Apr-01 8:24
sitebuilderMichael Dunn8-Apr-01 8:24 
GeneralEVERYTHING IS JUST FINE NOW Pin
Ryan Baillargeon8-Apr-01 10:44
Ryan Baillargeon8-Apr-01 10:44 
GeneralRe: CListCtrl - Still Not Working... Pin
Frank Deo1-Aug-01 10:28
Frank Deo1-Aug-01 10:28 
GeneralRe: CListCtrl - Delete Selected Items??? Pin
Ryan Baillargeon8-Apr-01 6:56
Ryan Baillargeon8-Apr-01 6:56 
Generaldetect wince hybernation Pin
7-Apr-01 9:11
suss7-Apr-01 9:11 
GeneralRe: detect wince hybernation Pin
Anders Molin8-Apr-01 3:28
professionalAnders Molin8-Apr-01 3:28 
QuestionHow do I read raw data from a HD Pin
Ben Burnett7-Apr-01 9:05
Ben Burnett7-Apr-01 9:05 
AnswerRe: How do I read raw data from a HD Pin
Michael Dunn7-Apr-01 9:21
sitebuilderMichael Dunn7-Apr-01 9:21 
Check out the docs on CreateFile() - you can pass "\\.\C:" as the file name (which would actually be "\\\\.\\C:" in C code) to get a handle which can read sectors of the C: drive. The first sector is the boot sector, so you can use ReadFile() and read 512 bytes to get the contents of the boot sector. This requires admin privs, for obvious reasons.
HANDLE hDevice;
BYTE byBuffer[512];
DWORD dwBytesRead;
 
  hDevice = CreateFile ( _T("\\\\.\\C:", GENERIC_READ,
                         FILE_SHARE_READ | FILE_SHARE_WRITE,
                         0, OPEN_EXISTING, 0, NULL );
 
  SetFilePointer ( hDevice, 0, 0, FILE_BEGIN );
  ReadFile ( hDevice, byBuffer, 512, &dwBytesRead, NULL );
  CloseHandle ( hDevice );
You obviously need error handling in there, but I left that out for clarity.

--Mike--
http://home.inreach.com/mdunn/
All your base are belong to ME~!
GeneralRe: How do I read raw data from a HD Pin
Ben Burnett7-Apr-01 9:40
Ben Burnett7-Apr-01 9:40 
GeneralCFile and my class Pin
Ahmad6-Apr-01 23:39
Ahmad6-Apr-01 23:39 
GeneralRe: CFile and my class Pin
AlexMarbus7-Apr-01 6:16
AlexMarbus7-Apr-01 6:16 
GeneralRe: CFile and my class Pin
Michael Dunn7-Apr-01 9:24
sitebuilderMichael Dunn7-Apr-01 9:24 
QuestionDLL newing objects on process heap? Pin
6-Apr-01 16:19
suss6-Apr-01 16:19 
AnswerRe: DLL newing objects on process heap? Pin
Michael Dunn6-Apr-01 18:48
sitebuilderMichael Dunn6-Apr-01 18:48 
GeneralRe: DLL newing objects on process heap? Pin
7-Apr-01 6:52
suss7-Apr-01 6:52 
AnswerRe: DLL newing objects on process heap? Pin
Tim Deveaux7-Apr-01 13:37
Tim Deveaux7-Apr-01 13:37 
QuestionDirectDraw in a CView -> possible? Pin
Michael Menne6-Apr-01 14:20
Michael Menne6-Apr-01 14:20 
GeneralConverting Pin
Drake Elsari6-Apr-01 13:16
Drake Elsari6-Apr-01 13:16 
GeneralRe: Converting Pin
Erik Thompson6-Apr-01 13:47
sitebuilderErik Thompson6-Apr-01 13:47 
GeneralRe: Converting Pin
Drake Elsari7-Apr-01 13:11
Drake Elsari7-Apr-01 13:11 
GeneralRe: Converting Pin
Erik Thompson7-Apr-01 14:17
sitebuilderErik Thompson7-Apr-01 14:17 
GeneralRe: Converting Pin
AlexMarbus8-Apr-01 3:41
AlexMarbus8-Apr-01 3:41 
GeneralRe: Converting Pin
Ivan Yap4-Dec-01 21:10
Ivan Yap4-Dec-01 21:10 
GeneralConverting Pin
Drake Elsari6-Apr-01 13:15
Drake Elsari6-Apr-01 13:15 
GeneralRe: Converting Pin
Kannan Kalyanaraman6-Apr-01 20:35
Kannan Kalyanaraman6-Apr-01 20:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.