Не определяется серийный номер диска почему-то
Код:
$Vol = 'C:\'
$lpRootPathName = DllStructCreate('wchar[' & StringLen($Vol)+1 & ']')
DllStructSetData($lpRootPathName, 1, $Vol)
$lpVolumeNameBuffer = DllStructCreate('wchar[255]')
$nVolumeNameSize = 255
$lpVolumeSerialNumber = DllStructCreate('wchar[255]')
$lpMaximumComponentLength = DllStructCreate('dword')
$lpFileSystemFlags = DllStructCreate('dword')
$lpFileSystemNameBuffer = DllStructCreate('wchar[255]')
$nFileSystemNameSize = 255
DllCall("Kernel32", "long", "GetVolumeInformationW", _
'ptr' , DllStructGetPtr($lpRootPathName), _
'ptr' , DllStructGetPtr($lpVolumeNameBuffer), _
'long', $nVolumeNameSize, _
'ptr' , DllStructGetPtr($lpVolumeSerialNumber), _
'ptr' , DllStructGetPtr($lpMaximumComponentLength), _
'ptr' , DllStructGetPtr($lpFileSystemFlags), _
'ptr' , DllStructGetPtr($lpFileSystemNameBuffer), _
'long', $nFileSystemNameSize)
ConsoleWrite('Volume name: ' & DllStructGetData($lpVolumeNameBuffer, 1) & @CRLF)
ConsoleWrite('Serial number: ' & DllStructGetData($lpVolumeSerialNumber, 1) & @CRLF)
ConsoleWrite('Max. Component Length: ' & DllStructGetData($lpMaximumComponentLength, 1) & @CRLF)
ConsoleWrite('File System: ' & DllStructGetData($lpFileSystemNameBuffer, 1) & @CRLF)