⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hid.par

📁 基于DELPHI的API
💻 PAR
📖 第 1 页 / 共 5 页
字号:
{$EXTERNALSYM HidD_GetFeature}

// Routine Description:
//     Send a feature report to a HID device.
//
// Arguments:
//     HidDeviceObject      A handle to a Hid Device Object.
//
//     ReportBuffer         The buffer of the feature report to send to the device
//
//     ReportBufferLength   The size (in bytes) of ReportBuffer.  This value
//                          should be greater than or equal to the
//                          FeatureReportByteLength field as specified in the
//                          HIDP_CAPS structure for the device
// Return Value:
//     TRUE if successful
//     FALSE otherwise  -- Use GetLastError() to get extended error information

function HidD_SetFeature(HidDeviceObject: THandle;
  var Report; Size: Integer): LongBool; stdcall;
{$EXTERNALSYM HidD_SetFeature}

// Routine Description:
//     This function returns the number of input buffers used by the specified
//     file handle to the Hid device.  Each file object has a number of buffers
//     associated with it to queue reports read from the device but which have
//     not yet been read by the user-mode app with a handle to that device.
//
// Arguments:
//     HidDeviceObject      A handle to a Hid Device Object.
//
//     NumberBuffers        Number of buffers currently being used for this file
//                          handle to the Hid device
//
// Return Value:
//     TRUE if successful
//     FALSE otherwise  -- Use GetLastError() to get extended error information

function HidD_GetNumInputBuffers(HidDeviceObject: THandle;
  var NumBufs: Integer): LongBool; stdcall;
{$EXTERNALSYM HidD_GetNumInputBuffers}

// Routine Description:
//     This function sets the number of input buffers used by the specified
//     file handle to the Hid device.  Each file object has a number of buffers
//     associated with it to queue reports read from the device but which have
//     not yet been read by the user-mode app with a handle to that device.
//
// Arguments:
//     HidDeviceObject      A handle to a Hid Device Object.
//
//     NumberBuffers        New number of buffers to use for this file handle to
//                          the Hid device
//
// Return Value:
//     TRUE if successful
//     FALSE otherwise  -- Use GetLastError() to get extended error information

function HidD_SetNumInputBuffers(HidDeviceObject: THandle;
  NumBufs: Integer): LongBool; stdcall;
{$EXTERNALSYM HidD_SetNumInputBuffers}

// Routine Description:
//     Given a handle to a valid Hid Class Device Object, retrieve the preparsed
//     data for the device.  This routine will allocate the appropriately
//     sized buffer to hold this preparsed data.  It is up to client to call
//     HidD_FreePreparsedData to free the memory allocated to this structure when
//     it is no longer needed.
//
// Arguments:
//    HidDeviceObject A handle to a Hid Device that the client obtains using
//                    a call to CreateFile on a valid Hid device string name.
//                    The string name can be obtained using standard PnP calls.
//
//    PreparsedData   An opaque data structure used by other functions in this
//                    library to retrieve information about a given device.
//
// Return Value:
//    TRUE if successful.
//    FALSE otherwise  -- Use GetLastError() to get extended error information

function HidD_GetAttributes(HidDeviceObject: THandle;
  var HidAttrs: THIDDAttributes): LongBool; stdcall;
{$EXTERNALSYM HidD_GetAttributes}

// Routine Description:
//     This function retrieves the manufacturer string from the specified
//     Hid device.
//
// Arguments:
//     HidDeviceObject      A handle to a Hid Device Object.
//
//     Buffer               Buffer which on return will contain the manufacturer
//                          string returned from the device.  This string is a
//                          wide-character string
//
//     BufferLength         Length of Buffer (in bytes)
//
// Return Value:
//     TRUE if successful
//     FALSE otherwise  -- Use GetLastError() to get extended error information

function HidD_GetManufacturerString(HidDeviceObject: THandle;
  Buffer: PWideChar; BufferLength: Integer): LongBool; stdcall;
{$EXTERNALSYM HidD_GetManufacturerString}

// Routine Description:
//     This function retrieves the product string from the specified
//     Hid device.
//
// Arguments:
//     HidDeviceObject      A handle to a Hid Device Object.
//
//     Buffer               Buffer which on return will contain the product
//                          string returned from the device.  This string is a
//                          wide-character string
//
//     BufferLength         Length of Buffer (in bytes)
//
// Return Value:
//     TRUE if successful
//     FALSE otherwise  -- Use GetLastError() to get extended error information

function HidD_GetProductString(HidDeviceObject: THandle;
  Buffer: PWideChar; BufferLength: Integer): LongBool; stdcall;
{$EXTERNALSYM HidD_GetProductString}

// Routine Description:
//     This function retrieves the serial number string from the specified
//     Hid device.
//
// Arguments:
//     HidDeviceObject      A handle to a Hid Device Object.
//
//     Buffer               Buffer which on return will contain the serial number
//                          string returned from the device.  This string is a
//                          wide-character string
//
//     BufferLength         Length of Buffer (in bytes)
//
// Return Value:
//     TRUE if successful
//     FALSE otherwise  -- Use GetLastError() to get extended error information

function HidD_GetSerialNumberString(HidDeviceObject: THandle;
  Buffer: PWideChar; BufferLength: Integer): LongBool; stdcall;
{$EXTERNALSYM HidD_GetSerialNumberString}

