496ee5c3d07e22ce889229d7bee6368b0d05cdf5
[wimlib] / src / win32.h
1 #ifndef _WIMLIB_WIN32_H
2 #define _WIMLIB_WIN32_H
3
4 #include "wimlib_internal.h"
5 #include <direct.h>
6
7 extern void win32_release_capture_privileges();
8 extern void win32_acquire_capture_privileges();
9
10 extern void win32_release_restore_privileges();
11 extern void win32_acquire_restore_privileges();
12
13 extern int win32_build_dentry_tree(struct wim_dentry **root_ret,
14                                    const char *root_disk_path,
15                                    struct wim_lookup_table *lookup_table,
16                                    struct wim_security_data *sd,
17                                    const struct capture_config *config,
18                                    int add_image_flags,
19                                    wimlib_progress_func_t progress_func,
20                                    void *extra_arg);
21
22 extern int win32_read_file(const char *filename, void *handle, u64 offset,
23                            size_t size, u8 *buf);
24 extern void *win32_open_file_readonly(const void *path_utf16);
25 extern void win32_close_file(void *handle);
26
27 #ifdef ENABLE_ERROR_MESSAGES
28 extern void win32_error(u32 err);
29 #else
30 #  define win32_error(err)
31 #endif
32
33 #define FNM_PATHNAME 0x1
34 #define FNM_NOMATCH 1
35 extern int fnmatch(const char *pattern, const char *string, int flags);
36
37 #define mkdir(name, mode) _mkdir(name)
38
39 extern int win32_do_apply_dentry(const char *output_path,
40                                  size_t output_path_len,
41                                  struct wim_dentry *dentry,
42                                  struct apply_args *args);
43
44 extern int win32_do_apply_dentry_timestamps(const char *output_path,
45                                             size_t output_path_len,
46                                             const struct wim_dentry *dentry,
47                                             const struct apply_args *args);
48
49 extern int fsync(int fd);
50
51 extern unsigned win32_get_number_of_processors();
52
53 extern char *realpath(const char *path, char *resolved_path);
54
55 #endif /* _WIMLIB_WIN32_H */