INetCfgComponent::GetPnpDevNodeId method

The GetPnpDevNodeId method retrieves the identifier of a network component's Plug and Play device node.

Syntax

HRESULT GetPnpDevNodeId(
  [out] LPWSTR *ppszwDevNodeId
);

Parameters

  • ppszwDevNodeId [out]
    Pointer to a buffer that receives a constant null-terminated string of 16-bit Unicode characters containing the identifier of a network component's Plug and Play device node.

Return value

Returns zero (S_OK) if successful; otherwise, returns NETCFG_* codes that are defined in Netcfgx.h. If the ppszwDevNodeId parameter is NULL, GetPnpDevNodeId returns E_POINTER. If the component is not a network card, that is, if the component is not a member of network class GUID_DEVCLASS_NET, GetPnpDevNodeId returns E_NOTIMPL.

Remarks

After notify objects call GetPnpDevNodeId to retrieve the identifier of a network component's Plug and Play device node, GetPnpDevNodeId allocates the memory required to store the string containing the identifier. After notify objects finish with the identifier, they must call the COM CoTaskMemFree function to release the memory. For more information about CoTaskMemFree, see the Microsoft Windows SDK.

The form of the identifier of a network component's Plug and Play device node is <enumerator>\<Device ID>\<Instance ID>.

GetPnpDevNodeId is only valid for components that are members of network class GUID_DEVCLASS_NET. GetPnpDevNodeId returns E_NOTIMPL if called for components of other types, including the following:

  • Transports represented by GUID_DEVCLASS_NETTRANS

  • Network services represented by GUID_DEVCLASS_NETSERVICE

  • Network clients represented by GUID_DEVCLASS_NETCLIENT

    Note  NetClient components are deprecated in Windows 8.1, Windows Server 2012 R2, and later.

     

Requirements

Target platform

Desktop

Header

Netcfgx.h (include Netcfgx.h)

 

 

Send comments about this topic to Microsoft