KsOpenDefaultDevice function (ksproxy.h)
The KsOpenDefaultDevice function opens a handle to the first device that is listed in the specified Plug and Play (PnP) category.
Syntax
KSDDKAPI HRESULT KsOpenDefaultDevice(
[in] REFGUID Category,
[in] ACCESS_MASK Access,
[out] PHANDLE DeviceHandle
);
Parameters
[in] Category
Identifier of the PnP category to enumerate.
[in] Access
An ACCESS_MASK bitmask specifying how to access the default device.
[out] DeviceHandle
Pointer to a variable that receives the handle to the default device that is opened.
Return value
Returns NOERROR if successful; otherwise, returns an error code.
Remarks
The KsOpenDefaultDevice function passes a pointer to Category in a call to the SetupDiGetClassDevs function to obtain a handle to the list of PnP devices. For more information about the ACCESS_MASK bitmask and SetupDiGetClassDevs, see the Microsoft Windows SDK documentation.
Requirements
Requirement | Value |
---|---|
Target Platform | Desktop |
Header | ksproxy.h (include Ksproxy.h) |
Library | Ksproxy.lib |