3.1.4.22 R_GetAllData (Opnum 13)

The R_GetAllData method returns all data associated with a node in the metabase, including all values that the node inherits.

 HRESULT R_GetAllData(
   [in] METADATA_HANDLE hMDHandle,
   [unique, in, string] LPCWSTR pszMDPath,
   [in] DWORD dwMDAttributes,
   [in] DWORD dwMDUserType,
   [in] DWORD dwMDDataType,
   [out] DWORD* pdwMDNumDataEntries,
   [out] DWORD* pdwMDDataSetNumber,
   [in] DWORD dwMDBufferSize,
   [out] DWORD* pdwMDRequiredBufferSize,
   [out] IIS_CRYPTO_BLOB** ppDataBlob
 );

hMDHandle: An unsigned 32-bit integer value containing an open metabase handle specifying the key to be queried.

pszMDPath: A pointer to a Unicode string that contains the path of the node with which the data to be returned is associated, relative to the path of the hMDHandle parameter.

dwMDAttributes: Flags used to specify the data, as listed in the METADATA_RECORD structure.

dwMDUserType: An integer value specifying the data to return based on user type.

Value

Meaning

ALL_METADATA

0x00000000

Returns all data, regardless of user type.

ASP_MD_UT_APP

0x00000065

Returns data specific to ASP application configuration.

IIS_MD_UT_FILE

0x00000002

Returns data specific to a file, such as access permissions or logon methods.

IIS_MD_UT_SERVER

0x00000001

Returns data specific to the server, such as ports in use and IP addresses.

IIS_MD_UT_WAM

0x00000064

Returns data specific to WAM.

dwMDDataType: An integer value specifying a data type. If this parameter is not set to ALL_METADATA, the data item will be returned only if its data type matches the specified type.

Value

Meaning

ALL_METADATA

0x00000000

Specifies all data, regardless of type.

BINARY_METADATA

0x00000003

Specifies binary data in any form.

DWORD_METADATA

0x00000001

Specifies all DWORD (unsigned 32-bit integer) data.

 EXPANDSZ_METADATA

0x00000004

Specifies all data that consists of a null-terminated string containing environment variables that are not expanded.

MULTISZ_METADATA

0x00000005

 Specifies all data represented as an array of null-terminated strings, terminated by two null characters.

STRING_METADATA

0x00000002

Specifies all data consisting of a null-terminated ASCII string.

pdwMDNumDataEntries: A pointer to an integer value that contains the number of entries in the array of METADATA_GETALL_RECORD structures returned in the ppDataBlob parameter.

pdwMDDataSetNumber: A pointer to an integer value used to identify the dataset number for the metabase node whose data is being retrieved. The dataset number is obtained by the GetDataSetNumber (section 3.1.4.18) method.

dwMDBufferSize: An integer value specifying the size, in bytes, required to hold the decrypted data returned by the ppDataBlob parameter.

pdwMDRequiredBufferSize: A pointer to an integer value that contains the buffer length required, in bytes, to contain the decrypted data referenced by the ppDataBlob parameter.

ppDataBlob: An IIS_CRYPTO_BLOB structure containing the requested values as encrypted opaque data. The encrypted data returned in IIS_CRYPTO_BLOB is a contiguous buffer containing an array of METADATA_GETALL_RECORD structures followed by the data referenced by the METADATA_GETALL_RECORD structures.

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].

Note Invalid dwMDUserType or dwMDDataType parameters result in a E_INVALIDARG return status.

Return value/code

Description

0x00000000

 S_OK

 The call was successful.

0x80070003

ERROR_PATH_NOT_FOUND

The system cannot find the path specified.

0x80070005

E_ACCESSDENIED

General access denied error.

0x80070057

E_INVALIDARG

An invalid parameter value was specified.

0x8007007A

ERROR_INSUFFICIENT_BUFFER

The data area passed to a system call is too small.

The opnum field value for this method is 13.

The client indicates how much decrypted data it is ready to receive by passing the number of bytes in the dwMDBufferSize parameter.

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

  • Check the path of the node indicated by hMDHandle and pszMDPath. If the path does not exist, return ERROR_PATH_NOT_FOUND.

  • If the value passed by the client in the dwMDBufferSize parameter is too small to contain an array of METADATA_GETALL_RECORD structures for each property value stored at the metabase node and their associated data, return ERROR_INSUFFICIENT_BUFFER and return the number of bytes required to hold the data in the pdwMDRequiredBufferSize parameter.

  • Check whether at least one of the METADATA_RECORD entries contains sensitive data. The METADATA_SECURE secure flag in the dwMDAttributes member of the METADATA_RECORD structure for all entries will be set.

If at least one matching entry with the METADATA_SECURE flag set is found:

  • Encrypt the data value based on the procedure described in section 3.1.4.1.2. The encrypted data BLOB will be stored in the IIS_CRYPTO_BLOB message format with the BlobSignature field set to the ENCRYPTED_DATA_BLOB_SIGNATURE signature.

If no METADATA_RECORD entry with the METADATA_SECURE flag is found:

  • Build the IIS_CRYPTO_BLOB message with the BlobSignature field set to CLEARTEXT_DATA_BLOB_SIGNATURE. Store the cleartext data in the BlobData field. Set the BlobDataLength field to match the length of the BlobData field.