3.7.4.1 AppCreate (Opnum 3)

The AppCreate method creates a new application at the specified metabase path.

 HRESULT AppCreate(
   [in, unique, string] LPCWSTR szMDPath,
   [in] BOOL fInProc
 );

szMDPath: A pointer to a Unicode string that contains the metabase path of the application.

fInProc:  A flag indicating whether the application runs in the parent IIS server process or in its own process.

Return Values:  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 HRESULT values, see [MS-ERREF].

Return value/code

Description

0x00000000

S_OK

The call was successful.

The opnum field value for this method is 3.

When processing this call, the server MUST do the following:

  • The server SHOULD validate that the metabase path specified in the szMDPath parameter is a valid application path.<26>

  • Check that the path specified in szMDPath exists in the metabase. If it does not, create it (see section 3.1.4.4).

  • 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 MD_APP_ISOLATED matches that specified by the user in the fInProc flag, do nothing. If the value does not match, delete the current application (see section 3.7.4.2).

  • Create the new application.

  • Set the MD_APP_ISOLATED property on the specified metabase path to 0 if the fInProc parameter is TRUE (nonzero). Set the MD_APP_ISOLATED property on the specified metabase path to 1 if the fInProc parameter is FALSE.

  • Set the MD_APP_ROOT property on the specified metabase path to the value of szMDPath without any trailing '/' if one was specified.