ReactOS 0.4.15-dev-7942-gd23573b
filesup.h
Go to the documentation of this file.
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: Casper S. Hornstrup (chorns@users.sourceforge.net)
6 * Copyright 2017-2018 Hermes Belusca-Maito
7 */
8
9#pragma once
10
13 IN PCWSTR DirectoryName);
14
18 IN BOOLEAN ForceDelete); // ForceDelete can be used to delete read-only files
19
22 IN PCWSTR SourceFileName,
23 IN PCWSTR DestinationFileName,
24 IN BOOLEAN FailIfExists);
25
26#ifndef _WINBASE_
27
28#define MOVEFILE_REPLACE_EXISTING 1
29#define MOVEFILE_COPY_ALLOWED 2
30#define MOVEFILE_WRITE_THROUGH 8
31
32#endif
33
36 IN PCWSTR ExistingFileName,
37 IN PCWSTR NewFileName,
38 IN ULONG Flags);
39
42 IN OUT PWSTR PathBuffer,
43 IN SIZE_T cchPathSize,
44 IN ULONG NumberOfPathComponents,
45 IN va_list PathComponentsList);
46
49 OUT PWSTR PathBuffer,
50 IN SIZE_T cchPathSize,
51 IN ULONG NumberOfPathComponents,
52 IN va_list PathComponentsList);
53
56 IN OUT PWSTR PathBuffer,
57 IN SIZE_T cchPathSize,
58 IN ULONG NumberOfPathComponents,
59 IN /* PCWSTR */ ...);
60
63 OUT PWSTR PathBuffer,
64 IN SIZE_T cchPathSize,
65 IN ULONG NumberOfPathComponents,
66 IN /* PCWSTR */ ...);
67
71 IN PCWSTR PathName,
73
74#define DoesDirExist(RootDirectory, DirName) \
75 DoesPathExist((RootDirectory), (DirName), TRUE)
76
77#define DoesFileExist(RootDirectory, FileName) \
78 DoesPathExist((RootDirectory), (FileName), FALSE)
79
80// FIXME: DEPRECATED! HACKish function that needs to be deprecated!
83 IN PCWSTR PathName OPTIONAL,
85
88 IN PCWSTR NtPath,
89 OUT PULONG pDiskNumber,
90 OUT PULONG pPartNumber,
92
96 IN PCWSTR PathNameToFile,
97 OUT PHANDLE FileHandle, // IN OUT PHANDLE OPTIONAL
98 OUT PHANDLE SectionHandle,
101 IN BOOLEAN ReadWriteAccess);
102
105 IN HANDLE SectionHandle,
107
108#define UnMapAndCloseFile(FileHandle, SectionHandle, BaseAddress) \
109do { \
110 UnMapFile((SectionHandle), (BaseAddress)); \
111 NtClose(FileHandle); \
112} while (0)
113
114/* EOF */
unsigned char BOOLEAN
char * va_list
Definition: acmsvcex.h:78
LONG NTSTATUS
Definition: precomp.h:26
WCHAR RootDirectory[MAX_PATH]
Definition: format.c:74
#define IsDirectory(Fcb)
Definition: ext2fs.h:283
NTSTATUS CombinePaths(OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN ...)
Definition: filesup.c:681
BOOLEAN UnMapFile(IN HANDLE SectionHandle, IN PVOID BaseAddress)
Definition: filesup.c:974
BOOLEAN DoesFileExist_2(IN PCWSTR PathName OPTIONAL, IN PCWSTR FileName)
Definition: filesup.c:748
BOOLEAN NtPathToDiskPartComponents(IN PCWSTR NtPath, OUT PULONG pDiskNumber, OUT PULONG pPartNumber, OUT PCWSTR *PathComponent OPTIONAL)
Definition: filesup.c:771
NTSTATUS ConcatPathsV(IN OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN va_list PathComponentsList)
Definition: filesup.c:596
NTSTATUS CombinePathsV(OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN va_list PathComponentsList)
Definition: filesup.c:643
NTSTATUS SetupMoveFile(IN PCWSTR ExistingFileName, IN PCWSTR NewFileName, IN ULONG Flags)
Definition: filesup.c:480
NTSTATUS ConcatPaths(IN OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN ...)
Definition: filesup.c:659
NTSTATUS OpenAndMapFile(IN HANDLE RootDirectory OPTIONAL, IN PCWSTR PathNameToFile, OUT PHANDLE FileHandle, OUT PHANDLE SectionHandle, OUT PVOID *BaseAddress, OUT PULONG FileSize OPTIONAL, IN BOOLEAN ReadWriteAccess)
Definition: filesup.c:858
NTSTATUS SetupCopyFile(IN PCWSTR SourceFileName, IN PCWSTR DestinationFileName, IN BOOLEAN FailIfExists)
Definition: filesup.c:240
BOOLEAN DoesPathExist(IN HANDLE RootDirectory OPTIONAL, IN PCWSTR PathName, IN BOOLEAN IsDirectory)
Definition: filesup.c:705
NTSTATUS SetupCreateDirectory(IN PCWSTR DirectoryName)
Definition: filesup.c:84
NTSTATUS SetupDeleteFile(IN PCWSTR FileName, IN BOOLEAN ForceDelete)
Definition: filesup.c:151
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
Definition: fsrtlfuncs.h:108
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170