共用方式為


3.1.4.21.6 GetContainerIDFromProcessID (Opnum 8)

This method is called by a client to find the instance container for a process ID.

 HRESULT GetContainerIDFromProcessID(
   [in] DWORD dwPID,
   [out, retval] BSTR* pbstrContainerID
 );

dwPID: The ProcessIdentifier (see section 3.1.1.3.21) of an instance container.

pbstrContainerID: A pointer to a value that, upon successful completion, MUST be set to the Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3) representation of the container identifier of an instance container.

Return Values: This method MUST return S_OK (0x00000000) on success, and a failure result, as specified in [MS-ERREF] section 2.1, on failure. All failure results MUST be treated identically.

Upon receiving a call to this method, the server MUST verify that there exists an instance container with the value dwPID for the ProcessIdentifier property (see section 3.1.1.3.21), and fail the call if not.

The server then MUST attempt to set the value referenced by pbstrContainerID to the Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3) representation of the container identifier of the instance container, and fail the call if it cannot.