// Routine Description:
//     This function retrieves the raw physical descriptor for the specified
//     Hid device.
//
// Arguments:
//     HidDeviceObject      A handle to a Hid Device Object.
//
//     Buffer               Buffer which on return will contain the physical
//                          descriptor if one exists for the specified device
//                          handle
//
//     BufferLength         Length of buffer (in bytes)
//
// Return Value:
//     TRUE if successful
//     FALSE otherwise  -- Use GetLastError() to get extended error information

function HidD_GetPhysicalDescriptor(HidDeviceObject: THandle;
  var Buffer; BufferLength: Integer): LongBool; stdcall;
{$EXTERNALSYM HidD_GetPhysicalDescriptor}

// Routine Description:
//     This function retrieves a string from the specified Hid device that is
//     specified with a certain string index.
//
// Arguments:
//     HidDeviceObject      A handle to a Hid Device Object.
//
//     StringIndex          Index of the string to retrieve
//
//     Buffer               Buffer which on return will contain the product
//                          string returned from the device.  This string is a
//                          wide-character string
//
//     BufferLength         Length of Buffer (in bytes)
//
// Return Value:
//     TRUE if successful
//     FALSE otherwise  -- Use GetLastError() to get extended error information

function HidD_GetIndexedString(HidDeviceObject: THandle;
  Index: Integer; Buffer: PWideChar; BufferLength: Integer): LongBool; stdcall;
{$EXTERNALSYM HidD_GetIndexedString}

// Routine Description:
//    Returns a list of capabilities of a given hid device as described by its
//    preparsed data.
// 
// Arguments:
//    PreparsedData    The preparsed data returned from HIDCLASS.
//    Capabilities     a HIDP_CAPS structure
// 
// Return Value:
// -  HIDP_STATUS_SUCCESS
// -  HIDP_STATUS_INVALID_PREPARSED_DATA

function HidP_GetCaps(PreparsedData: PHIDPPreparsedData;
  var Capabilities: THIDPCaps): NTSTATUS; stdcall;
{$EXTERNALSYM HidP_GetCaps}

// Routine Description:
//    Return a list of PHIDP_LINK_COLLECTION_NODEs used to describe the link
//    collection tree of this hid device.  See the above description of
//    struct _HIDP_LINK_COLLECTION_NODE.
// 
// Arguments:
//    LinkCollectionNodes - a caller allocated array into which
//                  HidP_GetLinkCollectionNodes will store the information
// 
//    LinkCollectionNodesLength - the caller sets this value to the length of the
//                  the array in terms of number of elements.
//                  HidP_GetLinkCollectionNodes sets this value to the actual
//                  number of elements set. The total number of nodes required to
//                  describe this HID device can be found in the
//                  NumberLinkCollectionNodes field in the HIDP_CAPS structure.

function HidP_GetLinkCollectionNodes(LinkCollectionNodes: PHIDPLinkCollectionNode;
  var LinkCollectionNodesLength: ULONG; PreparsedData: PHIDPPreparsedData): NTSTATUS; stdcall;
{$EXTERNALSYM HidP_GetLinkCollectionNodes}

function HidP_GetSpecificButtonCaps(ReportType: THIDPReportType;
  UsagePage: TUsage; LinkCollection: Word; Usage: TUsage; ButtonCaps: PHIDPButtonCaps;
  var ButtonCapsLength: Word; PreparsedData: PHIDPPreparsedData): NTSTATUS; stdcall;
{$EXTERNALSYM HidP_GetSpecificButtonCaps}

// Description:
//    HidP_GetButtonCaps returns all the buttons (binary values) that are a part
//    of the given report type for the Hid device represented by the given
//    preparsed data.
// 
// Parameters:
//    ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
// 
//    UsagePage   A usage page value used to limit the button caps returned to
//                 those on a given usage page.  If set to 0, this parameter is
//                 ignored.  Can be used with LinkCollection and Usage parameters
//                 to further limit the number of button caps structures returned.
// 
//    LinkCollection HIDP_LINK_COLLECTION node array index used to limit the
//                   button caps returned to those buttons in a given link
//                   collection.  If set to 0, this parameter is
//                   ignored.  Can be used with UsagePage and Usage parameters
//                   to further limit the number of button caps structures
//                   returned.
// 
//    Usage      A usage value used to limit the button caps returned to those
//                with the specified usage value.  If set to 0, this parameter
//                is ignored.  Can be used with LinkCollection and UsagePage
//                parameters to further limit the number of button caps
//                structures returned.
// 
//    ButtonCaps A _HIDP_BUTTON_CAPS array containing information about all the
//                binary values in the given report.  This buffer is provided by
//                the caller.
// 
//    ButtonLength   As input, this parameter specifies the length of the
//                   ButtonCaps parameter (array) in number of array elements.
//                   As output, this value is set to indicate how many of those
//                   array elements were filled in by the function.  The maximum number of
//                   button caps that can be returned is found in the HIDP_CAPS
//                   structure.  If HIDP_STATUS_BUFFER_TOO_SMALL is returned,
//                   this value contains the number of array elements needed to
//                   successfully complete the request.
// 
//    PreparsedData  The preparsed data returned from HIDCLASS.
// 
// 
// Return Value
// HidP_GetSpecificButtonCaps returns the following error codes:
// - HIDP_STATUS_SUCCESS.
// - HIDP_STATUS_INVALID_REPORT_TYPE
// - HIDP_STATUS_INVALID_PREPARSED_DATA
// - HIDP_STATUS_BUFFER_TOO_SMALL (all given entries however have been filled in)
// - HIDP_STATUS_USAGE_NOT_FOUND

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -