Direct access to disks and protected files from user-mode applications in Windows

RawDisk.GetSectorSize method


Pascal    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET   

RawDisk     See also    


Returns the size of the sector on given disk device


    class function GetSectorSize(DiskHandle : THandle) : DWORD;

[C++ (DLL/Lib)]
    static unsigned long GetSectorSize( const HANDLE DiskHandle);

[C++ (VCL)]
    static unsigned long __fastcall GetSectorSize( const THandle DiskHandle);

[C++ (.NET)]
    static UInt32 GetSectorSize( IntPtr DiskHandle);

    static UInt32 GetSectorSize( IntPtr DiskHandle);

    Shared Function GetSectorSize( ByVal DiskHandle As IntPtr) As UInt32


  • DiskHandle - the handle of the opened disk device


Use this method to get information about the size of sectors on the device. The handle to the device must have been obtained using Open() or OpenEx() methods.

If the method fails for whatever reason, an exception with Windows-defined error code is thrown.

See also

GetSectorCount     Open     OpenEx    

Back to top