https://git.reactos.org/?p=reactos.git;a=commitdiff;h=99489553fcaba00f30fb1…
commit 99489553fcaba00f30fb1c2f531490084607dc06
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Thu Sep 24 17:31:15 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Thu Sep 24 17:31:15 2020 +0300
[PSDK] Add definitions required for newer storage class drivers (cdrom)
CORE-17129
---
sdk/include/psdk/devpkey.h | 1 +
sdk/include/psdk/driverspecs.h | 4 +-
sdk/include/psdk/ntddcdrm.h | 243 ++++++++++++++++++++++++++++++++++--
sdk/include/psdk/ntddcdvd.h | 186 ++++++++++++++++++++++-----
sdk/include/psdk/ntddmmc.h | 4 +-
sdk/include/psdk/ntddstor.h | 33 ++++-
sdk/include/psdk/ntddvol.h | 30 ++---
sdk/include/psdk/sal.h | 116 ++++++++---------
sdk/include/psdk/specstrings.h | 7 ++
sdk/include/psdk/winapifamily.h | 71 +++++++++++
sdk/include/psdk/winpackagefamily.h | 56 +++++++++
11 files changed, 633 insertions(+), 118 deletions(-)
diff --git a/sdk/include/psdk/devpkey.h b/sdk/include/psdk/devpkey.h
index a908dfdebf2..97b96d935c0 100644
--- a/sdk/include/psdk/devpkey.h
+++ b/sdk/include/psdk/devpkey.h
@@ -57,6 +57,7 @@ DEFINE_DEVPROPKEY(DEVPKEY_Device_InstallState,
0xa45c254e,0xdf1c,0x4efd,0x80,0x2
DEFINE_DEVPROPKEY(DEVPKEY_Device_LocationPaths,
0xa45c254e,0xdf1c,0x4efd,0x80,0x20,0x67,0xd1,0x46,0xa8,0x50,0xe0, 37);
DEFINE_DEVPROPKEY(DEVPKEY_Device_BaseContainerId,
0xa45c254e,0xdf1c,0x4efd,0x80,0x20,0x67,0xd1,0x46,0xa8,0x50,0xe0, 38);
DEFINE_DEVPROPKEY(DEVPKEY_Device_InLocalMachineContainer, 0x8c7ed206, 0x3f8a, 0x4827,
0xb3, 0xab, 0xae, 0x9e, 0x1f, 0xae, 0xfc, 0x6c, 4);
+DEFINE_DEVPROPKEY(DEVPKEY_Device_SessionId,
0x83da6326,0x97a6,0x4088,0x94,0x53,0xa1,0x92,0x3f,0x57,0x3b,0x29, 6);
DEFINE_DEVPROPKEY(DEVPKEY_DeviceInterface_FriendlyName,
0x026e516e,0x8b14,0x414b,0x83,0xcd,0x85,0x6d,0x6f,0xef,0x48,0x22, 2);
DEFINE_DEVPROPKEY(DEVPKEY_DeviceInterface_Enabled,
0x026e516e,0x8b14,0x414b,0x83,0xcd,0x85,0x6d,0x6f,0xef,0x48,0x22, 3);
diff --git a/sdk/include/psdk/driverspecs.h b/sdk/include/psdk/driverspecs.h
index 56f276596d4..a15fb26e1e4 100644
--- a/sdk/include/psdk/driverspecs.h
+++ b/sdk/include/psdk/driverspecs.h
@@ -124,7 +124,7 @@
#define __drv_ret(annotes)
#define __drv_sameIRQL
#define __drv_savesIRQL
-#define __drv_savesIRQLGlobal
+#define __drv_savesIRQLGlobal(kind,param)
#define __drv_strictType(typename,mode)
#define __drv_strictTypeMatch(mode)
#define __drv_unit(p)
@@ -306,7 +306,7 @@ __ANNOTATION(SAL_callbackType(__In_impl_ __AuToQuOtE char *);)
#define __drv_ret(annotes)
#define __drv_sameIRQL
#define __drv_savesIRQL
-#define __drv_savesIRQLGlobal
+#define __drv_savesIRQLGlobal(kind,param)
#define __drv_setsIRQL(irql)
#define __drv_strictType(typename,mode)
#define __drv_strictTypeMatch(mode)
diff --git a/sdk/include/psdk/ntddcdrm.h b/sdk/include/psdk/ntddcdrm.h
index ce6766299a3..c9fd6dcb82c 100644
--- a/sdk/include/psdk/ntddcdrm.h
+++ b/sdk/include/psdk/ntddcdrm.h
@@ -95,6 +95,41 @@ extern "C" {
CTL_CODE(IOCTL_CDROM_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
+// #define IOCTL_CDROM_GET_LAST_SESSION CTL_CODE(IOCTL_CDROM_BASE, 0x000E,
METHOD_BUFFERED, FILE_READ_ACCESS)
+
+
+// #define IOCTL_CDROM_GET_CONFIGURATION CTL_CODE(IOCTL_CDROM_BASE, 0x0016,
METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_CDROM_EXCLUSIVE_ACCESS CTL_CODE(IOCTL_CDROM_BASE, 0x0017,
METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
+#define IOCTL_CDROM_SET_SPEED CTL_CODE(IOCTL_CDROM_BASE, 0x0018,
METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_CDROM_GET_INQUIRY_DATA CTL_CODE(IOCTL_CDROM_BASE, 0x0019,
METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_CDROM_ENABLE_STREAMING CTL_CODE(IOCTL_CDROM_BASE, 0x001A,
METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_CDROM_SEND_OPC_INFORMATION CTL_CODE(IOCTL_CDROM_BASE, 0x001B,
METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
+#define IOCTL_CDROM_GET_PERFORMANCE CTL_CODE(IOCTL_CDROM_BASE, 0x001C,
METHOD_BUFFERED, FILE_READ_ACCESS)
+
+// end_winioctl
+
+//
+// The following device control codes are common for all class drivers. The
+// functions codes defined here must match all of the other class drivers.
+//
+// Warning: these codes will be replaced in the future with the IOCTL_STORAGE
+// codes included below
+//
+
+// #define IOCTL_CDROM_CHECK_VERIFY CTL_CODE(IOCTL_CDROM_BASE, 0x0200,
METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_CDROM_MEDIA_REMOVAL CTL_CODE(IOCTL_CDROM_BASE, 0x0201, METHOD_BUFFERED,
FILE_READ_ACCESS)
+// #define IOCTL_CDROM_EJECT_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0202,
METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_CDROM_LOAD_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0203, METHOD_BUFFERED,
FILE_READ_ACCESS)
+#define IOCTL_CDROM_RESERVE CTL_CODE(IOCTL_CDROM_BASE, 0x0204, METHOD_BUFFERED,
FILE_READ_ACCESS)
+#define IOCTL_CDROM_RELEASE CTL_CODE(IOCTL_CDROM_BASE, 0x0205, METHOD_BUFFERED,
FILE_READ_ACCESS)
+// #define IOCTL_CDROM_FIND_NEW_DEVICES CTL_CODE(IOCTL_CDROM_BASE, 0x0206,
METHOD_BUFFERED, FILE_READ_ACCESS)
+
+
+#define MINIMUM_CDROM_INQUIRY_SIZE 36 // RTL_SIZEOF_THROUGH_FIELD(INQUIRYDATA,
ProductRevisionLevel)
+#define MAXIMUM_CDROM_INQUIRY_SIZE 260 // MAXUCHAR +
RTL_SIZEOF_THROUGH_FIELD(INQUIRYDATA, AdditionalLength)
+
#define MAXIMUM_NUMBER_TRACKS 100
#define MAXIMUM_CDROM_SIZE 804
#define MINIMUM_CDROM_READ_TOC_EX_SIZE 2
@@ -334,8 +369,8 @@ typedef union _SUB_Q_CHANNEL_DATA {
#define TWO_FOUR_CHANNEL_AUDIO 0x8
typedef struct _CDROM_AUDIO_CONTROL {
- UCHAR LbaFormat;
- USHORT LogicalBlocksPerSecond;
+ UCHAR LbaFormat;
+ USHORT LogicalBlocksPerSecond;
} CDROM_AUDIO_CONTROL, *PCDROM_AUDIO_CONTROL;
typedef struct _VOLUME_CONTROL {
@@ -343,17 +378,209 @@ typedef struct _VOLUME_CONTROL {
} VOLUME_CONTROL, *PVOLUME_CONTROL;
typedef enum _TRACK_MODE_TYPE {
- YellowMode2,
- XAForm2,
- CDDA
+ YellowMode2,
+ XAForm2,
+ CDDA,
+ RawWithC2AndSubCode,
+ RawWithC2,
+ RawWithSubCode
} TRACK_MODE_TYPE, *PTRACK_MODE_TYPE;
+#define CD_RAW_READ_C2_SIZE ( 296 )
+#define CD_RAW_READ_SUBCODE_SIZE ( 96)
+#define CD_RAW_SECTOR_WITH_C2_SIZE (2352+296 )
+#define CD_RAW_SECTOR_WITH_SUBCODE_SIZE (2352 +96)
+#define CD_RAW_SECTOR_WITH_C2_AND_SUBCODE_SIZE (2352+296+96)
+
typedef struct __RAW_READ_INFO {
- LARGE_INTEGER DiskOffset;
- ULONG SectorCount;
- TRACK_MODE_TYPE TrackMode;
+ LARGE_INTEGER DiskOffset;
+ ULONG SectorCount;
+ TRACK_MODE_TYPE TrackMode;
} RAW_READ_INFO, *PRAW_READ_INFO;
+
+// for IOCTL_CDROM_EXCLUSIVE_ACCESS
+
+#define CDROM_EXCLUSIVE_CALLER_LENGTH 64
+
+#define CDROM_LOCK_IGNORE_VOLUME (1 << 0)
+#define CDROM_NO_MEDIA_NOTIFICATIONS (1 << 1)
+
+#define CDROM_NOT_IN_EXCLUSIVE_MODE 0
+#define CDROM_IN_EXCLUSIVE_MODE 1
+
+typedef enum _EXCLUSIVE_ACCESS_REQUEST_TYPE
+{
+ ExclusiveAccessQueryState,
+ ExclusiveAccessLockDevice,
+ ExclusiveAccessUnlockDevice
+} EXCLUSIVE_ACCESS_REQUEST_TYPE, *PEXCLUSIVE_ACCESS_REQUEST_TYPE;
+
+typedef struct _CDROM_EXCLUSIVE_ACCESS
+{
+ EXCLUSIVE_ACCESS_REQUEST_TYPE RequestType;
+ ULONG Flags;
+} CDROM_EXCLUSIVE_ACCESS, *PCDROM_EXCLUSIVE_ACCESS;
+
+typedef struct _CDROM_EXCLUSIVE_LOCK
+{
+ CDROM_EXCLUSIVE_ACCESS Access;
+ UCHAR CallerName[CDROM_EXCLUSIVE_CALLER_LENGTH];
+} CDROM_EXCLUSIVE_LOCK, *PCDROM_EXCLUSIVE_LOCK;
+
+typedef struct _CDROM_EXCLUSIVE_LOCK_STATE
+{
+ BOOLEAN LockState;
+ UCHAR CallerName[CDROM_EXCLUSIVE_CALLER_LENGTH];
+} CDROM_EXCLUSIVE_LOCK_STATE, *PCDROM_EXCLUSIVE_LOCK_STATE;
+
+
+// for IOCTL_CDROM_SET_SPEED
+
+typedef enum _CDROM_SPEED_REQUEST
+{
+ CdromSetSpeed,
+ CdromSetStreaming
+} CDROM_SPEED_REQUEST, *PCDROM_SPEED_REQUEST;
+
+typedef enum _WRITE_ROTATION
+{
+ CdromDefaultRotation,
+ CdromCAVRotation
+} WRITE_ROTATION, *PWRITE_ROTATION;
+
+typedef struct _CDROM_SET_SPEED
+{
+ CDROM_SPEED_REQUEST RequestType;
+ USHORT ReadSpeed;
+ USHORT WriteSpeed;
+ WRITE_ROTATION RotationControl;
+} CDROM_SET_SPEED, *PCDROM_SET_SPEED;
+
+typedef struct _CDROM_SET_STREAMING
+{
+ CDROM_SPEED_REQUEST RequestType;
+ ULONG ReadSize;
+ ULONG ReadTime;
+ ULONG WriteSize;
+ ULONG WriteTime;
+ ULONG StartLba;
+ ULONG EndLba;
+ WRITE_ROTATION RotationControl;
+ BOOLEAN RestoreDefaults;
+ BOOLEAN SetExact;
+ BOOLEAN RandomAccess;
+ BOOLEAN Persistent;
+} CDROM_SET_STREAMING, *PCDROM_SET_STREAMING;
+
+
+// for IOCTL_CDROM_ENABLE_STREAMING
+
+typedef enum _STREAMING_CONTROL_REQUEST_TYPE
+{
+ CdromStreamingDisable = 1,
+ CdromStreamingEnableForReadOnly = 2,
+ CdromStreamingEnableForWriteOnly = 3,
+ CdromStreamingEnableForReadWrite = 4
+} STREAMING_CONTROL_REQUEST_TYPE, *PSTREAMING_CONTROL_REQUEST_TYPE;
+
+typedef struct _CDROM_STREAMING_CONTROL {
+ STREAMING_CONTROL_REQUEST_TYPE RequestType;
+} CDROM_STREAMING_CONTROL, *PCDROM_STREAMING_CONTROL;
+
+
+// for IOCTL_CDROM_SEND_OPC_INFORMATION
+
+typedef enum _CDROM_OPC_INFO_TYPE
+{
+ SimpleOpcInfo = 1
+} CDROM_OPC_INFO_TYPE, *PCDROM_OPC_INFO_TYPE;
+
+typedef struct _CDROM_SIMPLE_OPC_INFO
+{
+ CDROM_OPC_INFO_TYPE RequestType;
+ BOOLEAN Exclude0;
+ BOOLEAN Exclude1;
+} CDROM_SIMPLE_OPC_INFO, *PCDROM_SIMPLE_OPC_INFO;
+
+
+// for IOCTL_CDROM_GET_PERFORMANCE
+
+typedef enum _CDROM_PERFORMANCE_REQUEST_TYPE
+{
+ CdromPerformanceRequest = 1,
+ CdromWriteSpeedRequest = 2
+} CDROM_PERFORMANCE_REQUEST_TYPE, *PCDROM_PERFORMANCE_REQUEST_TYPE;
+
+typedef enum _CDROM_PERFORMANCE_TYPE
+{
+ CdromReadPerformance = 1,
+ CdromWritePerformance = 2
+} CDROM_PERFORMANCE_TYPE, *PCDROM_PERFORMANCE_TYPE;
+
+typedef enum _CDROM_PERFORMANCE_EXCEPTION_TYPE
+{
+ CdromNominalPerformance = 1,
+ CdromEntirePerformanceList = 2,
+ CdromPerformanceExceptionsOnly = 3
+} CDROM_PERFORMANCE_EXCEPTION_TYPE, *PCDROM_PERFORMANCE_EXCEPTION_TYPE;
+
+typedef enum _CDROM_PERFORMANCE_TOLERANCE_TYPE
+{
+ Cdrom10Nominal20Exceptions = 1
+} CDROM_PERFORMANCE_TOLERANCE_TYPE, *PCDROM_PERFORMANCE_TOLERANCE_TYPE;
+
+typedef struct _CDROM_PERFORMANCE_REQUEST
+{
+ CDROM_PERFORMANCE_REQUEST_TYPE RequestType;
+ CDROM_PERFORMANCE_TYPE PerformanceType;
+ CDROM_PERFORMANCE_EXCEPTION_TYPE Exceptions;
+ CDROM_PERFORMANCE_TOLERANCE_TYPE Tolerance;
+ ULONG StaringLba;
+} CDROM_PERFORMANCE_REQUEST, *PCDROM_PERFORMANCE_REQUEST;
+
+typedef struct _CDROM_WRITE_SPEED_REQUEST
+{
+ CDROM_PERFORMANCE_REQUEST_TYPE RequestType;
+} CDROM_WRITE_SPEED_REQUEST, *PCDROM_WRITE_SPEED_REQUEST;
+
+typedef struct _CDROM_PERFORMANCE_HEADER
+{
+ UCHAR DataLength[4];
+ UCHAR Except:1;
+ UCHAR Write:1;
+ UCHAR Reserved1:6;
+ UCHAR Reserved2[3];
+ UCHAR Data[0];
+} CDROM_PERFORMANCE_HEADER, *PCDROM_PERFORMANCE_HEADER;
+
+typedef struct _CDROM_NOMINAL_PERFORMANCE_DESCRIPTOR
+{
+ UCHAR StartLba[4];
+ UCHAR StartPerformance[4];
+ UCHAR EndLba[4];
+ UCHAR EndPerformance[4];
+} CDROM_NOMINAL_PERFORMANCE_DESCRIPTOR, *PCDROM_NOMINAL_PERFORMANCE_DESCRIPTOR;
+
+typedef struct _CDROM_EXCEPTION_PERFORMANCE_DESCRIPTOR
+{
+ UCHAR Lba[4];
+ UCHAR Time[2];
+} CDROM_EXCEPTION_PERFORMANCE_DESCRIPTOR, *PCDROM_EXCEPTION_PERFORMANCE_DESCRIPTOR;
+
+typedef struct _CDROM_WRITE_SPEED_DESCRIPTOR
+{
+ UCHAR MixedReadWrite:1;
+ UCHAR Exact:1;
+ UCHAR Reserved1:1;
+ UCHAR WriteRotationControl:2;
+ UCHAR Reserved2:3;
+ UCHAR Reserved3[3];
+ UCHAR EndLba[4];
+ UCHAR ReadSpeed[4];
+ UCHAR WriteSpeed[4];
+} CDROM_WRITE_SPEED_DESCRIPTOR, *PCDROM_WRITE_SPEED_DESCRIPTOR;
+
#ifdef __cplusplus
}
#endif
diff --git a/sdk/include/psdk/ntddcdvd.h b/sdk/include/psdk/ntddcdvd.h
index c07164de633..3026e199b48 100644
--- a/sdk/include/psdk/ntddcdvd.h
+++ b/sdk/include/psdk/ntddcdvd.h
@@ -34,36 +34,75 @@ extern "C" {
#define IOCTL_STORAGE_SET_READ_AHEAD \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0100, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_DVD_START_SESSION \
+ CTL_CODE(IOCTL_DVD_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_DVD_READ_KEY \
+ CTL_CODE(IOCTL_DVD_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_DVD_SEND_KEY \
+ CTL_CODE(IOCTL_DVD_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
+
#define IOCTL_DVD_END_SESSION \
CTL_CODE(IOCTL_DVD_BASE, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_DVD_SET_READ_AHEAD \
+ CTL_CODE(IOCTL_DVD_BASE, 0x0404, METHOD_BUFFERED, FILE_READ_ACCESS)
+
#define IOCTL_DVD_GET_REGION \
CTL_CODE(IOCTL_DVD_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DVD_SEND_KEY2 \
CTL_CODE(IOCTL_DVD_BASE, 0x0406, METHOD_BUFFERED, FILE_READ_ACCESS |
FILE_WRITE_ACCESS)
-#define IOCTL_DVD_READ_KEY \
- CTL_CODE(IOCTL_DVD_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_AACS_READ_MEDIA_KEY_BLOCK_SIZE \
+ CTL_CODE(IOCTL_DVD_BASE, 0x430, METHOD_BUFFERED, FILE_READ_ACCESS)
-#define IOCTL_DVD_READ_STRUCTURE \
- CTL_CODE(IOCTL_DVD_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_AACS_READ_MEDIA_KEY_BLOCK \
+ CTL_CODE(IOCTL_DVD_BASE, 0x431, METHOD_BUFFERED, FILE_READ_ACCESS)
-#define IOCTL_DVD_SEND_KEY \
- CTL_CODE(IOCTL_DVD_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_AACS_START_SESSION \
+ CTL_CODE(IOCTL_DVD_BASE, 0x432, METHOD_BUFFERED, FILE_READ_ACCESS)
-#define IOCTL_DVD_START_SESSION \
- CTL_CODE(IOCTL_DVD_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_AACS_END_SESSION \
+ CTL_CODE(IOCTL_DVD_BASE, 0x433, METHOD_BUFFERED, FILE_READ_ACCESS)
-#define IOCTL_DVD_SET_READ_AHEAD \
- CTL_CODE(IOCTL_DVD_BASE, 0x0404, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_AACS_SEND_CERTIFICATE \
+ CTL_CODE(IOCTL_DVD_BASE, 0x434, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_AACS_GET_CERTIFICATE \
+ CTL_CODE(IOCTL_DVD_BASE, 0x435, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_AACS_GET_CHALLENGE_KEY \
+ CTL_CODE(IOCTL_DVD_BASE, 0x436, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_AACS_SEND_CHALLENGE_KEY \
+ CTL_CODE(IOCTL_DVD_BASE, 0x437, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_AACS_READ_VOLUME_ID \
+ CTL_CODE(IOCTL_DVD_BASE, 0x438, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_AACS_READ_SERIAL_NUMBER \
+ CTL_CODE(IOCTL_DVD_BASE, 0x439, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_AACS_READ_MEDIA_ID \
+ CTL_CODE(IOCTL_DVD_BASE, 0x43A, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_AACS_READ_BINDING_NONCE \
+ CTL_CODE(IOCTL_DVD_BASE, 0x43B, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+#define IOCTL_AACS_GENERATE_BINDING_NONCE \
+ CTL_CODE(IOCTL_DVD_BASE, 0x43C, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
+
+#define IOCTL_DVD_READ_STRUCTURE \
+ CTL_CODE(IOCTL_DVD_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
typedef ULONG DVD_SESSION_ID, *PDVD_SESSION_ID;
typedef struct _STORAGE_SET_READ_AHEAD {
- LARGE_INTEGER TriggerAddress;
- LARGE_INTEGER TargetAddress;
+ LARGE_INTEGER TriggerAddress;
+ LARGE_INTEGER TargetAddress;
} STORAGE_SET_READ_AHEAD, *PSTORAGE_SET_READ_AHEAD;
typedef enum DVD_STRUCTURE_FORMAT {
@@ -122,27 +161,27 @@ typedef struct _DVD_DISK_KEY_DESCRIPTOR {
} DVD_DISK_KEY_DESCRIPTOR, *PDVD_DISK_KEY_DESCRIPTOR;
typedef enum _DVD_KEY_TYPE {
- DvdChallengeKey = 0x01,
- DvdBusKey1,
- DvdBusKey2,
- DvdTitleKey,
- DvdAsf,
- DvdSetRpcKey = 0x6,
- DvdGetRpcKey = 0x8,
- DvdDiskKey = 0x80,
- DvdInvalidateAGID = 0x3f
+ DvdChallengeKey = 0x01,
+ DvdBusKey1,
+ DvdBusKey2,
+ DvdTitleKey,
+ DvdAsf,
+ DvdSetRpcKey = 0x6,
+ DvdGetRpcKey = 0x8,
+ DvdDiskKey = 0x80,
+ DvdInvalidateAGID = 0x3f
} DVD_KEY_TYPE;
typedef struct _DVD_COPY_PROTECT_KEY {
- ULONG KeyLength;
- DVD_SESSION_ID SessionId;
- DVD_KEY_TYPE KeyType;
- ULONG KeyFlags;
- union {
- HANDLE FileHandle;
- LARGE_INTEGER TitleOffset;
- } Parameters;
- UCHAR KeyData[0];
+ ULONG KeyLength;
+ DVD_SESSION_ID SessionId;
+ DVD_KEY_TYPE KeyType;
+ ULONG KeyFlags;
+ union {
+ HANDLE FileHandle;
+ LARGE_INTEGER TitleOffset;
+ } Parameters;
+ UCHAR KeyData[0];
} DVD_COPY_PROTECT_KEY, *PDVD_COPY_PROTECT_KEY;
#define DVD_CHALLENGE_KEY_LENGTH (12 + sizeof(DVD_COPY_PROTECT_KEY))
@@ -201,14 +240,93 @@ typedef struct _DVD_ASF {
} DVD_ASF, *PDVD_ASF;
typedef struct _DVD_REGION {
- UCHAR CopySystem;
- UCHAR RegionData;
- UCHAR SystemRegion;
- UCHAR ResetCount;
+ UCHAR CopySystem;
+ UCHAR RegionData;
+ UCHAR SystemRegion;
+ UCHAR ResetCount;
} DVD_REGION, *PDVD_REGION;
#ifdef __cplusplus
}
#endif
+// for IOCTLS_AACS_*
+
+typedef _Field_range_(0,255) ULONG AACS_LAYER_NUMBER, *PAACS_LAYER_NUMBER;
+typedef _Field_range_(0,255) const ULONG CAACS_LAYER_NUMBER, *PCAACS_LAYER_NUMBER;
+
+typedef struct _AACS_CERTIFICATE
+{
+ UCHAR Nonce[20];
+ UCHAR Certificate[92];
+} AACS_CERTIFICATE, *PAACS_CERTIFICATE;
+typedef const AACS_CERTIFICATE CAACS_CERTIFICATE, *PCAACS_CERTIFICATE;
+C_ASSERT(sizeof(AACS_CERTIFICATE) == 112);
+
+typedef struct _AACS_CHALLENGE_KEY
+{
+ UCHAR EllipticCurvePoint[40];
+ UCHAR Signature[40];
+} AACS_CHALLENGE_KEY, *PAACS_CHALLENGE_KEY;
+typedef const AACS_CHALLENGE_KEY CAACS_CHALLENGE_KEY, *PCAACS_CHALLENGE_KEY;
+C_ASSERT(sizeof(AACS_CHALLENGE_KEY) == 80);
+
+typedef struct _AACS_VOLUME_ID
+{
+ UCHAR VolumeID[16];
+ UCHAR MAC[16];
+} AACS_VOLUME_ID, *PAACS_VOLUME_ID;
+typedef const AACS_VOLUME_ID CAACS_VOLUME_ID, *PCAACS_VOLUME_ID;
+C_ASSERT(sizeof(AACS_VOLUME_ID) == 32);
+
+typedef struct _AACS_SERIAL_NUMBER
+{
+ UCHAR PrerecordedSerialNumber[16];
+ UCHAR MAC[16];
+} AACS_SERIAL_NUMBER, *PAACS_SERIAL_NUMBER;
+typedef const AACS_SERIAL_NUMBER CAACS_SERIAL_NUMBER, *PCAACS_SERIAL_NUMBER;
+C_ASSERT(sizeof(AACS_SERIAL_NUMBER) == 32);
+
+typedef struct _AACS_MEDIA_ID
+{
+ UCHAR MediaID[16];
+ UCHAR MAC[16];
+} AACS_MEDIA_ID, *PAACS_MEDIA_ID;
+typedef const AACS_MEDIA_ID CAACS_MEDIA_ID, *PCAACS_MEDIA_ID;
+C_ASSERT(sizeof(AACS_MEDIA_ID) == 32);
+
+typedef struct _AACS_SEND_CERTIFICATE
+{
+ DVD_SESSION_ID SessionId;
+ AACS_CERTIFICATE Certificate;
+} AACS_SEND_CERTIFICATE, *PAACS_SEND_CERTIFICATE;
+typedef const AACS_SEND_CERTIFICATE CAACS_SEND_CERTIFICATE, *PCAACS_SEND_CERTIFICATE;
+
+typedef struct _AACS_SEND_CHALLENGE_KEY
+{
+ DVD_SESSION_ID SessionId;
+ AACS_CHALLENGE_KEY ChallengeKey;
+} AACS_SEND_CHALLENGE_KEY, *PAACS_SEND_CHALLENGE_KEY;
+typedef const AACS_SEND_CHALLENGE_KEY CAACS_SEND_CHALLENGE_KEY,
*PCAACS_SEND_CHALLENGE_KEY;
+
+typedef struct _AACS_BINDING_NONCE
+{
+ UCHAR BindingNonce[16];
+ UCHAR MAC[16];
+} AACS_BINDING_NONCE, *PAACS_BINDING_NONCE;
+typedef const AACS_BINDING_NONCE CAACS_BINDING_NONCE, *PCAACS_BINDING_NONCE;
+C_ASSERT(sizeof(AACS_BINDING_NONCE) == 32);
+
+typedef struct _AACS_READ_BINDING_NONCE
+{
+ DVD_SESSION_ID SessionId;
+ _Field_range_(0,255) ULONG NumberOfSectors;
+ ULONGLONG StartLba;
+ union
+ {
+ HANDLE Handle;
+ ULONGLONG ForceStructureLengthToMatch64bit;
+ };
+} AACS_READ_BINDING_NONCE, *PAACS_READ_BINDING_NONCE;
+
#endif /* _NTDDCDVD_ */
diff --git a/sdk/include/psdk/ntddmmc.h b/sdk/include/psdk/ntddmmc.h
index f98368af13f..bb1c672a104 100644
--- a/sdk/include/psdk/ntddmmc.h
+++ b/sdk/include/psdk/ntddmmc.h
@@ -162,10 +162,10 @@ typedef struct _FEATURE_DATA_MORPHING {
typedef struct _FEATURE_DATA_REMOVABLE_MEDIUM {
FEATURE_HEADER Header;
UCHAR Lockable:1;
- UCHAR Reserved1:1;
+ UCHAR DBML:1;
UCHAR DefaultToPrevent:1;
UCHAR Eject:1;
- UCHAR Reserved2:1;
+ UCHAR Load:1;
UCHAR LoadingMechanism:3;
UCHAR Reserved3[3];
} FEATURE_DATA_REMOVABLE_MEDIUM, *PFEATURE_DATA_REMOVABLE_MEDIUM;
diff --git a/sdk/include/psdk/ntddstor.h b/sdk/include/psdk/ntddstor.h
index c17954c6889..356e0b70a8b 100644
--- a/sdk/include/psdk/ntddstor.h
+++ b/sdk/include/psdk/ntddstor.h
@@ -80,6 +80,17 @@ DEFINE_GUID(GUID_DEVINTERFACE_HIDDEN_VOLUME,
#endif /* defined(DEFINE_GUID) */
+#if defined(DEFINE_DEVPROPKEY)
+DEFINE_DEVPROPKEY(DEVPKEY_Storage_Portable, 0x4d1ebee8, 0x803, 0x4774, 0x98,
0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 2);
+DEFINE_DEVPROPKEY(DEVPKEY_Storage_Removable_Media, 0x4d1ebee8, 0x803, 0x4774, 0x98,
0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 3);
+DEFINE_DEVPROPKEY(DEVPKEY_Storage_System_Critical, 0x4d1ebee8, 0x803, 0x4774, 0x98,
0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 4);
+DEFINE_DEVPROPKEY(DEVPKEY_Storage_Disk_Number, 0x4d1ebee8, 0x803, 0x4774, 0x98,
0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 5);
+DEFINE_DEVPROPKEY(DEVPKEY_Storage_Partition_Number, 0x4d1ebee8, 0x803, 0x4774, 0x98,
0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 6);
+DEFINE_DEVPROPKEY(DEVPKEY_Storage_Mbr_Type, 0x4d1ebee8, 0x803, 0x4774, 0x98,
0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 7);
+DEFINE_DEVPROPKEY(DEVPKEY_Storage_Gpt_Type, 0x4d1ebee8, 0x803, 0x4774, 0x98,
0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 8);
+DEFINE_DEVPROPKEY(DEVPKEY_Storage_Gpt_Name, 0x4d1ebee8, 0x803, 0x4774, 0x98,
0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 9);
+#endif
+
#ifndef _WINIOCTL_
#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
@@ -808,7 +819,7 @@ typedef struct _STORAGE_PRIORITY_HINT_SUPPORT {
#pragma warning(disable:4200)
#endif
-#if defined(_MSC_EXTENSIONS)
+// #if defined(_MSC_EXTENSIONS)
typedef struct _STORAGE_MEDIA_SERIAL_NUMBER_DATA {
USHORT Reserved;
@@ -835,7 +846,7 @@ typedef struct _PERSISTENT_RESERVE_COMMAND {
} DUMMYUNIONNAME;
} PERSISTENT_RESERVE_COMMAND, *PPERSISTENT_RESERVE_COMMAND;
-#endif /* defined(_MSC_EXTENSIONS) */
+// #endif /* defined(_MSC_EXTENSIONS) */
#ifdef _MSC_VER
#pragma warning(pop) /* disable:4200 */
@@ -1075,6 +1086,24 @@ typedef struct _STORAGE_IDLE_POWER {
ULONG D3IdleTimeout;
} STORAGE_IDLE_POWER, *PSTORAGE_IDLE_POWER;
+
+// for IOCTL_STORAGE_GET_IDLE_POWERUP_REASON
+
+typedef enum _STORAGE_POWERUP_REASON_TYPE {
+ StoragePowerupUnknown = 0,
+ StoragePowerupIO,
+ StoragePowerupDeviceAttention
+} STORAGE_POWERUP_REASON_TYPE, *PSTORAGE_POWERUP_REASON_TYPE;
+
+typedef struct _STORAGE_IDLE_POWERUP_REASON
+{
+ ULONG Version;
+ ULONG Size;
+ STORAGE_POWERUP_REASON_TYPE PowerupReason;
+} STORAGE_IDLE_POWERUP_REASON, *PSTORAGE_IDLE_POWERUP_REASON;
+
+#define STORAGE_IDLE_POWERUP_REASON_VERSION_V1 1
+
#ifdef __cplusplus
}
#endif
diff --git a/sdk/include/psdk/ntddvol.h b/sdk/include/psdk/ntddvol.h
index 0b14c49af4d..0777b073a13 100644
--- a/sdk/include/psdk/ntddvol.h
+++ b/sdk/include/psdk/ntddvol.h
@@ -74,6 +74,8 @@ extern "C" {
#define IOCTL_VOLUME_QUERY_FAILOVER_SET \
CTL_CODE(IOCTL_VOLUME_BASE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_VOLUME_POST_ONLINE \
+ CTL_CODE(IOCTL_VOLUME_BASE, 25, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
typedef struct _VOLUME_LOGICAL_OFFSET {
LONGLONG LogicalOffset;
@@ -100,32 +102,32 @@ typedef struct _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION {
} VOLUME_GET_GPT_ATTRIBUTES_INFORMATION, *PVOLUME_GET_GPT_ATTRIBUTES_INFORMATION;
typedef struct _VOLUME_SET_GPT_ATTRIBUTES_INFORMATION {
- ULONGLONG GptAttributes;
- BOOLEAN RevertOnClose;
- BOOLEAN ApplyToAllConnectedVolumes;
- USHORT Reserved1;
- ULONG Reserved2;
+ ULONGLONG GptAttributes;
+ BOOLEAN RevertOnClose;
+ BOOLEAN ApplyToAllConnectedVolumes;
+ USHORT Reserved1;
+ ULONG Reserved2;
} VOLUME_SET_GPT_ATTRIBUTES_INFORMATION, *PVOLUME_SET_GPT_ATTRIBUTES_INFORMATION;
typedef struct _DISK_EXTENT {
- ULONG DiskNumber;
- LARGE_INTEGER StartingOffset;
- LARGE_INTEGER ExtentLength;
+ ULONG DiskNumber;
+ LARGE_INTEGER StartingOffset;
+ LARGE_INTEGER ExtentLength;
} DISK_EXTENT, *PDISK_EXTENT;
typedef struct _VOLUME_DISK_EXTENTS {
- ULONG NumberOfDiskExtents;
- DISK_EXTENT Extents[1];
+ ULONG NumberOfDiskExtents;
+ DISK_EXTENT Extents[1];
} VOLUME_DISK_EXTENTS, *PVOLUME_DISK_EXTENTS;
typedef struct _VOLUME_NUMBER {
- ULONG VolumeNumber;
- WCHAR VolumeManagerName[8];
+ ULONG VolumeNumber;
+ WCHAR VolumeManagerName[8];
} VOLUME_NUMBER, *PVOLUME_NUMBER;
typedef struct _VOLUME_FAILOVER_SET {
- ULONG NumberOfDisks;
- ULONG DiskNumbers[1];
+ ULONG NumberOfDisks;
+ ULONG DiskNumbers[1];
} VOLUME_FAILOVER_SET, *PVOLUME_FAILOVER_SET;
#ifdef __cplusplus
diff --git a/sdk/include/psdk/sal.h b/sdk/include/psdk/sal.h
index 2fb7d3a2c8d..6b865345224 100644
--- a/sdk/include/psdk/sal.h
+++ b/sdk/include/psdk/sal.h
@@ -191,7 +191,7 @@
#else
-// Disable expansion of SAL macros in non-Prefast mode to
+// Disable expansion of SAL macros in non-Prefast mode to
// improve compiler throughput.
#ifndef _USE_DECLSPECS_FOR_SAL // [
#define _USE_DECLSPECS_FOR_SAL 0
@@ -436,7 +436,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes,
_SAL_default};
#define _Outptr_result_maybenull_z_ _SAL2_Source_(_Outptr_result_maybenull_z_, (),
_Out_impl_ _Deref_post_opt_z_)
#define _Outptr_opt_result_maybenull_z_ _SAL2_Source_(_Outptr_opt_result_maybenull_z_,
(), _Out_opt_impl_ _Deref_post_opt_z_)
-// Annotations for _Outptr_ parameters where the output pointer is set to NULL if the
function fails.
+// Annotations for _Outptr_ parameters where the output pointer is set to NULL if the
function fails.
#define _Outptr_result_nullonfailure_ _SAL2_Source_(_Outptr_result_nullonfailure_,
(), _Outptr_ _On_failure_(_Deref_post_null_))
#define _Outptr_opt_result_nullonfailure_
_SAL2_Source_(_Outptr_opt_result_nullonfailure_, (), _Outptr_opt_
_On_failure_(_Deref_post_null_))
@@ -787,10 +787,10 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes,
_SAL_default};
with _Out_. The default unit is elements. Use 'bytecap' if the size is given
in bytes
'count' describes the readable size of the buffer and is typically used with
_In_.
The default unit is elements. Use 'bytecount' if the size is given in bytes.
-
+
Argument syntax for cap_, bytecap_, count_, bytecount_:
(<parameter>|return)[+n] e.g. cch, return, cb+2
-
+
If the buffer size is a constant expression use the c_ postfix.
E.g. cap_c_(20), count_c_(MAX_PATH), bytecount_c_(16)
@@ -911,7 +911,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes,
_SAL_default};
#define _Out_z_bytecap_post_bytecount_(cap,count)
_SAL1_1_Source_(_Out_z_bytecap_post_bytecount_, (cap,count), _Pre_bytecap_(cap)
_Post_valid_impl_ _Post_z_bytecount_(count))
#define _Out_opt_z_bytecap_post_bytecount_(cap,count)
_SAL1_1_Source_(_Out_opt_z_bytecap_post_bytecount_, (cap,count), _Pre_opt_bytecap_(cap)
_Post_valid_impl_ _Post_z_bytecount_(count))
-// only use with dereferenced arguments e.g. '*pcch'
+// only use with dereferenced arguments e.g. '*pcch'
#define _Out_capcount_(capcount) _SAL1_1_Source_(_Out_capcount_, (capcount),
_Pre_cap_(capcount) _Post_valid_impl_ _Post_count_(capcount))
#define _Out_opt_capcount_(capcount) _SAL1_1_Source_(_Out_opt_capcount_,
(capcount), _Pre_opt_cap_(capcount) _Post_valid_impl_ _Post_count_(capcount))
#define _Out_bytecapcount_(capcount) _SAL1_1_Source_(_Out_bytecapcount_,
(capcount), _Pre_bytecap_(capcount) _Post_valid_impl_ _Post_bytecount_(capcount))
@@ -1080,7 +1080,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes,
_SAL_default};
#define _Deref_pre_valid_bytecap_x_(size)
_SAL1_1_Source_(_Deref_pre_valid_bytecap_x_, (size),
_Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__bytecap_x_impl(size))
_Pre_valid_impl_)
#define _Deref_pre_opt_valid_bytecap_x_(size)
_SAL1_1_Source_(_Deref_pre_opt_valid_bytecap_x_, (size),
_Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__bytecap_x_impl(size))
_Pre_valid_impl_)
-// e.g. void SaveMatrix( _In_count_(n) _Deref_pre_count_(n) const Elem** matrix, size_t n
);
+// e.g. void SaveMatrix( _In_count_(n) _Deref_pre_count_(n) const Elem** matrix, size_t n
);
// valid buffer extent is described by another parameter
#define _Deref_pre_count_(size) _SAL1_1_Source_(_Deref_pre_count_,
(size), _Deref_pre1_impl_(__notnull_impl_notref) _Deref_pre1_impl_(__count_impl(size))
_Pre_valid_impl_)
#define _Deref_pre_opt_count_(size) _SAL1_1_Source_(_Deref_pre_opt_count_,
(size), _Deref_pre1_impl_(__maybenull_impl_notref) _Deref_pre1_impl_(__count_impl(size))
_Pre_valid_impl_)
@@ -1161,12 +1161,12 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes,
_SAL_default};
#define _Deref_post_opt_valid_cap_(size)
_SAL1_1_Source_(_Deref_post_opt_valid_cap_, (size),
_Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__cap_impl(size))
_Post_valid_impl_)
#define _Deref_post_valid_bytecap_(size)
_SAL1_1_Source_(_Deref_post_valid_bytecap_, (size),
_Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecap_impl(size))
_Post_valid_impl_)
#define _Deref_post_opt_valid_bytecap_(size)
_SAL1_1_Source_(_Deref_post_opt_valid_bytecap_, (size),
_Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecap_impl(size))
_Post_valid_impl_)
-
+
#define _Deref_post_valid_cap_c_(size)
_SAL1_1_Source_(_Deref_post_valid_cap_c_, (size),
_Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__cap_c_impl(size))
_Post_valid_impl_)
#define _Deref_post_opt_valid_cap_c_(size)
_SAL1_1_Source_(_Deref_post_opt_valid_cap_c_, (size),
_Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__cap_c_impl(size))
_Post_valid_impl_)
#define _Deref_post_valid_bytecap_c_(size)
_SAL1_1_Source_(_Deref_post_valid_bytecap_c_, (size),
_Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecap_c_impl(size))
_Post_valid_impl_)
#define _Deref_post_opt_valid_bytecap_c_(size)
_SAL1_1_Source_(_Deref_post_opt_valid_bytecap_c_, (size),
_Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__bytecap_c_impl(size))
_Post_valid_impl_)
-
+
#define _Deref_post_valid_cap_x_(size)
_SAL1_1_Source_(_Deref_post_valid_cap_x_, (size),
_Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__cap_x_impl(size))
_Post_valid_impl_)
#define _Deref_post_opt_valid_cap_x_(size)
_SAL1_1_Source_(_Deref_post_opt_valid_cap_x_, (size),
_Deref_post1_impl_(__maybenull_impl_notref) _Deref_post1_impl_(__cap_x_impl(size))
_Post_valid_impl_)
#define _Deref_post_valid_bytecap_x_(size)
_SAL1_1_Source_(_Deref_post_valid_bytecap_x_, (size),
_Deref_post1_impl_(__notnull_impl_notref) _Deref_post1_impl_(__bytecap_x_impl(size))
_Post_valid_impl_)
@@ -1489,7 +1489,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes,
_SAL_default};
// not required to be a legal standalone annotation, and in the case
// of attribute annotations, usually is not. (In the case of some declspec
// annotations, it might be, but it should not be assumed so.) Those
-// symols will be used in the _PreN..., _PostN... and _RetN... annotations
+// symols will be used in the _PreN..., _PostN... and _RetN... annotations
// to build up more complete annotations.
// A symbol ending in _impl_ is reserved to the implementation as well,
@@ -1603,7 +1603,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes,
_SAL_default};
// Done this way so that they don't appear in the regular compiler's
// namespace.
#define __ANNOTATION(fun) _SA_annotes0(SAL_annotation) void __SA_##fun
-
+
#define __PRIMOP(type, fun) _SA_annotes0(SAL_primop) type __SA_##fun
#define __QUALIFIER(fun) _SA_annotes0(SAL_qualifier) void __SA_##fun;
@@ -1619,9 +1619,9 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes,
_SAL_default};
#define _SA_annotes2(n,pp1,pp2)
#define _SA_annotes3(n,pp1,pp2,pp3)
-#define __ANNOTATION(fun)
-#define __PRIMOP(type, fun)
-#define __QUALIFIER(type, fun)
+#define __ANNOTATION(fun)
+#define __PRIMOP(type, fun)
+#define __QUALIFIER(type, fun)
#endif // ]
@@ -2124,15 +2124,15 @@ typedef struct __F_ __F_;
#define _Pre3_impl_(p1,p2,p3)
#define _Post_impl_
-#define _Post1_impl_(p1)
+#define _Post1_impl_(p1)
#define _Post2_impl_(p1,p2)
#define _Post3_impl_(p1,p2,p3)
-#define _Ret1_impl_(p1)
+#define _Ret1_impl_(p1)
#define _Ret2_impl_(p1,p2)
#define _Ret3_impl_(p1,p2,p3)
-#define _Deref_pre1_impl_(p1)
+#define _Deref_pre1_impl_(p1)
#define _Deref_pre2_impl_(p1,p2)
#define _Deref_pre3_impl_(p1,p2,p3)
@@ -2164,7 +2164,7 @@ typedef struct __F_ __F_;
// This section contains the deprecated annotations
-/*
+/*
-------------------------------------------------------------------------------
Introduction
@@ -2355,7 +2355,7 @@ typedef struct __F_ __F_;
-------------------------------------------------------------------------------
Advanced Annotation Examples
- __success(return != FALSE) LWSTDAPI_(BOOL)
+ __success(return != FALSE) LWSTDAPI_(BOOL)
PathCanonicalizeA(__out_ecount(MAX_PATH) LPSTR pszBuf, LPCSTR pszPath) :
pszBuf is only guaranteed to be NULL-terminated when TRUE is returned.
@@ -2391,8 +2391,8 @@ extern "C" {
*/
/*
- The helper annotations are only understood by the compiler version used by
- various defect detection tools. When the regular compiler is running, they
+ The helper annotations are only understood by the compiler version used by
+ various defect detection tools. When the regular compiler is running, they
are defined into nothing, and do not affect the compiled code.
*/
@@ -2411,7 +2411,7 @@ extern "C" {
__null p
__notnull p
__maybenull p
-
+
Annotates a pointer p. States that pointer p is null. Commonly used
in the negated form __notnull or the possibly null form __maybenull.
*/
@@ -2426,7 +2426,7 @@ extern "C" {
__readonly l
__notreadonly l
__mabyereadonly l
-
+
Annotates a location l. States that location l is not modified after
this point. If the annotation is placed on the precondition state of
a function, the restriction only applies until the postcondition state
@@ -2443,7 +2443,7 @@ extern "C" {
__valid v
__notvalid v
__maybevalid v
-
+
Annotates any value v. States that the value satisfies all properties of
valid values of its type. For example, for a string buffer, valid means
that the buffer pointer is either NULL or points to a NULL-terminated string.
@@ -2455,7 +2455,7 @@ extern "C" {
/*
__readableTo(extent) p
-
+
Annotates a buffer pointer p. If the buffer can be read, extent describes
how much of the buffer is readable. For a reader of the buffer, this is
an explicit permission to read up to that amount, rather than a restriction to
@@ -2465,24 +2465,24 @@ extern "C" {
#define __readableTo(extent) _SA_annotes1(SAL_readableTo, extent)
/*
-
+
__elem_readableTo(size)
-
+
Annotates a buffer pointer p as being readable to size elements.
*/
#define __elem_readableTo(size) _SA_annotes1(SAL_readableTo, elementCount( size ))
-
+
/*
__byte_readableTo(size)
-
+
Annotates a buffer pointer p as being readable to size bytes.
*/
#define __byte_readableTo(size) _SA_annotes1(SAL_readableTo, byteCount(size))
-
+
/*
__writableTo(extent) p
-
+
Annotates a buffer pointer p. If the buffer can be modified, extent
describes how much of the buffer is writable (usually the allocation
size). For a writer of the buffer, this is an explicit permission to
@@ -2492,45 +2492,45 @@ extern "C" {
/*
__elem_writableTo(size)
-
+
Annotates a buffer pointer p as being writable to size elements.
*/
#define __elem_writableTo(size) _SA_annotes1(SAL_writableTo, elementCount( size ))
-
+
/*
__byte_writableTo(size)
-
+
Annotates a buffer pointer p as being writable to size bytes.
*/
#define __byte_writableTo(size) _SA_annotes1(SAL_writableTo, byteCount( size))
/*
__deref p
-
+
Annotates a pointer p. The next annotation applies one dereference down
in the type. If readableTo(p, size) then the next annotation applies to
all elements *(p+i) for which i satisfies the size. If p is a pointer
to a struct, the next annotation applies to all fields of the struct.
*/
#define __deref _Deref_impl_
-
+
/*
__pre __next_annotation
-
+
The next annotation applies in the precondition state
*/
#define __pre _Pre_impl_
-
+
/*
__post __next_annotation
-
+
The next annotation applies in the postcondition state
*/
#define __post _Post_impl_
-
+
/*
__precond(<expr>)
-
+
When <expr> is true, the next annotation applies in the precondition state
(currently not enabled)
*/
@@ -2538,7 +2538,7 @@ extern "C" {
/*
__postcond(<expr>)
-
+
When <expr> is true, the next annotation applies in the postcondition state
(currently not enabled)
*/
@@ -2546,26 +2546,26 @@ extern "C" {
/*
__exceptthat
-
+
Given a set of annotations Q containing __exceptthat maybeP, the effect of
the except clause is to erase any P or notP annotations (explicit or
implied) within Q at the same level of dereferencing that the except
clause appears, and to replace it with maybeP.
-
+
Example 1: __valid __pre_except_maybenull on a pointer p means that the
pointer may be null, and is otherwise valid, thus overriding
the implicit notnull annotation implied by __valid on
pointers.
-
+
Example 2: __valid __deref __pre_except_maybenull on an int **p means
that p is not null (implied by valid), but the elements
- pointed to by p could be null, and are otherwise valid.
+ pointed to by p could be null, and are otherwise valid.
*/
#define __exceptthat __inner_exceptthat
-
+
/*
_refparam
-
+
Added to all out parameter macros to indicate that they are all reference
parameters.
*/
@@ -2573,16 +2573,16 @@ extern "C" {
/*
__inner_*
-
+
Helper macros that directly correspond to certain high-level annotations.
-
+
*/
/*
Macros to classify the entrypoints and indicate their category.
-
+
Pre-defined control point categories include: RPC, LPC, DeviceDriver, UserToKernel,
ISAPI, COM.
-
+
*/
#define __inner_control_entrypoint(category) _SA_annotes2(SAL_entrypoint,
controlEntry, category)
@@ -2651,7 +2651,7 @@ extern "C" {
#endif /* #if !defined(__midl) && defined(_PREFAST_) */ // ]
-/*
+/*
-------------------------------------------------------------------------------
Buffer Annotation Definitions
@@ -2667,6 +2667,10 @@ buffer, use the table in the buffer annotations section.
#define __out _SAL1_Source_(__out, (),
_Out_)
#endif // !PAL_STDCPP_COMPAT
+#define __in_xcount(size)
_SAL1_Source_(__in_xcount, (size), __in _Pre_ __inexpressible_readableTo(size))
+#define __in_xcount_opt(size)
_SAL1_Source_(__in_xcount_opt, (size), __in_xcount(size) __exceptthat __maybenull)
+#define __out_xcount(size)
_SAL1_Source_(__out_xcount, (size), __xcount(size) _Post_ __valid __refparam)
+
#define __ecount(size) _SAL1_Source_(__ecount,
(size), __notnull __elem_writableTo(size))
#define __bcount(size) _SAL1_Source_(__bcount,
(size), __notnull __byte_writableTo(size))
#define __in_ecount(size)
_SAL1_Source_(__in_ecount, (size), _In_reads_(size))
@@ -2880,7 +2884,7 @@ of each annotation, see the advanced annotations section.
#define __data_entrypoint(category) __inner_data_entrypoint(category)
#define __useHeader _Use_decl_anno_impl_
#define __on_failure(annotes) _On_failure_impl_(annotes _SAL_nop_impl_)
-
+
#ifndef __fallthrough // [
__inner_fallthrough_dec
#define __fallthrough __inner_fallthrough
@@ -2890,7 +2894,7 @@ of each annotation, see the advanced annotations section.
#ifdef _PREFAST_ // [
#define __analysis_assume(expr) __assume(expr)
#else // ][
-#define __analysis_assume(expr)
+#define __analysis_assume(expr)
#endif // ]
#endif // ]
@@ -2898,14 +2902,14 @@ of each annotation, see the advanced annotations section.
#ifdef _PREFAST_ // [
#define _Analysis_assume_(expr) __assume(expr)
#else // ][
-#define _Analysis_assume_(expr)
+#define _Analysis_assume_(expr)
#endif // ]
#endif // ]
#define _Analysis_noreturn_ _SAL2_Source_(_Analysis_noreturn_, (),
_SA_annotes0(SAL_terminates))
#ifdef _PREFAST_ // [
-__inline __nothrow
+__inline __nothrow
void __AnalysisAssumeNullterminated(_Post_ __nullterminated void *p);
#define _Analysis_assume_nullterminated_(x) __AnalysisAssumeNullterminated(x)
diff --git a/sdk/include/psdk/specstrings.h b/sdk/include/psdk/specstrings.h
index 071324f7545..33a13e340f1 100644
--- a/sdk/include/psdk/specstrings.h
+++ b/sdk/include/psdk/specstrings.h
@@ -48,6 +48,13 @@
#define __nullnullterminated
#define __in_data_source(src_sym)
#define __kernel_entry
+#define __range(lb,ub)
+#define __in_bound
+#define __out_bound
+#define __in_range(lb,ub)
+#define __out_range(lb,ub)
+#define __deref_in_range(lb,ub)
+#define __deref_out_range(lb,ub)
#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_)
diff --git a/sdk/include/psdk/winapifamily.h b/sdk/include/psdk/winapifamily.h
new file mode 100644
index 00000000000..58bd80220b1
--- /dev/null
+++ b/sdk/include/psdk/winapifamily.h
@@ -0,0 +1,71 @@
+#ifndef _WINAPIFAMILY_H_
+#define _WINAPIFAMILY_H_
+
+#include <winpackagefamily.h>
+
+#define WINAPI_FAMILY_PC_APP 2
+#define WINAPI_FAMILY_PHONE_APP 3
+#define WINAPI_FAMILY_SYSTEM 4
+#define WINAPI_FAMILY_SERVER 5
+#define WINAPI_FAMILY_GAMES 6
+#define WINAPI_FAMILY_DESKTOP_APP 100
+
+#define WINAPI_FAMILY_APP WINAPI_FAMILY_PC_APP
+
+#ifndef WINAPI_FAMILY
+#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
+#endif
+
+#if WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP && \
+ WINAPI_FAMILY != WINAPI_FAMILY_PC_APP && \
+ WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP && \
+ WINAPI_FAMILY != WINAPI_FAMILY_SYSTEM && \
+ WINAPI_FAMILY != WINAPI_FAMILY_GAMES && \
+ WINAPI_FAMILY != WINAPI_FAMILY_SERVER
+#error Unknown WINAPI_FAMILY value?
+#endif
+
+#ifndef WINAPI_PARTITION_DESKTOP
+#define WINAPI_PARTITION_DESKTOP (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_APP
+#define WINAPI_PARTITION_APP \
+ (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP || \
+ WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || \
+ WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_PC_APP
+#define WINAPI_PARTITION_PC_APP \
+ (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP || \
+ WINAPI_FAMILY == WINAPI_FAMILY_PC_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_PHONE_APP
+#define WINAPI_PARTITION_PHONE_APP (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_GAMES
+#define WINAPI_PARTITION_GAMES \
+ (WINAPI_FAMILY == WINAPI_FAMILY_GAMES || \
+ WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_SYSTEM
+#define WINAPI_PARTITION_SYSTEM \
+ (WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM || \
+ WINAPI_FAMILY == WINAPI_FAMILY_SERVER)
+#endif
+
+#define WINAPI_PARTITION_PHONE WINAPI_PARTITION_PHONE_APP
+
+#define WINAPI_FAMILY_PARTITION(Partitions) (Partitions)
+
+#define _WINAPI_DEPRECATED_DECLARATION
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) &&
!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#define APP_DEPRECATED_HRESULT HRESULT _WINAPI_DEPRECATED_DECLARATION
+#endif
+
+#endif // _WINAPIFAMILY_H_
diff --git a/sdk/include/psdk/winpackagefamily.h b/sdk/include/psdk/winpackagefamily.h
new file mode 100644
index 00000000000..5849729bd6f
--- /dev/null
+++ b/sdk/include/psdk/winpackagefamily.h
@@ -0,0 +1,56 @@
+#ifndef _WINPACKAGEFAMILY_H_
+#define _WINPACKAGEFAMILY_H_
+
+#ifndef WINAPI_PARTITION_SERVER
+#define WINAPI_PARTITION_SERVER (WINAPI_FAMILY == WINAPI_FAMILY_SERVER)
+#endif
+
+#undef WINAPI_PARTITION_PKG_WINTRUST
+#undef WINAPI_PARTITION_PKG_WEBSERVICES
+#undef WINAPI_PARTITION_PKG_EVENTLOGSERVICE
+#undef WINAPI_PARTITION_PKG_VHD
+#undef WINAPI_PARTITION_PKG_PERFCOUNTER
+#undef WINAPI_PARTITION_PKG_SECURESTARTUP
+#undef WINAPI_PARTITION_PKG_REMOTEFS
+#undef WINAPI_PARTITION_PKG_BOOTABLESKU
+#undef WINAPI_PARTITION_PKG_CMDTOOLS
+#undef WINAPI_PARTITION_PKG_DISM
+#undef WINAPI_PARTITION_PKG_CORESETUP
+#undef WINAPI_PARTITION_PKG_APPRUNTIME
+#undef WINAPI_PARTITION_PKG_ESENT
+#undef WINAPI_PARTITION_PKG_WINMGMT
+#undef WINAPI_PARTITION_PKG_WNV
+#undef WINAPI_PARTITION_PKG_CLUSTER
+#undef WINAPI_PARTITION_PKG_VSS
+#undef WINAPI_PARTITION_PKG_TRAFFIC
+#undef WINAPI_PARTITION_PKG_ISCSI
+#undef WINAPI_PARTITION_PKG_STORAGE
+#undef WINAPI_PARTITION_PKG_MPSSVC
+#undef WINAPI_PARTITION_PKG_APPXDEPLOYMENT
+#undef WINAPI_PARTITION_PKG_WER
+
+#define WINAPI_PARTITION_PKG_WINTRUST (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_WEBSERVICES (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_EVENTLOGSERVICE (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_VHD (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_PERFCOUNTER (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_SECURESTARTUP (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_REMOTEFS (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_BOOTABLESKU (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_CMDTOOLS (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_DISM (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_CORESETUP (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_APPRUNTIME (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_ESENT (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_WINMGMT (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_WNV (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_CLUSTER (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_VSS (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_TRAFFIC (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_ISCSI (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_STORAGE (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_MPSSVC (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_APPXDEPLOYMENT (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_WER (WINAPI_PARTITION_SERVER == 1)
+
+#endif // _WINPACKAGEFAMILY_H_