PhysicalDrive ??

Hello,

The SDK says:
“The lpFileName string should be of the form \.\PHYSICALDRIVEx to open
the hard disk x. Hard disk numbers start at zero.”

It’s OK for 0 to 9. I’ve found that there may be holes in the
sequence, for an example when a FireWire disk is disconnected.

Now, I’ve tried to connect more than 10 drives to a computer to see
if one should use PhysicalDrive10 after PhysicalDrive9, but I always
crash the computer at some point.

Does somebody knows?


Pierre Duhem
xxxxx@macdisk.com

x is an arbitrary number which can get to be more than a single digit.
As you noticed there is the potential for holes to exist in the
namespace. If you want to find all disks on a 2k or XP system you
should use the SetupDI functions to find every device which exposes the
disk device interface. This API will give you a very icky symbolic link
name which you can then use to open the device. One nice thing about
this symbolic name is that it remains as constant as possible across
reboots, unlike the \.\PhysicalDriveX namespace.

-p

-----Original Message-----
From: Pierre Duhem [mailto:xxxxx@duhem.com]
Sent: Thursday, August 01, 2002 6:14 AM
To: NT Developers Interest List
Subject: [ntdev] PhysicalDrive ??

Hello,

The SDK says:
“The lpFileName string should be of the form \.\PHYSICALDRIVEx to open
the hard disk x. Hard disk numbers start at zero.”

It’s OK for 0 to 9. I’ve found that there may be holes in the sequence,
for an example when a FireWire disk is disconnected.

Now, I’ve tried to connect more than 10 drives to a computer to see if
one should use PhysicalDrive10 after PhysicalDrive9, but I always crash
the computer at some point.

Does somebody knows?


Pierre Duhem
xxxxx@macdisk.com


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to %%email.unsub%%

Now 9 is 39 hex. Have you tried to name a drive PHYSICALDRIVE@,
PHYSICALDRIVEA, PHYSICALDRIVEB, and so on ? Because @ is 40h, uppercase A is
41h, and so on. Who knows, it might even work !

Alberto.

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Thursday, August 01, 2002 1:18 PM
To: NT Developers Interest List
Subject: [ntdev] RE: PhysicalDrive ??

x is an arbitrary number which can get to be more than a single digit.
As you noticed there is the potential for holes to exist in the
namespace. If you want to find all disks on a 2k or XP system you
should use the SetupDI functions to find every device which exposes the
disk device interface. This API will give you a very icky symbolic link
name which you can then use to open the device. One nice thing about
this symbolic name is that it remains as constant as possible across
reboots, unlike the \.\PhysicalDriveX namespace.

-p

-----Original Message-----
From: Pierre Duhem [mailto:xxxxx@duhem.com]
Sent: Thursday, August 01, 2002 6:14 AM
To: NT Developers Interest List
Subject: [ntdev] PhysicalDrive ??

Hello,

The SDK says:
“The lpFileName string should be of the form \.\PHYSICALDRIVEx to open
the hard disk x. Hard disk numbers start at zero.”

It’s OK for 0 to 9. I’ve found that there may be holes in the sequence,
for an example when a FireWire disk is disconnected.

Now, I’ve tried to connect more than 10 drives to a computer to see if
one should use PhysicalDrive10 after PhysicalDrive9, but I always crash
the computer at some point.

Does somebody knows?


Pierre Duhem
xxxxx@macdisk.com


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to %%email.unsub%%

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

Uh, Alberto, you forgot:

‘:’ (3AH)
‘;’ (3BH)
‘<’ (3CH)
‘=’ (3DH)
‘>’ (3EH)
‘?’ (3FH)

“Moreira, Alberto” wrote in message
news:xxxxx@ntdev…
>
> Now 9 is 39 hex. Have you tried to name a drive PHYSICALDRIVE@,
> PHYSICALDRIVEA, PHYSICALDRIVEB, and so on ? Because @ is 40h, uppercase A
is
> 41h, and so on. Who knows, it might even work !
>
>
> Alberto.
>
>
>
> -----Original Message-----
> From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
> Sent: Thursday, August 01, 2002 1:18 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: PhysicalDrive ??
>
>
> x is an arbitrary number which can get to be more than a single digit.
> As you noticed there is the potential for holes to exist in the
> namespace. If you want to find all disks on a 2k or XP system you
> should use the SetupDI functions to find every device which exposes the
> disk device interface. This API will give you a very icky symbolic link
> name which you can then use to open the device. One nice thing about
> this symbolic name is that it remains as constant as possible across
> reboots, unlike the \.\PhysicalDriveX namespace.
>
> -p
>
> -----Original Message-----
> From: Pierre Duhem [mailto:xxxxx@duhem.com]
> Sent: Thursday, August 01, 2002 6:14 AM
> To: NT Developers Interest List
> Subject: [ntdev] PhysicalDrive ??
>
>
> Hello,
>
> The SDK says:
> “The lpFileName string should be of the form \.\PHYSICALDRIVEx to open
> the hard disk x. Hard disk numbers start at zero.”
>
> It’s OK for 0 to 9. I’ve found that there may be holes in the sequence,
> for an example when a FireWire disk is disconnected.
>
> Now, I’ve tried to connect more than 10 drives to a computer to see if
> one should use PhysicalDrive10 after PhysicalDrive9, but I always crash
> the computer at some point.
>
> Does somebody knows?
>
> –
> Pierre Duhem
> xxxxx@macdisk.com
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@microsoft.com To
> unsubscribe send a blank email to %%email.unsub%%
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@compuware.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
>
> The contents of this e-mail are intended for the named addressee only. It
> contains information that may be confidential. Unless you are the named
> addressee or an authorized designee, you may not copy or use it, or
disclose
> it to anyone else. If you received it in error please notify us
immediately
> and then destroy it.
>
>
>
>

