// ntdddisk.h
typedef struct _DISK_GEOMETRY_EX {
DISK_GEOMETRY Geometry;
LARGE_INTEGER DiskSize;
UCHAR Data[1];
} DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX;
View the official Windows Driver Kit DDI reference
// winioctl.h
typedef struct _DISK_GEOMETRY_EX {
DISK_GEOMETRY Geometry;
LARGE_INTEGER DiskSize;
BYTE Data[1];
} DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX;
View the official Win32 API reference
No description available.
The DISK_GEOMETRY_EX structure is an arbitrary-length structure composed of a DISK_GEOMETRY structure followed by a DISK_PARTITION_INFO structure followed, in turn, by a DISK_DETECTION_INFO structure.
Geometry
See DISK_GEOMETRY for a description of this member.
DiskSize
Contains the size in bytes of the disk.
Data
Beginning of the data block, starting with a DISK_PARTITION_INFO structure followed by a DISK_DETECTION_INFO structure.
DISK_GEOMETRY_EX is used in conjunction with the IOCTL_DISK_GET_DRIVE_GEOMETRY_EX and the IOCTL_DISK_GET_MEDIA_TYPES IOCTLs, in order to retrieve information about the geometry of a physical disk (media type, number of cylinders, tracks per cylinder, sectors per track, and bytes per sector).
Because the partition and detect information are not at fixed locations within the DISK_GEOMETRY_EX structure, ntdddisk.h provides two macros for accessing this information. Both macros take a pointer to a structure of type DISK_GEOMETRY_EX as an argument:
#if (NTDDI_VERSION < NTDDI_WS03)
#define DiskGeometryGetPartition(Geometry)\
((PDISK_PARTITION_INFO)((Geometry)+1))
#define DiskGeometryGetDetect(Geometry)\
((PDISK_DETECTION_INFO)(((PBYTE)DiskGeometryGetPartition(Geometry)+\
DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo)))
#else
#define DiskGeometryGetPartition(Geometry)\
((PDISK_PARTITION_INFO)((Geometry)->Data))
#define DiskGeometryGetDetect(Geometry)\
((PDISK_DETECTION_INFO)(((ULONG_PTR)DiskGeometryGetPartition(Geometry)+\
DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo)))
#endif
Describes the extended geometry of disk devices and media.
Geometry
A DISK_GEOMETRY structure.
DiskSize
The disk size, in bytes. See LARGE_INTEGER.
Data
Any additional data. For more information, see Remarks.
DISK_GEOMETRY_EX is a variable-length structure composed of a DISK_GEOMETRY structure followed by a DISK_PARTITION_INFO structure and a DISK_DETECTION_INFO structure. Because the detection information is not at a fixed location within the DISK_GEOMETRY_EX structure, use the following macro to access the DISK_DETECTION_INFO structure.
PDISK_DETECTION_INFO DiskGeometryGetDetect(
PDISK_GEOMETRY_EX Geometry
);
Similarly, use the following macro to access the DISK_PARTITION_INFO structure.
PDISK_PARTITION_INFO DiskGeometryGetPartition(
PDISK_GEOMETRY_EX Geometry
);
The information returned does not include the number of partitions nor the partition information contained in the DISK_PARTITION_INFO structure. To obtain this information, use the IOCTL_DISK_GET_DRIVE_LAYOUT_EX control code.
DISK_GEOMETRY, DISK_DETECTION_INFO, DISK_PARTITION_INFO, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX