X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib%2Fwin32_common.h;h=f27a2d71be285a634185de1d0ba263a73656e370;hb=b8ebc57d493d7b6e660a50f7789fcb5451f5d77d;hp=8b4a48d4c7badf72bad7741d16e158fea6280c0d;hpb=969809ef646ec6ceb9730da2eb21884feaff994d;p=wimlib diff --git a/include/wimlib/win32_common.h b/include/wimlib/win32_common.h index 8b4a48d4..f27a2d71 100644 --- a/include/wimlib/win32_common.h +++ b/include/wimlib/win32_common.h @@ -1,26 +1,22 @@ #ifndef _WIMLIB_WIN32_COMMON_H #define _WIMLIB_WIN32_COMMON_H +#include #include +#include + #ifdef ERROR # undef ERROR #endif - #include "wimlib/types.h" #include "wimlib/win32.h" -#include -#include - 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, @@ -143,7 +139,33 @@ 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 void +win32_warning(DWORD err, const wchar_t *format, ...) _cold_attribute; + +extern void +win32_error(DWORD err, const wchar_t *format, ...) _cold_attribute; + +extern void +winnt_warning(NTSTATUS status, const wchar_t *format, ...) _cold_attribute; + +extern void +winnt_error(NTSTATUS status, const wchar_t *format, ...) _cold_attribute; + #endif /* _WIMLIB_WIN32_COMMON_H */