News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Hard Disk Serial Number

Started by N1ghtm4r3, May 04, 2011, 11:13:52 AM

Previous topic - Next topic

RuiLoureiro

Hi
    I am trying to use DeviceIoControl
    but i havent STORAGE_PROPERTY_QUERY and IOCTL_STORAGE_QUERY_PROPERTY
    where can i find it ?
    Thanks


RuiLoureiro


RuiLoureiro

When
        szDriveName     db "C:\", 0

        invoke  CreateFile, Addr szDriveName, NULL, NULL, NULL, OPEN_EXISTING, NULL, NULL
        returns    eax=INVALID_HANDLE_VALUE

        It doesnt work ! Why ?

ragdog

QuoteTo retrieve a handle to the device, you must call the CreateFile function with either the name of a device or the name of the driver associated with a device. To specify a device name, use the following format:

\\.\DeviceName

DeviceIoControl can accept a handle to a specific device. For example, to open a handle to the logical drive A: with CreateFile, specify \\.\a:. Alternatively, you can use the names \\.\PhysicalDrive0, \\.\PhysicalDrive1, and so on, to open handles to the physical drives on a system.

http://msdn.microsoft.com/en-us/library/aa363216%28v=vs.85%29.aspx

RuiLoureiro

Ok, Thank you ragdog !   :wink
i will go to test it

N1ghtm4r3

New version of this DLL is out, win 7 issue might be fixed in this version.

http://www.devlib.net/download-getdiskserial.htm

ragdog

$31.96 for a dll that give me information about my drives ::)

I think that is not really difficult to coding it gives many examples about it

SeaFarer have a good example
http://www.winasm.net/forum/index.php?showtopic=2224