From dca290866ce864efd57afa7b22425bb529608640 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 13 May 2014 14:58:57 -0500 Subject: [PATCH] Load NtOpenFile() and NtClose() --- include/wimlib/win32_common.h | 9 +++++++++ src/win32_common.c | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/include/wimlib/win32_common.h b/include/wimlib/win32_common.h index dfc98e6e..3cc79e35 100644 --- a/include/wimlib/win32_common.h +++ b/include/wimlib/win32_common.h @@ -38,6 +38,13 @@ extern BOOL (WINAPI *func_CreateSymbolicLinkW)(const wchar_t *lpSymlinkFileName, /* ntdll functions */ +extern NTSTATUS (WINAPI *func_NtOpenFile) (PHANDLE FileHandle, + ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + PIO_STATUS_BLOCK IoStatusBlock, + ULONG ShareAccess, + ULONG OpenOptions); + extern NTSTATUS (WINAPI *func_NtQueryInformationFile)(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FileInformation, @@ -67,6 +74,8 @@ extern NTSTATUS (WINAPI *func_NtSetSecurityObject)(HANDLE Handle, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor); +extern NTSTATUS (WINAPI *func_NtClose) (HANDLE Handle); + extern DWORD (WINAPI *func_RtlNtStatusToDosError)(NTSTATUS status); extern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder) diff --git a/src/win32_common.c b/src/win32_common.c index fa890c1c..93174cf0 100644 --- a/src/win32_common.c +++ b/src/win32_common.c @@ -517,7 +517,12 @@ BOOL (WINAPI *func_CreateSymbolicLinkW)(const wchar_t *lpSymlinkFileName, /* ntdll.dll */ -DWORD (WINAPI *func_RtlNtStatusToDosError)(NTSTATUS status); +NTSTATUS (WINAPI *func_NtOpenFile) (PHANDLE FileHandle, + ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes, + PIO_STATUS_BLOCK IoStatusBlock, + ULONG ShareAccess, + ULONG OpenOptions); NTSTATUS (WINAPI *func_NtQueryInformationFile)(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, @@ -547,6 +552,10 @@ NTSTATUS (WINAPI *func_NtSetSecurityObject)(HANDLE Handle, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor); +NTSTATUS (WINAPI *func_NtClose) (HANDLE Handle); + +DWORD (WINAPI *func_RtlNtStatusToDosError)(NTSTATUS status); + NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder) (PCUNICODE_STRING VolumeRootPath); @@ -584,11 +593,13 @@ struct dll_spec { struct dll_spec ntdll_spec = { .name = L"ntdll.dll", .syms = { - DLL_SYM(RtlNtStatusToDosError, true), + DLL_SYM(NtOpenFile, true), DLL_SYM(NtQueryInformationFile, true), DLL_SYM(NtQuerySecurityObject, true), DLL_SYM(NtQueryDirectoryFile, true), DLL_SYM(NtSetSecurityObject, true), + DLL_SYM(NtClose, true), + DLL_SYM(RtlNtStatusToDosError, true), DLL_SYM(RtlCreateSystemVolumeInformationFolder, false), {NULL, NULL}, }, -- 2.43.0