Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

HidD_FreePreparsedData (hid)
 
.
Summary
The routine releases the resources that the HID class driver allocated to hold a top-level collection's preparsed data.

C# Signature:

[DllImport("hid.dll", SetLastError=true)]
static extern Boolean HidD_FreePreparsedData(IntPtr PreparsedData);

VB Signature:

Declare Function HidD_FreePreparsedData Lib "hid.dll" (ByRef PreparsedData As Integer) As Boolean

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Return Value - Returns TRUE if the routine succeeds. Otherwise, it returns FALSE if the buffer was not a preparsed data buffer.

Tips & Tricks:

Please add some!

Sample Code:

Code In C#:

    internal HIDP_CAPS GetDeviceCapabilities( SafeFileHandle hidHandle )
    {        
        Byte[] preparsedDataBytes = new Byte[ 30 ];
        String preparsedDataString = null;
        IntPtr preparsedDataPointer = new System.IntPtr();
        Int32 result = 0;
        Boolean success = false;
        Byte[] valueCaps = new Byte[ 1024 ]; // (the array size is a guess)

        try
        {        

        success = HidD_GetPreparsedData( hidHandle, ref preparsedDataPointer );

        //  Copy the data at PreparsedDataPointer into a byte array.

        preparsedDataString = Convert.ToBase64String( preparsedDataBytes );

        result = HidP_GetCaps( preparsedDataPointer, ref Capabilities );
        if ( ( result != 0 ) )
        {            
            result = HidP_GetValueCaps(HidP_Input, ref valueCaps[0], ref Capabilities.NumberInputValueCaps, preparsedDataPointer);

            success = HidD_FreePreparsedData( ref preparsedDataPointer );            
        }        
        }
        catch ( Exception ex )
        {
        DisplayException( MODULE_NAME, ex );
        throw ;
        }

        return Capabilities;        
    }

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions