Skip to content

Latest commit

 

History

History
83 lines (59 loc) · 2.72 KB

nf-fileapifromapp-copyfilefromappw.md

File metadata and controls

83 lines (59 loc) · 2.72 KB
UID tech.root title ms.date targetos description req.assembly req.construct-type req.ddi-compliance req.dll req.header req.idl req.include-header req.irql req.kmdf-ver req.lib req.max-support req.namespace req.redist req.target-min-winverclnt req.target-min-winversvr req.target-type req.type-library req.umdf-ver req.unicode-ansi topic_type api_location api_name api_type f1_keywords dev_langs
NF:fileapifromapp.CopyFileFromAppW
fs
CopyFileFromAppW
03/23/2021
Windows
Copies an existing file to a new file. The behavior of this function is identical to CopyFile, except that this function adheres to the Universal Windows Platform app security model.
function
fileapifromapp.h
Windows 10, version 1803
apiref
Kernel32.dll
CopyFileFromAppW
CopyFileFromApp
DLLExport
CopyFileFromAppW
fileapifromapp/CopyFileFromAppW
c++

-description

Copies an existing file to a new file. The behavior of this function is identical to CopyFile, except that this function adheres to the Universal Windows Platform app security model.

-parameters

-param lpExistingFileName

The name of an existing file.

For information about opting out of the MAX_PATH limitation without prepending "\\?\", see the "Maximum Path Length Limitation" section of Naming Files, Paths, and Namespaces for details.

If lpExistingFileName does not exist, the function fails, and GetLastError returns ERROR_FILE_NOT_FOUND.

-param lpNewFileName

The name of the new file.

In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.

For the unicode version of this function (CopyFileFromAppW), you can opt-in to remove the MAX_PATH limitation without prepending "\\?\". See the "Maximum Path Length Limitation" section of Naming Files, Paths, and Namespaces for details.

-param bFailIfExists

If this parameter is TRUE and the new file specified by lpNewFileName already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.

-returns

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

-remarks

-see-also