Expand Minimize

StgSetTimes function

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

Syntax


WINOLEAPI StgSetTimes(
  _In_  WCHAR const *lpszName,
  _In_  FILETIME const *pctime,
  _In_  FILETIME const *patime,
  _In_  FILETIME const *pmtime
);

Parameters

lpszName [in]

Pointer to the name of the file to be changed.

pctime [in]

Pointer to the new value for the creation time.

patime [in]

Pointer to the new value for the access time.

pmtime [in]

Pointer to the new value for the modification time.

Return value

S_OK

Indicates time values successfully set.

STG_E_FILENOTFOUND

Indicates that the element does not exist.

STG_E_INVALIDNAME

Indicates a non-valid name passed in the lpszName parameter, or a file system error.

STG_E_ACCESSDENIED

Access denied because the caller does not have enough permissions, or another caller has the file open and locked.

STG_E_LOCKVIOLATION

Access denied because another caller has the file open and locked.

STG_E_SHAREVIOLATION

Access denied because another caller has the file open and locked.

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

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Objbase.h

Library

Ole32.lib

DLL

Ole32.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft