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
5e4a5bec
Commit
5e4a5bec
authored
Feb 13, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added native mode dll support (based on a patch by Marcus Meissner).
parent
69063fa0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
12 deletions
+53
-12
build.h
tools/winebuild/build.h
+1
-0
import.c
tools/winebuild/import.c
+1
-0
main.c
tools/winebuild/main.c
+1
-0
spec32.c
tools/winebuild/spec32.c
+46
-11
winebuild.man.in
tools/winebuild/winebuild.man.in
+4
-1
No files found.
tools/winebuild/build.h
View file @
5e4a5bec
...
...
@@ -53,6 +53,7 @@ typedef enum
typedef
enum
{
SPEC_MODE_DLL
,
SPEC_MODE_NATIVE
,
SPEC_MODE_GUIEXE
,
SPEC_MODE_CUIEXE
,
SPEC_MODE_GUIEXE_UNICODE
,
...
...
tools/winebuild/import.c
View file @
5e4a5bec
...
...
@@ -569,6 +569,7 @@ static void add_extra_undef_symbols( const DLLSPEC *spec )
switch
(
spec
->
mode
)
{
case
SPEC_MODE_DLL
:
case
SPEC_MODE_NATIVE
:
break
;
case
SPEC_MODE_GUIEXE
:
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetCommandLineA"
,
spec
);
...
...
tools/winebuild/main.c
View file @
5e4a5bec
...
...
@@ -268,6 +268,7 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
else
if
(
!
strcmp
(
optarg
,
"cui"
))
spec
->
mode
=
SPEC_MODE_CUIEXE
;
else
if
(
!
strcmp
(
optarg
,
"guiw"
))
spec
->
mode
=
SPEC_MODE_GUIEXE_UNICODE
;
else
if
(
!
strcmp
(
optarg
,
"cuiw"
))
spec
->
mode
=
SPEC_MODE_CUIEXE_UNICODE
;
else
if
(
!
strcmp
(
optarg
,
"native"
))
spec
->
mode
=
SPEC_MODE_NATIVE
;
else
usage
(
1
);
break
;
case
'o'
:
...
...
tools/winebuild/spec32.c
View file @
5e4a5bec
...
...
@@ -72,6 +72,27 @@ static const char *make_internal_name( const ORDDEF *odp, DLLSPEC *spec, const c
}
/*******************************************************************
* declare_weak_function
*
* Output a prototype for a weak function.
*/
static
void
declare_weak_function
(
FILE
*
outfile
,
const
char
*
name
,
const
char
*
prototype
)
{
fprintf
(
outfile
,
"#ifdef __GNUC__
\n
"
);
fprintf
(
outfile
,
"# ifdef __APPLE__
\n
"
);
fprintf
(
outfile
,
"extern %s __attribute__((weak_import));
\n
"
,
prototype
);
fprintf
(
outfile
,
"# else
\n
"
);
fprintf
(
outfile
,
"extern %s __attribute__((weak));
\n
"
,
prototype
);
fprintf
(
outfile
,
"# endif
\n
"
);
fprintf
(
outfile
,
"#else
\n
"
);
fprintf
(
outfile
,
"extern %s;
\n
"
,
prototype
);
fprintf
(
outfile
,
"static void __asm__dummy_%s(void)"
,
name
);
fprintf
(
outfile
,
" { asm(
\"
.weak "
__ASM_NAME
(
"%s"
)
"
\"
); }
\n
"
,
name
);
fprintf
(
outfile
,
"#endif
\n\n
"
);
}
/*******************************************************************
* output_debug
*
* Output the debug channels.
...
...
@@ -559,17 +580,8 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
fprintf
(
outfile
,
"extern int __stdcall %s( void*, unsigned int, void* );
\n\n
"
,
init_func
);
else
{
fprintf
(
outfile
,
"#ifdef __GNUC__
\n
"
);
fprintf
(
outfile
,
"# ifdef __APPLE__
\n
"
);
fprintf
(
outfile
,
"extern int __stdcall DllMain( void*, unsigned int, void* ) __attribute__((weak_import));
\n
"
);
fprintf
(
outfile
,
"# else
\n
"
);
fprintf
(
outfile
,
"extern int __stdcall DllMain( void*, unsigned int, void* ) __attribute__((weak));
\n
"
);
fprintf
(
outfile
,
"# endif
\n
"
);
fprintf
(
outfile
,
"#else
\n
"
);
fprintf
(
outfile
,
"extern int __stdcall DllMain( void*, unsigned int, void* );
\n
"
);
fprintf
(
outfile
,
"static void __asm__dummy_dllmain(void)"
);
fprintf
(
outfile
,
" { asm(
\"
.weak "
__ASM_NAME
(
"DllMain"
)
"
\"
); }
\n
"
);
fprintf
(
outfile
,
"#endif
\n\n
"
);
declare_weak_function
(
outfile
,
"DllMain"
,
"int __stdcall DllMain( void*, unsigned int, void* )"
);
init_func
=
"DllMain"
;
}
fprintf
(
outfile
,
...
...
@@ -586,6 +598,29 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
init_func
=
"__wine_dll_main"
;
characteristics
=
IMAGE_FILE_DLL
;
break
;
case
SPEC_MODE_NATIVE
:
if
(
init_func
)
fprintf
(
outfile
,
"extern int __stdcall %s( void*, void* );
\n\n
"
,
init_func
);
else
{
declare_weak_function
(
outfile
,
"DriverEntry"
,
"int __stdcall DriverEntry( void*, void* )"
);
init_func
=
"DriverEntry"
;
}
fprintf
(
outfile
,
"static int __stdcall __wine_driver_entry( void *obj, void *path )
\n
"
"{
\n
"
" int ret;
\n
"
" if (reason == %d && __wine_spec_init_state == 1)
\n
"
" _init( __wine_main_argc, __wine_main_argv, __wine_main_environ );
\n
"
" ret = %s ? %s( obj, path ) : 0;
\n
"
" if (reason == %d && __wine_spec_init_state == 1) _fini();
\n
"
" return ret;
\n
"
"}
\n
"
,
DLL_PROCESS_ATTACH
,
init_func
,
init_func
,
DLL_PROCESS_DETACH
);
init_func
=
"__wine_driver_entry"
;
subsystem
=
IMAGE_SUBSYSTEM_NATIVE
;
break
;
case
SPEC_MODE_GUIEXE
:
case
SPEC_MODE_GUIEXE_UNICODE
:
if
(
!
init_func
)
init_func
=
"WinMain"
;
...
...
tools/winebuild/winebuild.man.in
View file @
5e4a5bec
...
...
@@ -145,7 +145,10 @@ for a graphical ASCII executable,
for a command line Unicode executable,
.br
.B guiw
for a graphical Unicode executable.
for a graphical Unicode executable,
.br
.B native
for a native-mode dll.
.br
A command line executable entry point is a normal C \fBmain\fR
function. A graphical executable has a \fBWinMain\fR entry point
...
...
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