[SETUPLIB] Additions for filesup.c and inicache.c.

- In DoesFileExist(): Call NtOpenFile with FILE_GENERIC_READ instead of the more generic GENERIC_READ access right.
- OpenAndMapFile(): Add support for opening & mapping files with write access (to be used latter).

svn path=/branches/setup_improvements/; revision=74710

- Split IniCacheLoad() and IniCacheSave() into: themselves & IniCacheLoadByHandle() and IniCacheSaveByHandle(),
  respectively, so that we can load & save INI files if we already have an opened handle to them.

svn path=/branches/setup_improvements/; revision=74711
This commit is contained in:
Hermès Bélusca-Maïto 2017-05-31 00:18:13 +00:00
parent 6b6163a5d9
commit 7f5428633b
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
4 changed files with 131 additions and 87 deletions

View file

@ -68,12 +68,13 @@ NtPathToDiskPartComponents(
NTSTATUS
OpenAndMapFile(
IN HANDLE RootDirectory OPTIONAL,
IN PCWSTR PathNameToFile,
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(