PDA

Click to See Complete Forum and Search --> : GetVolumeInformation API


DACOSTA2
Dec 4th, 1999, 04:11 AM
I posted a topic today with wrong information. The problem is that I use GetVolumeInformation with W95, but it does not run in Windows NT.

Anybody can help me to get the disk serial number runing in NT?

Marty, if you this message, I apologize for my error.

Thanks in advance

Ruben

DACOSTA2
Dec 6th, 1999, 12:59 AM
Nobody can help me?

There is not form of knowing the disk serial number in NT?

Ruben

Serge
Dec 6th, 1999, 01:05 AM
It works just fine on WinNT:

Private Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long


Public Function GetDiskSerialNumber(pstrDisk As String) As Long
Dim lRet As Long
Dim lUnused1 As Long
Dim lUnused2 As Long
Dim strUnused1 As String
Dim strUnused2 As String

lRet = GetVolumeInformation(pstrDisk, strUnused1, Len(strUnused1), GetDiskSerialNumber, 0, 0, strUnused2, Len(strUnused2))
End Function


Example: MsgBox GetDiskSerialNumber("C:")


------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)