]> wimlib.net Git - wimlib/blobdiff - include/wimlib/win32_common.h
Load NtOpenFile() and NtClose()
[wimlib] / include / wimlib / win32_common.h
index ebd0564d7ccf15c7b3d80f11c46638cf839931f6..3cc79e35b64f6bbed705d9cdf92ba852fd566641 100644 (file)
@@ -9,40 +9,78 @@
 #include "wimlib/types.h"
 #include "wimlib/win32.h"
 
+#include <ntstatus.h>
+#include <winternl.h>
 
-#ifdef ENABLE_ERROR_MESSAGES
 extern void
-win32_error(DWORD err_code);
-#else
-static inline void
-win32_error(DWORD err_code)
-{
-}
-#endif
+set_errno_from_GetLastError(void);
 
 extern void
-set_errno_from_GetLastError(void);
+set_errno_from_win32_error(DWORD err);
 
-extern int
-win32_error_to_errno(DWORD err_code);
+extern void
+set_errno_from_nt_status(NTSTATUS status);
+
+extern bool
+win32_path_is_root_of_drive(const wchar_t *path);
 
 extern int
-win32_get_vol_flags(const wchar_t *path, unsigned *vol_flags_ret);
+win32_get_vol_flags(const wchar_t *path, unsigned *vol_flags_ret,
+                   bool *supports_SetFileShortName_ret);
 
 extern HANDLE
 win32_open_existing_file(const wchar_t *path, DWORD dwDesiredAccess);
 
-extern HANDLE
-win32_open_file_data_only(const wchar_t *path);
-
-extern HANDLE (WINAPI *win32func_FindFirstStreamW)(LPCWSTR lpFileName,
-                                                  STREAM_INFO_LEVELS InfoLevel,
-                                                  LPVOID lpFindStreamData,
-                                                  DWORD dwFlags);
-
 /* Vista and later */
-extern BOOL (WINAPI *win32func_FindNextStreamW)(HANDLE hFindStream,
-                                               LPVOID lpFindStreamData);
+extern BOOL (WINAPI *func_CreateSymbolicLinkW)(const wchar_t *lpSymlinkFileName,
+                                              const wchar_t *lpTargetFileName,
+                                              DWORD dwFlags);
+
+/* 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,
+                                                     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 NTSTATUS (WINAPI *func_NtClose) (HANDLE Handle);
+
+extern DWORD (WINAPI *func_RtlNtStatusToDosError)(NTSTATUS status);
+
+extern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder)
+                       (PCUNICODE_STRING VolumeRootPath);
+
 
 extern bool
 windows_version_is_at_least(unsigned major, unsigned minor);