Partager via


IMDSPDevice2::GetCanonicalName

banner art

The GetCanonicalPName method gets the canonical name of a device.

Syntax

HRESULT GetCanonicalName(LPWSTRpwszPnPName,UINTnMaxChars);

Parameters

pwszPnPName

[out]  A wide character, null-terminated buffer holding the canonical name. The caller allocates and releases this buffer.

nMaxChars

[in]  Integer containing the maximum number of characters that can be placed in pwszCanonicalName, including the termination character.

Return Values

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Possible values include, but are not limited to, those in the following table.

Return code Description
E_INVALIDARG The pwszCanonicalName parameter is an invalid or NULL pointer.
WMDM_E_NOTSUPPORTED The device does not support a canonical name.
WMDM_E_BUFFERTOOSMALL The buffer specified is too small for the canonical name.
E_FAIL An unspecified error occurred.

Remarks

This method returns a canonical name for the device. The service provider should return the device path name of the device as its canonical name. The service provider is passed the device path name in the CreateDevice method on the IMDServiceProvider2 interface.

This is optional. For more information, see Mandatory and Optional Interfaces.

Requirements

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also