1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| [Code]
const
MAX_PATH = 260;
function GetVolumeInformation(
lpRootPathName: PAnsiChar;
lpVolumeNameBuffer: PAnsiChar;
nVolumeNameSize: dword;
var lpVolumeSerialNumber: dword;
var lpMaximumComponentLength: dword;
var lpFileSystemFlags: dword;
lpFileSystemNameBuffer: PAnsiChar;
nFileSystemNameSize: dword): bool;
external 'GetVolumeInformationA@kernel32.dll stdcall';
function NextButtonClick(CurPage: Integer): Boolean;
var
RootPath :AnsiString;
VolName :AnsiString;
FileSysName :AnsiString;
VolSerial :dword;
CompoMaxLen :dword;
FileFlags :dword;
begin
Result := TRUE;
if CurPage = wpSelectDir then
begin
RootPath := AddBackslash(ExtractFileDrive(WizardDirValue));
SetLength(VolName, MAX_PATH +1);
SetLength(FileSysName, MAX_PATH +1);
if GetVolumeInformation(PAnsiChar(RootPath), PAnsiChar(VolName), Length(VolName), VolSerial, CompoMaxLen, FileFlags, PAnsiChar(FileSysName), Length(FileSysName))
then MsgBox(Format('Volume %s has filesystem type (%s)', [RootPath, PAnsiChar(FileSysName)]), mbInformation, MB_OK)
else MsgBox(SysErrorMessage(DLLGetLastError), mbError, MB_OK);
end;
end; |
Partager