Discussion:
DiskId32 in Windows 64 bit
(too old to reply)
Lynn McGuire
2005-04-06 18:34:18 UTC
Permalink
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
2005-04-06 18:42:09 UTC
Permalink
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 ***@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
Post by Lynn McGuire
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
Lynn McGuire
2005-04-06 19:44:05 UTC
Permalink
Post by Daniel Terhell
Trying to read the drive IDs using physical access with admin rights
works OK !
Post by Daniel Terhell
Trying to read the drive IDs using the SCSI back door
does not work !
Post by Daniel Terhell
Trying to read the drive IDs using physical access with zero rights
works but is corrupted - very, very bad !

Thanks,
Lynn McGuire
Daniel Terhell
2006-06-18 04:05:33 UTC
Permalink
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
Post by Lynn McGuire
Post by Daniel Terhell
Trying to read the drive IDs using physical access with admin rights
works OK !
Post by Daniel Terhell
Trying to read the drive IDs using the SCSI back door
does not work !
Post by Daniel Terhell
Trying to read the drive IDs using physical access with zero rights
works but is corrupted - very, very bad !
Thanks,
Lynn McGuire
teschner
2013-09-24 21:18:29 UTC
Permalink
Lynn McGuire wrote on 04/06/2005 14:34 ET
Post by Lynn McGuire
Can someone try my DiskId32 program on their Windows 64 P
and tell me what happened
http://www.winsim.com/diskid32/diskid32.htm
BTW, does Visual C++ 2003 work well on Windows 64 yet
Thanks
Lynn McGuir
In a small application I use a very small code part of diskid32 written by Lyn
McGuire, but now this application had a problem with a "64bit window
8" system
I search and found a memory violation in the part of diskid32.cpp during usag
of IOCTL_STORAGE_QUERY_PROPERTY
I don't check it (because it is not in use by me), but I think the call t
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 th
problem, a lot of internet threads show discussion about the code of diskid32



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

//----------------------------------------------------------------
// Wrong (original) cod
//----------------------------------------------------------------

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 use
//----------------------------------------------------------------

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, /
<<<<<<<<<<<<<<<<< withou
&, because buffer is a pointer to 10000 char
sizeof (buffer)
& cbBytesReturned, NULL)

STORAGE_DEVICE_DESCRIPTOR * descrip = (STORAGE_DEVICE_DESCRIPTOR *) buffer; /
<<<<<<<<<<<<<<<<< withou


//... see IOCTL_DISK_GET_DRIVE_GEOMETRY_EX and access also
Lynn McGuire
2013-10-01 20:53:45 UTC
Permalink
Post by Lynn McGuire
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
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
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

Loading...