<div class="content"><p>This method is called by a client to request a <a href="e6e3f493-e460-4df6-95a1-74ff12ea822d#gt_86177a04-79cb-4afe-803c-be6155b69479" data-linktype="relative-path">process dump</a> for the
process containing a particular <a href="e6e3f493-e460-4df6-95a1-74ff12ea822d#gt_791190e6-1e02-42cb-bd25-5aee3ab516ed" data-linktype="relative-path">instance container</a>.</p><dl>
<dd>
<div><pre> [id(2)] HRESULT DumpProcess(
   [in] BSTR bstrContainerID,
   [in] BSTR bstrDirectory,
   [in] DWORD dwMaxFiles,
   [out, retval] BSTR* pbstrDumpFile
 );
</pre></div>
</dd></dl><p><b>bstrContainerID: </b>The <a href="dc2d8c03-c1ff-42f6-8b46-6653b7077a4d" data-linktype="relative-path">CurlyBraceGuidString</a>
(section 2.2.1) representation of a container identifier for a distinguished
container.</p><p><b>bstrDirectory: </b>Either a path, in the
convention of the server&#39;s file system, to a location in which the file
produced by process dump is to be written, or NULL to indicate that the client
wants the COMT server to write the file to an implementation-specific default
location.</p><p><b>dwMaxFiles: </b>The maximum number of process dump
files associated with the <a href="e6e3f493-e460-4df6-95a1-74ff12ea822d#gt_ea5c531f-5dd5-43aa-9da1-2ae068c622db" data-linktype="relative-path">conglomeration</a>
of the instance container identified by the <i>bstrContainerID</i> parameter
that the client requests the COMT server to leave in the location specified by
the <i>bstrDirectory</i> parameter before the server begins deleting previously
written files. A value of 0x00000000 indicates that the COMT server is to use
an implementation-specific default limit.</p><p><b>pbstrDumpFile: </b>A pointer to a variable that,
upon successful completion, contains a fully qualified path, in the convention
of the server&#39;s file system, to the process dump file written.</p><p><b>Return Values: </b>This method MUST return S_OK
(0x00000000) on success and a failure result (as specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/0642cb2f-2075-4469-918c-4441e69c548a" data-linktype="relative-path">2.1</a>)
on failure.</p><p>When this method is invoked, if the server does not support
process dump, it MUST simply return E_NOTIMPL (0x80004001). Otherwise, the
server MUST verify that the <i>bstrContainerID</i> parameter identifies a
tracked instance container, and that this instance container is a <a href="e6e3f493-e460-4df6-95a1-74ff12ea822d#gt_82990f08-d334-4eed-94ee-be16d82f630b" data-linktype="relative-path">distinguished container</a>,
and fail the call if not.</p><p>The server then MUST verify that the <i>bstrDirectory</i>
parameter, if not NULL, is in a file path syntax supported<a id="Appendix_A_Target_20"></a><a aria-label="Product behavior note 20" href="8a5428f5-1574-4b06-9c20-5963b11e9035#Appendix_A_20" data-linktype="relative-path">&lt;20&gt;</a> by the server and fail the call
if not. If <i>bstrDirectory</i> is not NULL, the server MUST select the
location specified by this parameter as the dump file location, the use of which
is described later in this section. Otherwise, the server MUST select an
implementation-specific <a id="Appendix_A_Target_21"></a><a aria-label="Product behavior note 21" href="8a5428f5-1574-4b06-9c20-5963b11e9035#Appendix_A_21" data-linktype="relative-path">&lt;21&gt;</a> default
location.</p><p>The server then MUST select the dump file limit, the use of
which is described later in this section, as the value specified by the <i>dwMaxFiles</i>
parameter if this parameter is nonzero, and an implementation-specific <a id="Appendix_A_Target_22"></a><a aria-label="Product behavior note 22" href="8a5428f5-1574-4b06-9c20-5963b11e9035#Appendix_A_22" data-linktype="relative-path">&lt;22&gt;</a> default limit if this parameter
is zero.</p><p>The server SHOULD<a id="Appendix_A_Target_23"></a><a aria-label="Product behavior note 23" href="8a5428f5-1574-4b06-9c20-5963b11e9035#Appendix_A_23" data-linktype="relative-path">&lt;23&gt;</a>
impersonate the client while performing any file access specified in the
remainder of the method behavior.</p><p>The server then SHOULD attempt to determine the number of
previously written process dump files that are associated with the
conglomeration of the instance container identified in <i>bstrContainerID</i>
in the dump file location, and MAY fail the call if it cannot do so. If the
number of previously written files is greater than or equal to the dump file
limit, the server SHOULD attempt to delete at least one of the previously
written files, and MAY fail the call if it cannot do so. If more than one
previously written file exists, the server SHOULD attempt to determine which of
these files was written least recently, and SHOULD select that file for
deletion.</p><p>The server then MUST attempt to perform an
implementation-specific <a id="Appendix_A_Target_24"></a><a aria-label="Product behavior note 24" href="8a5428f5-1574-4b06-9c20-5963b11e9035#Appendix_A_24" data-linktype="relative-path">&lt;24&gt;</a> process
dump procedure by writing a file to the dump file location, and fail the call
if it cannot.</p><p>The server then MUST set the <i>pbstrDumpFile</i> parameter
to the fully qualified path to the file written, and return success.</p></div>