[SETUPLIB][USETUP] Refactor the DoesFileExist() function so that it now looks closer...
[reactos.git] / base / setup / lib / filesup.h
1 /*
2 * PROJECT: ReactOS Setup Library
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: File support functions.
5 * COPYRIGHT: Copyright 2017-2018 Hermes Belusca-Maito
6 */
7
8 #pragma once
9
10 #if 0
11
12 BOOLEAN
13 IsValidPath(
14 IN PCWSTR InstallDir);
15
16 #endif
17
18 NTSTATUS
19 ConcatPathsV(
20 IN OUT PWSTR PathBuffer,
21 IN SIZE_T cchPathSize,
22 IN ULONG NumberOfPathComponents,
23 IN va_list PathComponentsList);
24
25 NTSTATUS
26 CombinePathsV(
27 OUT PWSTR PathBuffer,
28 IN SIZE_T cchPathSize,
29 IN ULONG NumberOfPathComponents,
30 IN va_list PathComponentsList);
31
32 NTSTATUS
33 ConcatPaths(
34 IN OUT PWSTR PathBuffer,
35 IN SIZE_T cchPathSize,
36 IN ULONG NumberOfPathComponents,
37 IN /* PCWSTR */ ...);
38
39 NTSTATUS
40 CombinePaths(
41 OUT PWSTR PathBuffer,
42 IN SIZE_T cchPathSize,
43 IN ULONG NumberOfPathComponents,
44 IN /* PCWSTR */ ...);
45
46 BOOLEAN
47 DoesPathExist(
48 IN HANDLE RootDirectory OPTIONAL,
49 IN PCWSTR PathName);
50
51 BOOLEAN
52 DoesFileExist(
53 IN HANDLE RootDirectory OPTIONAL,
54 IN PCWSTR PathNameToFile);
55
56 // FIXME: DEPRECATED! HACKish function that needs to be deprecated!
57 BOOLEAN
58 DoesFileExist_2(
59 IN PCWSTR PathName OPTIONAL,
60 IN PCWSTR FileName);
61
62 BOOLEAN
63 NtPathToDiskPartComponents(
64 IN PCWSTR NtPath,
65 OUT PULONG pDiskNumber,
66 OUT PULONG pPartNumber,
67 OUT PCWSTR* PathComponent OPTIONAL);
68
69 NTSTATUS
70 OpenAndMapFile(
71 IN HANDLE RootDirectory OPTIONAL,
72 IN PCWSTR PathNameToFile,
73 OUT PHANDLE FileHandle, // IN OUT PHANDLE OPTIONAL
74 OUT PHANDLE SectionHandle,
75 OUT PVOID* BaseAddress,
76 OUT PULONG FileSize OPTIONAL);
77
78 BOOLEAN
79 UnMapFile(
80 IN HANDLE SectionHandle,
81 IN PVOID BaseAddress);
82
83 /* EOF */