Jump to content
Sign in to follow this  
Guest dldaniele

issues with dllcall and "getvolumeserialnumber"

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
layer

and... next time post in the "Support Forum" =) please, thank you... but we all make mistakes =)


FootbaG

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.