Vol name -- getting a string from a Kernel call
Hello,
I'm trying to retrieve the volume name (the disk label) for a removable disk. But I only see an empty string.
Thank you for your help,
Larry the newbie
ps. I indeed read the manual, system call docs, & Dll example. Unfortunately to no avail.
; Based on http://nsis.sourceforge.net/Get_Disk..._Serial_Number
; first and only parameter - Drive to check. Returns the Disk label (Volume Name)
; Remember to free the memory by calling System::Free <var>
Function GetDiskVolumeName
Pop $1 ; get parameter
System::Alloc 1024 ; Allocate string body
Pop $0 ; Get the allocated string's address
MessageBox MB_OK "Looking for drive $1 label"
!define GetVolumeInformation "Kernel32::GetVolumeInformation(t,*t,i,*i,*i,*i,t,i) i"
System::Call '${GetVolumeInformation}("$1",.r0,1024,,,,,)'
MessageBox MB_OK "$1 Label: $0"
; Push result
Push $0
FunctionEnd ; GetDiskVolumeName