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

Comments, questions, bug reports, etc.
Post Reply
haobinnan
Posts: 4
Joined: Fri Mar 27, 2026 2:25 am

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

Post 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!
synchronicity
Site Admin
Posts: 498
Joined: Sun Aug 02, 2015 10:31 pm

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

Post 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.
haobinnan
Posts: 4
Joined: Fri Mar 27, 2026 2:25 am

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

Post 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?
haobinnan
Posts: 4
Joined: Fri Mar 27, 2026 2:25 am

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

Post by haobinnan »

I think wimlib should also set the SeCreateSymbolicLink Privilege.
haobinnan
Posts: 4
Joined: Fri Mar 27, 2026 2:25 am

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

Post 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?
Post Reply