[SETUPLIB] Merge DoesPathExist() and DoesFileExist() into (temporarily called) DoesPa...
[reactos.git] / base / setup / lib / filesup.h
index bf5a283..a9fabf4 100644 (file)
@@ -7,28 +7,74 @@
 
 #pragma once
 
-#if 0
+NTSTATUS
+SetupDeleteFile(
+    IN PCWSTR FileName,
+    IN BOOLEAN ForceDelete); // ForceDelete can be used to delete read-only files
 
-BOOLEAN
-IsValidPath(
-    IN PCWSTR InstallDir);
+NTSTATUS
+SetupCopyFile(
+    IN PCWSTR SourceFileName,
+    IN PCWSTR DestinationFileName,
+    IN BOOLEAN FailIfExists);
+
+#ifndef _WINBASE_
+
+#define MOVEFILE_REPLACE_EXISTING   1
+#define MOVEFILE_COPY_ALLOWED       2
+#define MOVEFILE_WRITE_THROUGH      8
 
 #endif
 
+NTSTATUS
+SetupMoveFile(
+    IN PCWSTR ExistingFileName,
+    IN PCWSTR NewFileName,
+    IN ULONG Flags);
+
+NTSTATUS
+ConcatPathsV(
+    IN OUT PWSTR PathBuffer,
+    IN SIZE_T cchPathSize,
+    IN ULONG NumberOfPathComponents,
+    IN va_list PathComponentsList);
+
+NTSTATUS
+CombinePathsV(
+    OUT PWSTR PathBuffer,
+    IN SIZE_T cchPathSize,
+    IN ULONG NumberOfPathComponents,
+    IN va_list PathComponentsList);
+
 NTSTATUS
 ConcatPaths(
-    IN OUT PWSTR PathElem1,
+    IN OUT PWSTR PathBuffer,
+    IN SIZE_T cchPathSize,
+    IN ULONG NumberOfPathComponents,
+    IN /* PCWSTR */ ...);
+
+NTSTATUS
+CombinePaths(
+    OUT PWSTR PathBuffer,
     IN SIZE_T cchPathSize,
-    IN PCWSTR PathElem2 OPTIONAL);
+    IN ULONG NumberOfPathComponents,
+    IN /* PCWSTR */ ...);
 
 BOOLEAN
-DoesPathExist(
+DoesPathExistEx(
     IN HANDLE RootDirectory OPTIONAL,
-    IN PCWSTR PathName);
+    IN PCWSTR PathName,
+    IN BOOLEAN IsDirectory);
 
+#define DoesPathExist(RootDirectory, PathName)  \
+    DoesPathExistEx((RootDirectory), (PathName), TRUE)
+
+#define DoesFileExist(RootDirectory, FileName)  \
+    DoesPathExistEx((RootDirectory), (FileName), FALSE)
+
+// FIXME: DEPRECATED! HACKish function that needs to be deprecated!
 BOOLEAN
-DoesFileExist(
-    IN HANDLE RootDirectory OPTIONAL,
+DoesFileExist_2(
     IN PCWSTR PathName OPTIONAL,
     IN PCWSTR FileName);
 
@@ -41,13 +87,13 @@ NtPathToDiskPartComponents(
 
 NTSTATUS
 OpenAndMapFile(
-    IN HANDLE RootDirectory OPTIONAL,
-    IN PCWSTR PathName OPTIONAL,
-    IN PCWSTR FileName,             // OPTIONAL
+    IN  HANDLE RootDirectory OPTIONAL,
+    IN  PCWSTR PathNameToFile,
     OUT PHANDLE FileHandle,         // IN OUT PHANDLE OPTIONAL
     OUT PHANDLE SectionHandle,
     OUT PVOID* BaseAddress,
-    OUT PULONG FileSize OPTIONAL);
+    OUT PULONG FileSize OPTIONAL,
+    IN  BOOLEAN ReadWriteAccess);
 
 BOOLEAN
 UnMapFile(