#include "wimlib/types.h"
#include "wimlib/win32.h"
+#ifdef WITH_NTDLL
+# include <ntstatus.h>
+# include <winternl.h>
+#endif
+
extern void
set_errno_from_GetLastError(void);
#ifdef WITH_NTDLL
extern void
-set_errno_from_nt_status(DWORD status);
+set_errno_from_nt_status(NTSTATUS status);
#endif
extern bool
extern HANDLE
win32_open_existing_file(const wchar_t *path, DWORD dwDesiredAccess);
-extern HANDLE
-win32_open_file_data_only(const wchar_t *path);
-
/* Vista and later */
extern HANDLE (WINAPI *win32func_FindFirstStreamW)(LPCWSTR lpFileName,
STREAM_INFO_LEVELS InfoLevel,
const wchar_t *lpTargetFileName,
DWORD dwFlags);
+/* ntdll functions */
+
+#ifdef WITH_NTDLL
+
+extern NTSTATUS (WINAPI *func_NtQueryInformationFile)(HANDLE FileHandle,
+ PIO_STATUS_BLOCK IoStatusBlock,
+ PVOID FileInformation,
+ ULONG Length,
+ FILE_INFORMATION_CLASS FileInformationClass);
+
+extern NTSTATUS (WINAPI *func_NtQuerySecurityObject)(HANDLE handle,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR SecurityDescriptor,
+ ULONG Length,
+ PULONG LengthNeeded);
+
+extern NTSTATUS (WINAPI *func_NtQueryDirectoryFile) (HANDLE FileHandle,
+ HANDLE Event,
+ PIO_APC_ROUTINE ApcRoutine,
+ PVOID ApcContext,
+ PIO_STATUS_BLOCK IoStatusBlock,
+ PVOID FileInformation,
+ ULONG Length,
+ FILE_INFORMATION_CLASS FileInformationClass,
+ BOOLEAN ReturnSingleEntry,
+ PUNICODE_STRING FileName,
+ BOOLEAN RestartScan);
+
+
+extern NTSTATUS (WINAPI *func_NtSetSecurityObject)(HANDLE Handle,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR SecurityDescriptor);
+
+extern DWORD (WINAPI *func_RtlNtStatusToDosError)(NTSTATUS status);
+
+extern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder)
+ (PCUNICODE_STRING VolumeRootPath);
+#endif
+
+
+
extern bool
windows_version_is_at_least(unsigned major, unsigned minor);