Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
None
Description
IOCTL_STORAGE_QUERY_PROPERTY StorageAccessAlignmentProperty PropertyStandardQuery causes BSOD.
int __cdecl main() |
{
|
typedef enum { |
StorageAccessAlignmentProperty = 6,
|
ioctl_storage_query_property = CTL_CODE(45, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
} STORAGE_PROPERTY_ID;
|
typedef enum { PropertyStandardQuery = 0, PropertyExistsQuery = 1, PropertyMaskQuery = 2, PropertyQueryMaxDefined = 3 } STORAGE_QUERY_TYPE; |
typedef struct { STORAGE_PROPERTY_ID PropertyId; STORAGE_QUERY_TYPE QueryType; BYTE AdditionalParameters[1]; } STORAGE_PROPERTY_QUERY; |
typedef struct _STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR { UINT Version, Size, BytesPerCacheLine, BytesOffsetForCacheAlignment, BytesPerLogicalSector, BytesPerPhysicalSector, BytesOffsetForSectorAlignment; } STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR; |
|
CHAR vol[] = "\\\\.\\A:", win[MAX_PATH]; |
GetWindowsDirectoryA(win, MAX_PATH);
|
vol[4] = win[0];
|
HANDLE hVolume = CreateFileA(vol, 0, 7, NULL, OPEN_EXISTING, 0, 0); |
if (hVolume != INVALID_HANDLE_VALUE) |
{
|
STORAGE_PROPERTY_QUERY query = { StorageAccessAlignmentProperty, PropertyStandardQuery };
|
STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR alignment = { 0 };
|
DWORD output = 0; |
BOOL succ = DeviceIoControl(hVolume, ioctl_storage_query_property, &query, sizeof(query), &alignment, sizeof(alignment), &output, NULL); |
printf("%d %d %d\n", succ, output, alignment.BytesPerPhysicalSector); // Windows: "1 28 4096" |
CloseHandle(hVolume);
|
}
|
return 0; |
}
|
|
(ntoskrnl/mm/ARM3/expool.c:284) Entry BlockSize 5, tag ScC4. NextEntry PreviousSize 0, tag RMAP
|
|
*** Fatal System Error: 0x00000019
|
(0x00000005,0xB421A900,0x00000120,0xB421A8D8)
|
20240720-0.4.15-dev-8415-g39077a7.GNU_8.4.0 on FAT32 (VirtualBox)