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
cf0420cb
Commit
cf0420cb
authored
May 26, 2008
by
James Hawkins
Committed by
Alexandre Julliard
May 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winetest: Use the win32 API to extract the tests.
parent
173d79a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
main.c
programs/winetest/main.c
+12
-6
No files found.
programs/winetest/main.c
View file @
cf0420cb
...
...
@@ -276,24 +276,30 @@ extract_test (struct wine_test *test, const char *dir, LPTSTR res_name)
{
BYTE
*
code
;
DWORD
size
;
FILE
*
fout
;
char
*
exepos
;
HANDLE
hfile
;
DWORD
written
;
code
=
extract_rcdata
(
res_name
,
TESTRES
,
&
size
);
if
(
!
code
)
report
(
R_FATAL
,
"Can't find test resource %s: %d"
,
res_name
,
GetLastError
());
test
->
name
=
xstrdup
(
res_name
);
test
->
exename
=
strmake
(
NULL
,
"%s
/
%s"
,
dir
,
test
->
name
);
test
->
exename
=
strmake
(
NULL
,
"%s
\\
%s"
,
dir
,
test
->
name
);
exepos
=
strstr
(
test
->
name
,
testexe
);
if
(
!
exepos
)
report
(
R_FATAL
,
"Not an .exe file: %s"
,
test
->
name
);
*
exepos
=
0
;
test
->
name
=
xrealloc
(
test
->
name
,
exepos
-
test
->
name
+
1
);
report
(
R_STEP
,
"Extracting: %s"
,
test
->
name
);
if
(
!
(
fout
=
fopen
(
test
->
exename
,
"wb"
))
||
(
fwrite
(
code
,
size
,
1
,
fout
)
!=
1
)
||
fclose
(
fout
))
report
(
R_FATAL
,
"Failed to write file %s."
,
test
->
exename
);
hfile
=
CreateFileA
(
test
->
exename
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hfile
==
INVALID_HANDLE_VALUE
)
report
(
R_FATAL
,
"Failed to open file %s."
,
test
->
exename
);
if
(
!
WriteFile
(
hfile
,
code
,
size
,
&
written
,
NULL
))
report
(
R_FATAL
,
"Failed to write file %s."
,
test
->
exename
);
CloseHandle
(
hfile
);
}
/* Run a command for MS milliseconds. If OUT != NULL, also redirect
...
...
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