IMDSPDevice2::GetCanonicalName
The GetCanonicalPName method gets the canonical name of a device. This method is optional. For more information, see the second table under Implementing Service Providers.
Syntax
HRESULT GetCanonicalName(
LPWSTR pwszPnPName,
UINT nMaxChars
);
Parameters
pwszPnPName
[out] A wide character buffer for the canonical names.
nMaxChars
[in] Integer containing the maximum number of characters that can be placed in pwszCanonicalName.
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.
Requirements
Header: Defined in wmsp.idl.
Library: mssachlp.lib
See Also