3.1.4.19 GetHandleInfo (Opnum 21)

The GetHandleInfo method returns information associated with the specified metabase handle.

 HRESULT GetHandleInfo(
   [in] METADATA_HANDLE hMDHandle,
   [out] METADATA_HANDLE_INFO* pmdhiInfo
 );

hMDHandle: An unsigned 32-bit integer value containing a handle to a node in the metabase as returned by the OpenKey method.

pmdhiInfo: A pointer to a METADATA_HANDLE_INFO structure containing information about the specified handle.

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.

0x80070006

ERROR_INVALID_HANDLE

 The handle is invalid.

The opnum field value for this method is 21.

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

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

  • Populate the supplied METADATA_HANDLE_INFO structure with the permission level for the handle and the value of the system change number at the time the handle was opened. See GetSystemChangeNumber (section 3.1.4.21) for a specification of the system change number.