Author: akhaldi
Date: Mon Jan 23 16:07:08 2012
New Revision: 55116
URL:
http://svn.reactos.org/svn/reactos?rev=55116&view=rev
Log:
[DDK]
* Update usbbusif.h, usbdlib.h and usbscan.h annotations.
Modified:
trunk/reactos/include/ddk/usbbusif.h
trunk/reactos/include/ddk/usbdlib.h
trunk/reactos/include/ddk/usbscan.h
Modified: trunk/reactos/include/ddk/usbbusif.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/usbbusif.h?rev…
==============================================================================
--- trunk/reactos/include/ddk/usbbusif.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/usbbusif.h [iso-8859-1] Mon Jan 23 16:07:08 2012
@@ -12,31 +12,33 @@
typedef PVOID PUSB_DEVICE_HANDLE;
#endif
+_Must_inspect_result_
typedef NTSTATUS
(USB_BUSIFFN *PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB) (
- IN PVOID,
- IN PURB);
+ _In_ PVOID,
+ _In_ PURB);
#define USB_HCD_CAPS_SUPPORTS_RT_THREADS 0x00000001
typedef VOID
(USB_BUSIFFN *PUSB_BUSIFFN_GETUSBDI_VERSION) (
- IN PVOID,
- OUT PUSBD_VERSION_INFORMATION OPTIONAL,
- OUT PULONG OPTIONAL);
-
+ _In_ PVOID,
+ _Out_opt_ PUSBD_VERSION_INFORMATION,
+ _Out_opt_ PULONG);
+
+_Must_inspect_result_
typedef NTSTATUS
(USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_TIME) (
- IN PVOID,
- OUT PULONG OPTIONAL);
+ _In_ PVOID,
+ _Out_opt_ PULONG);
typedef NTSTATUS
(USB_BUSIFFN *PUSB_BUSIFFN_ENUM_LOG_ENTRY) (
- IN PVOID,
- IN ULONG,
- IN ULONG,
- IN ULONG,
- IN ULONG);
+ _In_ PVOID,
+ _In_ ULONG,
+ _In_ ULONG,
+ _In_ ULONG,
+ _In_ ULONG);
typedef struct _USB_BUS_INFORMATION_LEVEL_0 {
ULONG TotalBandwidth;
@@ -50,17 +52,19 @@
WCHAR ControllerNameUnicodeString[1];
} USB_BUS_INFORMATION_LEVEL_1, *PUSB_BUS_INFORMATION_LEVEL_1;
+_Must_inspect_result_
typedef NTSTATUS
(USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_INFORMATION) (
- IN PVOID,
- IN ULONG,
- IN OUT PVOID,
- OUT PULONG,
- OUT PULONG OPTIONAL);
-
+ _In_ PVOID,
+ _In_ ULONG,
+ _Inout_ PVOID,
+ _Out_ PULONG,
+ _Out_opt_ PULONG);
+
+_Must_inspect_result_
typedef BOOLEAN
(USB_BUSIFFN *PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED) (
- IN PVOID OPTIONAL);
+ _In_opt_ PVOID);
#define USB_BUSIF_USBDI_VERSION_0 0x0000
#define USB_BUSIF_USBDI_VERSION_1 0x0001
@@ -113,21 +117,23 @@
#if (NTDDI_VERSION >= NTDDI_VISTA)
+_Must_inspect_result_
typedef NTSTATUS
(USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_TIME_EX) (
- IN PVOID OPTIONAL,
- OUT PULONG OPTIONAL);
-
+ _In_opt_ PVOID,
+ _Out_opt_ PULONG);
+
+_Must_inspect_result_
typedef NTSTATUS
(USB_BUSIFFN *PUSB_BUSIFFN_QUERY_CONTROLLER_TYPE) (
- IN PVOID OPTIONAL,
- OUT PULONG OPTIONAL,
- OUT PUSHORT OPTIONAL,
- OUT PUSHORT OPTIONAL,
- OUT PUCHAR OPTIONAL,
- OUT PUCHAR OPTIONAL,
- OUT PUCHAR OPTIONAL,
- OUT PUCHAR OPTIONAL);
+ _In_opt_ PVOID,
+ _Out_opt_ PULONG,
+ _Out_opt_ PUSHORT,
+ _Out_opt_ PUSHORT,
+ _Out_opt_ PUCHAR,
+ _Out_opt_ PUCHAR,
+ _Out_opt_ PUCHAR,
+ _Out_opt_ PUCHAR);
typedef struct _USB_BUS_INTERFACE_USBDI_V3 {
USHORT Size;
@@ -161,25 +167,26 @@
PVOID Reserved;
} USBC_FUNCTION_DESCRIPTOR, *PUSBC_FUNCTION_DESCRIPTOR;
-typedef
-NTSTATUS
+_Must_inspect_result_
+typedef NTSTATUS
(USB_BUSIFFN *USBC_START_DEVICE_CALLBACK)(
- IN PUSB_DEVICE_DESCRIPTOR DeviceDescriptor,
- IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
- OUT PUSBC_FUNCTION_DESCRIPTOR *FunctionDescriptorBuffer,
- OUT PULONG FunctionDescriptorBufferLength,
- IN PDEVICE_OBJECT FdoDeviceObject,
- IN PDEVICE_OBJECT PdoDeviceObject);
-
-typedef
-BOOLEAN
+ _In_ PUSB_DEVICE_DESCRIPTOR DeviceDescriptor,
+ _In_ PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
+ _Outptr_result_bytebuffer_maybenull_(*FunctionDescriptorBufferLength)
+ PUSBC_FUNCTION_DESCRIPTOR *FunctionDescriptorBuffer,
+ _Out_ PULONG FunctionDescriptorBufferLength,
+ _In_ PDEVICE_OBJECT FdoDeviceObject,
+ _In_ PDEVICE_OBJECT PdoDeviceObject);
+
+_Must_inspect_result_
+typedef BOOLEAN
(USB_BUSIFFN *USBC_PDO_ENABLE_CALLBACK)(
- IN PVOID Context,
- IN USHORT FirstInterfaceNumber,
- IN USHORT NumberOfInterfaces,
- IN UCHAR FunctionClass,
- IN UCHAR FunctionSubClass,
- IN UCHAR FunctionProtocol);
+ _In_ PVOID Context,
+ _In_ USHORT FirstInterfaceNumber,
+ _In_ USHORT NumberOfInterfaces,
+ _In_ UCHAR FunctionClass,
+ _In_ UCHAR FunctionSubClass,
+ _In_ UCHAR FunctionProtocol);
#define USBC_DEVICE_CONFIGURATION_INTERFACE_VERSION_1 0x0001
@@ -190,7 +197,7 @@
PINTERFACE_REFERENCE InterfaceReference;
PINTERFACE_DEREFERENCE InterfaceDereference;
USBC_START_DEVICE_CALLBACK StartDeviceCallback;
- USBC_PDO_ENABLE_CALLBACK PdoEnableCallback;
+ USBC_PDO_ENABLE_CALLBACK PdoEnableCallback;
PVOID Reserved[7];
} USBC_DEVICE_CONFIGURATION_INTERFACE_V1, *PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1;
Modified: trunk/reactos/include/ddk/usbdlib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/usbdlib.h?rev=…
==============================================================================
--- trunk/reactos/include/ddk/usbdlib.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/usbdlib.h [iso-8859-1] Mon Jan 23 16:07:08 2012
@@ -114,109 +114,118 @@
#ifndef _USBD_
+_IRQL_requires_max_(DISPATCH_LEVEL)
DECLSPEC_IMPORT
VOID
NTAPI
USBD_GetUSBDIVersion(
- OUT PUSBD_VERSION_INFORMATION VersionInformation);
+ _Out_ PUSBD_VERSION_INFORMATION VersionInformation);
DECLSPEC_IMPORT
PUSB_INTERFACE_DESCRIPTOR
NTAPI
USBD_ParseConfigurationDescriptor(
- IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
- IN UCHAR InterfaceNumber,
- IN UCHAR AlternateSetting);
+ _In_ PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
+ _In_ UCHAR InterfaceNumber,
+ _In_ UCHAR AlternateSetting);
DECLSPEC_IMPORT
PURB
NTAPI
USBD_CreateConfigurationRequest(
- IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
- OUT PUSHORT Siz);
-
+ _In_ PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
+ _Out_ PUSHORT Siz);
+
+_IRQL_requires_max_(APC_LEVEL)
DECLSPEC_IMPORT
PUSB_COMMON_DESCRIPTOR
NTAPI
USBD_ParseDescriptors(
- IN PVOID DescriptorBuffer,
- IN ULONG TotalLength,
- IN PVOID StartPosition,
- IN LONG DescriptorType);
-
+ _In_ PVOID DescriptorBuffer,
+ _In_ ULONG TotalLength,
+ _In_ PVOID StartPosition,
+ _In_ LONG DescriptorType);
+
+_IRQL_requires_max_(APC_LEVEL)
DECLSPEC_IMPORT
PUSB_INTERFACE_DESCRIPTOR
NTAPI
USBD_ParseConfigurationDescriptorEx(
- IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
- IN PVOID StartPosition,
- IN LONG InterfaceNumber,
- IN LONG AlternateSetting,
- IN LONG InterfaceClass,
- IN LONG InterfaceSubClass,
- IN LONG InterfaceProtocol);
-
+ _In_ PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
+ _In_ PVOID StartPosition,
+ _In_ LONG InterfaceNumber,
+ _In_ LONG AlternateSetting,
+ _In_ LONG InterfaceClass,
+ _In_ LONG InterfaceSubClass,
+ _In_ LONG InterfaceProtocol);
+
+_IRQL_requires_max_(DISPATCH_LEVEL)
DECLSPEC_IMPORT
PURB
NTAPI
USBD_CreateConfigurationRequestEx(
- IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
- IN PUSBD_INTERFACE_LIST_ENTRY InterfaceList);
-
+ _In_ PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
+ _In_ PUSBD_INTERFACE_LIST_ENTRY InterfaceList);
+
+_IRQL_requires_max_(PASSIVE_LEVEL)
DECLSPEC_EXPORT
ULONG
NTAPI
USBD_GetInterfaceLength(
- IN PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor,
- IN PUCHAR BufferEnd);
-
+ _In_ PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor,
+ _In_ PUCHAR BufferEnd);
+
+_IRQL_requires_max_(PASSIVE_LEVEL)
DECLSPEC_EXPORT
VOID
NTAPI
USBD_RegisterHcFilter(
- IN PDEVICE_OBJECT DeviceObject,
- IN PDEVICE_OBJECT FilterDeviceObject);
-
+ _In_ PDEVICE_OBJECT DeviceObject,
+ _In_ PDEVICE_OBJECT FilterDeviceObject);
+
+_IRQL_requires_max_(APC_LEVEL)
DECLSPEC_EXPORT
NTSTATUS
NTAPI
USBD_GetPdoRegistryParameter(
- IN PDEVICE_OBJECT PhysicalDeviceObject,
- IN OUT PVOID Parameter,
- IN ULONG ParameterLength,
- IN PWSTR KeyName,
- IN ULONG KeyNameLength);
+ _In_ PDEVICE_OBJECT PhysicalDeviceObject,
+ _Inout_updates_bytes_(ParameterLength) PVOID Parameter,
+ _In_ ULONG ParameterLength,
+ _In_reads_bytes_(KeyNameLength) PWSTR KeyName,
+ _In_ ULONG KeyNameLength);
DECLSPEC_EXPORT
NTSTATUS
NTAPI
USBD_QueryBusTime(
- IN PDEVICE_OBJECT RootHubPdo,
- OUT PULONG CurrentFrame);
+ _In_ PDEVICE_OBJECT RootHubPdo,
+ _Out_ PULONG CurrentFrame);
#if (NTDDI_VERSION >= NTDDI_WINXP)
+_IRQL_requires_max_(DISPATCH_LEVEL)
DECLSPEC_IMPORT
ULONG
NTAPI
USBD_CalculateUsbBandwidth(
- IN ULONG MaxPacketSize,
- IN UCHAR EndpointType,
- IN BOOLEAN LowSpeed);
+ _In_ ULONG MaxPacketSize,
+ _In_ UCHAR EndpointType,
+ _In_ BOOLEAN LowSpeed);
#endif
#if (NTDDI_VERSION >= NTDDI_VISTA)
+_IRQL_requires_max_(DISPATCH_LEVEL)
DECLSPEC_IMPORT
USBD_STATUS
NTAPI
USBD_ValidateConfigurationDescriptor(
- IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc,
- IN ULONG BufferLength,
- IN USHORT Level,
- OUT PUCHAR *Offset,
- IN ULONG Tag OPTIONAL);
+ _In_reads_bytes_(BufferLength) PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc,
+ _In_ ULONG BufferLength,
+ _In_ USHORT Level,
+ _Out_ PUCHAR *Offset,
+ _In_opt_ ULONG Tag);
#endif
Modified: trunk/reactos/include/ddk/usbscan.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/usbscan.h?rev=…
==============================================================================
--- trunk/reactos/include/ddk/usbscan.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/usbscan.h [iso-8859-1] Mon Jan 23 16:07:08 2012
@@ -37,32 +37,32 @@
#define BULKIN_FLAG 0x80
typedef struct _DRV_VERSION {
- OUT ULONG major;
- OUT ULONG minor;
- OUT ULONG internal;
+ _Out_ ULONG major;
+ _Out_ ULONG minor;
+ _Out_ ULONG internal;
} DRV_VERSION, *PDRV_VERSION;
typedef struct _IO_BLOCK {
- IN ULONG uOffset;
- IN ULONG uLength;
- IN OUT PUCHAR pbyData;
- IN ULONG uIndex;
+ _In_ ULONG uOffset;
+ _In_ ULONG uLength;
+ _Inout_updates_bytes_(uLength) PUCHAR pbyData;
+ _In_ ULONG uIndex;
} IO_BLOCK, *PIO_BLOCK;
typedef struct _IO_BLOCK_EX {
- IN ULONG uOffset;
- IN ULONG uLength;
- IN OUT PUCHAR pbyData;
- IN ULONG uIndex;
- IN UCHAR bRequest;
- IN UCHAR bmRequestType;
- IN UCHAR fTransferDirectionIn;
+ _In_ ULONG uOffset;
+ _In_ ULONG uLength;
+ _Inout_updates_bytes_(uLength) PUCHAR pbyData;
+ _In_ ULONG uIndex;
+ _In_ UCHAR bRequest;
+ _In_ UCHAR bmRequestType;
+ _In_ UCHAR fTransferDirectionIn;
} IO_BLOCK_EX, *PIO_BLOCK_EX;
typedef struct _CHANNEL_INFO {
- OUT ULONG EventChannelSize;
- OUT ULONG uReadDataAlignment;
- OUT ULONG uWriteDataAlignment;
+ _Out_ ULONG EventChannelSize;
+ _Out_ ULONG uReadDataAlignment;
+ _Out_ ULONG uWriteDataAlignment;
}CHANNEL_INFO, *PCHANNEL_INFO;
typedef enum _PIPE_TYPE {
@@ -73,16 +73,16 @@
} PIPE_TYPE;
typedef struct _USBSCAN_GET_DESCRIPTOR {
- IN UCHAR DescriptorType;
- IN UCHAR Index;
- IN USHORT LanguageId;
+ _In_ UCHAR DescriptorType;
+ _In_ UCHAR Index;
+ _In_ USHORT LanguageId;
} USBSCAN_GET_DESCRIPTOR, *PUSBSCAN_GET_DESCRIPTOR;
typedef struct _DEVICE_DESCRIPTOR {
- OUT USHORT usVendorId;
- OUT USHORT usProductId;
- OUT USHORT usBcdDevice;
- OUT USHORT usLanguageId;
+ _Out_ USHORT usVendorId;
+ _Out_ USHORT usProductId;
+ _Out_ USHORT usBcdDevice;
+ _Out_ USHORT usLanguageId;
} DEVICE_DESCRIPTOR, *PDEVICE_DESCRIPTOR;
typedef enum _RAW_PIPE_TYPE {
@@ -100,8 +100,8 @@
} USBSCAN_PIPE_INFORMATION, *PUSBSCAN_PIPE_INFORMATION;
typedef struct _USBSCAN_PIPE_CONFIGURATION {
- OUT ULONG NumberOfPipes;
- OUT USBSCAN_PIPE_INFORMATION PipeInfo[MAX_NUM_PIPES];
+ _Out_ ULONG NumberOfPipes;
+ _Out_writes_(NumberOfPipes) USBSCAN_PIPE_INFORMATION PipeInfo[MAX_NUM_PIPES];
} USBSCAN_PIPE_CONFIGURATION, *PUSBSCAN_PIPE_CONFIGURATION;
#if (NTDDI_VERSION >= NTDDI_WINXP)