Jump to content

issues with dllcall and "getvolumeserialnumber"


Guest dldaniele
 Share

Recommended Posts

Guest dldaniele

I would like to obtain the internal volume ID of the local harddrive. Using the GetVolumeSerialNumber function in Kernel32.dll, this should be possible. The following code receives an error in the call. Any assistance would be appreciated.

I am using the latest beta downloaded Dec 7, 2004.

$serialno = 0

$returned = DllCall("kernel32.DLL", "long", "GetVolumeSerialNumber", "str", "C:\", "str", "", "long", 0, "long", 0, "long", 0, "long", 0, "long", 0, "long", 0)

if @error = 1 then

Tooltip(" error in call " & $serialno, 0,0)

sleep (5000)

exit

endif

tooltip (" Drive Serial is " & $returned[4] & " ---", 0,0)

sleep (5000)

Thanks,

Dean

Link to comment
Share on other sites

Guest dldaniele

seems you need to supply some ommitted info... try this...

$serialno = 0
$returned = DllCall("kernel32.DLL", "int", "GetVolumeInformation", "str", "C:\",_
           "str", "", "long", 64, "long_ptr",  0,_
           "long_ptr", 2048, "long_ptr", 0, "str", "",_
           "long", 64)

if @error = 1 then
  Tooltip(" error in call " & $serialno, 0,0)
  sleep (5000)
  exit
endif
tooltip (" Drive Serial is " & $returned[4] & " ---", 0,0)
sleep (5000)

<{POST_SNAPBACK}>

Larry,

Thanks for the feedback... works great!!

Regards,

Dean

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...