1 #ifndef _WIMLIB_WIN32_COMMON_H
2 #define _WIMLIB_WIN32_COMMON_H
9 #include "wimlib/types.h"
10 #include "wimlib/win32.h"
16 set_errno_from_GetLastError(void);
19 set_errno_from_win32_error(DWORD err);
22 set_errno_from_nt_status(NTSTATUS status);
25 win32_path_is_root_of_drive(const wchar_t *path);
28 win32_get_vol_flags(const wchar_t *path, unsigned *vol_flags_ret,
29 bool *supports_SetFileShortName_ret);
32 win32_open_existing_file(const wchar_t *path, DWORD dwDesiredAccess);
35 extern BOOL (WINAPI *func_CreateSymbolicLinkW)(const wchar_t *lpSymlinkFileName,
36 const wchar_t *lpTargetFileName,
41 extern NTSTATUS (WINAPI *func_NtOpenFile) (PHANDLE FileHandle,
42 ACCESS_MASK DesiredAccess,
43 POBJECT_ATTRIBUTES ObjectAttributes,
44 PIO_STATUS_BLOCK IoStatusBlock,
48 extern NTSTATUS (WINAPI *func_NtReadFile) (HANDLE FileHandle,
50 PIO_APC_ROUTINE ApcRoutine,
52 PIO_STATUS_BLOCK IoStatusBlock,
55 PLARGE_INTEGER ByteOffset,
58 extern NTSTATUS (WINAPI *func_NtQueryInformationFile)(HANDLE FileHandle,
59 PIO_STATUS_BLOCK IoStatusBlock,
60 PVOID FileInformation,
62 FILE_INFORMATION_CLASS FileInformationClass);
64 extern NTSTATUS (WINAPI *func_NtQuerySecurityObject)(HANDLE handle,
65 SECURITY_INFORMATION SecurityInformation,
66 PSECURITY_DESCRIPTOR SecurityDescriptor,
70 extern NTSTATUS (WINAPI *func_NtQueryDirectoryFile) (HANDLE FileHandle,
72 PIO_APC_ROUTINE ApcRoutine,
74 PIO_STATUS_BLOCK IoStatusBlock,
75 PVOID FileInformation,
77 FILE_INFORMATION_CLASS FileInformationClass,
78 BOOLEAN ReturnSingleEntry,
79 PUNICODE_STRING FileName,
82 extern NTSTATUS (WINAPI *func_NtQueryVolumeInformationFile) (HANDLE FileHandle,
83 PIO_STATUS_BLOCK IoStatusBlock,
86 FS_INFORMATION_CLASS FsInformationClass);
89 extern NTSTATUS (WINAPI *func_NtSetSecurityObject)(HANDLE Handle,
90 SECURITY_INFORMATION SecurityInformation,
91 PSECURITY_DESCRIPTOR SecurityDescriptor);
93 extern NTSTATUS (WINAPI *func_NtClose) (HANDLE Handle);
95 extern DWORD (WINAPI *func_RtlNtStatusToDosError)(NTSTATUS status);
97 extern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder)
98 (PCUNICODE_STRING VolumeRootPath);
102 windows_version_is_at_least(unsigned major, unsigned minor);
104 #define running_on_windows_xp_or_later() \
105 windows_version_is_at_least(5, 1)
107 #define running_on_windows_vista_or_later() \
108 windows_version_is_at_least(6, 0)
110 #define running_on_windows_7_or_later() \
111 windows_version_is_at_least(6, 1)
115 #endif /* _WIMLIB_WIN32_COMMON_H */