- Timestamp:
- Dec 23, 2018 1:01:58 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/nt/nt.h
r75878 r76385 1562 1562 1563 1563 #ifdef IPRT_NT_USE_WINTERNL 1564 typedef struct _FILE_FS_SIZE_INFORMATION 1565 { 1566 LARGE_INTEGER TotalAllocationUnits; 1567 LARGE_INTEGER AvailableAllocationUnits; 1568 ULONG SectorsPerAllocationUnit; 1569 ULONG BytesPerSector; 1570 } FILE_FS_SIZE_INFORMATION; 1571 typedef FILE_FS_SIZE_INFORMATION *PFILE_FS_SIZE_INFORMATION; 1572 1564 1573 typedef enum _FSINFOCLASS 1565 1574 { 1566 1575 FileFsVolumeInformation = 1, 1567 1576 FileFsLabelInformation, 1568 FileFsSizeInformation, 1577 FileFsSizeInformation, /**< FILE_FS_SIZE_INFORMATION */ 1569 1578 FileFsDeviceInformation, 1570 1579 FileFsAttributeInformation, -
trunk/src/VBox/Devices/Storage/DrvHostBase-win.cpp
r76384 r76385 21 21 *********************************************************************************************************************************/ 22 22 #define LOG_GROUP LOG_GROUP_DRV_HOST_BASE 23 #pragma warning(disable : 4163) 24 #define _interlockedbittestandset they_messed_it_up_in_winnt_h_this_time_sigh__interlockedbittestandset 25 #define _interlockedbittestandreset they_messed_it_up_in_winnt_h_this_time_sigh__interlockedbittestandreset 26 #define _interlockedbittestandset64 they_messed_it_up_in_winnt_h_this_time_sigh__interlockedbittestandset64 27 #define _interlockedbittestandreset64 they_messed_it_up_in_winnt_h_this_time_sigh__interlockedbittestandreset64 28 29 #define WIN32_NO_STATUS 30 #include <iprt/win/windows.h> 23 #include <iprt/nt/nt-and-windows.h> 31 24 #include <dbt.h> 32 #undef WIN32_NO_STATUS33 34 #include <winioctl.h>35 25 #include <ntddscsi.h> 36 #pragma warning(default : 4163)37 #undef _interlockedbittestandset38 #undef _interlockedbittestandreset39 #undef _interlockedbittestandset6440 #undef _interlockedbittestandreset6441 #include <ntstatus.h>42 43 /* from ntdef.h */44 typedef LONG NTSTATUS;45 46 /* from ntddk.h */47 typedef struct _IO_STATUS_BLOCK {48 union {49 NTSTATUS Status;50 PVOID Pointer;51 };52 ULONG_PTR Information;53 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;54 55 56 /* from ntinternals.com */57 typedef enum _FS_INFORMATION_CLASS {58 FileFsVolumeInformation=1,59 FileFsLabelInformation,60 FileFsSizeInformation,61 FileFsDeviceInformation,62 FileFsAttributeInformation,63 FileFsControlInformation,64 FileFsFullSizeInformation,65 FileFsObjectIdInformation,66 FileFsMaximumInformation67 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;68 69 typedef struct _FILE_FS_SIZE_INFORMATION {70 LARGE_INTEGER TotalAllocationUnits;71 LARGE_INTEGER AvailableAllocationUnits;72 ULONG SectorsPerAllocationUnit;73 ULONG BytesPerSector;74 } FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;75 76 extern "C"77 NTSTATUS __stdcall NtQueryVolumeInformationFile(78 /*IN*/ HANDLE FileHandle,79 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock,80 /*OUT*/ PVOID FileSystemInformation,81 /*IN*/ ULONG Length,82 /*IN*/ FS_INFORMATION_CLASS FileSystemInformationClass );83 26 84 27 #include <iprt/ctype.h> … … 362 305 /* use NT api, retry a few times if the media is being verified. */ 363 306 IO_STATUS_BLOCK IoStatusBlock = {0}; 364 FILE_FS_SIZE_INFORMATION FsSize = {0};307 FILE_FS_SIZE_INFORMATION FsSize = {0}; 365 308 NTSTATUS rcNt = NtQueryVolumeInformationFile((HANDLE)RTFileToNative(pThis->Os.hFileDevice), &IoStatusBlock, 366 309 &FsSize, sizeof(FsSize), FileFsSizeInformation);
Note:
See TracChangeset
for help on using the changeset viewer.