IWDFIoRequest::SetInformation method

[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]

The SetInformation method sets the size of information for a request.

Syntax


void SetInformation(
  [in] ULONG_PTR Information
);

Parameters

Information [in]

A ULONG_PTR value that specifies the size of information to set for the request.

Return value

None

Examples

The following code example sets the size of a request's information.


HRESULT
CUmdfHidFile::HandleGetCollectionInformation(
    __in IWDFIoRequest* WdfRequest
    )
{
    PHIDP_COLLECTION_DESC collectionDesc = m_Collection->GetCollectionDesc();
    HID_COLLECTION_INFORMATION collectionInfo;

    CComPtr<IWDFMemory> wdfMemory;

    HRESULT hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);

    collectionInfo.DescriptorSize = collectionDesc->PreparsedDataLength;
    collectionInfo.Polled = false;
    collectionInfo.Reserved1[0] = 0;
    collectionInfo.VendorID = 0;
    collectionInfo.ProductID = 0;
    collectionInfo.VersionNumber = 0;

    WdfRequest->GetOutputMemory(&wdfMemory);

    if (wdfMemory != NULL)
    {
        hr = wdfMemory->CopyFromBuffer(0, 
                                       &collectionInfo, 
                                       sizeof(collectionInfo));
    }

    if (SUCCEEDED(hr))
    {
        WdfRequest->SetInformation(sizeof(collectionInfo));
    }

    return hr;
}

Requirements

Target platform

Desktop

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.5

Header

Wudfddi.h (include Wudfddi.h)

DLL

WUDFx.dll

See also

IWDFIoRequest

 

 

Send comments about this topic to Microsoft

Show: