StgSetTimes function (coml2api.h)

The StgSetTimes function sets the creation, access, and modification times of the indicated file, if supported by the underlying file system.

Syntax

HRESULT StgSetTimes(
  [in] const WCHAR    *lpszName,
  [in] const FILETIME *pctime,
  [in] const FILETIME *patime,
  [in] const FILETIME *pmtime
);

Parameters

[in] lpszName

Pointer to the name of the file to be changed.

[in] pctime

Pointer to the new value for the creation time.

[in] patime

Pointer to the new value for the access time.

[in] pmtime

Pointer to the new value for the modification time.

Return value

The StgSetTimes function can also return any file system errors or system errors wrapped in an HRESULT. See Error Handling Strategies and Handling Unknown Errors.

Remarks

The StgSetTimes function sets the time values for the specified file. Each of the time value parameters can be NULL, indicating that no modification should occur.

It is possible that one or more of these time values are not supported by the underlying file system. This function sets the times that can be set and ignores the rest.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header coml2api.h (include Objbase.h)
Library Ole32.lib
DLL Ole32.dll