FILE_RENAME_INFO structure (winbase.h)

Contains the target name to which the source file should be renamed. Use only when calling SetFileInformationByHandle.

Syntax

typedef struct _FILE_RENAME_INFO {
  union {
    BOOLEAN ReplaceIfExists;
    DWORD   Flags;
  } DUMMYUNIONNAME;
  BOOLEAN ReplaceIfExists;
  HANDLE  RootDirectory;
  DWORD   FileNameLength;
  WCHAR   FileName[1];
} FILE_RENAME_INFO, *PFILE_RENAME_INFO;

Members

DUMMYUNIONNAME

DUMMYUNIONNAME.ReplaceIfExists

This field is used when SetFileInformationByHandle's FileInformationClass parameter is set to FileRenameInfo. If this field is TRUE and the target file exists then the target file will be replaced by the source file. If this field is FALSE and the target file exists then operation will return an error.

DUMMYUNIONNAME.Flags

This field is used when SetFileInformationByHandle's FileInformationClass parameter is set to FileRenameInfoEx.

ReplaceIfExists

RootDirectory

This field should be set to NULL.

FileNameLength

The size of FileName in bytes, not including the NUL-termination.

FileName[1]

A NUL-terminated wide-character string containing the new path to the file. The value can be one of the following:

  • An absolute path (drive, directory, and filename).
  • A path relative to the process's current directory.
  • The new name of an NTFS file stream, starting with :.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Header winbase.h (include Windows.h)
Redistributable Windows SDK on Windows Server 2003 and Windows XP.

See also

FILE_INFO_BY_HANDLE_CLASS

SetFileInformationByHandle