Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128/* * PROJECT: ReactOS Setup Library * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) * PURPOSE: File support functions. * COPYRIGHT: Casper S. Hornstrup (chorns@users.sourceforge.net) * Copyright 2017-2018 Hermes Belusca-Maito */
#pragma once
NTSTATUSSetupCreateDirectory( _In_ PCWSTR PathName);
NTSTATUSSetupDeleteFile( IN PCWSTR FileName, IN BOOLEAN ForceDelete); // ForceDelete can be used to delete read-only files
NTSTATUSSetupCopyFile( 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
NTSTATUSSetupMoveFile( IN PCWSTR ExistingFileName, IN PCWSTR NewFileName, IN ULONG Flags);
NTSTATUSConcatPathsV( IN OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN va_list PathComponentsList);
NTSTATUSCombinePathsV( OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN va_list PathComponentsList);
NTSTATUSConcatPaths( IN OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN /* PCWSTR */ ...);
NTSTATUSCombinePaths( OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN /* PCWSTR */ ...);
BOOLEANDoesPathExist_UStr( _In_opt_ HANDLE RootDirectory, _In_ PCUNICODE_STRING PathName, _In_ BOOLEAN IsDirectory);
BOOLEANDoesPathExist( _In_opt_ HANDLE RootDirectory, _In_ PCWSTR PathName, _In_ BOOLEAN IsDirectory);
#define DoesDirExist(RootDirectory, DirName) \ DoesPathExist((RootDirectory), (DirName), TRUE)
#define DoesFileExist(RootDirectory, FileName) \ DoesPathExist((RootDirectory), (FileName), FALSE)
// FIXME: DEPRECATED! HACKish function that needs to be deprecated!BOOLEANDoesFileExist_2( IN PCWSTR PathName OPTIONAL, IN PCWSTR FileName);
BOOLEANNtPathToDiskPartComponents( IN PCWSTR NtPath, OUT PULONG pDiskNumber, OUT PULONG pPartNumber, OUT PCWSTR* PathComponent OPTIONAL);
NTSTATUSOpenAndMapFile( _In_opt_ HANDLE RootDirectory, _In_ PCWSTR PathNameToFile, _Out_opt_ PHANDLE FileHandle, _Out_opt_ PULONG FileSize, _Out_ PHANDLE SectionHandle, _Out_ PVOID* BaseAddress, _In_ BOOLEAN ReadWriteAccess);
NTSTATUSMapFile( _In_ HANDLE FileHandle, _Out_ PHANDLE SectionHandle, _Out_ PVOID* BaseAddress, _In_ BOOLEAN ReadWriteAccess);
BOOLEANUnMapFile( _In_ HANDLE SectionHandle, _In_ PVOID BaseAddress);
#define UnMapAndCloseFile(FileHandle, SectionHandle, BaseAddress) \do { \ UnMapFile((SectionHandle), (BaseAddress)); \ NtClose(FileHandle); \} while (0)
/* EOF */