I need a function to get the Physical Sector Size for all kind of system drives, in Win7 or higher.

This is the code that I've used until today, when I found out that it's not working with my external USB HDD (exFAT file system) and with my USB MP3 Player (FAT16). In these cases the function `DeviceIoControl` fails and I get the exception: "System Error. Code 50. The request is not suported". But it works very well with NTFS volumes.

```
function GetSectorSize(Drive:Char):DWORD;
var h:THandle;
    junk:DWORD;
    Query:STORAGE_PROPERTY_QUERY;
    Alignment:STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR;
begin
 result:=0;
 h:=CreateFileW(PWideChar('\\.\'+UpperCase(Drive)+':'),0,FILE_SHARE_READ or FILE_SHARE_WRITE,nil,OPEN_EXISTING,0,0);
 if h=INVALID_HANDLE_VALUE then RaiseLastOSError;
 try
  FillChar(Query,SizeOf(Query),0);
  Query.PropertyId:=StorageAccessAlignmentProperty;
  Query.QueryType:=PropertyStandardQuery;
  if not DeviceIoControl(h,IOCTL_STORAGE_QUERY_PROPERTY,@Query,SizeOf(Query),@Alignment,SizeOf(Alignment),junk,nil) then RaiseLastOSError;
  result:=Alignment.BytesPerPhysicalSector;
 finally
  CloseHandle(h);
 end;
end;

```