DiskId32 in Windows 64 bit

816 views
Skip to first unread message

Lynn McGuire

unread,
Apr 6, 2005, 2:34:18 PM4/6/05
to
Can someone try my DiskId32 program on their Windows 64 PC
and tell me what happened ?

http://www.winsim.com/diskid32/diskid32.html

BTW, does Visual C++ 2003 work well on Windows 64 yet ?

Thanks,
Lynn McGuire


Daniel Terhell

unread,
Apr 6, 2005, 2:42:09 PM4/6/05
to
This is the output on beta build 1421:

Trying to read the drive IDs using physical access with admin rights

Primary Controller - Master drive

Drive Model Number________________: WDC WD1600JD-00GBB0
Drive Serial Number_______________: WD-WMAES4142752
Drive Controller Revision Number__: 02.05D02
Controller Buffer Size on Drive___: 8388608 bytes
Drive Type________________________: Fixed
Drive Size________________________: 160041885696 bytes

Trying to read the drive IDs using the SCSI back door

Trying to read the drive IDs using physical access with zero rights

**** STORAGE_DEVICE_DESCRIPTOR for drive 0 ****
Vendor Id = (
Product Id = WDC WD1600JD-00GBB0
Product Revision = 02.05D02
Serial Number = WD W@AES4188252

DeviceIOControl IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER error =
The request is not valid for this device.


**** STORAGE_DEVICE_DESCRIPTOR for drive 1 ****
Vendor Id = NVIDIA
Product Id = STRIPE 228.99G
Product Revision =
Serial Number =

DeviceIOControl IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER error =
The request is not valid for this device.


Hard Drive Serial Number__________: WD-WMAES4132252

Computer ID_______________________: 11284437252


/Daniel


"Lynn McGuire" <NOSPAM...@NOSPAM.winsim.com> wrote in message
news:e4xm$ctOFH...@TK2MSFTNGP12.phx.gbl...

Lynn McGuire

unread,
Apr 6, 2005, 3:44:05 PM4/6/05
to
> Trying to read the drive IDs using physical access with admin rights

works OK !

> Trying to read the drive IDs using the SCSI back door

does not work !

> Trying to read the drive IDs using physical access with zero rights

works but is corrupted - very, very bad !

Thanks,
Lynn McGuire


Daniel Terhell

unread,
Apr 6, 2005, 4:18:23 PM4/6/05
to
Sorry, that was probably me. I didn't want my serials hanging around on the
internet and didn't know you were gonna check these.

/Daniel

"Lynn McGuire" <NOSPAM...@NOSPAM.winsim.com> wrote in message

news:O9AT$DuOFH...@TK2MSFTNGP14.phx.gbl...

teschner

unread,
Sep 24, 2013, 5:18:29 PM9/24/13
to
In a small application I use a very small code part of diskid32 written by Lynn
McGuire, but now this application had a problem with a "64bit windows
8" system.
I search and found a memory violation in the part of diskid32.cpp during usage
of IOCTL_STORAGE_QUERY_PROPERTY.
I don't check it (because it is not in use by me), but I think the call to
IOCTL_DISK_GET_DRIVE_GEOMETRY_EX has the same problem.

I use a small part of your freeware and I think it's fair to tell you the
problem, a lot of internet threads show discussion about the code of diskid32.



//
// Problem in DISKID32.cpp
// There is a "buffer" defined as array, but in DeviceIoControl there
is given a pointer to the array which is also a pointer to memory // So, the
DeviceIoControl writes possibly into invalid memory //

//-----------------------------------------------------------------
// Wrong (original) code
//-----------------------------------------------------------------

char buffer [10000];

memset ((void *) & query, 0, sizeof (query)); query.PropertyId =
StorageDeviceProperty; query.QueryType = PropertyStandardQuery;

memset (buffer, 0, sizeof (buffer));

if (DeviceIoControl (hPhysicalDriveIOCTL, IOCTL_STORAGE_QUERY_PROPERTY,
& query,
sizeof (query),
& buffer,
sizeof (buffer),
& cbBytesReturned, NULL))
{
STORAGE_DEVICE_DESCRIPTOR * descrip = (STORAGE_DEVICE_DESCRIPTOR *) &
buffer;
...

//-----------------------------------------------------------------
// With following fix, the defined memory is really used
//-----------------------------------------------------------------

char buffer [10000];

memset ((void *) & query, 0, sizeof (query)); query.PropertyId =
StorageDeviceProperty; query.QueryType = PropertyStandardQuery;

memset (buffer, 0, sizeof (buffer));

if (DeviceIoControl (hPhysicalDriveIOCTL, IOCTL_STORAGE_QUERY_PROPERTY,
& query,
sizeof (query),
buffer, //
<<<<<<<<<<<<<<<<< without
&, because buffer is a pointer to 10000 chars
sizeof (buffer),
& cbBytesReturned, NULL))
{
STORAGE_DEVICE_DESCRIPTOR * descrip = (STORAGE_DEVICE_DESCRIPTOR *) buffer; //
<<<<<<<<<<<<<<<<< without
&

//... see IOCTL_DISK_GET_DRIVE_GEOMETRY_EX and access also

Lynn McGuire

unread,
Oct 1, 2013, 4:53:45 PM10/1/13
to
Hi Torsten,

Thank you for alerting me to the coding error.

I have updated the source code and website:
http://www.winsim.com/diskid32/diskid32.html

Sincerely
Lynn McGuire

Reply all
Reply to author
Forward
0 new messages