I’m trying to remember a Win32 API that returns the number of physical
hard disks that are installed. I have a feeling it’s something like
GetSystemInfo() and that the number of installed drives is one of the
fields of a returned struct. Does anyone remember how to get this info?
Nate,
you wrote on Thursday, October 10, 2002, 19:31:38:
NB> I’m trying to remember a Win32 API that returns the number of
NB> physical hard disks that are installed. I have a feeling it’s
NB> something like GetSystemInfo() and that the number of installed
NB> drives is one of the fields of a returned struct. Does anyone
NB> remember how to get this info?
Sounds like you remember NtQuerySystemInformation() with info class
SystemConfigurationInformation…
But the IMHO recommended way to do this is the Setup API:
#include <windows.h>
#include <initguid.h>
#include <setupapi.h>
#include <devguid.h>
hDevInfoSet = SetupDiGetClassDevs(
&GUID_DEVCLASS_DISKDRIVE,
0, 0, DIGCF_PRESENT
);
DevInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
dwDisks = 0;
while ( SetupDiEnumDeviceInfo(hDevInfoSet, dwDisks, &DevInfoData) )
{
dwDisks++;
}
SetupDiDestroyDeviceInfoList(hDevInfoSet);
BTW, you don’t have relatives in Germany, do you? It’s just that the
names translate perfectly …
Ralf.
–</devguid.h></setupapi.h></initguid.h></windows.h>
Oh blast, that’s it, NtQuerySystemInformation(). I was thinking it was
a Win32 API. Thanks for the reminder!
Yeah, I do have a lot of German ancestory. My great great great great
great grandpa and grandma John Henry (aka Hans Heinrich) Bussmann and
Esther Franks Bussmann moved from Mackensen, Hanover, Germany (Prussia)
to Lancaster PA around 1766. I don’t know the exact date but I do know
that one of their kids (Abraham Bushman) was born on 12 April 1767. The
name changed from Bussmann to Bushman when the emigrated.
Nate
-----Original Message-----
From: Ralf Buschmann [mailto:xxxxx@backmagic.de]
Sent: Thursday, October 10, 2002 11:59 AM
To: NT Developers Interest List
Subject: [ntdev] Re: How do you get the number of physically installed
hard disks (Win32)?
Nate,
you wrote on Thursday, October 10, 2002, 19:31:38:
NB> I’m trying to remember a Win32 API that returns the number of
NB> physical hard disks that are installed. I have a feeling it’s
NB> something like GetSystemInfo() and that the number of installed
NB> drives is one of the fields of a returned struct. Does anyone
NB> remember how to get this info?
Sounds like you remember NtQuerySystemInformation() with info class
SystemConfigurationInformation…
But the IMHO recommended way to do this is the Setup API:
#include <windows.h>
#include <initguid.h>
#include <setupapi.h>
#include <devguid.h>
hDevInfoSet = SetupDiGetClassDevs(
&GUID_DEVCLASS_DISKDRIVE,
0, 0, DIGCF_PRESENT
);
DevInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
dwDisks = 0;
while ( SetupDiEnumDeviceInfo(hDevInfoSet, dwDisks, &DevInfoData) )
{
dwDisks++;
}
SetupDiDestroyDeviceInfoList(hDevInfoSet);
BTW, you don’t have relatives in Germany, do you? It’s just that the
names translate perfectly …
Ralf.
–
—
You are currently subscribed to ntdev as: xxxxx@powerquest.com
To unsubscribe send a blank email to %%email.unsub%%</devguid.h></setupapi.h></initguid.h></windows.h>
No, try SetupDiGetClassDevs on disks.
Max
----- Original Message -----
From: Nate Bushman
To: NT Developers Interest List
Sent: Thursday, October 10, 2002 9:31 PM
Subject: [ntdev] How do you get the number of physically installed hard disks (Win32)?
I’m trying to remember a Win32 API that returns the number of physical hard disks that are installed. I have a feeling it’s something like GetSystemInfo() and that the number of installed drives is one of the fields of a returned struct. Does anyone remember how to get this info?
You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%