IPart::GetGlobalId method (devicetopology.h)
The GetGlobalId method gets the global ID of this part.
Syntax
HRESULT GetGlobalId(
[out] LPWSTR *ppwstrGlobalId
);
Parameters
[out] ppwstrGlobalId
Pointer to a pointer variable into which the method writes the address of a null-terminated, wide-character string that contains the global ID. The method allocates the storage for the string. The caller is responsible for freeing the storage, when it is no longer needed, by calling the CoTaskMemFree function. If the GetGlobalId call fails, *ppwstrGlobalId is NULL. For information about CoTaskMemFree, see the Windows SDK documentation.
Return value
If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.
Return code | Description |
---|---|
|
Pointer ppwstrGlobalId is NULL. |
|
Out of memory. |
Remarks
A global ID is a string that uniquely identifies a part among all parts in all device topologies in the system. Clients should treat this string as opaque. That is, clients should not attempt to parse the contents of the string to obtain information about the part. The reason is that the string format is undefined and might change from one implementation of the DeviceTopology API to the next.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | devicetopology.h |