Click here to Skip to main content
16,015,481 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Search for Safe worker thread? Pin
Hans Ruck6-Mar-03 3:11
Hans Ruck6-Mar-03 3:11 
Generalc library Pin
ferdykdb5-Mar-03 15:47
ferdykdb5-Mar-03 15:47 
GeneralDetecting Dynamic Drives Pin
BlinkyBill5-Mar-03 15:25
BlinkyBill5-Mar-03 15:25 
GeneralRe: Detecting Dynamic Drives Pin
Brian Shifrin6-Mar-03 2:16
Brian Shifrin6-Mar-03 2:16 
GeneralRe: Detecting Dynamic Drives Pin
BlinkyBill6-Mar-03 11:22
BlinkyBill6-Mar-03 11:22 
GeneralRe: Detecting Dynamic Drives Pin
Brian Shifrin6-Mar-03 12:49
Brian Shifrin6-Mar-03 12:49 
GeneralRe: Detecting Dynamic Drives Pin
Brian Shifrin6-Mar-03 12:51
Brian Shifrin6-Mar-03 12:51 
GeneralRe: Detecting Dynamic Drives Pin
BlinkyBill6-Mar-03 13:24
BlinkyBill6-Mar-03 13:24 
It was the second parameter to CreateFile() that was giving the access problems, I have got it now, its easier to do this:

<snippet>

PARTITION_INFORMATION pti;

hDevice = CreateFile("\\\\.\\c:",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);

bResult = DeviceIoControl(hDevice,
IOCTL_DISK_GET_PARTITION_INFO,
NULL, 0,
pti, sizeof(*pti),
&junk,
(LPOVERLAPPED) NULL);

if (bResult)
{
switch(pdi.PartitionType)
{
case PARTITION_LDM:
AfxMessageBox("Dynamic Drive Detected");
break;
case PARTITION_EXTENDED:
AfxMessageBox("Extended Partition Detected");
break;
case PARTITION_FAT32:
AfxMessageBox("FAT32 partiton Detected");
break;
case PARTITION_FAT_16:
AfxMessageBox("FAT16 partition Detected");
break;
default:
AfxMessageBox("None detected");
}
}


Just a note though. The doco says that PARTITION_INFORMATION and IOCTL_DISK_GET_PARTITION_INFO is obsolete, so you need to use the latest versions, however, this is fine for what we are doing.
GeneralWindows Explorer Folders Pin
MajinRyan5-Mar-03 15:18
MajinRyan5-Mar-03 15:18 
GeneralRe: Windows Explorer Folders Pin
Michael Dunn5-Mar-03 17:03
sitebuilderMichael Dunn5-Mar-03 17:03 
Generalchar array error Pin
act_x5-Mar-03 14:56
act_x5-Mar-03 14:56 
GeneralRe: char array error Pin
Michael Dunn5-Mar-03 15:01
sitebuilderMichael Dunn5-Mar-03 15:01 
GeneralAutomating install tasks... Pin
el davo5-Mar-03 14:50
el davo5-Mar-03 14:50 
GeneralInstalling GDI+ (and Platform SDK questions etc) Pin
JeffBAbil5-Mar-03 14:30
JeffBAbil5-Mar-03 14:30 
GeneralRe: Installing GDI+ (and Platform SDK questions etc) Pin
Anders Molin5-Mar-03 14:47
professionalAnders Molin5-Mar-03 14:47 
GeneralRe: Installing GDI+ (and Platform SDK questions etc) Pin
Michael Dunn5-Mar-03 15:03
sitebuilderMichael Dunn5-Mar-03 15:03 
GeneralRe: Installing GDI+ (and Platform SDK questions etc) Pin
Anders Molin5-Mar-03 15:24
professionalAnders Molin5-Mar-03 15:24 
GeneralRe: Installing GDI+ (and Platform SDK questions etc) Pin
Joe Woodbury5-Mar-03 19:28
professionalJoe Woodbury5-Mar-03 19:28 
QuestionHow many columns does a CListCtrl have? Pin
work_to_live5-Mar-03 13:22
work_to_live5-Mar-03 13:22 
AnswerRe: How many columns does a CListCtrl have? Pin
Chris Richardson5-Mar-03 13:29
Chris Richardson5-Mar-03 13:29 
AnswerRe: How many columns does a CListCtrl have? Pin
Michael Dunn5-Mar-03 13:30
sitebuilderMichael Dunn5-Mar-03 13:30 
GeneralRe: How many columns does a CListCtrl have? Pin
work_to_live6-Mar-03 2:29
work_to_live6-Mar-03 2:29 
AnswerRe: How many columns does a CListCtrl have? Pin
Dave Bryant5-Mar-03 13:34
Dave Bryant5-Mar-03 13:34 
GeneralRe: How many columns does a CListCtrl have? Pin
Dave Bryant5-Mar-03 13:35
Dave Bryant5-Mar-03 13:35 
GeneralRe: How many columns does a CListCtrl have? Pin
work_to_live6-Mar-03 2:32
work_to_live6-Mar-03 2:32 

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.