3.1.4.12 R_EnumData (Opnum 12)

The R_EnumData method enumerates the data entries of a node in the metabase.

 HRESULT R_EnumData(
   [in] METADATA_HANDLE hMDHandle,
   [unique, in, string] LPCWSTR pszMDPath,
   [in, out] METADATA_RECORD* pmdrMDData,
   [in] DWORD dwMDEnumDataIndex,
   [out] DWORD* pdwMDRequiredDataLen,
   [out] IIS_CRYPTO_BLOB** ppDataBlob
 );

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

pszMDPath: A pointer to a Unicode string that contains the path of the node to be enumerated, relative to the path of the hMDHandle parameter.

pmdrMDData: A pointer to a METADATA_RECORD structure that specifies the retrieved data.

dwMDEnumDataIndex: An integer value specifying the index of the entry retrieved.

pdwMDRequiredDataLen: Pointer to a DWORD that receives the required buffer size if the method returns ERROR_INSUFFICIENT_BUFFER as specified in [MS-ERREF].

ppDataBlob: An IIS_CRYPTO_BLOB structure containing the data value as encrypted opaque data.

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.

0x80070003

ERROR_PATH_NOT_FOUND

The system cannot find the path specified.

0x80070005

E_ACCESSDENIED

General access denied error.

0x80070006

ERROR_INVALID_HANDLE

The handle is invalid.

0x80070057

E_INVALIDARG

One or more arguments are invalid.

0x8007007A

ERROR_INSUFFICIENT_BUFFER

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

0x80070103

ERROR_NO_MORE_ITEMS

No more data is available.

The opnum field value for this method is 12.

The client indicates how much decrypted data it is ready to receive by passing the number of bytes in the dwMDDataLen field of the pmdrMDData parameter. If this value is too small to contain the decrypted data value, the server MUST return ERROR_INSUFFICIENT_BUFFER and return the number of bytes required to hold the data in the pdwMDRequiredDataLen parameter.

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

  • Check the handle. This handle is valid if it is either the master root handle or a handle returned from a previous OpenKey call. If the handle is invalid, return ERROR_INVALID_HANDLE.

  • The server SHOULD check whether the handle was opened for read access. If not, return E_ACCESSDENIED.<13>

  • The server SHOULD check whether the relative path points to the existing subnode of the parent handle. If not, return ERROR_PATH_NOT_FOUND.

  • Obtain the requested data using an index parameter. If the index is equal or greater than the number of data items associated with the node, return ERROR_NO_MORE_ITEMS.

  • To return the data value to the client, build the IIS_CRYPTO_BLOB structure as specified in the rules of the R_GetData method.