1 #ifndef _WIMLIB_WIN32_COMMON_H
2 #define _WIMLIB_WIN32_COMMON_H
9 #include "wimlib/types.h"
10 #include "wimlib/win32.h"
13 # include <ntstatus.h>
14 # include <winternl.h>
18 set_errno_from_GetLastError(void);
21 set_errno_from_win32_error(DWORD err);
25 set_errno_from_nt_status(NTSTATUS status);
29 win32_path_is_root_of_drive(const wchar_t *path);
32 win32_get_vol_flags(const wchar_t *path, unsigned *vol_flags_ret,
33 bool *supports_SetFileShortName_ret);
36 win32_open_existing_file(const wchar_t *path, DWORD dwDesiredAccess);
39 extern HANDLE (WINAPI *win32func_FindFirstStreamW)(LPCWSTR lpFileName,
40 STREAM_INFO_LEVELS InfoLevel,
41 LPVOID lpFindStreamData,
45 extern BOOL (WINAPI *win32func_FindNextStreamW)(HANDLE hFindStream,
46 LPVOID lpFindStreamData);
49 extern BOOL (WINAPI *win32func_CreateSymbolicLinkW)(const wchar_t *lpSymlinkFileName,
50 const wchar_t *lpTargetFileName,
57 extern NTSTATUS (WINAPI *func_NtQueryInformationFile)(HANDLE FileHandle,
58 PIO_STATUS_BLOCK IoStatusBlock,
59 PVOID FileInformation,
61 FILE_INFORMATION_CLASS FileInformationClass);
63 extern NTSTATUS (WINAPI *func_NtQuerySecurityObject)(HANDLE handle,
64 SECURITY_INFORMATION SecurityInformation,
65 PSECURITY_DESCRIPTOR SecurityDescriptor,
69 extern NTSTATUS (WINAPI *func_NtQueryDirectoryFile) (HANDLE FileHandle,
71 PIO_APC_ROUTINE ApcRoutine,
73 PIO_STATUS_BLOCK IoStatusBlock,
74 PVOID FileInformation,
76 FILE_INFORMATION_CLASS FileInformationClass,
77 BOOLEAN ReturnSingleEntry,
78 PUNICODE_STRING FileName,
82 extern NTSTATUS (WINAPI *func_NtSetSecurityObject)(HANDLE Handle,
83 SECURITY_INFORMATION SecurityInformation,
84 PSECURITY_DESCRIPTOR SecurityDescriptor);
86 extern DWORD (WINAPI *func_RtlNtStatusToDosError)(NTSTATUS status);
88 extern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder)
89 (PCUNICODE_STRING VolumeRootPath);
95 windows_version_is_at_least(unsigned major, unsigned minor);
97 #define running_on_windows_xp_or_later() \
98 windows_version_is_at_least(5, 1)
100 #define running_on_windows_vista_or_later() \
101 windows_version_is_at_least(6, 0)
103 #define running_on_windows_7_or_later() \
104 windows_version_is_at_least(6, 1)
108 #endif /* _WIMLIB_WIN32_COMMON_H */