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
b6b180a1
Commit
b6b180a1
authored
Aug 25, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the implementation of spec file stubs to the winecrt0 library.
parent
4946623d
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
90 additions
and
42 deletions
+90
-42
Makefile.in
dlls/activeds/Makefile.in
+1
-0
Makefile.in
dlls/d3dim/Makefile.in
+1
-0
Makefile.in
dlls/d3drm/Makefile.in
+1
-0
Makefile.in
dlls/msnet32/Makefile.in
+1
-0
Makefile.in
dlls/msvcrt20/Makefile.in
+1
-1
Makefile.in
dlls/msvcrt40/Makefile.in
+1
-1
exception.c
dlls/ntdll/exception.c
+21
-0
Makefile.in
dlls/oleacc/Makefile.in
+1
-0
Makefile.in
dlls/sti/Makefile.in
+1
-0
Makefile.in
dlls/url/Makefile.in
+1
-0
Makefile.in
dlls/winecrt0/Makefile.in
+2
-1
stub.c
dlls/winecrt0/stub.c
+33
-0
import.c
tools/winebuild/import.c
+16
-11
spec32.c
tools/winebuild/spec32.c
+9
-28
No files found.
dlls/activeds/Makefile.in
View file @
b6b180a1
...
...
@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
activeds.dll
IMPORTLIB
=
libactiveds.
$(IMPLIBEXT)
IMPORTS
=
kernel32
C_SRCS
=
activeds_main.c
...
...
dlls/d3dim/Makefile.in
View file @
b6b180a1
...
...
@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
d3dim.dll
IMPORTLIB
=
libd3dim.
$(IMPLIBEXT)
IMPORTS
=
kernel32
C_SRCS
=
d3dim_main.c
...
...
dlls/d3drm/Makefile.in
View file @
b6b180a1
...
...
@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
d3drm.dll
IMPORTLIB
=
libd3drm.
$(IMPLIBEXT)
IMPORTS
=
kernel32
C_SRCS
=
d3drm_main.c
...
...
dlls/msnet32/Makefile.in
View file @
b6b180a1
...
...
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
msnet32.dll
IMPORTS
=
kernel32
C_SRCS
=
msnet_main.c
...
...
dlls/msvcrt20/Makefile.in
View file @
b6b180a1
...
...
@@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
msvcrt20.dll
IMPORTLIB
=
libmsvcrt20.
$(IMPLIBEXT)
IMPORTS
=
msvcrt
IMPORTS
=
msvcrt
kernel32
EXTRALIBS
=
$(LIBUNICODE)
C_SRCS
=
msvcrt20.c
...
...
dlls/msvcrt40/Makefile.in
View file @
b6b180a1
...
...
@@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
msvcrt40.dll
IMPORTLIB
=
libmsvcrt40.
$(IMPLIBEXT)
IMPORTS
=
msvcrt
IMPORTS
=
msvcrt
kernel32
C_SRCS
=
msvcrt40.c
...
...
dlls/ntdll/exception.c
View file @
b6b180a1
...
...
@@ -547,3 +547,24 @@ DWORD __wine_finally_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION_R
}
return
ExceptionContinueSearch
;
}
/*************************************************************
* __wine_spec_unimplemented_stub
*
* ntdll-specific implementation to avoid depending on kernel functions.
* Can be removed once ntdll.spec no longer contains stubs.
*/
void
__wine_spec_unimplemented_stub
(
const
char
*
module
,
const
char
*
function
)
{
EXCEPTION_RECORD
record
;
record
.
ExceptionCode
=
EXCEPTION_WINE_STUB
;
record
.
ExceptionFlags
=
EH_NONCONTINUABLE
;
record
.
ExceptionRecord
=
NULL
;
record
.
ExceptionAddress
=
__wine_spec_unimplemented_stub
;
record
.
NumberParameters
=
2
;
record
.
ExceptionInformation
[
0
]
=
(
ULONG_PTR
)
module
;
record
.
ExceptionInformation
[
1
]
=
(
ULONG_PTR
)
function
;
RtlRaiseException
(
&
record
);
}
dlls/oleacc/Makefile.in
View file @
b6b180a1
...
...
@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
oleacc.dll
IMPORTLIB
=
liboleacc.
$(IMPLIBEXT)
IMPORTS
=
kernel32
C_SRCS
=
\
main.c
...
...
dlls/sti/Makefile.in
View file @
b6b180a1
...
...
@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
sti.dll
IMPORTLIB
=
libsti.
$(IMPLIBEXT)
IMPORTS
=
kernel32
C_SRCS
=
sti_main.c
...
...
dlls/url/Makefile.in
View file @
b6b180a1
...
...
@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
url.dll
IMPORTLIB
=
liburl.
$(IMPLIBEXT)
IMPORTS
=
kernel32
C_SRCS
=
url_main.c
...
...
dlls/winecrt0/Makefile.in
View file @
b6b180a1
...
...
@@ -7,7 +7,8 @@ MODULE = libwinecrt0.a
C_SRCS
=
\
dll_main.c
\
exe_main.c
\
exe_wmain.c
exe_wmain.c
\
stub.c
@MAKE_IMPLIB_RULES@
...
...
dlls/winecrt0/stub.c
0 → 100644
View file @
b6b180a1
/*
* Common handling of stub functions
*
* Copyright 2005 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/exception.h"
void
__wine_spec_unimplemented_stub
(
const
char
*
module
,
const
char
*
function
)
{
ULONG_PTR
args
[
2
];
args
[
0
]
=
(
ULONG_PTR
)
module
;
args
[
1
]
=
(
ULONG_PTR
)
function
;
RaiseException
(
EXCEPTION_WINE_STUB
,
EH_NONCONTINUABLE
,
2
,
args
);
}
tools/winebuild/import.c
View file @
b6b180a1
...
...
@@ -479,21 +479,27 @@ static int add_extra_symbol( const char **extras, int *count, const char *name,
return
1
;
}
/* check if the spec file exports any stubs */
static
int
has_stubs
(
const
DLLSPEC
*
spec
)
{
int
i
;
for
(
i
=
0
;
i
<
spec
->
nb_entry_points
;
i
++
)
{
ORDDEF
*
odp
=
&
spec
->
entry_points
[
i
];
if
(
odp
->
type
==
TYPE_STUB
)
return
1
;
}
return
0
;
}
/* add the extra undefined symbols that will be contained in the generated spec file itself */
static
void
add_extra_undef_symbols
(
const
DLLSPEC
*
spec
)
{
const
char
*
extras
[
10
];
int
i
,
count
=
0
,
nb_stubs
=
0
;
int
kernel_imports
=
0
,
ntdll_imports
=
0
;
int
i
,
count
=
0
;
int
kernel_imports
=
0
;
sort_names
(
&
undef_symbols
);
for
(
i
=
0
;
i
<
spec
->
nb_entry_points
;
i
++
)
{
ORDDEF
*
odp
=
&
spec
->
entry_points
[
i
];
if
(
odp
->
type
==
TYPE_STUB
)
nb_stubs
++
;
}
/* add symbols that will be contained in the spec file itself */
if
(
!
(
spec
->
characteristics
&
IMAGE_FILE_DLL
))
{
...
...
@@ -515,12 +521,9 @@ static void add_extra_undef_symbols( const DLLSPEC *spec )
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetProcAddress"
,
spec
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"DelayLoadFailureHook"
,
spec
);
}
if
(
nb_stubs
)
ntdll_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"RtlRaiseException"
,
spec
);
/* make sure we import the dlls that contain these functions */
if
(
kernel_imports
)
add_import_dll
(
"kernel32"
,
NULL
);
if
(
ntdll_imports
)
add_import_dll
(
"ntdll"
,
NULL
);
if
(
count
)
{
...
...
@@ -600,6 +603,8 @@ void read_undef_symbols( DLLSPEC *spec, char **argv )
else
if
(
spec
->
subsystem
==
IMAGE_SUBSYSTEM_NATIVE
)
add_extra_ld_symbol
(
"DriverEntry "
);
else
add_extra_ld_symbol
(
"main"
);
if
(
has_stubs
(
spec
))
add_extra_ld_symbol
(
"__wine_spec_unimplemented_stub"
);
strcpy
(
name_prefix
,
asm_name
(
""
)
);
prefix_len
=
strlen
(
name_prefix
);
...
...
tools/winebuild/spec32.c
View file @
b6b180a1
...
...
@@ -322,29 +322,10 @@ static void output_stub_funcs( FILE *outfile, DLLSPEC *spec )
ORDDEF
*
odp
=
&
spec
->
entry_points
[
i
];
if
(
odp
->
type
!=
TYPE_STUB
)
continue
;
fprintf
(
outfile
,
"#ifdef __GNUC__
\n
"
);
fprintf
(
outfile
,
"static void __wine_unimplemented( const char *func ) __attribute__((noreturn));
\n
"
);
fprintf
(
outfile
,
"#endif
\n\n
"
);
fprintf
(
outfile
,
"struct exc_record {
\n
"
);
fprintf
(
outfile
,
" unsigned int code, flags;
\n
"
);
fprintf
(
outfile
,
" void *rec, *addr;
\n
"
);
fprintf
(
outfile
,
" unsigned int params;
\n
"
);
fprintf
(
outfile
,
" const void *info[15];
\n
"
);
fprintf
(
outfile
,
"};
\n\n
"
);
fprintf
(
outfile
,
"extern void __stdcall RtlRaiseException( struct exc_record * );
\n\n
"
);
fprintf
(
outfile
,
"static void __wine_unimplemented( const char *func )
\n
{
\n
"
);
fprintf
(
outfile
,
" struct exc_record rec;
\n
"
);
fprintf
(
outfile
,
" rec.code = 0x%08x;
\n
"
,
EXCEPTION_WINE_STUB
);
fprintf
(
outfile
,
" rec.flags = %d;
\n
"
,
EH_NONCONTINUABLE
);
fprintf
(
outfile
,
" rec.rec = 0;
\n
"
);
fprintf
(
outfile
,
" rec.params = 2;
\n
"
);
fprintf
(
outfile
,
" rec.info[0] =
\"
%s
\"
;
\n
"
,
spec
->
file_name
);
fprintf
(
outfile
,
" rec.info[1] = func;
\n
"
);
fprintf
(
outfile
,
"#ifdef __GNUC__
\n
"
);
fprintf
(
outfile
,
" rec.addr = __builtin_return_address(1);
\n
"
);
fprintf
(
outfile
,
"extern void __wine_spec_unimplemented_stub( const char *module, const char *func ) __attribute__((noreturn));
\n
"
);
fprintf
(
outfile
,
"#else
\n
"
);
fprintf
(
outfile
,
" rec.addr = 0;
\n
"
);
fprintf
(
outfile
,
"#endif
\n
"
);
fprintf
(
outfile
,
" for (;;) RtlRaiseException( &rec );
\n
}
\n\n
"
);
fprintf
(
outfile
,
"extern void __wine_spec_unimplemented_stub( const char *module, const char *func );
\n
"
);
fprintf
(
outfile
,
"#endif
\n\n
"
);
break
;
}
...
...
@@ -354,11 +335,11 @@ static void output_stub_funcs( FILE *outfile, DLLSPEC *spec )
if
(
odp
->
type
!=
TYPE_STUB
)
continue
;
fprintf
(
outfile
,
"void %s(void) "
,
make_internal_name
(
odp
,
spec
,
"stub"
)
);
if
(
odp
->
name
)
fprintf
(
outfile
,
"{ __wine_
unimplemented(
\"
%s
\"
); }
\n
"
,
odp
->
name
);
fprintf
(
outfile
,
"{ __wine_
spec_unimplemented_stub(__wine_spec_file_name,
\"
%s
\"
); }
\n
"
,
odp
->
name
);
else
if
(
odp
->
export_name
)
fprintf
(
outfile
,
"{ __wine_
unimplemented(
\"
%s
\"
); }
\n
"
,
odp
->
export_name
);
fprintf
(
outfile
,
"{ __wine_
spec_unimplemented_stub(__wine_spec_file_name,
\"
%s
\"
); }
\n
"
,
odp
->
export_name
);
else
fprintf
(
outfile
,
"{ __wine_
unimplemented(
\"
%d
\"
); }
\n
"
,
odp
->
ordinal
);
fprintf
(
outfile
,
"{ __wine_
spec_unimplemented_stub(__wine_spec_file_name,
\"
%d
\"
); }
\n
"
,
odp
->
ordinal
);
}
}
...
...
@@ -494,6 +475,7 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
else
fprintf
(
outfile
,
"extern char _end[];
\n
"
);
fprintf
(
outfile
,
"static const char __wine_spec_file_name[] =
\"
%s
\"
;
\n
"
,
spec
->
file_name
);
fprintf
(
outfile
,
"extern int __wine_spec_data_start[], __wine_spec_exports[];
\n\n
"
);
if
(
target_cpu
==
CPU_x86
)
...
...
@@ -732,9 +714,8 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
"{
\n
"
" extern void __wine_dll_register( const struct image_nt_headers *, const char * );
\n
"
" __wine_spec_init_state = 1;
\n
"
" __wine_dll_register( &nt_header,
\"
%s
\"
);
\n
"
"}
\n\n
"
,
spec
->
file_name
);
" __wine_dll_register( &nt_header, __wine_spec_file_name );
\n
"
"}
\n\n
"
);
fprintf
(
outfile
,
"void __wine_spec_init_ctor(void)
\n
"
...
...
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