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
a9d73e97
Commit
a9d73e97
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/tests: Add more tests for UpdateResource.
Signed-off-by:
Ziqing Hui
<
zhui@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7f8f424f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
resource.c
dlls/kernel32/tests/resource.c
+35
-0
No files found.
dlls/kernel32/tests/resource.c
View file @
a9d73e97
...
...
@@ -201,6 +201,7 @@ static int build_exe( const sec_build* sec_descr )
opt
->
SectionAlignment
=
page_size
;
opt
->
FileAlignment
=
page_size
;
opt
->
NumberOfRvaAndSizes
=
IMAGE_FILE_RESOURCE_DIRECTORY
+
1
;
opt
->
DataDirectory
[
IMAGE_FILE_RESOURCE_DIRECTORY
].
VirtualAddress
=
rva_rsrc_start
;
opt
->
DataDirectory
[
IMAGE_FILE_RESOURCE_DIRECTORY
].
Size
=
page_size
;
...
...
@@ -357,6 +358,39 @@ static void update_resources_bigdata( void )
ok
(
r
,
"EndUpdateResource failed
\n
"
);
}
static
void
update_resources_name
(
void
)
{
char
foo
[]
=
"resource data"
,
res_name
[]
=
"name"
,
res_type
[]
=
"type"
;
HANDLE
res
=
NULL
;
HMODULE
module
;
HRSRC
rsrc
;
BOOL
ret
;
res
=
BeginUpdateResourceA
(
filename
,
TRUE
);
ok
(
res
!=
NULL
,
"BeginUpdateResource failed: %u
\n
"
,
GetLastError
()
);
if
(
!
res
)
return
;
ret
=
UpdateResourceA
(
res
,
res_type
,
res_name
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
),
foo
,
sizeof
(
foo
)
);
ok
(
ret
==
TRUE
,
"UpdateResource failed: %u
\n
"
,
GetLastError
()
);
ret
=
EndUpdateResourceA
(
res
,
FALSE
);
ok
(
ret
,
"EndUpdateResource failed: %u
\n
"
,
GetLastError
()
);
if
(
!
ret
)
return
;
module
=
LoadLibraryExA
(
filename
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
ok
(
module
!=
NULL
,
"LoadLibraryEx failed: %u
\n
"
,
GetLastError
()
);
if
(
!
module
)
return
;
rsrc
=
FindResourceA
(
module
,
res_name
,
res_type
);
todo_wine
ok
(
rsrc
!=
NULL
||
broken
(
GetLastError
()
==
ERROR_RESOURCE_TYPE_NOT_FOUND
)
/* win2008 */
,
"FindResource failed: %u
\n
"
,
GetLastError
()
);
ret
=
FreeLibrary
(
module
);
ok
(
ret
,
"FreeLibrary failed: %u
\n
"
,
GetLastError
()
);
}
static
void
check_exe
(
const
sec_verify
*
verify
)
{
int
i
;
...
...
@@ -515,6 +549,7 @@ START_TEST(resource)
check_exe
(
&
sec
->
chk_version
);
update_resources_bigdata
();
check_exe
(
&
sec
->
chk_bigdata
);
update_resources_name
();
DeleteFileA
(
filename
);
}
test_find_resource
();
...
...
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