<div class="content"><p>The AppCreate method creates a new application at the specified
<a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_086b13f2-2715-4000-a16c-6acc3d59cc19" data-linktype="relative-path">metabase</a> path.</p><dl>
<dd>
<div><pre> HRESULT AppCreate(
   [in, unique, string] LPCWSTR szMDPath,
   [in] BOOL fInProc
 );
</pre></div>
</dd></dl><p><b>szMDPath: </b>A pointer to a Unicode string that
contains the metabase path of the application.</p><p><b>fInProc: </b> A flag indicating whether the
application runs in the parent IIS server process or in its own process.</p><p><b>Return Values: </b> A signed 32-bit value that
indicates return status. If the method returns a negative value, it failed. If
the 12-bit facility code (bits 16–27) is set to 0x007, the value contains a
Win32 error code in the lower 16 bits. Zero or positive values indicate success,
with the lower 16 bits in positive nonzero values containing warnings or flags
defined in the method implementation. For more information about Win32 error
codes and <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>
values, see <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.
</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000000</p>
  <p>S_OK</p>
  </td>
  <td>
  <p>The call was successful.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_e127848e-c66d-427d-b3aa-9f904fa4ada7" data-linktype="relative-path">opnum</a>
field value for this method is 3. </p><p>When processing this call, the server MUST do the following:</p><ul><li><p><span><span> 
</span></span>The <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a>
SHOULD validate that the metabase path specified in the <i>szMDPath</i>
parameter is a valid application path.<a id="Appendix_A_Target_26"></a><a aria-label="Product behavior note 26" href="88fd1df0-e63e-41ca-9bf3-bedcab57cd86#Appendix_A_26" data-linktype="relative-path">&lt;26&gt;</a> </p>
</li><li><p><span><span> 
</span></span>Check that the path specified in <i>szMDPath</i> exists in the
metabase. If it does not, create it (see section <a href="0ebc0707-0fa4-4093-b9d3-e30302e8f1d9" data-linktype="relative-path">3.1.4.4</a>).</p>
</li><li><p><span><span> 
</span></span>If the path exists, check to see whether an application is
defined on the path. If an application is already defined at this metabase path
and the value of <a href="5df9ca57-2a81-4ff4-97d5-fd39aa6731af" data-linktype="relative-path">MD_APP_ISOLATED</a>
matches that specified by the user in the <i>fInProc</i> flag, do nothing. If
the value does not match, delete the current application (see section <a href="f4683981-4b25-46fa-9017-90cb0f08466c" data-linktype="relative-path">3.7.4.2</a>).</p>
</li><li><p><span><span> 
</span></span>Create the new application. </p>
</li><li><p><span><span> 
</span></span>Set the MD_APP_ISOLATED property on the specified metabase path
to 0 if the <i>fInProc</i> parameter is TRUE (nonzero). Set the MD_APP_ISOLATED
property on the specified metabase path to 1 if the <i>fInProc</i> parameter is
FALSE.</p>
</li><li><p><span><span> 
</span></span>Set the <a href="941aefe0-7996-4614-ac1e-b899c6ff8b7e" data-linktype="relative-path">MD_APP_ROOT</a>
property on the specified metabase path to the value of <i>szMDPath</i> without
any trailing &#39;/&#39; if one was specified.</p>
</li></ul></div>