Partager via


FindFirstDevice (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

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 Value

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

Header winbase.h
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

Device Manager Functions
DeviceSearchType
DEVMGR_DEVICE_INFORMATION
FindNextDevice

Other Resources

FindClose