SysFlags, sysName, 512 ) Return volName.CString( 0 )īut as we’re covering Unicode in the same function then we need to allocate the space and set things to *2 so 522 SysFlags, sysName, 512 ) Return volName.WString( 0 )Ĭall GetVolumeInformationA( Left( f.NativePath, 3 ), volName, 512, volSerial, maxCompLength, _
SysFlags, sysName, 256 ) Return volName.CString( 0 )Įnd put 512 in the memory block allocations to handle the call to GetVolumeInformation W because each character is twice as wide.Ĭall GetVolumeInformationW( Left( f.NativePath, 3 ), volName, 512, volSerial, maxCompLength, _ SysFlags, sysName, 256 ) Return volName.WString( 0 )Ĭall GetVolumeInformationA( Left( f.NativePath, 3 ), volName, 256, volSerial, maxCompLength, _ If System.IsFunctionAvailable( “GetVolumeInformationW”, “Kernel32” ) ThenĬall GetVolumeInformationW( Left( f.NativePath, 3 ), volName, 256, volSerial, maxCompLength, _ Soft Declare Function GetVolumeInformationW Lib “Kernel32” ( root As WString, _ĭim volSerial, maxCompLength, sysFlags As Integer MaxCompLength As Integer, ByRef sysFlags As Integer, sysName As Ptr, _ VolName As Ptr, volNameSize As Integer, ByRef volSer As Integer, ByRef _
Soft Declare Function GetVolumeInformationA Lib “Kernel32” ( root As CString, _ Here’s my modification for newer Xojo and using it as an extension to FolderItem:įunction GetVolumeName(extends f As FolderItem) As String