Mega Code Archive

 
Categories / Delphi / Files
 

If drive[volume] supports persistent security

(* Combination with function that checks if OS is NT-based can by used to detect if volume is NTFS. >> Note: To get proper info about any volume you must have at least read access to it even it is a sharing(e.g.\\myserver\MyShare ) or exact path (e.g. C:\) *) ....... /* uses SysUtils, Windows */ ...... //The function supports UNC paths //Example aPath values: // C:\ // C:\Program Files\MyInstallationFolder // C:\Program Files\MyInstallationFolder\ // \\myserver\c$\ // \\myserver\MyShare function VolumeSupportsPersistentACLs( aPath : string) : Boolean; var maxClen, driveFlags : Cardinal; VolName, FSysName : array[0..MAX_PATH] of Char; begin aPath := ExtractFileDrive( aPath) +'\'; Result := FALSE; if GetVolumeInformation( PChar( aPath), VolName, SizeOf( VolName), nil, maxClen, driveFlags, FsysName, SizeOf( FsysName) ) then Result := driveFlags and FS_PERSISTENT_ACLS = FS_PERSISTENT_ACLS ; end;