Page 1 of 1

wimlib_extract_image fails with WIMLIB_ERR_OPEN (47) during "Applying metadata to files"

Posted: Fri Mar 27, 2026 2:26 am
by haobinnan
Content

I'm encountering an issue when using wimlib to extract a WIM image.

During wimlib_extract_image, the stages behave as follows:

Creating files ✅ OK
Extracting file data ✅ OK
Applying metadata to files ❌ Failed

Error code:

WIMLIB_ERR_OPEN (47)

Code snippet:

wimlib_global_init(0);

wimlib_open_wim_with_progress(
pThreadParam->strSystemImagePath,
0,
&wim,
Dwtv_imagex_progress_func,
pThreadParam
);

wimlib_extract_image(
wim,
pThreadParam->iImageIndex,
strPath,
0
);

wimlib_free(wim);

wimlib_global_cleanup();

File creation and data extraction both work fine.
The failure only occurs during the metadata applying stage.

Does anyone know what could typically cause this?

Also one question:
On Windows, does wimlib_global_init() automatically enable privileges like SeBackupPrivilege / SeRestorePrivilege?
Or do these still need to be handled manually?

I can provide more details (e.g., failing file path or environment info) if needed.

Thanks in advance!

Re: wimlib_extract_image fails with WIMLIB_ERR_OPEN (47) during "Applying metadata to files"

Posted: Fri Mar 27, 2026 2:32 am
by synchronicity
Does anyone know what could typically cause this?
Does anything appear in the error log, if you enable error logging?
On Windows, does wimlib_global_init() automatically enable privileges like SeBackupPrivilege / SeRestorePrivilege?
Yes, it enables those by default.

Re: wimlib_extract_image fails with WIMLIB_ERR_OPEN (47) during "Applying metadata to files"

Posted: Fri Mar 27, 2026 3:13 am
by haobinnan
synchronicity wrote: Fri Mar 27, 2026 2:32 am
Does anyone know what could typically cause this?
Does anything appear in the error log, if you enable error logging?
On Windows, does wimlib_global_init() automatically enable privileges like SeBackupPrivilege / SeRestorePrivilege?
Yes, it enables those by default.

I encountered a permission issue when using wimlib's wimlib_extract_image function on Windows. The details are as follows:

Log output:
[WARNING] Can't create symbolic link "F:\Users\All Users"!
(Need Administrator rights, or at least the
SeCreateSymbolicLink privilege.)

[ERROR] Can't open "F:\Program Files\WindowsApps\Microsoft.ZuneVideo_10.19071.19011.0_x64__8wekyb3d8bbwe\GlassVertexShader.cso" to set metadata (status=c0000022): {Access Denied}
A process tried to access an object but did not have the required permissions.
Steps I have tried:
I used wimlib_set_error_file_by_name in my code to capture detailed logs.
For the symbolic link warning, I requested the SE_CREATE_SYMBOLIC_LINK_NAME privilege in my program. After that, the warning [WARNING] Can't create symbolic link "F:\Users\All Users"! disappeared.
Remaining issue:
The following error still occurs:
[ERROR] Can't open "F:\Program Files\WindowsApps\Microsoft.ZuneVideo_10.19071.19011.0_x64__8wekyb3d8bbwe\GlassVertexShader.cso" to set metadata (status=c0000022): {Access Denied}
A process tried to access an object but did not have the required permissions.
I suspect this is related to NTFS permissions on system files inside the WindowsApps folder. Even running the program as Administrator may not allow wimlib to open certain system files to set metadata.
Questions / Seeking advice:
Is there a way to allow wimlib to successfully set metadata on these system files in Windows?
Are special privileges or security policy changes required?
Are there any feasible workarounds to avoid the status=c0000022 error?

Re: wimlib_extract_image fails with WIMLIB_ERR_OPEN (47) during "Applying metadata to files"

Posted: Fri Mar 27, 2026 5:55 am
by haobinnan
I think wimlib should also set the SeCreateSymbolicLink Privilege.

Re: wimlib_extract_image fails with WIMLIB_ERR_OPEN (47) during "Applying metadata to files"

Posted: Fri Mar 27, 2026 6:40 am
by haobinnan
Does wimlib-imagex apply install.wim 2 f: use wimlib_global_init, wimlib_open_wim_with_progress, and wimlib_extract_image with all flags set to 0 by default?