I skipped them because they’re more like delimiters, and maybe the parser
would barf at a name such as PHYSICALDRIVE: or something like that; but the
“at” sign is probably safe enough, who knows ? I’m betting they have some
sort of table, so, using “A”, or 41h, would skip a few entries in the table,
that is, assuming that there is a table and that there are enough empty
slots in the table.

Almost makes me say, if I was a virus designer, I’d be willing to
investigate this further. :slight_smile:

Alberto.

-----Original Message-----
From: Scott Neugroschl [mailto:xxxxx@yahoo.com]
Sent: Thursday, August 01, 2002 1:39 PM
To: NT Developers Interest List
Subject: [ntdev] Re: PhysicalDrive ??

Uh, Alberto, you forgot:

‘:’ (3AH)
‘;’ (3BH)
‘<’ (3CH)
‘=’ (3DH)
‘>’ (3EH)
‘?’ (3FH)

“Moreira, Alberto” wrote in message
news:xxxxx@ntdev…
>
> Now 9 is 39 hex. Have you tried to name a drive PHYSICALDRIVE@,
> PHYSICALDRIVEA, PHYSICALDRIVEB, and so on ? Because @ is 40h, uppercase A
is
> 41h, and so on. Who knows, it might even work !
>
>
> Alberto.
>
>
>
> -----Original Message-----
> From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
> Sent: Thursday, August 01, 2002 1:18 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: PhysicalDrive ??
>
>
> x is an arbitrary number which can get to be more than a single digit.
> As you noticed there is the potential for holes to exist in the
> namespace. If you want to find all disks on a 2k or XP system you
> should use the SetupDI functions to find every device which exposes the
> disk device interface. This API will give you a very icky symbolic link
> name which you can then use to open the device. One nice thing about
> this symbolic name is that it remains as constant as possible across
> reboots, unlike the \.\PhysicalDriveX namespace.
>
> -p
>
> -----Original Message-----
> From: Pierre Duhem [mailto:xxxxx@duhem.com]
> Sent: Thursday, August 01, 2002 6:14 AM
> To: NT Developers Interest List
> Subject: [ntdev] PhysicalDrive ??
>
>
> Hello,
>
> The SDK says:
> “The lpFileName string should be of the form \.\PHYSICALDRIVEx to open
> the hard disk x. Hard disk numbers start at zero.”
>
> It’s OK for 0 to 9. I’ve found that there may be holes in the sequence,
> for an example when a FireWire disk is disconnected.
>
> Now, I’ve tried to connect more than 10 drives to a computer to see if
> one should use PhysicalDrive10 after PhysicalDrive9, but I always crash
> the computer at some point.
>
> Does somebody knows?
>
> –
> Pierre Duhem
> xxxxx@macdisk.com
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@microsoft.com To
> unsubscribe send a blank email to %%email.unsub%%
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@compuware.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
>
> The contents of this e-mail are intended for the named addressee only. It
> contains information that may be confidential. Unless you are the named
> addressee or an authorized designee, you may not copy or use it, or
disclose
> it to anyone else. If you received it in error please notify us
immediately
> and then destroy it.
>
>
>
>


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to %%email.unsub%%

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

Peter,

PW> x is an arbitrary number which can get to be more than a single digit.
PW> As you noticed there is the potential for holes to exist in the
PW> namespace. If you want to find all disks on a 2k or XP system you
PW> should use the SetupDI functions to find every device which exposes the
PW> disk device interface. This API will give you a very icky symbolic link
PW> name which you can then use to open the device. One nice thing about
PW> this symbolic name is that it remains as constant as possible across
PW> reboots, unlike the \.\PhysicalDriveX namespace.

Thanks for your answer. For the time being, I’ll scan up to
PhysicalDrive26 (to follow the drive letter limitation). The lost time
is not important.

