IMDSPDevice2::GetCanonicalName method (mswmdm.h)

The GetCanonicalPName method gets the canonical name of a device.

Syntax

HRESULT GetCanonicalName(
  [out] LPWSTR pwszPnPName,
  [in]  UINT   nMaxChars
);

Parameters

[out] pwszPnPName

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

[in] nMaxChars

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

Return value

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

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

Requirement Value
Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

IMDSPDevice2 Interface

IMDServiceProvider2 Interface

IMDServiceProvider2::CreateDevice