[Bug 52046] New: UpdateResource does not delete resources
https://bugs.winehq.org/show_bug.cgi?id=52046 Bug ID: 52046 Summary: UpdateResource does not delete resources Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs(a)winehq.org Reporter: info(a)daniel-marschall.de Distribution: --- Hello, I noticed that UpdateResourceA() does not delete resources if data=NULL and length=0. Example code HANDLE hUpdate = BeginUpdateResourceA("d:\\test.dll", false); UpdateResourceA(hUpdate, "TEST", "X", 1033, NULL, 0); EndUpdateResourceA(hUpdate, false); I analyzed the code https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/resource.c and I have found the following: `BeginUpdateResourceW` creates a list `list_init( &updates->root );` of type `QUEUEDUPDATES`. The list is empty and stays empty! `check_pe_exe( file, updates )` is called, but the argument `updates` is not used. The list will not be filled with the resources of the EXE file! When `UpdateResource` wants to delete a resource, then `update_add_resource` will not find the existing resource: `find_resource_dir_entry` fails, because the list is empty. So there is nothing to delete. Another side effect of this bug: If I add or modify a resource (it will get added to the queue) and then delete the resource (it will be deleted from the queue), then the resource will stay unchanged in the target file. I think the fix would be that `check_pe_exe` loads all resources into the list (which is then not a "queue" anymore), then the add/delete/change operations are taking place, and in EndUpdateResource, the changes are written (or discarded). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52046 Ken Sharp <imwellcushtymelike(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |6.22 Keywords| |source -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla