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
64df5458
Commit
64df5458
authored
Oct 10, 2003
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Oct 10, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have the wrapper load the used DLLs in case the main program
calls them from constructors (with help from Alexandre Julliard).
parent
a6ed49ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
winewrap.c
tools/winegcc/winewrap.c
+12
-4
No files found.
tools/winegcc/winewrap.c
View file @
64df5458
...
...
@@ -175,7 +175,8 @@ static const char *wrapper_code =
"{
\n
"
" HINSTANCE hApp = 0, hMFC = 0, hMain = 0;
\n
"
" void* appMain;
\n
"
" int retcode;
\n
"
" int retcode, i;
\n
"
" const char* libs[] = { %s };
\n
"
"
\n
"
" /* Then if this application is MFC based, load the MFC module */
\n
"
" if (mfcModule) {
\n
"
...
...
@@ -185,6 +186,10 @@ static const char *wrapper_code =
" hMain = hMFC;
\n
"
" }
\n
"
"
\n
"
" for (i = 0; i < sizeof(libs)/sizeof(libs[0]); i++) {
\n
"
" if (!LoadLibrary(libs[i])) error(
\"
Could not load %%s (%%d)
\"
, libs[i], GetLastError());
\n
"
" }
\n
"
"
\n
"
" /* Load the application's module */
\n
"
" if (!appModule) appModule = appName;
\n
"
" hApp = LoadLibrary(appModule);
\n
"
...
...
@@ -340,8 +345,9 @@ static void add_lib_file(const char* library)
static
void
create_the_wrapper
(
char
*
base_file
,
char
*
base_name
,
char
*
app_name
,
int
gui_mode
)
{
char
*
wrp_temp_name
,
*
wspec_name
,
*
wspec_c_name
,
*
wspec_o_name
;
char
*
wrap_c_name
,
*
wrap_o_name
;
char
*
wrap_c_name
,
*
wrap_o_name
,
*
dlls
=
""
;
strarray
*
wwrap_args
,
*
wspec_args
,
*
wcomp_args
,
*
wlink_args
;
int
i
;
wrp_temp_name
=
tempnam
(
0
,
"wwrp"
);
wspec_name
=
strmake
(
"%s.spec"
,
wrp_temp_name
);
...
...
@@ -362,7 +368,9 @@ static void create_the_wrapper(char* base_file, char* base_name, char* app_name,
strarray_add
(
wwrap_args
,
wrap_c_name
);
strarray_add
(
wwrap_args
,
NULL
);
create_file
(
wrap_c_name
,
wrapper_code
,
base_name
,
gui_mode
,
app_name
);
for
(
i
=
dll_files
->
size
-
1
;
i
>=
0
;
i
--
)
dlls
=
strmake
(
"
\"
%s
\"
, %s"
,
dll_files
->
base
[
i
]
+
2
,
dlls
);
create_file
(
wrap_c_name
,
wrapper_code
,
base_name
,
gui_mode
,
app_name
,
dlls
);
spawn
(
wwrap_args
);
strarray_free
(
wwrap_args
);
rm_temp_file
(
wrap_c_name
);
...
...
@@ -611,7 +619,7 @@ int main(int argc, char **argv)
rm_temp_file
(
spec_o_name
);
if
(
create_wrapper
)
create_the_wrapper
(
base_file
,
base_name
,
app_name
,
gui_mode
);
create_the_wrapper
(
base_file
,
base_name
,
app_name
,
gui_mode
);
/* create the loader script */
create_file
(
base_file
,
app_loader_script
,
base_name
);
...
...
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