Partager via


EnumPnpIds (Compact 2013)

3/26/2014

This function returns a list of the Plug and Play identifiers that are currently active in the system. Calling RequestDeviceNotifications with DEVCLASS_STREAM_GUID supersedes this function.

Syntax

DWORD EnumPnpIds(
  LPTSTR lpszPnpList,
  LPDWORD lpBuflen
);

Parameters

  • lpszPnpList
    [in] List of null-terminated strings. The list terminates with two consecutive null characters, one that terminates the last entry in the list and another null character to terminate the list. For example, MEGAHERTZ-XJ2288-9E81\0XIRCOM-X2250-F877\0\0.
  • lpBuflen
    [in] Pointer to a DWORD containing the length of the lpszPnpList buffer that the caller allocated. If the buffer is too small to hold the entire list, then EnumPnpIds stores the necessary buffer size in lpBufLen.

Return Value

The following table shows the return values for this function.

Value

Description

ERROR_SUCCESS

The function returned successfully.

ERROR_INSUFFICIENT_BUFFER

The buffer size was sufficient, but the buffer pointer was NULL.

Because the buffer size is treated as valid even when the buffer pointer is set to NULL, a return value of ERROR_INSUFFICIENT_BUFFER means that a call to EnumPnpIds with a particular buffer size would have succeeded had it been made with a non-NULL buffer pointer.

ERROR_INVALID_PARAMETER

The lpBufLen parameter was NULL.

ERROR_MORE_DATA

The buffer size passed in was not large enough to hold all the data items.

ERROR_NO_MORE_DEVICES

EnumPnpIds failed to find any active Plug and Play identifiers.

Remarks

Device drivers should not use this function.

Requirements

Header

devload.h

Library

coredll.lib

See Also

Reference

Device Manager Functions
RequestDeviceNotifications