Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2698591a
Commit
2698591a
authored
Sep 16, 2020
by
Ziqing Hui
Committed by
Alexandre Julliard
Sep 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Use uppercase name in UpdateResourceW().
Signed-off-by:
Ziqing Hui
<
zhui@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a9d73e97
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
resource.c
dlls/kernel32/resource.c
+33
-2
resource.c
dlls/kernel32/tests/resource.c
+0
-1
No files found.
dlls/kernel32/resource.c
View file @
2698591a
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include "wine/exception.h"
#include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
#include "wine/list.h"
#include "wine/list.h"
#include "kernel_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
resource
);
WINE_DEFAULT_DEBUG_CHANNEL
(
resource
);
...
@@ -62,6 +63,26 @@ static NTSTATUS get_res_nameA( LPCSTR name, UNICODE_STRING *str )
...
@@ -62,6 +63,26 @@ static NTSTATUS get_res_nameA( LPCSTR name, UNICODE_STRING *str )
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
static
NTSTATUS
get_res_nameW
(
LPCWSTR
name
,
UNICODE_STRING
*
str
)
{
if
(
IS_INTRESOURCE
(
name
))
{
str
->
Buffer
=
ULongToPtr
(
LOWORD
(
name
)
);
return
STATUS_SUCCESS
;
}
if
(
name
[
0
]
==
'#'
)
{
ULONG
value
;
RtlInitUnicodeString
(
str
,
name
+
1
);
if
(
RtlUnicodeStringToInteger
(
str
,
10
,
&
value
)
!=
STATUS_SUCCESS
||
HIWORD
(
value
))
return
STATUS_INVALID_PARAMETER
;
str
->
Buffer
=
ULongToPtr
(
value
);
return
STATUS_SUCCESS
;
}
RtlCreateUnicodeString
(
str
,
name
);
RtlUpcaseUnicodeString
(
str
,
str
,
FALSE
);
return
STATUS_SUCCESS
;
}
/**********************************************************************
/**********************************************************************
* FindResourceExA (KERNEL32.@)
* FindResourceExA (KERNEL32.@)
...
@@ -1290,27 +1311,37 @@ BOOL WINAPI UpdateResourceW( HANDLE hUpdate, LPCWSTR lpType, LPCWSTR lpName,
...
@@ -1290,27 +1311,37 @@ BOOL WINAPI UpdateResourceW( HANDLE hUpdate, LPCWSTR lpType, LPCWSTR lpName,
WORD
wLanguage
,
LPVOID
lpData
,
DWORD
cbData
)
WORD
wLanguage
,
LPVOID
lpData
,
DWORD
cbData
)
{
{
QUEUEDUPDATES
*
updates
;
QUEUEDUPDATES
*
updates
;
UNICODE_STRING
nameW
,
typeW
;
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
TRACE
(
"%p %s %s %08x %p %d
\n
"
,
hUpdate
,
TRACE
(
"%p %s %s %08x %p %d
\n
"
,
hUpdate
,
debugstr_w
(
lpType
),
debugstr_w
(
lpName
),
wLanguage
,
lpData
,
cbData
);
debugstr_w
(
lpType
),
debugstr_w
(
lpName
),
wLanguage
,
lpData
,
cbData
);
nameW
.
Buffer
=
typeW
.
Buffer
=
NULL
;
updates
=
GlobalLock
(
hUpdate
);
updates
=
GlobalLock
(
hUpdate
);
if
(
updates
)
if
(
updates
)
{
{
if
(
!
set_ntstatus
(
get_res_nameW
(
lpName
,
&
nameW
)))
goto
done
;
if
(
!
set_ntstatus
(
get_res_nameW
(
lpType
,
&
typeW
)))
goto
done
;
if
(
lpData
==
NULL
&&
cbData
==
0
)
/* remove resource */
if
(
lpData
==
NULL
&&
cbData
==
0
)
/* remove resource */
{
{
ret
=
update_add_resource
(
updates
,
lpType
,
lpName
,
wLanguage
,
NULL
,
TRUE
);
ret
=
update_add_resource
(
updates
,
typeW
.
Buffer
,
nameW
.
Buffer
,
wLanguage
,
NULL
,
TRUE
);
}
}
else
else
{
{
struct
resource_data
*
data
;
struct
resource_data
*
data
;
data
=
allocate_resource_data
(
wLanguage
,
0
,
lpData
,
cbData
,
TRUE
);
data
=
allocate_resource_data
(
wLanguage
,
0
,
lpData
,
cbData
,
TRUE
);
if
(
data
)
if
(
data
)
ret
=
update_add_resource
(
updates
,
lpType
,
lpName
,
wLanguage
,
data
,
TRUE
);
ret
=
update_add_resource
(
updates
,
typeW
.
Buffer
,
nameW
.
Buffer
,
wLanguage
,
data
,
TRUE
);
}
}
done:
GlobalUnlock
(
hUpdate
);
GlobalUnlock
(
hUpdate
);
}
}
if
(
!
IS_INTRESOURCE
(
nameW
.
Buffer
))
HeapFree
(
GetProcessHeap
(),
0
,
nameW
.
Buffer
);
if
(
!
IS_INTRESOURCE
(
typeW
.
Buffer
))
HeapFree
(
GetProcessHeap
(),
0
,
typeW
.
Buffer
);
return
ret
;
return
ret
;
}
}
...
...
dlls/kernel32/tests/resource.c
View file @
2698591a
...
@@ -382,7 +382,6 @@ static void update_resources_name( void )
...
@@ -382,7 +382,6 @@ static void update_resources_name( void )
if
(
!
module
)
return
;
if
(
!
module
)
return
;
rsrc
=
FindResourceA
(
module
,
res_name
,
res_type
);
rsrc
=
FindResourceA
(
module
,
res_name
,
res_type
);
todo_wine
ok
(
rsrc
!=
NULL
||
ok
(
rsrc
!=
NULL
||
broken
(
GetLastError
()
==
ERROR_RESOURCE_TYPE_NOT_FOUND
)
/* win2008 */
,
broken
(
GetLastError
()
==
ERROR_RESOURCE_TYPE_NOT_FOUND
)
/* win2008 */
,
"FindResource failed: %u
\n
"
,
GetLastError
()
);
"FindResource failed: %u
\n
"
,
GetLastError
()
);
...
...
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