[SDK][PSDK] Add a version check for DiskGeometryGetPartition and DiskGeometryGetDetect and add a missing member to PARTITION_INFORMATION_EX structure (#2541)

DiskGeometryGetPartition() and DiskGeometryGetDetect() are guarded in NTDDI_VERSION for version checking as they differ between Windows XP and Server 2003. In conjunction to that, the PARTITION_INFORMATION_EX structure has "IsServicePartition" as member which is missing in the current NT IOCTL Disk interface header.
This commit is contained in:
Bișoc George 2020-04-15 12:47:01 +02:00 committed by GitHub
parent 643458114f
commit 12d4409086
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -387,12 +387,21 @@ typedef struct _DISK_GEOMETRY_EX {
UCHAR Data[1];
} DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX;
#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
typedef struct _PARTITION_INFORMATION {
LARGE_INTEGER StartingOffset;
@ -464,6 +473,9 @@ typedef struct _PARTITION_INFORMATION_EX {
LARGE_INTEGER PartitionLength;
ULONG PartitionNumber;
BOOLEAN RewritePartition;
#if (NTDDI_VERSION >= NTDDI_WIN10_RS3)
BOOLEAN IsServicePartition;
#endif
_ANONYMOUS_UNION union {
PARTITION_INFORMATION_MBR Mbr;
PARTITION_INFORMATION_GPT Gpt;