StephaneLenclud@50: // StephaneLenclud@50: // SL: We use this file to generate P/Invoke using P/Invoke Interop Assistant. StephaneLenclud@50: // StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: typedef USHORT USAGE, *PUSAGE; StephaneLenclud@50: typedef LONG NTSTATUS; StephaneLenclud@50: StephaneLenclud@50: #define HIDP_LINK_COLLECTION_ROOT ((USHORT) -1) StephaneLenclud@50: #define HIDP_LINK_COLLECTION_UNSPECIFIED ((USHORT) 0) StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: typedef enum _HIDP_REPORT_TYPE StephaneLenclud@50: { StephaneLenclud@50: HidP_Input, StephaneLenclud@50: HidP_Output, StephaneLenclud@50: HidP_Feature StephaneLenclud@50: } HIDP_REPORT_TYPE; StephaneLenclud@50: StephaneLenclud@50: typedef struct _USAGE_AND_PAGE StephaneLenclud@50: { StephaneLenclud@50: USAGE Usage; StephaneLenclud@50: USAGE UsagePage; StephaneLenclud@50: } USAGE_AND_PAGE, *PUSAGE_AND_PAGE; StephaneLenclud@50: StephaneLenclud@50: #define HidP_IsSameUsageAndPage(u1, u2) ((* (PULONG) &u1) == (* (PULONG) &u2)) StephaneLenclud@50: StephaneLenclud@50: typedef struct _HIDP_BUTTON_CAPS StephaneLenclud@50: { StephaneLenclud@50: USAGE UsagePage; StephaneLenclud@50: UCHAR ReportID; StephaneLenclud@50: BOOLEAN IsAlias; StephaneLenclud@50: StephaneLenclud@50: USHORT BitField; StephaneLenclud@50: USHORT LinkCollection; // A unique internal index pointer StephaneLenclud@50: StephaneLenclud@50: USAGE LinkUsage; StephaneLenclud@50: USAGE LinkUsagePage; StephaneLenclud@50: StephaneLenclud@50: BOOLEAN IsRange; StephaneLenclud@50: BOOLEAN IsStringRange; StephaneLenclud@50: BOOLEAN IsDesignatorRange; StephaneLenclud@50: BOOLEAN IsAbsolute; StephaneLenclud@50: StephaneLenclud@50: ULONG Reserved[10]; StephaneLenclud@50: union { StephaneLenclud@50: struct { StephaneLenclud@50: USAGE UsageMin, UsageMax; StephaneLenclud@50: USHORT StringMin, StringMax; StephaneLenclud@50: USHORT DesignatorMin, DesignatorMax; StephaneLenclud@50: USHORT DataIndexMin, DataIndexMax; StephaneLenclud@50: } Range; StephaneLenclud@50: struct { StephaneLenclud@50: USAGE Usage, Reserved1; StephaneLenclud@50: USHORT StringIndex, Reserved2; StephaneLenclud@50: USHORT DesignatorIndex, Reserved3; StephaneLenclud@50: USHORT DataIndex, Reserved4; StephaneLenclud@50: } NotRange; StephaneLenclud@50: }; StephaneLenclud@50: StephaneLenclud@50: } HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS; StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: typedef struct _HIDP_VALUE_CAPS StephaneLenclud@50: { StephaneLenclud@50: USAGE UsagePage; StephaneLenclud@50: UCHAR ReportID; StephaneLenclud@50: BOOLEAN IsAlias; StephaneLenclud@50: StephaneLenclud@50: USHORT BitField; StephaneLenclud@50: USHORT LinkCollection; // A unique internal index pointer StephaneLenclud@50: StephaneLenclud@50: USAGE LinkUsage; StephaneLenclud@50: USAGE LinkUsagePage; StephaneLenclud@50: StephaneLenclud@50: BOOLEAN IsRange; StephaneLenclud@50: BOOLEAN IsStringRange; StephaneLenclud@50: BOOLEAN IsDesignatorRange; StephaneLenclud@50: BOOLEAN IsAbsolute; StephaneLenclud@50: StephaneLenclud@50: BOOLEAN HasNull; // Does this channel have a null report union StephaneLenclud@50: UCHAR Reserved; StephaneLenclud@50: USHORT BitSize; // How many bits are devoted to this value? StephaneLenclud@50: StephaneLenclud@50: USHORT ReportCount; // See Note below. Usually set to 1. StephaneLenclud@50: USHORT Reserved2[5]; StephaneLenclud@50: StephaneLenclud@50: ULONG UnitsExp; StephaneLenclud@50: ULONG Units; StephaneLenclud@50: StephaneLenclud@50: LONG LogicalMin, LogicalMax; StephaneLenclud@50: LONG PhysicalMin, PhysicalMax; StephaneLenclud@50: StephaneLenclud@50: union { StephaneLenclud@50: struct { StephaneLenclud@50: USAGE UsageMin, UsageMax; StephaneLenclud@50: USHORT StringMin, StringMax; StephaneLenclud@50: USHORT DesignatorMin, DesignatorMax; StephaneLenclud@50: USHORT DataIndexMin, DataIndexMax; StephaneLenclud@50: } Range; StephaneLenclud@50: StephaneLenclud@50: struct { StephaneLenclud@50: USAGE Usage, Reserved1; StephaneLenclud@50: USHORT StringIndex, Reserved2; StephaneLenclud@50: USHORT DesignatorIndex, Reserved3; StephaneLenclud@50: USHORT DataIndex, Reserved4; StephaneLenclud@50: } NotRange; StephaneLenclud@50: }; StephaneLenclud@50: } HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS; StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // Notes: StephaneLenclud@50: // StephaneLenclud@50: // ReportCount: When a report descriptor declares an Input, Output, or StephaneLenclud@50: // Feature main item with fewer usage declarations than the report count, then StephaneLenclud@50: // the last usage applies to all remaining unspecified count in that main item. StephaneLenclud@50: // (As an example you might have data that required many fields to describe, StephaneLenclud@50: // possibly buffered bytes.) In this case, only one value cap structure is StephaneLenclud@50: // allocated for these associtated fields, all with the same usage, and Report StephaneLenclud@50: // Count reflects the number of fields involved. Normally ReportCount is 1. StephaneLenclud@50: // To access all of the fields in such a value structure would require using StephaneLenclud@50: // HidP_GetUsageValueArray and HidP_SetUsageValueArray. HidP_GetUsageValue/ StephaneLenclud@50: // HidP_SetScaledUsageValue will also work, however, these functions will only StephaneLenclud@50: // work with the first field of the structure. StephaneLenclud@50: // StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // The link collection tree consists of an array of LINK_COLLECTION_NODES StephaneLenclud@50: // where the index into this array is the same as the collection number. StephaneLenclud@50: // StephaneLenclud@50: // Given a collection A which contains a subcollection B, A is defined to be StephaneLenclud@50: // the parent B, and B is defined to be the child. StephaneLenclud@50: // StephaneLenclud@50: // Given collections A, B, and C where B and C are children of A, and B was StephaneLenclud@50: // encountered before C in the report descriptor, B is defined as a sibling of StephaneLenclud@50: // C. (This implies, of course, that if B is a sibling of C, then C is NOT a StephaneLenclud@50: // sibling of B). StephaneLenclud@50: // StephaneLenclud@50: // B is defined as the NextSibling of C if and only if there exists NO StephaneLenclud@50: // child collection of A, call it D, such that B is a sibling of D and D StephaneLenclud@50: // is a sibling of C. StephaneLenclud@50: // StephaneLenclud@50: // E is defined to be the FirstChild of A if and only if for all children of A, StephaneLenclud@50: // F, that are not equivalent to E, F is a sibling of E. StephaneLenclud@50: // (This implies, of course, that the does not exist a child of A, call it G, StephaneLenclud@50: // where E is a sibling of G). In other words the first sibling is the last StephaneLenclud@50: // link collection found in the list. StephaneLenclud@50: // StephaneLenclud@50: // In other words, if a collection B is defined within the definition of another StephaneLenclud@50: // collection A, B becomes a child of A. All collections with the same parent StephaneLenclud@50: // are considered siblings. The FirstChild of the parent collection, A, will be StephaneLenclud@50: // last collection defined that has A as a parent. The order of sibling pointers StephaneLenclud@50: // is similarly determined. When a collection B is defined, it becomes the StephaneLenclud@50: // FirstChild of it's parent collection. The previously defined FirstChild of the StephaneLenclud@50: // parent collection becomes the NextSibling of the new collection. As new StephaneLenclud@50: // collections with the same parent are discovered, the chain of sibling is built. StephaneLenclud@50: // StephaneLenclud@50: // With that in mind, the following describes conclusively a data structure StephaneLenclud@50: // that provides direct traversal up, down, and accross the link collection StephaneLenclud@50: // tree. StephaneLenclud@50: // StephaneLenclud@50: // StephaneLenclud@50: typedef struct _HIDP_LINK_COLLECTION_NODE StephaneLenclud@50: { StephaneLenclud@50: USAGE LinkUsage; StephaneLenclud@50: USAGE LinkUsagePage; StephaneLenclud@50: USHORT Parent; StephaneLenclud@50: USHORT NumberOfChildren; StephaneLenclud@50: USHORT NextSibling; StephaneLenclud@50: USHORT FirstChild; StephaneLenclud@50: ULONG CollectionType: 8; // As defined in 6.2.2.6 of HID spec StephaneLenclud@50: ULONG IsAlias : 1; // This link node is an allias of the next link node. StephaneLenclud@50: ULONG Reserved: 23; StephaneLenclud@50: PVOID UserContext; // The user can hang his coat here. StephaneLenclud@50: } HIDP_LINK_COLLECTION_NODE, *PHIDP_LINK_COLLECTION_NODE; StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // When a link collection is described by a delimiter, alias link collection StephaneLenclud@50: // nodes are created. (One for each usage within the delimiter). StephaneLenclud@50: // The parser assigns each capability description listed above only one StephaneLenclud@50: // link collection. StephaneLenclud@50: // StephaneLenclud@50: // If a control is defined within a collection defined by StephaneLenclud@50: // delimited usages, then that control is said to be within multiple link StephaneLenclud@50: // collections, one for each usage within the open and close delimiter tokens. StephaneLenclud@50: // Such multiple link collecions are said to be aliases. The first N-1 such StephaneLenclud@50: // collections, listed in the link collection node array, have their IsAlias StephaneLenclud@50: // bit set. The last such link collection is the link collection index used StephaneLenclud@50: // in the capabilities described above. StephaneLenclud@50: // Clients wishing to set a control in an aliased collection, should walk the StephaneLenclud@50: // collection array once for each time they see the IsAlias flag set, and use StephaneLenclud@50: // the last link collection as the index for the below accessor functions. StephaneLenclud@50: // StephaneLenclud@50: // NB: if IsAlias is set, then NextSibling should be one more than the current StephaneLenclud@50: // link collection node index. StephaneLenclud@50: // StephaneLenclud@50: StephaneLenclud@50: typedef PUCHAR PHIDP_REPORT_DESCRIPTOR; StephaneLenclud@50: typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA; StephaneLenclud@50: StephaneLenclud@50: typedef struct _HIDP_CAPS StephaneLenclud@50: { StephaneLenclud@50: USAGE Usage; StephaneLenclud@50: USAGE UsagePage; StephaneLenclud@50: USHORT InputReportByteLength; StephaneLenclud@50: USHORT OutputReportByteLength; StephaneLenclud@50: USHORT FeatureReportByteLength; StephaneLenclud@50: USHORT Reserved[17]; StephaneLenclud@50: StephaneLenclud@50: USHORT NumberLinkCollectionNodes; StephaneLenclud@50: StephaneLenclud@50: USHORT NumberInputButtonCaps; StephaneLenclud@50: USHORT NumberInputValueCaps; StephaneLenclud@50: USHORT NumberInputDataIndices; StephaneLenclud@50: StephaneLenclud@50: USHORT NumberOutputButtonCaps; StephaneLenclud@50: USHORT NumberOutputValueCaps; StephaneLenclud@50: USHORT NumberOutputDataIndices; StephaneLenclud@50: StephaneLenclud@50: USHORT NumberFeatureButtonCaps; StephaneLenclud@50: USHORT NumberFeatureValueCaps; StephaneLenclud@50: USHORT NumberFeatureDataIndices; StephaneLenclud@50: } HIDP_CAPS, *PHIDP_CAPS; StephaneLenclud@50: StephaneLenclud@50: typedef struct _HIDP_DATA StephaneLenclud@50: { StephaneLenclud@50: USHORT DataIndex; StephaneLenclud@50: USHORT Reserved; StephaneLenclud@50: union { StephaneLenclud@50: ULONG RawValue; // for values StephaneLenclud@50: BOOLEAN On; // for buttons MUST BE TRUE for buttons. StephaneLenclud@50: }; StephaneLenclud@50: } HIDP_DATA, *PHIDP_DATA; StephaneLenclud@50: // StephaneLenclud@50: // The HIDP_DATA structure is used with HidP_GetData and HidP_SetData StephaneLenclud@50: // functions. StephaneLenclud@50: // StephaneLenclud@50: // The parser contiguously assigns every control (button or value) in a hid StephaneLenclud@50: // device a unique data index from zero to NumberXXXDataIndices -1 , inclusive. StephaneLenclud@50: // This value is found in the HIDP_BUTTON_CAPS and HIDP_VALUE_CAPS structures. StephaneLenclud@50: // StephaneLenclud@50: // Most clients will find the Get/Set Buttons / Value accessor functions StephaneLenclud@50: // sufficient to their needs, as they will allow the clients to access the StephaneLenclud@50: // data known to them while ignoring the other controls. StephaneLenclud@50: // StephaneLenclud@50: // More complex clients, which actually read the Button / Value Caps, and which StephaneLenclud@50: // do a value add service to these routines (EG Direct Input), will need to StephaneLenclud@50: // access all the data in the device without interest in the individual usage StephaneLenclud@50: // or link collection location. These are the clients that will find StephaneLenclud@50: // HidP_Data useful. StephaneLenclud@50: // StephaneLenclud@50: StephaneLenclud@50: typedef struct _HIDP_UNKNOWN_TOKEN StephaneLenclud@50: { StephaneLenclud@50: UCHAR Token; StephaneLenclud@50: UCHAR Reserved[3]; StephaneLenclud@50: ULONG BitField; StephaneLenclud@50: } HIDP_UNKNOWN_TOKEN, *PHIDP_UNKNOWN_TOKEN; StephaneLenclud@50: StephaneLenclud@50: typedef struct _HIDP_EXTENDED_ATTRIBUTES StephaneLenclud@50: { StephaneLenclud@50: UCHAR NumGlobalUnknowns; StephaneLenclud@50: UCHAR Reserved [3]; StephaneLenclud@50: PHIDP_UNKNOWN_TOKEN GlobalUnknowns; StephaneLenclud@50: // ... Additional attributes StephaneLenclud@50: ULONG Data [1]; // variableLength DO NOT ACCESS THIS FIELD StephaneLenclud@50: } HIDP_EXTENDED_ATTRIBUTES, *PHIDP_EXTENDED_ATTRIBUTES; StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetCaps ( StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: PHIDP_CAPS Capabilities StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Returns a list of capabilities of a given hid device as described by its StephaneLenclud@50: preparsed data. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: PreparsedData The preparsed data returned from HIDCLASS. StephaneLenclud@50: Capabilities a HIDP_CAPS structure StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: HIDP_STATUS_SUCCESS StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetLinkCollectionNodes ( StephaneLenclud@50: PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, StephaneLenclud@50: PULONG LinkCollectionNodesLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Return a list of PHIDP_LINK_COLLECTION_NODEs used to describe the link StephaneLenclud@50: collection tree of this hid device. See the above description of StephaneLenclud@50: struct _HIDP_LINK_COLLECTION_NODE. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: LinkCollectionNodes - a caller allocated array into which StephaneLenclud@50: HidP_GetLinkCollectionNodes will store the information StephaneLenclud@50: StephaneLenclud@50: LinKCollectionNodesLength - the caller sets this value to the length of the StephaneLenclud@50: the array in terms of number of elements. StephaneLenclud@50: HidP_GetLinkCollectionNodes sets this value to the actual StephaneLenclud@50: number of elements set. The total number of nodes required to StephaneLenclud@50: describe this HID device can be found in the StephaneLenclud@50: NumberLinkCollectionNodes field in the HIDP_CAPS structure. StephaneLenclud@50: StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetSpecificButtonCaps ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, // Optional (0 => ignore) StephaneLenclud@50: USHORT LinkCollection, // Optional (0 => ignore) StephaneLenclud@50: USAGE Usage, // Optional (0 => ignore) StephaneLenclud@50: PHIDP_BUTTON_CAPS ButtonCaps, StephaneLenclud@50: PUSHORT ButtonCapsLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Description: StephaneLenclud@50: HidP_GetButtonCaps returns all the buttons (binary values) that are a part StephaneLenclud@50: of the given report type for the Hid device represented by the given StephaneLenclud@50: preparsed data. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output, or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage A usage page value used to limit the button caps returned to StephaneLenclud@50: those on a given usage page. If set to 0, this parameter is StephaneLenclud@50: ignored. Can be used with LinkCollection and Usage parameters StephaneLenclud@50: to further limit the number of button caps structures returned. StephaneLenclud@50: StephaneLenclud@50: LinkCollection HIDP_LINK_COLLECTION node array index used to limit the StephaneLenclud@50: button caps returned to those buttons in a given link StephaneLenclud@50: collection. If set to 0, this parameter is StephaneLenclud@50: ignored. Can be used with UsagePage and Usage parameters StephaneLenclud@50: to further limit the number of button caps structures StephaneLenclud@50: returned. StephaneLenclud@50: StephaneLenclud@50: Usage A usage value used to limit the button caps returned to those StephaneLenclud@50: with the specified usage value. If set to 0, this parameter StephaneLenclud@50: is ignored. Can be used with LinkCollection and UsagePage StephaneLenclud@50: parameters to further limit the number of button caps StephaneLenclud@50: structures returned. StephaneLenclud@50: StephaneLenclud@50: ButtonCaps A _HIDP_BUTTON_CAPS array containing information about all the StephaneLenclud@50: binary values in the given report. This buffer is provided by StephaneLenclud@50: the caller. StephaneLenclud@50: StephaneLenclud@50: ButtonLength As input, this parameter specifies the length of the StephaneLenclud@50: ButtonCaps parameter (array) in number of array elements. StephaneLenclud@50: As output, this value is set to indicate how many of those StephaneLenclud@50: array elements were filled in by the function. The maximum number of StephaneLenclud@50: button caps that can be returned is found in the HIDP_CAPS StephaneLenclud@50: structure. If HIDP_STATUS_BUFFER_TOO_SMALL is returned, StephaneLenclud@50: this value contains the number of array elements needed to StephaneLenclud@50: successfully complete the request. StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data returned from HIDCLASS. StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: HidP_GetSpecificButtonCaps returns the following error codes: StephaneLenclud@50: HIDP_STATUS_SUCCESS. StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA StephaneLenclud@50: HIDP_STATUS_BUFFER_TOO_SMALL (all given entries however have been filled in) StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND StephaneLenclud@50: --*/ StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetButtonCaps ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: PHIDP_BUTTON_CAPS ButtonCaps, StephaneLenclud@50: PUSHORT ButtonCapsLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetSpecificValueCaps ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, // Optional (0 => ignore) StephaneLenclud@50: USHORT LinkCollection, // Optional (0 => ignore) StephaneLenclud@50: USAGE Usage, // Optional (0 => ignore) StephaneLenclud@50: PHIDP_VALUE_CAPS ValueCaps, StephaneLenclud@50: PUSHORT ValueCapsLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Description: StephaneLenclud@50: HidP_GetValueCaps returns all the values (non-binary) that are a part StephaneLenclud@50: of the given report type for the Hid device represented by the given StephaneLenclud@50: preparsed data. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output, or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage A usage page value used to limit the value caps returned to StephaneLenclud@50: those on a given usage page. If set to 0, this parameter is StephaneLenclud@50: ignored. Can be used with LinkCollection and Usage parameters StephaneLenclud@50: to further limit the number of value caps structures returned. StephaneLenclud@50: StephaneLenclud@50: LinkCollection HIDP_LINK_COLLECTION node array index used to limit the StephaneLenclud@50: value caps returned to those buttons in a given link StephaneLenclud@50: collection. If set to 0, this parameter is StephaneLenclud@50: ignored. Can be used with UsagePage and Usage parameters StephaneLenclud@50: to further limit the number of value caps structures StephaneLenclud@50: returned. StephaneLenclud@50: StephaneLenclud@50: Usage A usage value used to limit the value caps returned to those StephaneLenclud@50: with the specified usage value. If set to 0, this parameter StephaneLenclud@50: is ignored. Can be used with LinkCollection and UsagePage StephaneLenclud@50: parameters to further limit the number of value caps StephaneLenclud@50: structures returned. StephaneLenclud@50: StephaneLenclud@50: ValueCaps A _HIDP_VALUE_CAPS array containing information about all the StephaneLenclud@50: non-binary values in the given report. This buffer is provided StephaneLenclud@50: by the caller. StephaneLenclud@50: StephaneLenclud@50: ValueLength As input, this parameter specifies the length of the ValueCaps StephaneLenclud@50: parameter (array) in number of array elements. As output, StephaneLenclud@50: this value is set to indicate how many of those array elements StephaneLenclud@50: were filled in by the function. The maximum number of StephaneLenclud@50: value caps that can be returned is found in the HIDP_CAPS StephaneLenclud@50: structure. If HIDP_STATUS_BUFFER_TOO_SMALL is returned, StephaneLenclud@50: this value contains the number of array elements needed to StephaneLenclud@50: successfully complete the request. StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data returned from HIDCLASS. StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: HidP_GetValueCaps returns the following error codes: StephaneLenclud@50: HIDP_STATUS_SUCCESS. StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA StephaneLenclud@50: HIDP_STATUS_BUFFER_TOO_SMALL (all given entries however have been filled in) StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND StephaneLenclud@50: StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetValueCaps ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: PHIDP_VALUE_CAPS ValueCaps, StephaneLenclud@50: PUSHORT ValueCapsLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetExtendedAttributes ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USHORT DataIndex, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: PHIDP_EXTENDED_ATTRIBUTES Attributes, StephaneLenclud@50: PULONG LengthAttributes StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Description: StephaneLenclud@50: Given a data index from the value or button capabilities of a given control StephaneLenclud@50: return any extended attributes for the control if any exist. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output, or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: DataIndex The data index for the given control, found in the capabilities StephaneLenclud@50: structure for that control StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data returned from HIDCLASS. StephaneLenclud@50: StephaneLenclud@50: Attributes Pointer to a buffer into which the extended attribute data will StephaneLenclud@50: be copied. StephaneLenclud@50: StephaneLenclud@50: LengthAttributes Length of the given buffer in bytes. StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: HIDP_STATUS_SUCCESS StephaneLenclud@50: HIDP_STATUS_DATA_INDEX_NOT_FOUND StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_InitializeReportForID ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: UCHAR ReportID, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: StephaneLenclud@50: Routine Description: StephaneLenclud@50: StephaneLenclud@50: Initialize a report based on the given report ID. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output, or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: PreparasedData Preparsed data structure returned by HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report Buffer which to set the data into. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length of Report...Report should be at least as long as the StephaneLenclud@50: value indicated in the HIDP_CAPS structure for the device and StephaneLenclud@50: the corresponding ReportType StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not equal StephaneLenclud@50: to the length specified in HIDP_CAPS StephaneLenclud@50: structure for the given ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_SetData ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: PHIDP_DATA DataList, StephaneLenclud@50: PULONG DataLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: StephaneLenclud@50: Routine Description: StephaneLenclud@50: StephaneLenclud@50: Please Note: Since usage value arrays deal with multiple fields for StephaneLenclud@50: for one usage value, they cannot be used with HidP_SetData StephaneLenclud@50: and HidP_GetData. In this case, StephaneLenclud@50: HIDP_STATUS_IS_USAGE_VALUE_ARRAY will be returned. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output, or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: DataList Array of HIDP_DATA structures that contains the data values StephaneLenclud@50: that are to be set into the given report StephaneLenclud@50: StephaneLenclud@50: DataLength As input, length in array elements of DataList. As output, StephaneLenclud@50: contains the number of data elements set on successful StephaneLenclud@50: completion or an index into the DataList array to identify StephaneLenclud@50: the faulting HIDP_DATA value if an error code is returned. StephaneLenclud@50: StephaneLenclud@50: PreparasedData Preparsed data structure returned by HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report Buffer which to set the data into. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length of Report...Report should be at least as long as the StephaneLenclud@50: value indicated in the HIDP_CAPS structure for the device and StephaneLenclud@50: the corresponding ReportType StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: HidP_SetData returns the following error codes. The report packet will StephaneLenclud@50: have all the data set up until the HIDP_DATA structure that caused the StephaneLenclud@50: error. DataLength, in the error case, will return this problem index. StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successful insertion of all data StephaneLenclud@50: into the report packet. StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_DATA_INDEX_NOT_FOUND -- if a HIDP_DATA structure referenced a StephaneLenclud@50: data index that does not exist for this StephaneLenclud@50: device's ReportType StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not equal StephaneLenclud@50: to the length specified in HIDP_CAPS StephaneLenclud@50: structure for the given ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: HIDP_STATUS_IS_USAGE_VALUE_ARRAY -- if one of the HIDP_DATA structures StephaneLenclud@50: references a usage value array. StephaneLenclud@50: DataLength will contain the index into StephaneLenclud@50: the array that was invalid StephaneLenclud@50: HIDP_STATUS_BUTTON_NOT_PRESSED -- if a HIDP_DATA structure attempted StephaneLenclud@50: to unset a button that was not already StephaneLenclud@50: set in the Report StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- a HIDP_DATA structure was found with StephaneLenclud@50: a valid index value but is contained StephaneLenclud@50: in a different report than the one StephaneLenclud@50: currently being processed StephaneLenclud@50: HIDP_STATUS_BUFFER_TOO_SMALL -- if there are not enough entries in StephaneLenclud@50: a given Main Array Item to report all StephaneLenclud@50: buttons that have been requested to be StephaneLenclud@50: set StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetData ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: PHIDP_DATA DataList, StephaneLenclud@50: PULONG DataLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: StephaneLenclud@50: Routine Description: StephaneLenclud@50: StephaneLenclud@50: Please Note: For obvious reasons HidP_SetData and HidP_GetData will not StephaneLenclud@50: access UsageValueArrays. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output, or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: DataList Array of HIDP_DATA structures that will receive the data StephaneLenclud@50: values that are set in the given report StephaneLenclud@50: StephaneLenclud@50: DataLength As input, length in array elements of DataList. As output, StephaneLenclud@50: contains the number of data elements that were successfully StephaneLenclud@50: set by HidP_GetData. The maximum size necessary for DataList StephaneLenclud@50: can be determined by calling HidP_MaxDataListLength StephaneLenclud@50: StephaneLenclud@50: PreparasedData Preparsed data structure returned by HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report Buffer which to set the data into. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length of Report...Report should be at least as long as the StephaneLenclud@50: value indicated in the HIDP_CAPS structure for the device and StephaneLenclud@50: the corresponding ReportType StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: HidP_GetData returns the following error codes. StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successful retrieval of all data StephaneLenclud@50: from the report packet. StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not equal StephaneLenclud@50: to the length specified in HIDP_CAPS StephaneLenclud@50: structure for the given ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: HIDP_STATUS_BUFFER_TOO_SMALL -- if there are not enough array entries in StephaneLenclud@50: DataList to store all the indice values StephaneLenclud@50: in the given report. DataLength will StephaneLenclud@50: contain the number of array entries StephaneLenclud@50: required to hold all data StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: ULONG __stdcall StephaneLenclud@50: HidP_MaxDataListLength ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: StephaneLenclud@50: This function returns the maximum length of HIDP_DATA elements that StephaneLenclud@50: HidP_GetData could return for the given report type. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: PreparsedData Preparsed data structure returned by HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: StephaneLenclud@50: The length of the data list array required for the HidP_GetData function StephaneLenclud@50: call. If an error occurs (either HIDP_STATUS_INVALID_REPORT_TYPE or StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA), this function returns 0. StephaneLenclud@50: StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: #define HidP_SetButtons(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle) \ StephaneLenclud@50: HidP_SetUsages(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle) StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_SetUsages ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, StephaneLenclud@50: USHORT LinkCollection, StephaneLenclud@50: PUSAGE UsageList, StephaneLenclud@50: PULONG UsageLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function sets binary values (buttons) in a report. Given an StephaneLenclud@50: initialized packet of correct length, it modifies the report packet so that StephaneLenclud@50: each element in the given list of usages has been set in the report packet. StephaneLenclud@50: For example, in an output report with 5 LED's, each with a given usage, StephaneLenclud@50: an application could turn on any subset of these lights by placing their StephaneLenclud@50: usages in any order into the usage array (UsageList). HidP_SetUsages would, StephaneLenclud@50: in turn, set the appropriate bit or add the corresponding byte into the StephaneLenclud@50: HID Main Array Item. StephaneLenclud@50: StephaneLenclud@50: A properly initialized Report packet is one of the correct byte length, StephaneLenclud@50: and all zeros. StephaneLenclud@50: StephaneLenclud@50: NOTE: A packet that has already been set with a call to a HidP_Set routine StephaneLenclud@50: can also be passed in. This routine then sets processes the UsageList StephaneLenclud@50: in the same fashion but verifies that the ReportID already set in StephaneLenclud@50: Report matches the report ID for the given usages. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage All of the usages in the usage array, which HidP_SetUsages will StephaneLenclud@50: set in the report, refer to this same usage page. StephaneLenclud@50: If a client wishes to set usages in a report for multiple StephaneLenclud@50: usage pages then that client needs to make multiple calls to StephaneLenclud@50: HidP_SetUsages for each of the usage pages. StephaneLenclud@50: StephaneLenclud@50: UsageList A usage array containing the usages that HidP_SetUsages will set in StephaneLenclud@50: the report packet. StephaneLenclud@50: StephaneLenclud@50: UsageLength The length of the given usage array in array elements. StephaneLenclud@50: The parser will set this value to the position in the usage StephaneLenclud@50: array where it stopped processing. If successful, UsageLength StephaneLenclud@50: will be unchanged. In any error condition, this parameter StephaneLenclud@50: reflects how many of the usages in the usage list have StephaneLenclud@50: actually been set by the parser. This is useful for finding StephaneLenclud@50: the usage in the list which caused the error. StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data recevied from HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length of the given report packet...Must be equal to the StephaneLenclud@50: value reported in the HIDP_CAPS structure for the device StephaneLenclud@50: and corresponding report type. StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: HidP_SetUsages returns the following error codes. On error, the report packet StephaneLenclud@50: will be correct up until the usage element that caused the error. StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successful insertion of all usages StephaneLenclud@50: into the report packet. StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if a usage was found that exists in a StephaneLenclud@50: different report. If the report is StephaneLenclud@50: zero-initialized on entry the first StephaneLenclud@50: usage in the list will determine which StephaneLenclud@50: report ID is used. Otherwise, the StephaneLenclud@50: parser will verify that usage matches StephaneLenclud@50: the passed in report's ID StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if the usage does not exist for any StephaneLenclud@50: report (no matter what the report ID) StephaneLenclud@50: for the given report type. StephaneLenclud@50: HIDP_STATUS_BUFFER_TOO_SMALL -- if there are not enough entries in a StephaneLenclud@50: given Main Array Item to list all of StephaneLenclud@50: the given usages. The caller needs StephaneLenclud@50: to split his request into more than StephaneLenclud@50: one call StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: #define HidP_UnsetButtons(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle) \ StephaneLenclud@50: HidP_UnsetUsages(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle) StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_UnsetUsages ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, StephaneLenclud@50: USHORT LinkCollection, StephaneLenclud@50: PUSAGE UsageList, StephaneLenclud@50: PULONG UsageLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function unsets (turns off) binary values (buttons) in the report. Given StephaneLenclud@50: an initialized packet of correct length, it modifies the report packet so StephaneLenclud@50: that each element in the given list of usages has been unset in the StephaneLenclud@50: report packet. StephaneLenclud@50: StephaneLenclud@50: This function is the "undo" operation for SetUsages. If the given usage StephaneLenclud@50: is not already set in the Report, it will return an error code of StephaneLenclud@50: HIDP_STATUS_BUTTON_NOT_PRESSED. If the button is pressed, HidP_UnsetUsages StephaneLenclud@50: will unset the appropriate bit or remove the corresponding index value from StephaneLenclud@50: the HID Main Array Item. StephaneLenclud@50: StephaneLenclud@50: A properly initialized Report packet is one of the correct byte length, StephaneLenclud@50: and all zeros.. StephaneLenclud@50: StephaneLenclud@50: NOTE: A packet that has already been set with a call to a HidP_Set routine StephaneLenclud@50: can also be passed in. This routine then processes the UsageList StephaneLenclud@50: in the same fashion but verifies that the ReportID already set in StephaneLenclud@50: Report matches the report ID for the given usages. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage All of the usages in the usage array, which HidP_UnsetUsages will StephaneLenclud@50: unset in the report, refer to this same usage page. StephaneLenclud@50: If a client wishes to unset usages in a report for multiple StephaneLenclud@50: usage pages then that client needs to make multiple calls to StephaneLenclud@50: HidP_UnsetUsages for each of the usage pages. StephaneLenclud@50: StephaneLenclud@50: UsageList A usage array containing the usages that HidP_UnsetUsages will StephaneLenclud@50: unset in the report packet. StephaneLenclud@50: StephaneLenclud@50: UsageLength The length of the given usage array in array elements. StephaneLenclud@50: The parser will set this value to the position in the usage StephaneLenclud@50: array where it stopped processing. If successful, UsageLength StephaneLenclud@50: will be unchanged. In any error condition, this parameter StephaneLenclud@50: reflects how many of the usages in the usage list have StephaneLenclud@50: actually been unset by the parser. This is useful for finding StephaneLenclud@50: the usage in the list which caused the error. StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data recevied from HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length of the given report packet...Must be equal to the StephaneLenclud@50: value reported in the HIDP_CAPS structure for the device StephaneLenclud@50: and corresponding report type. StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: HidP_UnsetUsages returns the following error codes. On error, the report StephaneLenclud@50: packet will be correct up until the usage element that caused the error. StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successful "unsetting" of all usages StephaneLenclud@50: in the report packet. StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if a usage was found that exists in a StephaneLenclud@50: different report. If the report is StephaneLenclud@50: zero-initialized on entry the first StephaneLenclud@50: usage in the list will determine which StephaneLenclud@50: report ID is used. Otherwise, the StephaneLenclud@50: parser will verify that usage matches StephaneLenclud@50: the passed in report's ID StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if the usage does not exist for any StephaneLenclud@50: report (no matter what the report ID) StephaneLenclud@50: for the given report type. StephaneLenclud@50: HIDP_STATUS_BUTTON_NOT_PRESSED -- if a usage corresponds to a button that StephaneLenclud@50: is not already set in the given report StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: #define HidP_GetButtons(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe) \ StephaneLenclud@50: HidP_GetUsages(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe) StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetUsages ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, StephaneLenclud@50: USHORT LinkCollection, StephaneLenclud@50: PUSAGE UsageList, StephaneLenclud@50: PULONG UsageLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function returns the binary values (buttons) that are set in a HID StephaneLenclud@50: report. Given a report packet of correct length, it searches the report StephaneLenclud@50: packet for each usage for the given usage page and returns them in the StephaneLenclud@50: usage list. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage All of the usages in the usage list, which HidP_GetUsages will StephaneLenclud@50: retrieve in the report, refer to this same usage page. StephaneLenclud@50: If the client wishes to get usages in a packet for multiple StephaneLenclud@50: usage pages then that client needs to make multiple calls StephaneLenclud@50: to HidP_GetUsages. StephaneLenclud@50: StephaneLenclud@50: LinkCollection An optional value which can limit which usages are returned StephaneLenclud@50: in the UsageList to those usages that exist in a specific StephaneLenclud@50: LinkCollection. A non-zero value indicates the index into StephaneLenclud@50: the HIDP_LINK_COLLECITON_NODE list returned by StephaneLenclud@50: HidP_GetLinkCollectionNodes of the link collection the StephaneLenclud@50: usage should belong to. A value of 0 indicates this StephaneLenclud@50: should value be ignored. StephaneLenclud@50: StephaneLenclud@50: UsageList The usage array that will contain all the usages found in StephaneLenclud@50: the report packet. StephaneLenclud@50: StephaneLenclud@50: UsageLength The length of the given usage array in array elements. StephaneLenclud@50: On input, this value describes the length of the usage list. StephaneLenclud@50: On output, HidP_GetUsages sets this value to the number of StephaneLenclud@50: usages that was found. Use HidP_MaxUsageListLength to StephaneLenclud@50: determine the maximum length needed to return all the usages StephaneLenclud@50: that a given report packet may contain. StephaneLenclud@50: StephaneLenclud@50: PreparsedData Preparsed data structure returned by HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length (in bytes) of the given report packet StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: HidP_GetUsages returns the following error codes: StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successfully retrieving all the StephaneLenclud@50: usages from the report packet StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: HIDP_STATUS_BUFFER_TOO_SMALL -- if the UsageList is not big enough to StephaneLenclud@50: hold all the usages found in the report StephaneLenclud@50: packet. If this is returned, the buffer StephaneLenclud@50: will contain UsageLength number of StephaneLenclud@50: usages. Use HidP_MaxUsageListLength to StephaneLenclud@50: find the maximum length needed StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if no usages were found but usages StephaneLenclud@50: that match the UsagePage and StephaneLenclud@50: LinkCollection specified could be found StephaneLenclud@50: in a report with a different report ID StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if there are no usages in a reports for StephaneLenclud@50: the device and ReportType that match the StephaneLenclud@50: UsagePage and LinkCollection that were StephaneLenclud@50: specified StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: #define HidP_GetButtonsEx(Rty, LCo, BLi, ULe, Ppd, Rep, RLe) \ StephaneLenclud@50: HidP_GetUsagesEx(Rty, LCo, BLi, ULe, Ppd, Rep, RLe) StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetUsagesEx ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USHORT LinkCollection, // Optional StephaneLenclud@50: PUSAGE_AND_PAGE ButtonList, StephaneLenclud@50: ULONG * UsageLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: reads_bytes_(ReportLength) PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: /*++ StephaneLenclud@50: StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function returns the binary values (buttons) in a HID report. StephaneLenclud@50: Given a report packet of correct length, it searches the report packet StephaneLenclud@50: for all buttons and returns the UsagePage and Usage for each of the buttons StephaneLenclud@50: it finds. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: LinkCollection An optional value which can limit which usages are returned StephaneLenclud@50: in the ButtonList to those usages that exist in a specific StephaneLenclud@50: LinkCollection. A non-zero value indicates the index into StephaneLenclud@50: the HIDP_LINK_COLLECITON_NODE list returned by StephaneLenclud@50: HidP_GetLinkCollectionNodes of the link collection the StephaneLenclud@50: usage should belong to. A value of 0 indicates this StephaneLenclud@50: should value be ignored. StephaneLenclud@50: StephaneLenclud@50: ButtonList An array of USAGE_AND_PAGE structures describing all the StephaneLenclud@50: buttons currently ``down'' in the device. StephaneLenclud@50: StephaneLenclud@50: UsageLength The length of the given array in terms of elements. StephaneLenclud@50: On input, this value describes the length of the list. On StephaneLenclud@50: output, HidP_GetUsagesEx sets this value to the number of StephaneLenclud@50: usages that were found. Use HidP_MaxUsageListLength to StephaneLenclud@50: determine the maximum length needed to return all the usages StephaneLenclud@50: that a given report packet may contain. StephaneLenclud@50: StephaneLenclud@50: PreparsedData Preparsed data returned by HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length (in bytes) of the given report packet. StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value StephaneLenclud@50: HidP_GetUsagesEx returns the following error codes: StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successfully retrieving all the StephaneLenclud@50: usages from the report packet StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: HIDP_STATUS_BUFFER_TOO_SMALL -- if ButtonList is not big enough to StephaneLenclud@50: hold all the usages found in the report StephaneLenclud@50: packet. If this is returned, the buffer StephaneLenclud@50: will contain UsageLength number of StephaneLenclud@50: usages. Use HidP_MaxUsageListLength to StephaneLenclud@50: find the maximum length needed StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if no usages were found but usages StephaneLenclud@50: that match the specified LinkCollection StephaneLenclud@50: exist in report with a different report StephaneLenclud@50: ID. StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if there are no usages in any reports that StephaneLenclud@50: match the LinkCollection parameter StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: _IRQL_requires_max_(PASSIVE_LEVEL) StephaneLenclud@50: ULONG __stdcall StephaneLenclud@50: HidP_MaxUsageListLength ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, // Optional StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function returns the maximum number of usages that a call to StephaneLenclud@50: HidP_GetUsages or HidP_GetUsagesEx could return for a given HID report. StephaneLenclud@50: If calling for number of usages returned by HidP_GetUsagesEx, use 0 as StephaneLenclud@50: the UsagePage value. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage Specifies the optional UsagePage to query for. If 0, will StephaneLenclud@50: return all the maximum number of usage values that could be StephaneLenclud@50: returned for a given ReportType. If non-zero, will return StephaneLenclud@50: the maximum number of usages that would be returned for the StephaneLenclud@50: ReportType with the given UsagePage. StephaneLenclud@50: StephaneLenclud@50: PreparsedData Preparsed data returned from HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: The length of the usage list array required for the HidP_GetUsages or StephaneLenclud@50: HidP_GetUsagesEx function call. If an error occurs (such as StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE or HIDP_INVALID_PREPARSED_DATA, this StephaneLenclud@50: returns 0. StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_SetUsageValue ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, StephaneLenclud@50: USHORT LinkCollection, StephaneLenclud@50: USAGE Usage, StephaneLenclud@50: ULONG UsageValue, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: updates_bytes_(ReportLength) PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Description: StephaneLenclud@50: HidP_SetUsageValue inserts a value into the HID Report Packet in the field StephaneLenclud@50: corresponding to the given usage page and usage. HidP_SetUsageValue StephaneLenclud@50: casts this value to the appropriate bit length. If a report packet StephaneLenclud@50: contains two different fields with the same Usage and UsagePage, StephaneLenclud@50: they can be distinguished with the optional LinkCollection field value. StephaneLenclud@50: Using this function sets the raw value into the report packet with StephaneLenclud@50: no checking done as to whether it actually falls within the logical StephaneLenclud@50: minimum/logical maximum range. Use HidP_SetScaledUsageValue for this... StephaneLenclud@50: StephaneLenclud@50: NOTE: Although the UsageValue parameter is a ULONG, any casting that is StephaneLenclud@50: done will preserve or sign-extend the value. The value being set StephaneLenclud@50: should be considered a LONG value and will be treated as such by StephaneLenclud@50: this function. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: ReportType One of HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage The usage page to which the given usage refers. StephaneLenclud@50: StephaneLenclud@50: LinkCollection (Optional) This value can be used to differentiate StephaneLenclud@50: between two fields that may have the same StephaneLenclud@50: UsagePage and Usage but exist in different StephaneLenclud@50: collections. If the link collection value StephaneLenclud@50: is zero, this function will set the first field StephaneLenclud@50: it finds that matches the usage page and StephaneLenclud@50: usage. StephaneLenclud@50: StephaneLenclud@50: Usage The usage whose value HidP_SetUsageValue will set. StephaneLenclud@50: StephaneLenclud@50: UsageValue The raw value to set in the report buffer. This value must be within StephaneLenclud@50: the logical range or if a NULL value this value should be the StephaneLenclud@50: most negative value that can be represented by the number of bits StephaneLenclud@50: for this field. StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data returned for HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length (in bytes) of the given report packet. StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: HidP_SetUsageValue returns the following error codes: StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successfully setting the value StephaneLenclud@50: in the report packet StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and StephaneLenclud@50: link collection exist but exists in StephaneLenclud@50: a report with a different report ID StephaneLenclud@50: than the report being passed in. To StephaneLenclud@50: set this value, call HidP_SetUsageValue StephaneLenclud@50: again with a zero-initizialed report StephaneLenclud@50: packet StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if the usage page, usage, and link StephaneLenclud@50: collection combination does not exist StephaneLenclud@50: in any reports for this ReportType StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_SetScaledUsageValue ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, StephaneLenclud@50: USHORT LinkCollection, StephaneLenclud@50: USAGE Usage, StephaneLenclud@50: LONG UsageValue, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: updates_bytes_(ReportLength) PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: /*++ StephaneLenclud@50: Description: StephaneLenclud@50: HidP_SetScaledUsageValue inserts the UsageValue into the HID report packet StephaneLenclud@50: in the field corresponding to the given usage page and usage. If a report StephaneLenclud@50: packet contains two different fields with the same Usage and UsagePage, StephaneLenclud@50: they can be distinguished with the optional LinkCollection field value. StephaneLenclud@50: StephaneLenclud@50: If the specified field has a defined physical range, this function converts StephaneLenclud@50: the physical value specified to the corresponding logical value for the StephaneLenclud@50: report. If a physical value does not exist, the function will verify that StephaneLenclud@50: the value specified falls within the logical range and set according. StephaneLenclud@50: StephaneLenclud@50: If the range checking fails but the field has NULL values, the function will StephaneLenclud@50: set the field to the defined NULL value (most negative number possible) and StephaneLenclud@50: return HIDP_STATUS_NULL. In other words, use this function to set NULL StephaneLenclud@50: values for a given field by passing in a value that falls outside the StephaneLenclud@50: physical range if it is defined or the logical range otherwise. StephaneLenclud@50: StephaneLenclud@50: If the field does not support NULL values, an out of range error will be StephaneLenclud@50: returned instead. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: ReportType One of HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage The usage page to which the given usage refers. StephaneLenclud@50: StephaneLenclud@50: LinkCollection (Optional) This value can be used to differentiate StephaneLenclud@50: between two fields that may have the same StephaneLenclud@50: UsagePage and Usage but exist in different StephaneLenclud@50: collections. If the link collection value StephaneLenclud@50: is zero, this function will set the first field StephaneLenclud@50: it finds that matches the usage page and StephaneLenclud@50: usage. StephaneLenclud@50: StephaneLenclud@50: Usage The usage whose value HidP_SetScaledUsageValue will set. StephaneLenclud@50: StephaneLenclud@50: UsageValue The value to set in the report buffer. See the routine StephaneLenclud@50: description above for the different interpretations of this StephaneLenclud@50: value StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data returned from HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length (in bytes) of the given report packet. StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: HidP_SetScaledUsageValue returns the following error codes: StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successfully setting the value StephaneLenclud@50: in the report packet StephaneLenclud@50: HIDP_STATUS_NULL -- upon successfully setting the value StephaneLenclud@50: in the report packet as a NULL value StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_VALUEOF_RANGE -- if the value specified failed to fall StephaneLenclud@50: within the physical range if it exists StephaneLenclud@50: or within the logical range otherwise StephaneLenclud@50: and the field specified by the usage StephaneLenclud@50: does not allow NULL values StephaneLenclud@50: HIDP_STATUS_BAD_LOG_PHY_VALUES -- if the field has a physical range but StephaneLenclud@50: either the logical range is invalid StephaneLenclud@50: (max <= min) or the physical range is StephaneLenclud@50: invalid StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and StephaneLenclud@50: link collection exist but exists in StephaneLenclud@50: a report with a different report ID StephaneLenclud@50: than the report being passed in. To StephaneLenclud@50: set this value, call StephaneLenclud@50: HidP_SetScaledUsageValue again with StephaneLenclud@50: a zero-initialized report packet StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if the usage page, usage, and link StephaneLenclud@50: collection combination does not exist StephaneLenclud@50: in any reports for this ReportType StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_SetUsageValueArray ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, StephaneLenclud@50: USHORT LinkCollection, StephaneLenclud@50: USAGE Usage, StephaneLenclud@50: reads_bytes_(UsageValueByteLength) PCHAR UsageValue, StephaneLenclud@50: USHORT UsageValueByteLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: updates_bytes_(ReportLength) PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Descripton: StephaneLenclud@50: A usage value array occurs when the last usage in the list of usages StephaneLenclud@50: describing a main item must be repeated because there are less usages defined StephaneLenclud@50: than there are report counts declared for the given main item. In this case StephaneLenclud@50: a single value cap is allocated for that usage and the report count of that StephaneLenclud@50: value cap is set to reflect the number of fields to which that usage refers. StephaneLenclud@50: StephaneLenclud@50: HidP_SetUsageValueArray sets the raw bits for that usage which spans StephaneLenclud@50: more than one field in a report. StephaneLenclud@50: StephaneLenclud@50: NOTE: This function currently does not support value arrays where the StephaneLenclud@50: ReportSize for each of the fields in the array is not a multiple StephaneLenclud@50: of 8 bits. StephaneLenclud@50: StephaneLenclud@50: The UsageValue buffer should have the values set as they would appear StephaneLenclud@50: in the report buffer. If this function supported non 8-bit multiples StephaneLenclud@50: for the ReportSize then caller should format the input buffer so that StephaneLenclud@50: each new value begins at the bit immediately following the last bit StephaneLenclud@50: of the previous value StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: ReportType One of HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage The usage page to which the given usage refers. StephaneLenclud@50: StephaneLenclud@50: LinkCollection (Optional) This value can be used to differentiate StephaneLenclud@50: between two fields that may have the same StephaneLenclud@50: UsagePage and Usage but exist in different StephaneLenclud@50: collections. If the link collection value StephaneLenclud@50: is zero, this function will set the first field StephaneLenclud@50: it finds that matches the usage page and StephaneLenclud@50: usage. StephaneLenclud@50: StephaneLenclud@50: Usage The usage whose value array HidP_SetUsageValueArray will set. StephaneLenclud@50: StephaneLenclud@50: UsageValue The buffer with the values to set into the value array. StephaneLenclud@50: The number of BITS required is found by multiplying the StephaneLenclud@50: BitSize and ReportCount fields of the Value Cap for this StephaneLenclud@50: control. The least significant bit of this control found in the StephaneLenclud@50: given report will be placed in the least significan bit location StephaneLenclud@50: of the array given (little-endian format), regardless of whether StephaneLenclud@50: or not the field is byte alligned or if the BitSize is a multiple StephaneLenclud@50: of sizeof (CHAR). StephaneLenclud@50: StephaneLenclud@50: See the above note for current implementation limitations. StephaneLenclud@50: StephaneLenclud@50: UsageValueByteLength Length of the UsageValue buffer (in bytes) StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data returned from HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length (in bytes) of the given report packet. StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successfully setting the value StephaneLenclud@50: array in the report packet StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: HIDP_STATUS_NOT_VALUE_ARRAY -- if the control specified is not a StephaneLenclud@50: value array -- a value array will have StephaneLenclud@50: a ReportCount field in the StephaneLenclud@50: HIDP_VALUE_CAPS structure that is > 1 StephaneLenclud@50: Use HidP_SetUsageValue instead StephaneLenclud@50: HIDP_STATUS_BUFFER_TOO_SMALL -- if the size of the passed in buffer with StephaneLenclud@50: the values to set is too small (ie. has StephaneLenclud@50: fewer values than the number of fields in StephaneLenclud@50: the array StephaneLenclud@50: HIDP_STATUS_NOT_IMPLEMENTED -- if the usage value array has field sizes StephaneLenclud@50: that are not multiples of 8 bits, this StephaneLenclud@50: error code is returned since the function StephaneLenclud@50: currently does not handle setting into StephaneLenclud@50: such arrays. StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and StephaneLenclud@50: link collection exist but exists in StephaneLenclud@50: a report with a different report ID StephaneLenclud@50: than the report being passed in. To StephaneLenclud@50: set this value, call StephaneLenclud@50: HidP_SetUsageValueArray again with StephaneLenclud@50: a zero-initialized report packet StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if the usage page, usage, and link StephaneLenclud@50: collection combination does not exist StephaneLenclud@50: in any reports for this ReportType StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetUsageValue ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, StephaneLenclud@50: USHORT LinkCollection, StephaneLenclud@50: USAGE Usage, StephaneLenclud@50: PULONG UsageValue, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: reads_bytes_(ReportLength) PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: /* StephaneLenclud@50: Description StephaneLenclud@50: HidP_GetUsageValue retrieves the value from the HID Report for the usage StephaneLenclud@50: specified by the combination of usage page, usage and link collection. StephaneLenclud@50: If a report packet contains two different fields with the same StephaneLenclud@50: Usage and UsagePage, they can be distinguished with the optional StephaneLenclud@50: LinkCollection field value. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: ReportType One of HidP_Input or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage The usage page to which the given usage refers. StephaneLenclud@50: StephaneLenclud@50: LinkCollection (Optional) This value can be used to differentiate StephaneLenclud@50: between two fields that may have the same StephaneLenclud@50: UsagePage and Usage but exist in different StephaneLenclud@50: collections. If the link collection value StephaneLenclud@50: is zero, this function will set the first field StephaneLenclud@50: it finds that matches the usage page and StephaneLenclud@50: usage. StephaneLenclud@50: StephaneLenclud@50: Usage The usage whose value HidP_GetUsageValue will retrieve StephaneLenclud@50: StephaneLenclud@50: UsageValue The raw value that is set for the specified field in the report StephaneLenclud@50: buffer. This value will either fall within the logical range StephaneLenclud@50: or if NULL values are allowed, a number outside the range to StephaneLenclud@50: indicate a NULL StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data returned for HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length (in bytes) of the given report packet. StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: HidP_GetUsageValue returns the following error codes: StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successfully retrieving the value StephaneLenclud@50: from the report packet StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_REPORT_DOES_NOT_EXIST -- if there are no reports on this device StephaneLenclud@50: for the given ReportType StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and StephaneLenclud@50: link collection exist but exists in StephaneLenclud@50: a report with a different report ID StephaneLenclud@50: than the report being passed in. To StephaneLenclud@50: set this value, call HidP_GetUsageValue StephaneLenclud@50: again with a different report packet StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if the usage page, usage, and link StephaneLenclud@50: collection combination does not exist StephaneLenclud@50: in any reports for this ReportType StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetScaledUsageValue ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, StephaneLenclud@50: USHORT LinkCollection, StephaneLenclud@50: USAGE Usage, StephaneLenclud@50: PLONG UsageValue, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: reads_bytes_(ReportLength) PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: /*++ StephaneLenclud@50: Description StephaneLenclud@50: HidP_GetScaledUsageValue retrieves a UsageValue from the HID report packet StephaneLenclud@50: in the field corresponding to the given usage page and usage. If a report StephaneLenclud@50: packet contains two different fields with the same Usage and UsagePage, StephaneLenclud@50: they can be distinguished with the optional LinkCollection field value. StephaneLenclud@50: StephaneLenclud@50: If the specified field has a defined physical range, this function converts StephaneLenclud@50: the logical value that exists in the report packet to the corresponding StephaneLenclud@50: physical value. If a physical range does not exist, the function will StephaneLenclud@50: return the logical value. This function will check to verify that the StephaneLenclud@50: logical value in the report falls within the declared logical range. StephaneLenclud@50: StephaneLenclud@50: When doing the conversion between logical and physical values, this StephaneLenclud@50: function assumes a linear extrapolation between the physical max/min and StephaneLenclud@50: the logical max/min. (Where logical is the values reported by the device StephaneLenclud@50: and physical is the value returned by this function). If the data field StephaneLenclud@50: size is less than 32 bits, then HidP_GetScaledUsageValue will sign extend StephaneLenclud@50: the value to 32 bits. StephaneLenclud@50: StephaneLenclud@50: If the range checking fails but the field has NULL values, the function StephaneLenclud@50: will set UsageValue to 0 and return HIDP_STATUS_NULL. Otherwise, it StephaneLenclud@50: returns a HIDP_STATUSOF_RANGE error. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: ReportType One of HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage The usage page to which the given usage refers. StephaneLenclud@50: StephaneLenclud@50: LinkCollection (Optional) This value can be used to differentiate StephaneLenclud@50: between two fields that may have the same StephaneLenclud@50: UsagePage and Usage but exist in different StephaneLenclud@50: collections. If the link collection value StephaneLenclud@50: is zero, this function will retrieve the first StephaneLenclud@50: field it finds that matches the usage page StephaneLenclud@50: and usage. StephaneLenclud@50: StephaneLenclud@50: Usage The usage whose value HidP_GetScaledUsageValue will retrieve StephaneLenclud@50: StephaneLenclud@50: UsageValue The value retrieved from the report buffer. See the routine StephaneLenclud@50: description above for the different interpretations of this StephaneLenclud@50: value StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data returned from HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length (in bytes) of the given report packet. StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: HidP_GetScaledUsageValue returns the following error codes: StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successfully retrieving the value StephaneLenclud@50: from the report packet StephaneLenclud@50: HIDP_STATUS_NULL -- if the report packet had a NULL value StephaneLenclud@50: set StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_VALUEOF_RANGE -- if the value retrieved from the packet StephaneLenclud@50: falls outside the logical range and StephaneLenclud@50: the field does not support NULL values StephaneLenclud@50: HIDP_STATUS_BAD_LOG_PHY_VALUES -- if the field has a physical range but StephaneLenclud@50: either the logical range is invalid StephaneLenclud@50: (max <= min) or the physical range is StephaneLenclud@50: invalid StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and StephaneLenclud@50: link collection exist but exists in StephaneLenclud@50: a report with a different report ID StephaneLenclud@50: than the report being passed in. To StephaneLenclud@50: set this value, call StephaneLenclud@50: HidP_GetScaledUsageValue with a StephaneLenclud@50: different report packet StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if the usage page, usage, and link StephaneLenclud@50: collection combination does not exist StephaneLenclud@50: in any reports for this ReportType StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_GetUsageValueArray ( StephaneLenclud@50: HIDP_REPORT_TYPE ReportType, StephaneLenclud@50: USAGE UsagePage, StephaneLenclud@50: USHORT LinkCollection, StephaneLenclud@50: USAGE Usage, StephaneLenclud@50: updates_bytes_(UsageValueByteLength) PCHAR UsageValue, StephaneLenclud@50: USHORT UsageValueByteLength, StephaneLenclud@50: PHIDP_PREPARSED_DATA PreparsedData, StephaneLenclud@50: reads_bytes_(ReportLength) PCHAR Report, StephaneLenclud@50: ULONG ReportLength StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Descripton: StephaneLenclud@50: A usage value array occurs when the last usage in the list of usages StephaneLenclud@50: describing a main item must be repeated because there are less usages defined StephaneLenclud@50: than there are report counts declared for the given main item. In this case StephaneLenclud@50: a single value cap is allocated for that usage and the report count of that StephaneLenclud@50: value cap is set to reflect the number of fields to which that usage refers. StephaneLenclud@50: StephaneLenclud@50: HidP_GetUsageValueArray returns the raw bits for that usage which spans StephaneLenclud@50: more than one field in a report. StephaneLenclud@50: StephaneLenclud@50: NOTE: This function currently does not support value arrays where the StephaneLenclud@50: ReportSize for each of the fields in the array is not a multiple StephaneLenclud@50: of 8 bits. StephaneLenclud@50: StephaneLenclud@50: The UsageValue buffer will have the raw values as they are set StephaneLenclud@50: in the report packet. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: ReportType One of HidP_Input, HidP_Output or HidP_Feature. StephaneLenclud@50: StephaneLenclud@50: UsagePage The usage page to which the given usage refers. StephaneLenclud@50: StephaneLenclud@50: LinkCollection (Optional) This value can be used to differentiate StephaneLenclud@50: between two fields that may have the same StephaneLenclud@50: UsagePage and Usage but exist in different StephaneLenclud@50: collections. If the link collection value StephaneLenclud@50: is zero, this function will set the first field StephaneLenclud@50: it finds that matches the usage page and StephaneLenclud@50: usage. StephaneLenclud@50: StephaneLenclud@50: Usage The usage whose value HidP_GetUsageValueArray will retreive. StephaneLenclud@50: StephaneLenclud@50: UsageValue A pointer to an array of characters where the value will be StephaneLenclud@50: placed. The number of BITS required is found by multiplying the StephaneLenclud@50: BitSize and ReportCount fields of the Value Cap for this StephaneLenclud@50: control. The least significant bit of this control found in the StephaneLenclud@50: given report will be placed in the least significant bit location StephaneLenclud@50: of the buffer (little-endian format), regardless of whether StephaneLenclud@50: or not the field is byte aligned or if the BitSize is a multiple StephaneLenclud@50: of sizeof (CHAR). StephaneLenclud@50: StephaneLenclud@50: See note above about current implementation limitations StephaneLenclud@50: StephaneLenclud@50: UsageValueByteLength StephaneLenclud@50: the length of the given UsageValue buffer. StephaneLenclud@50: StephaneLenclud@50: PreparsedData The preparsed data returned by the HIDCLASS StephaneLenclud@50: StephaneLenclud@50: Report The report packet. StephaneLenclud@50: StephaneLenclud@50: ReportLength Length of the given report packet. StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: StephaneLenclud@50: HIDP_STATUS_SUCCESS -- upon successfully retrieving the value StephaneLenclud@50: from the report packet StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_TYPE -- if ReportType is not valid. StephaneLenclud@50: HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid StephaneLenclud@50: HIDP_STATUS_INVALID_REPORT_LENGTH -- the length of the report packet is not StephaneLenclud@50: equal to the length specified in StephaneLenclud@50: the HIDP_CAPS structure for the given StephaneLenclud@50: ReportType StephaneLenclud@50: HIDP_STATUS_NOT_VALUE_ARRAY -- if the control specified is not a StephaneLenclud@50: value array -- a value array will have StephaneLenclud@50: a ReportCount field in the StephaneLenclud@50: HIDP_VALUE_CAPS structure that is > 1 StephaneLenclud@50: Use HidP_GetUsageValue instead StephaneLenclud@50: HIDP_STATUS_BUFFER_TOO_SMALL -- if the size of the passed in buffer in StephaneLenclud@50: which to return the array is too small StephaneLenclud@50: (ie. has fewer values than the number of StephaneLenclud@50: fields in the array StephaneLenclud@50: HIDP_STATUS_NOT_IMPLEMENTED -- if the usage value array has field sizes StephaneLenclud@50: that are not multiples of 8 bits, this StephaneLenclud@50: error code is returned since the function StephaneLenclud@50: currently does not handle getting values StephaneLenclud@50: from such arrays. StephaneLenclud@50: HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and StephaneLenclud@50: link collection exist but exists in StephaneLenclud@50: a report with a different report ID StephaneLenclud@50: than the report being passed in. To StephaneLenclud@50: set this value, call StephaneLenclud@50: HidP_GetUsageValueArray with a StephaneLenclud@50: different report packet StephaneLenclud@50: HIDP_STATUS_USAGE_NOT_FOUND -- if the usage page, usage, and link StephaneLenclud@50: collection combination does not exist StephaneLenclud@50: in any reports for this ReportType StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: _IRQL_requires_max_(PASSIVE_LEVEL) StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_UsageListDifference ( StephaneLenclud@50: reads_(UsageListLength) PUSAGE PreviousUsageList, StephaneLenclud@50: reads_(UsageListLength) PUSAGE CurrentUsageList, StephaneLenclud@50: writes_(UsageListLength) PUSAGE BreakUsageList, StephaneLenclud@50: writes_(UsageListLength) PUSAGE MakeUsageList, StephaneLenclud@50: ULONG UsageListLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function will return the difference between a two lists of usages StephaneLenclud@50: (as might be returned from HidP_GetUsages), In other words, it will return StephaneLenclud@50: return a list of usages that are in the current list but not the previous StephaneLenclud@50: list as well as a list of usages that are in the previous list but not StephaneLenclud@50: the current list. StephaneLenclud@50: StephaneLenclud@50: Parameters: StephaneLenclud@50: StephaneLenclud@50: PreviousUsageList The list of usages before. StephaneLenclud@50: CurrentUsageList The list of usages now. StephaneLenclud@50: BreakUsageList Previous - Current. StephaneLenclud@50: MakeUsageList Current - Previous. StephaneLenclud@50: UsageListLength Represents the length of the usage lists in array StephaneLenclud@50: elements. If comparing two lists with a differing StephaneLenclud@50: number of array elements, this value should be StephaneLenclud@50: the size of the larger of the two lists. Any StephaneLenclud@50: zero found with a list indicates an early termination StephaneLenclud@50: of the list and any usages found after the first zero StephaneLenclud@50: will be ignored. StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: _IRQL_requires_max_(PASSIVE_LEVEL) StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_UsageAndPageListDifference ( StephaneLenclud@50: reads_(UsageListLength) PUSAGE_AND_PAGE PreviousUsageList, StephaneLenclud@50: reads_(UsageListLength) PUSAGE_AND_PAGE CurrentUsageList, StephaneLenclud@50: writes_(UsageListLength) PUSAGE_AND_PAGE BreakUsageList, StephaneLenclud@50: writes_(UsageListLength) PUSAGE_AND_PAGE MakeUsageList, StephaneLenclud@50: ULONG UsageListLength StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // Produce Make or Break Codes StephaneLenclud@50: // StephaneLenclud@50: typedef enum _HIDP_KEYBOARD_DIRECTION { StephaneLenclud@50: HidP_Keyboard_Break, StephaneLenclud@50: HidP_Keyboard_Make StephaneLenclud@50: } HIDP_KEYBOARD_DIRECTION; StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // A bitmap of the current shift state of the keyboard when using the StephaneLenclud@50: // below keyboard usages to i8042 translation function. StephaneLenclud@50: // StephaneLenclud@50: typedef struct _HIDP_KEYBOARD_MODIFIER_STATE { StephaneLenclud@50: union { StephaneLenclud@50: struct { StephaneLenclud@50: ULONG LeftControl: 1; StephaneLenclud@50: ULONG LeftShift: 1; StephaneLenclud@50: ULONG LeftAlt: 1; StephaneLenclud@50: ULONG LeftGUI: 1; StephaneLenclud@50: ULONG RightControl: 1; StephaneLenclud@50: ULONG RightShift: 1; StephaneLenclud@50: ULONG RightAlt: 1; StephaneLenclud@50: ULONG RigthGUI: 1; StephaneLenclud@50: ULONG CapsLock: 1; StephaneLenclud@50: ULONG ScollLock: 1; StephaneLenclud@50: ULONG NumLock: 1; StephaneLenclud@50: ULONG Reserved: 21; StephaneLenclud@50: }; StephaneLenclud@50: ULONG ul; StephaneLenclud@50: }; StephaneLenclud@50: StephaneLenclud@50: } HIDP_KEYBOARD_MODIFIER_STATE, * PHIDP_KEYBOARD_MODIFIER_STATE; StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // A call back function to give the i8042 scan codes to the caller of StephaneLenclud@50: // the below translation function. StephaneLenclud@50: // StephaneLenclud@50: typedef BOOLEAN (* PHIDP_INSERT_SCANCODES) ( StephaneLenclud@50: PVOID Context, // Some caller supplied context. StephaneLenclud@50: reads_bytes_(Length) PCHAR NewScanCodes, // A list of i8042 scan codes. StephaneLenclud@50: ULONG Length // the length of the scan codes. StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_TranslateUsageAndPagesToI8042ScanCodes ( StephaneLenclud@50: reads_(UsageListLength) PUSAGE_AND_PAGE ChangedUsageList, StephaneLenclud@50: ULONG UsageListLength, StephaneLenclud@50: HIDP_KEYBOARD_DIRECTION KeyAction, StephaneLenclud@50: PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, StephaneLenclud@50: PHIDP_INSERT_SCANCODES InsertCodesProcedure, StephaneLenclud@50: PVOID InsertCodesContext StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Parameters: StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: NTSTATUS __stdcall StephaneLenclud@50: HidP_TranslateUsagesToI8042ScanCodes ( StephaneLenclud@50: reads_(UsageListLength) PUSAGE ChangedUsageList, StephaneLenclud@50: ULONG UsageListLength, StephaneLenclud@50: HIDP_KEYBOARD_DIRECTION KeyAction, StephaneLenclud@50: PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, StephaneLenclud@50: PHIDP_INSERT_SCANCODES InsertCodesProcedure, StephaneLenclud@50: PVOID InsertCodesContext StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Parameters: StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // Define NT Status codes with Facility Code of FACILITY_HID_ERROR_CODE StephaneLenclud@50: // StephaneLenclud@50: StephaneLenclud@50: // FACILITY_HID_ERROR_CODE defined in ntstatus.h StephaneLenclud@50: #ifndef FACILITY_HID_ERROR_CODE StephaneLenclud@50: #define FACILITY_HID_ERROR_CODE 0x11 StephaneLenclud@50: #endif StephaneLenclud@50: StephaneLenclud@50: #define HIDP_ERROR_CODES(SEV, CODE) \ StephaneLenclud@50: ((NTSTATUS) (((SEV) << 28) | (FACILITY_HID_ERROR_CODE << 16) | (CODE))) StephaneLenclud@50: StephaneLenclud@50: #define HIDP_STATUS_SUCCESS (HIDP_ERROR_CODES(0x0,0)) StephaneLenclud@50: #define HIDP_STATUS_NULL (HIDP_ERROR_CODES(0x8,1)) StephaneLenclud@50: #define HIDP_STATUS_INVALID_PREPARSED_DATA (HIDP_ERROR_CODES(0xC,1)) StephaneLenclud@50: #define HIDP_STATUS_INVALID_REPORT_TYPE (HIDP_ERROR_CODES(0xC,2)) StephaneLenclud@50: #define HIDP_STATUS_INVALID_REPORT_LENGTH (HIDP_ERROR_CODES(0xC,3)) StephaneLenclud@50: #define HIDP_STATUS_USAGE_NOT_FOUND (HIDP_ERROR_CODES(0xC,4)) StephaneLenclud@50: #define HIDP_STATUS_VALUEOF_RANGE (HIDP_ERROR_CODES(0xC,5)) StephaneLenclud@50: #define HIDP_STATUS_BAD_LOG_PHY_VALUES (HIDP_ERROR_CODES(0xC,6)) StephaneLenclud@50: #define HIDP_STATUS_BUFFER_TOO_SMALL (HIDP_ERROR_CODES(0xC,7)) StephaneLenclud@50: #define HIDP_STATUS_INTERNAL_ERROR (HIDP_ERROR_CODES(0xC,8)) StephaneLenclud@50: #define HIDP_STATUS_I8042_TRANS_UNKNOWN (HIDP_ERROR_CODES(0xC,9)) StephaneLenclud@50: #define HIDP_STATUS_INCOMPATIBLE_REPORT_ID (HIDP_ERROR_CODES(0xC,0xA)) StephaneLenclud@50: #define HIDP_STATUS_NOT_VALUE_ARRAY (HIDP_ERROR_CODES(0xC,0xB)) StephaneLenclud@50: #define HIDP_STATUS_IS_VALUE_ARRAY (HIDP_ERROR_CODES(0xC,0xC)) StephaneLenclud@50: #define HIDP_STATUS_DATA_INDEX_NOT_FOUND (HIDP_ERROR_CODES(0xC,0xD)) StephaneLenclud@50: #define HIDP_STATUS_DATA_INDEXOF_RANGE (HIDP_ERROR_CODES(0xC,0xE)) StephaneLenclud@50: #define HIDP_STATUS_BUTTON_NOT_PRESSED (HIDP_ERROR_CODES(0xC,0xF)) StephaneLenclud@50: #define HIDP_STATUS_REPORT_DOES_NOT_EXIST (HIDP_ERROR_CODES(0xC,0x10)) StephaneLenclud@50: #define HIDP_STATUS_NOT_IMPLEMENTED (HIDP_ERROR_CODES(0xC,0x20)) StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // We blundered this status code. StephaneLenclud@50: // StephaneLenclud@50: #define HIDP_STATUS_I8242_TRANS_UNKNOWN HIDP_STATUS_I8042_TRANS_UNKNOWN StephaneLenclud@50: StephaneLenclud@50: /*++ StephaneLenclud@50: StephaneLenclud@50: Copyright (c) Microsoft Corporation. All rights reserved. StephaneLenclud@50: StephaneLenclud@50: Module Name: StephaneLenclud@50: StephaneLenclud@50: HIDSDI.H StephaneLenclud@50: StephaneLenclud@50: Abstract: StephaneLenclud@50: StephaneLenclud@50: This module contains the PUBLIC definitions for the StephaneLenclud@50: code that implements the HID dll. StephaneLenclud@50: StephaneLenclud@50: Environment: StephaneLenclud@50: StephaneLenclud@50: Kernel & user mode StephaneLenclud@50: StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: typedef struct _HIDD_CONFIGURATION { StephaneLenclud@50: PVOID cookie; StephaneLenclud@50: ULONG size; StephaneLenclud@50: ULONG RingBufferSize; StephaneLenclud@50: } HIDD_CONFIGURATION, *PHIDD_CONFIGURATION; StephaneLenclud@50: StephaneLenclud@50: typedef struct _HIDD_ATTRIBUTES { StephaneLenclud@50: ULONG Size; // = sizeof (struct _HIDD_ATTRIBUTES) StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // Vendor ids of this hid device StephaneLenclud@50: // StephaneLenclud@50: USHORT VendorID; StephaneLenclud@50: USHORT ProductID; StephaneLenclud@50: USHORT VersionNumber; StephaneLenclud@50: StephaneLenclud@50: // StephaneLenclud@50: // Additional fields will be added to the end of this structure. StephaneLenclud@50: // StephaneLenclud@50: } HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES; StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetAttributes ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PHIDD_ATTRIBUTES Attributes StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Fill in the given HIDD_ATTRIBUTES structure with the attributes of the StephaneLenclud@50: given hid device. StephaneLenclud@50: StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: void __stdcall StephaneLenclud@50: HidD_GetHidGuid ( StephaneLenclud@50: LPGUID HidGuid StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetPreparsedData ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PHIDP_PREPARSED_DATA * PreparsedData StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Given a handle to a valid Hid Class Device Object, retrieve the preparsed StephaneLenclud@50: data for the device. This routine will allocate the appropriately StephaneLenclud@50: sized buffer to hold this preparsed data. It is up to client to call StephaneLenclud@50: HidP_FreePreparsedData to free the memory allocated to this structure when StephaneLenclud@50: it is no longer needed. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device that the client obtains using StephaneLenclud@50: a call to CreateFile on a valid Hid device string name. StephaneLenclud@50: The string name can be obtained using standard PnP calls. StephaneLenclud@50: StephaneLenclud@50: PreparsedData An opaque data structure used by other functions in this StephaneLenclud@50: library to retrieve information about a given device. StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful. StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_FreePreparsedData ( StephaneLenclud@50: __drv_freesMem(Mem) PHIDP_PREPARSED_DATA PreparsedData StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_FlushQueue ( StephaneLenclud@50: HANDLE HidDeviceObject StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Flush the input queue for the given HID device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device that the client obtains using StephaneLenclud@50: a call to CreateFile on a valid Hid device string name. StephaneLenclud@50: The string name can be obtained using standard PnP calls. StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetConfiguration ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PHIDD_CONFIGURATION Configuration, StephaneLenclud@50: ULONG ConfigurationLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Get the configuration information for this Hid device StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: Configuration A configuration structure. HidD_GetConfiguration MUST StephaneLenclud@50: be called before the configuration can be modified and StephaneLenclud@50: set using HidD_SetConfiguration StephaneLenclud@50: StephaneLenclud@50: ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this StephaneLenclud@50: parameter, we can later increase the length of the StephaneLenclud@50: configuration array and not break older apps. StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_SetConfiguration ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: reads_bytes_(ConfigurationLength) PHIDD_CONFIGURATION Configuration, StephaneLenclud@50: ULONG ConfigurationLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Set the configuration information for this Hid device... StephaneLenclud@50: StephaneLenclud@50: NOTE: HidD_GetConfiguration must be called to retrieve the current StephaneLenclud@50: configuration information before this information can be modified StephaneLenclud@50: and set. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: Configuration A configuration structure. HidD_GetConfiguration MUST StephaneLenclud@50: be called before the configuration can be modified and StephaneLenclud@50: set using HidD_SetConfiguration StephaneLenclud@50: StephaneLenclud@50: ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this StephaneLenclud@50: parameter, we can later increase the length of the StephaneLenclud@50: configuration array and not break older apps. StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetFeature ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PVOID ReportBuffer, StephaneLenclud@50: ULONG ReportBufferLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Retrieve a feature report from a HID device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: ReportBuffer The buffer that the feature report should be placed StephaneLenclud@50: into. The first byte of the buffer should be set to StephaneLenclud@50: the report ID of the desired report StephaneLenclud@50: StephaneLenclud@50: ReportBufferLength The size (in bytes) of ReportBuffer. This value StephaneLenclud@50: should be greater than or equal to the StephaneLenclud@50: FeatureReportByteLength field as specified in the StephaneLenclud@50: HIDP_CAPS structure for the device StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_SetFeature ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: reads_bytes_(ReportBufferLength) PVOID ReportBuffer, StephaneLenclud@50: ULONG ReportBufferLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Send a feature report to a HID device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: ReportBuffer The buffer of the feature report to send to the device StephaneLenclud@50: StephaneLenclud@50: ReportBufferLength The size (in bytes) of ReportBuffer. This value StephaneLenclud@50: should be greater than or equal to the StephaneLenclud@50: FeatureReportByteLength field as specified in the StephaneLenclud@50: HIDP_CAPS structure for the device StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetInputReport ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PVOID ReportBuffer, StephaneLenclud@50: ULONG ReportBufferLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Retrieve an input report from a HID device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: ReportBuffer The buffer that the input report should be placed StephaneLenclud@50: into. The first byte of the buffer should be set to StephaneLenclud@50: the report ID of the desired report StephaneLenclud@50: StephaneLenclud@50: ReportBufferLength The size (in bytes) of ReportBuffer. This value StephaneLenclud@50: should be greater than or equal to the StephaneLenclud@50: InputReportByteLength field as specified in the StephaneLenclud@50: HIDP_CAPS structure for the device StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_SetOutputReport ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: reads_bytes_(ReportBufferLength) PVOID ReportBuffer, StephaneLenclud@50: ULONG ReportBufferLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: Send an output report to a HID device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: ReportBuffer The buffer of the output report to send to the device StephaneLenclud@50: StephaneLenclud@50: ReportBufferLength The size (in bytes) of ReportBuffer. This value StephaneLenclud@50: should be greater than or equal to the StephaneLenclud@50: OutputReportByteLength field as specified in the StephaneLenclud@50: HIDP_CAPS structure for the device StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: #endif StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetNumInputBuffers ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PULONG NumberBuffers StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function returns the number of input buffers used by the specified StephaneLenclud@50: file handle to the Hid device. Each file object has a number of buffers StephaneLenclud@50: associated with it to queue reports read from the device but which have StephaneLenclud@50: not yet been read by the user-mode app with a handle to that device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: NumberBuffers Number of buffers currently being used for this file StephaneLenclud@50: handle to the Hid device StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_SetNumInputBuffers ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: ULONG NumberBuffers StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function sets the number of input buffers used by the specified StephaneLenclud@50: file handle to the Hid device. Each file object has a number of buffers StephaneLenclud@50: associated with it to queue reports read from the device but which have StephaneLenclud@50: not yet been read by the user-mode app with a handle to that device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: NumberBuffers New number of buffers to use for this file handle to StephaneLenclud@50: the Hid device StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetPhysicalDescriptor ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PVOID Buffer, StephaneLenclud@50: ULONG BufferLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function retrieves the raw physical descriptor for the specified StephaneLenclud@50: Hid device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: Buffer Buffer which on return will contain the physical StephaneLenclud@50: descriptor if one exists for the specified device StephaneLenclud@50: handle StephaneLenclud@50: StephaneLenclud@50: BufferLength Length of buffer (in bytes) StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetManufacturerString ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PVOID Buffer, StephaneLenclud@50: ULONG BufferLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function retrieves the manufacturer string from the specified StephaneLenclud@50: Hid device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: Buffer Buffer which on return will contain the manufacturer StephaneLenclud@50: string returned from the device. This string is a StephaneLenclud@50: wide-character string StephaneLenclud@50: StephaneLenclud@50: BufferLength Length of Buffer (in bytes) StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetProductString ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PVOID Buffer, StephaneLenclud@50: ULONG BufferLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function retrieves the product string from the specified StephaneLenclud@50: Hid device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: Buffer Buffer which on return will contain the product StephaneLenclud@50: string returned from the device. This string is a StephaneLenclud@50: wide-character string StephaneLenclud@50: StephaneLenclud@50: BufferLength Length of Buffer (in bytes) StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetIndexedString ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: ULONG StringIndex, StephaneLenclud@50: PVOID Buffer, StephaneLenclud@50: ULONG BufferLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function retrieves a string from the specified Hid device that is StephaneLenclud@50: specified with a certain string index. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: StringIndex Index of the string to retrieve StephaneLenclud@50: StephaneLenclud@50: Buffer Buffer which on return will contain the product StephaneLenclud@50: string returned from the device. This string is a StephaneLenclud@50: wide-character string StephaneLenclud@50: StephaneLenclud@50: BufferLength Length of Buffer (in bytes) StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetSerialNumberString ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PVOID Buffer, StephaneLenclud@50: ULONG BufferLength StephaneLenclud@50: ); StephaneLenclud@50: /*++ StephaneLenclud@50: Routine Description: StephaneLenclud@50: This function retrieves the serial number string from the specified StephaneLenclud@50: Hid device. StephaneLenclud@50: StephaneLenclud@50: Arguments: StephaneLenclud@50: HidDeviceObject A handle to a Hid Device Object. StephaneLenclud@50: StephaneLenclud@50: Buffer Buffer which on return will contain the serial number StephaneLenclud@50: string returned from the device. This string is a StephaneLenclud@50: wide-character string StephaneLenclud@50: StephaneLenclud@50: BufferLength Length of Buffer (in bytes) StephaneLenclud@50: StephaneLenclud@50: Return Value: StephaneLenclud@50: TRUE if successful StephaneLenclud@50: FALSE otherwise -- Use GetLastError() to get extended error information StephaneLenclud@50: --*/ StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: BOOLEAN __stdcall StephaneLenclud@50: HidD_GetMsGenreDescriptor ( StephaneLenclud@50: HANDLE HidDeviceObject, StephaneLenclud@50: PVOID Buffer, StephaneLenclud@50: ULONG BufferLength StephaneLenclud@50: ); StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: StephaneLenclud@50: