[SDK][FMIFS] Partially implement QueryDeviceInformation

On Windows, QueryDeviceInformation leverages the ifsutil.dll's API.
This is a standalone implementation that mimics Vista behaviour.
This commit is contained in:
Adam Słaboń 2024-03-02 23:48:33 +01:00 committed by Hermès BÉLUSCA - MAÏTO
parent 8de4d4d2ea
commit 4838d7bd56
3 changed files with 178 additions and 5 deletions

View file

@ -33,6 +33,20 @@ typedef struct
PCHAR Output;
} TEXTOUTPUT, *PTEXTOUTPUT;
/* Device information */
typedef struct _DEVICE_INFORMATION
{
ULONG DeviceFlags;
ULONG SectorSize;
LARGE_INTEGER SectorCount;
} DEVICE_INFORMATION, *PDEVICE_INFORMATION;
/* Device information flags */
#define MEMORYSTICK_FORMAT_CAPABLE 0x10
#define MEMORYSTICK_SUPPORTS_PROGRESS_BAR 0x20
#define DEVICE_HOTPLUG 0x40
#define DEVICE_MEMORYSTICK 0x41
/* media flags */
typedef enum
{
@ -163,11 +177,12 @@ QueryAvailableFileSystemFormat(
OUT UCHAR* Minor,
OUT BOOLEAN* LatestVersion);
BOOL NTAPI
BOOL
NTAPI
QueryDeviceInformation(
IN PWCHAR DriveRoot,
OUT ULONG* Buffer, /* That is probably some 4-bytes structure */
IN ULONG BufferSize); /* 4 */
_In_ PWCHAR DriveRoot,
_Out_ PVOID DeviceInformation,
_In_ ULONG BufferSize);
BOOL NTAPI
QueryFileSystemName(