3.1.4.1.2 GetMetadata (Opnum 4)

The GetMetadata method is received by the server in an RPC_REQUEST packet. The purpose of the method is to retrieve settings and other behavior-modifying attributes of the administration system. The administration system supports modifications through these settings and attributes. The metadata returns the details of these modifications to the caller. The returned metadata is referenced by a string name, and is thus extensible without changing the main Interface Definition Language (IDL) file. As administration systems implementers add more options to their systems, they can expose these options as named metadata through this method.

This method is used to get a metadata property.

 HRESULT GetMetadata(
   [in] BSTR bstrMetadataType,
   [out, retval] VARIANT* pValue
 );

bstrMetadataType: The name of the metadata property to fetch. Valid names are as follows.

Value

Meaning

"pathMapper"

Returns the IAppHostPathMapper object, which is a user-provided object that controls how the administration system implementation maps a specified path hierarchy to actual resources.

"pathMapper2"

Returns the IAppHostPathMapper2 object, which is a user-provided object that controls how the administration system implementation maps a specified path hierarchy to actual resources.

"changeHandler"

Returns the IAppHostChangeHandler object, which is a user-provided object that receives notification when the administration system detects that a part of the path hierarchy has changed.

"ignoreInvalidAttributes"

Returns the flag that controls whether the administration system ignores certain types of errors when evaluating the IAppHostProperty part of an IAppHostElement. If the flag is true, the administration system ignores these errors. If the flag is false, the administration system treats these IAppHostProperty errors as fatal and invalidates the container IAppHostElement.

bool

"ignoreInvalidRanges"

Returns the flag that controls whether the administration system will ignore certain types of errors when evaluating the IAppHostProperty part of an IAppHostElement. If the flag is true, the administration system ignores these errors. If the flag is false, the administration system treats these IAppHostProperty errors as fatal and invalidates the container IAppHostElement.

bool

"ignoreInvalidDecryption"

Returns the flag that controls whether the administration system will ignore decryption errors when evaluating the IAppHostProperty part of an IAppHostElement. If the flag is true, the administration system ignores these errors. If the flag is false, the administration system treats these IAppHostProperty errors as fatal and invalidates the container IAppHostElement.

bool

"expandEnvironmentStrings"

 Returns the flag that controls whether the administration system will expand environment variables when parsing the configuration system. If the flag is true, the administration system expands the variables. If the flag is false, the administration system does not expand the variables.

bool

"disableExtensions"

Returns a flag that determines whether the administration system supports custom server-side extensions that can extend how the system evaluates IAppHostElement objects. If true, the system will not support custom server-side extensions. If false, the system will support custom server-side extensions.

bool

"availableSections"

Returns a comma-separated series of strings that contains all the names of the available administration section names that are supported by the administration system. Section names represent the names of IAppHostElement objects. If the administration system supports an IAppHostElement that is named "X", then X must appear in the comma-delimited list that is returned.

string

"mappingExtension"

Returns an object that is used to directly access the hierarchy mapping system of the administration system, and is accessed through the IAppHostMappingExtension interface.

IAppHostMappingExtension

"hideExceptionPhysicalPath"

 Returns the flag that controls whether the administration system will give information about the physical path of the configuration file in exception messages. If the flag is true, the administration system hides the physical path. If the flag is false, the administration system returns the physical path.

bool

"lockMetadata"

 Returns the flag that controls whether metadata can be modified with the SetMetadata call. If the flag is true, then further calls to SetMetadata will fail with a locking violation. If the flag is false, SetMetadata calls are allowed.

bool

pValue: Returns the value of the specified metadata property, and the type depends on the property fetched. Upon success, the property is returned in a VARIANT, and the type of the value depends on the type of metadata that is requested (specified in bstrMetadataType).

Return Values: The server MUST return zero if it successfully processes the message that is received from the client. If processing fails, the server MUST return a nonzero HRESULT code as defined in [MS-ERREF]. The following table describes the error conditions that MUST be handled and the corresponding error codes. A server MAY return additional implementation-specific error codes.

Return value/code

Description

0X00000000

NO_ERROR

The operation completed successfully.

0X80070057

ERROR_INVALID_PARAMETER

One or more parameters are incorrect or null.

0X00000008

E_OUTOFMEMORY

Not enough memory is available to process this command.

0X80070032

ERROR_NOT_SUPPORTED

The metadata property specified by bstrMetadataType is not supported.