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_NtQueryInformationFile)(HANDLE FileHandle,
49 PIO_STATUS_BLOCK IoStatusBlock,
50 PVOID FileInformation,
52 FILE_INFORMATION_CLASS FileInformationClass);
54 extern NTSTATUS (WINAPI *func_NtQuerySecurityObject)(HANDLE handle,
55 SECURITY_INFORMATION SecurityInformation,
56 PSECURITY_DESCRIPTOR SecurityDescriptor,
60 extern NTSTATUS (WINAPI *func_NtQueryDirectoryFile) (HANDLE FileHandle,
62 PIO_APC_ROUTINE ApcRoutine,
64 PIO_STATUS_BLOCK IoStatusBlock,
65 PVOID FileInformation,
67 FILE_INFORMATION_CLASS FileInformationClass,
68 BOOLEAN ReturnSingleEntry,
69 PUNICODE_STRING FileName,
73 extern NTSTATUS (WINAPI *func_NtSetSecurityObject)(HANDLE Handle,
74 SECURITY_INFORMATION SecurityInformation,
75 PSECURITY_DESCRIPTOR SecurityDescriptor);
77 extern NTSTATUS (WINAPI *func_NtClose) (HANDLE Handle);
79 extern DWORD (WINAPI *func_RtlNtStatusToDosError)(NTSTATUS status);
81 extern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder)
82 (PCUNICODE_STRING VolumeRootPath);
86 windows_version_is_at_least(unsigned major, unsigned minor);
88 #define running_on_windows_xp_or_later() \
89 windows_version_is_at_least(5, 1)
91 #define running_on_windows_vista_or_later() \
92 windows_version_is_at_least(6, 0)
94 #define running_on_windows_7_or_later() \
95 windows_version_is_at_least(6, 1)
99 #endif /* _WIMLIB_WIN32_COMMON_H */