3.1.4.31 SetLastChangeTime (Opnum 24)

The SetLastChangeTime method sets the last change time associated with a node in the metabase.

 HRESULT SetLastChangeTime(
   [in] METADATA_HANDLE hMDHandle,
   [unique, in, string] LPCWSTR pszMDPath,
   [in] PFILETIME pftMDLastChangeTime,
   [in] BOOL bLocalTime
 );

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

pszMDPath: A pointer to a Unicode string containing the path of the node to be set, relative to the path of the hMDHandle parameter.

pftMDLastChangeTime: A pointer to a FILETIME structure that contains the last change time to set for the node.

bLocalTime: A Boolean value indicating whether the time value specified in the pftMDLastChangeTime parameter is local time (TRUE) or UTC time (FALSE).

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.

0x80070057

E_INVALIDARG

One or more arguments are invalid.

The opnum field value for this method is 24.

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

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

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

  • If the path exists and is valid, the server SHOULD update the last modified time for the node based on the value of the pftMDLastChangeTime structure. If bLocalTime is 0, the time is treated as UTC time. Otherwise the time is treated as the local server time.<21>