The SetupDI functions are those which give strings like
“\.\Volume{GUID}”? I looked at them some time ago but reverted to the
old and trusty PhysicalDrive, for whatever reason.


Pierre Duhem
xxxxx@macdisk.com

You are looking using the wrong guid.

=====================
Mark Roddy
Windows XP/2000/NT Consultant, Microsoft MVP
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pierre Duhem
Sent: Friday, August 02, 2002 3:51 AM
To: NT Developers Interest List
Subject: [ntdev] RE: PhysicalDrive ??

Peter,

PW> x is an arbitrary number which can get to be more than a single
PW> digit. As you noticed there is the potential for holes to
exist in
PW> the namespace. If you want to find all disks on a 2k or
XP system
PW> you should use the SetupDI functions to find every device which
PW> exposes the disk device interface. This API will give you a very
PW> icky symbolic link name which you can then use to open
the device.
PW> One nice thing about this symbolic name is that it remains as
PW> constant as possible across reboots, unlike the
\.\PhysicalDriveX
PW> namespace.

Thanks for your answer. For the time being, I’ll scan up to
PhysicalDrive26 (to follow the drive letter limitation). The lost time
is not important.

The SetupDI functions are those which give strings like
“\.\Volume{GUID}”? I looked at them some time ago but reverted to the
old and trusty PhysicalDrive, for whatever reason.


Pierre Duhem
xxxxx@macdisk.com


You are currently subscribed to ntdev as: xxxxx@hollistech.com To
unsubscribe send a blank email to %%email.unsub%%

not quite. The names you’re talking about are probably coming from the
mount manager APIs which give you access to the volume names. Those are
great if you want to find a particular partition/RAID set but aren’t
what you want for finding a physical disk.

the setupDI routines will give you device interface names. On my
machine if I request the list of devices exposing GUID_DEVINTERFACE_DISK
(defined in ntddstor.h) I’d get:

SCSI#Disk&Ven_SEAGATE&Prod_ST136403FC&Rev_0002#5&1f731355&0&1420#{53f563
07-b6bf-11d0-94f2-00a0c91efb8b} SymbolicLink -
\Device\Scsi\lp6nds351Port4Path1Target42Lun0
SCSI#Disk&Ven_SEAGATE&Prod_ST136403FC&Rev_0004#5&1f731355&0&1440#{53f563
07-b6bf-11d0-94f2-00a0c91efb8b} SymbolicLink -
\Device\Scsi\lp6nds351Port4Path1Target44Lun0
SCSI#Disk&Ven_SEAGATE&Prod_ST318275LW&Rev_0001#6&10fefaee&0&010#{53f5630
7-b6bf-11d0-94f2-00a0c91efb8b} SymbolicLink -
\Device\Scsi\adpu160m1Port2Path0Target1Lun0

as long as the address of these devices don’t change relative to their
bus, these names will always point to the same device.

use SetupDiGetClassDevs, specifying DIGCF_DEVICEINTERFACE to indicate
that the guid you’re providing is a device interface guid (otherwise it
will be a device class guid, which could also work). You can use
SetupDiGetDeviceInterfaceDetail to convert each instance in the list
into a symbolic link name.

-p

-----Original Message-----
From: Pierre Duhem [mailto:xxxxx@duhem.com]
Sent: Friday, August 02, 2002 12:51 AM
To: NT Developers Interest List
Subject: [ntdev] RE: PhysicalDrive ??

Peter,

PW> x is an arbitrary number which can get to be more than a single
PW> digit. As you noticed there is the potential for holes to exist in
PW> the namespace. If you want to find all disks on a 2k or XP system
PW> you should use the SetupDI functions to find every device which
PW> exposes the disk device interface. This API will give you a very
PW> icky symbolic link name which you can then use to open the device.
PW> One nice thing about this symbolic name is that it remains as
PW> constant as possible across reboots, unlike the \.\PhysicalDriveX
PW> namespace.

Thanks for your answer. For the time being, I’ll scan up to
PhysicalDrive26 (to follow the drive letter limitation). The lost time
is not important.

The SetupDI functions are those which give strings like
“\.\Volume{GUID}”? I looked at them some time ago but reverted to the
old and trusty PhysicalDrive, for whatever reason.


Pierre Duhem
xxxxx@macdisk.com


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to %%email.unsub%%

Peter,

PW> not quite. The names you’re talking about are probably coming from the
PW> mount manager APIs which give you access to the volume names. Those are
PW> great if you want to find a particular partition/RAID set but aren’t
PW> what you want for finding a physical disk.

PW> the setupDI routines will give you device interface names. On my
PW> machine if I request the list of devices exposing GUID_DEVINTERFACE_DISK
PW> (defined in ntddstor.h) I’d get:

Thanks for the very helpful precisions.

I’ll look at this.


Pierre Duhem
xxxxx@macdisk.com