]> wimlib.net Git - wimlib/blobdiff - include/wimlib/win32_common.h
system compression: try to attach WOF if compression fails
[wimlib] / include / wimlib / win32_common.h
index 691af744c9fc00eb04d4c34957fca98485760177..0e2db43884392be2d7052bab22c27faba5d257ee 100644 (file)
@@ -1,26 +1,16 @@
 #ifndef _WIMLIB_WIN32_COMMON_H
 #define _WIMLIB_WIN32_COMMON_H
 
+#include <ntstatus.h>
 #include <windows.h>
+#include <winternl.h>
+
 #ifdef ERROR
 #  undef ERROR
 #endif
-
 #include "wimlib/types.h"
 #include "wimlib/win32.h"
 
-#include <ntstatus.h>
-#include <winternl.h>
-
-extern void
-set_errno_from_GetLastError(void);
-
-extern void
-set_errno_from_win32_error(DWORD err);
-
-extern void
-set_errno_from_nt_status(NTSTATUS status);
-
 /* ntdll functions  */
 
 extern NTSTATUS (WINAPI *func_NtCreateFile)(PHANDLE FileHandle,
@@ -35,6 +25,10 @@ extern NTSTATUS (WINAPI *func_NtCreateFile)(PHANDLE FileHandle,
                                            PVOID EaBuffer,
                                            ULONG EaLength);
 
+#ifndef FILE_OPENED
+#  define FILE_OPENED 0x00000001
+#endif
+
 extern NTSTATUS (WINAPI *func_NtOpenFile) (PHANDLE FileHandle,
                                           ACCESS_MASK DesiredAccess,
                                           POBJECT_ATTRIBUTES ObjectAttributes,
@@ -143,20 +137,36 @@ extern NTSTATUS (WINAPI *func_RtlDosPathNameToNtPathName_U_WithStatus)
 extern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder)
                        (PCUNICODE_STRING VolumeRootPath);
 
+#define FSCTL_SET_PERSISTENT_VOLUME_STATE 0x90238
+
+#define PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED 0x00000001
+
+typedef struct _FILE_FS_PERSISTENT_VOLUME_INFORMATION {
+       ULONG VolumeFlags;
+       ULONG FlagMask;
+       ULONG Version;
+       ULONG Reserved;
+} FILE_FS_PERSISTENT_VOLUME_INFORMATION, *PFILE_FS_PERSISTENT_VOLUME_INFORMATION;
+
+extern int
+win32_path_to_nt_path(const wchar_t *win32_path, UNICODE_STRING *nt_path);
+
+extern int
+win32_get_drive_path(const wchar_t *file_path, wchar_t drive_path[7]);
 
 extern bool
-windows_version_is_at_least(unsigned major, unsigned minor);
+win32_try_to_attach_wof(const wchar_t *drive);
 
-#define running_on_windows_xp_or_later() \
-                       windows_version_is_at_least(5, 1)
+extern void
+win32_warning(DWORD err, const wchar_t *format, ...) _cold_attribute;
 
-#define running_on_windows_vista_or_later() \
-                       windows_version_is_at_least(6, 0)
+extern void
+win32_error(DWORD err, const wchar_t *format, ...) _cold_attribute;
 
-#define running_on_windows_7_or_later() \
-                       windows_version_is_at_least(6, 1)
+extern void
+winnt_warning(NTSTATUS status, const wchar_t *format, ...) _cold_attribute;
 
-extern int
-win32_path_to_nt_path(const wchar_t *win32_path, UNICODE_STRING *nt_path);
+extern void
+winnt_error(NTSTATUS status, const wchar_t *format, ...) _cold_attribute;
 
 #endif /* _WIMLIB_WIN32_COMMON_H */