On Windows, wimlib_global_init() can fail if functions are missing from
ntdll. It's best to fail fast in this case rather than plowing ahead and
assuming the user would have already called wimlib_global_init()
themselves if they cared.
int mount_flags;
int ret;
int mount_flags;
int ret;
- wimlib_global_init(WIMLIB_INIT_FLAG_ASSUME_UTF8);
+ ret = wimlib_global_init(WIMLIB_INIT_FLAG_ASSUME_UTF8);
+ if (ret)
+ return ret;
if (unmount_flags & ~(WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY |
WIMLIB_UNMOUNT_FLAG_COMMIT |
if (unmount_flags & ~(WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY |
WIMLIB_UNMOUNT_FLAG_COMMIT |
struct wim_lookup_table *table;
int ret;
struct wim_lookup_table *table;
int ret;
- wimlib_global_init(WIMLIB_INIT_FLAG_ASSUME_UTF8);
+ ret = wimlib_global_init(WIMLIB_INIT_FLAG_ASSUME_UTF8);
+ if (ret)
+ return ret;
DEBUG("Creating new WIM with %"TS" compression.",
wimlib_get_compression_type_string(ctype));
DEBUG("Creating new WIM with %"TS" compression.",
wimlib_get_compression_type_string(ctype));
else
DEBUG("Opening WIM file \"%"TS"\"", (const tchar*)wim_filename_or_fd);
else
DEBUG("Opening WIM file \"%"TS"\"", (const tchar*)wim_filename_or_fd);
- wimlib_global_init(WIMLIB_INIT_FLAG_ASSUME_UTF8);
+ ret = wimlib_global_init(WIMLIB_INIT_FLAG_ASSUME_UTF8);
+ if (ret)
+ return ret;
if (wim_ret == NULL)
return WIMLIB_ERR_INVALID_PARAM;
if (wim_ret == NULL)
return WIMLIB_ERR_INVALID_PARAM;