Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d5cb11a4
Commit
d5cb11a4
authored
Dec 21, 2010
by
Kirill Smelkov
Committed by
Alexandre Julliard
Dec 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Support deleting resources in UpdateResource.
parent
46784476
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
resource.c
dlls/kernel32/resource.c
+13
-4
No files found.
dlls/kernel32/resource.c
View file @
d5cb11a4
...
...
@@ -706,7 +706,8 @@ static void res_free_str( LPWSTR str )
}
static
BOOL
update_add_resource
(
QUEUEDUPDATES
*
updates
,
LPCWSTR
Type
,
LPCWSTR
Name
,
struct
resource_data
*
resdata
,
BOOL
overwrite_existing
)
LANGID
Lang
,
struct
resource_data
*
resdata
,
BOOL
overwrite_existing
)
{
struct
resource_dir_entry
*
restype
,
*
resname
;
struct
resource_data
*
existing
;
...
...
@@ -736,7 +737,7 @@ static BOOL update_add_resource( QUEUEDUPDATES *updates, LPCWSTR Type, LPCWSTR N
* If there's an existing resource entry with matching (Type,Name,Language)
* it needs to be removed before adding the new data.
*/
existing
=
find_resource_data
(
&
resname
->
children
,
resdata
->
l
ang
);
existing
=
find_resource_data
(
&
resname
->
children
,
L
ang
);
if
(
existing
)
{
if
(
!
overwrite_existing
)
...
...
@@ -745,6 +746,7 @@ static BOOL update_add_resource( QUEUEDUPDATES *updates, LPCWSTR Type, LPCWSTR N
HeapFree
(
GetProcessHeap
(),
0
,
existing
);
}
if
(
resdata
)
add_resource_data_entry
(
&
resname
->
children
,
resdata
);
return
TRUE
;
...
...
@@ -1007,7 +1009,7 @@ static BOOL enumerate_mapped_resources( QUEUEDUPDATES *updates,
resdata
=
allocate_resource_data
(
Lang
,
data
->
CodePage
,
p
,
data
->
Size
,
FALSE
);
if
(
resdata
)
{
if
(
!
update_add_resource
(
updates
,
Type
,
Name
,
resdata
,
FALSE
))
if
(
!
update_add_resource
(
updates
,
Type
,
Name
,
Lang
,
resdata
,
FALSE
))
HeapFree
(
GetProcessHeap
(),
0
,
resdata
);
}
}
...
...
@@ -1697,10 +1699,17 @@ BOOL WINAPI UpdateResourceW( HANDLE hUpdate, LPCWSTR lpType, LPCWSTR lpName,
updates
=
GlobalLock
(
hUpdate
);
if
(
updates
)
{
if
(
lpData
==
NULL
&&
cbData
==
0
)
/* remove resource */
{
ret
=
update_add_resource
(
updates
,
lpType
,
lpName
,
wLanguage
,
NULL
,
TRUE
);
}
else
{
struct
resource_data
*
data
;
data
=
allocate_resource_data
(
wLanguage
,
0
,
lpData
,
cbData
,
TRUE
);
if
(
data
)
ret
=
update_add_resource
(
updates
,
lpType
,
lpName
,
data
,
TRUE
);
ret
=
update_add_resource
(
updates
,
lpType
,
lpName
,
wLanguage
,
data
,
TRUE
);
}
GlobalUnlock
(
hUpdate
);
}
return
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment