2 * PROJECT: ReactOS Setup Library
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: File support functions.
5 * COPYRIGHT: Casper S. Hornstrup (chorns@users.sourceforge.net)
6 * Copyright 2017-2018 Hermes Belusca-Maito
13 IN PCWSTR DirectoryName
);
18 IN BOOLEAN ForceDelete
); // ForceDelete can be used to delete read-only files
22 IN PCWSTR SourceFileName
,
23 IN PCWSTR DestinationFileName
,
24 IN BOOLEAN FailIfExists
);
28 #define MOVEFILE_REPLACE_EXISTING 1
29 #define MOVEFILE_COPY_ALLOWED 2
30 #define MOVEFILE_WRITE_THROUGH 8
36 IN PCWSTR ExistingFileName
,
37 IN PCWSTR NewFileName
,
42 IN OUT PWSTR PathBuffer
,
43 IN SIZE_T cchPathSize
,
44 IN ULONG NumberOfPathComponents
,
45 IN
va_list PathComponentsList
);
50 IN SIZE_T cchPathSize
,
51 IN ULONG NumberOfPathComponents
,
52 IN
va_list PathComponentsList
);
56 IN OUT PWSTR PathBuffer
,
57 IN SIZE_T cchPathSize
,
58 IN ULONG NumberOfPathComponents
,
64 IN SIZE_T cchPathSize
,
65 IN ULONG NumberOfPathComponents
,
70 IN HANDLE RootDirectory OPTIONAL
,
72 IN BOOLEAN IsDirectory
);
74 #define DoesDirExist(RootDirectory, DirName) \
75 DoesPathExist((RootDirectory), (DirName), TRUE)
77 #define DoesFileExist(RootDirectory, FileName) \
78 DoesPathExist((RootDirectory), (FileName), FALSE)
80 // FIXME: DEPRECATED! HACKish function that needs to be deprecated!
83 IN PCWSTR PathName OPTIONAL
,
87 NtPathToDiskPartComponents(
89 OUT PULONG pDiskNumber
,
90 OUT PULONG pPartNumber
,
91 OUT PCWSTR
* PathComponent OPTIONAL
);
95 IN HANDLE RootDirectory OPTIONAL
,
96 IN PCWSTR PathNameToFile
,
97 OUT PHANDLE FileHandle
, // IN OUT PHANDLE OPTIONAL
98 OUT PHANDLE SectionHandle
,
99 OUT PVOID
* BaseAddress
,
100 OUT PULONG FileSize OPTIONAL
,
101 IN BOOLEAN ReadWriteAccess
);
105 IN HANDLE SectionHandle
,
106 IN PVOID BaseAddress
);
108 #define UnMapAndCloseFile(FileHandle, SectionHandle, BaseAddress) \
110 UnMapFile((SectionHandle), (BaseAddress)); \
111 NtClose(FileHandle); \