Compartir a través de


FindFirstDevice (Windows CE 5.0)

Send Feedback

This function searches for device information and fills a DEVMGR_DEVICE_INFORMATION structure with this information.

HANDLE FindFirstDevice(  DeviceSearchType searchType,  LPCVOID pvSearchParam,  PDEVMGR_DEVICE_INFORMATION pdi);

Parameters

  • searchType
    [in] Method of searching for a device. Set to an element of the DeviceSearchType enumeration.
  • pvSearchParam
    [in] Pointer to a string, pointer to a GUID, or an activation handle. The following table shows examples of these based on the element of DeviceSearchType passed in searchType.
    searchType pvSearchParam
    DeviceSearchByLegacyName L"COM*" for all COMx: devices.
    DeviceSearchByDeviceName L"COM*" for all COMx devices.
    DeviceSearchByBusName L"PCI_0_3*" for PCI_0_3_0, PCI_0_3_1 and so on.
    DeviceSearchByGuid Pointer to a GUID.
    DeviceSearchByParent Activation handle value from ActivateDeviceEx.
  • pdi
    [out] Pointer to a DEVMGR_DEVICE_INFORMATION structure to store the device's information.

Return Values

If successful, FindFirstDevice returns a search handle that can be used in subsequent calls to FindNextDevice. If the function is not successful, it returns INVALID_HANDLE_VALUE. To obtain extended error information, the application can call the GetLastError function.

Remarks

Wildcards are supported in name-based searches. Unnamed devices can be found using a zero-length search string.

Close the handle with FindClose when searching is complete.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Winbase.h.

See Also

DeviceSearchType | DEVMGR_DEVICE_INFORMATION | FindClose | FindNextDevice

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.