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
d18b406b
Commit
d18b406b
authored
Mar 27, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp90: Use DEFINE_RTTI_DATA to initialize exception RTTI data.
parent
1328da18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
24 deletions
+26
-24
exception.c
dlls/msvcp90/exception.c
+26
-22
msvcp90.h
dlls/msvcp90/msvcp90.h
+0
-1
msvcp90_main.c
dlls/msvcp90/msvcp90_main.c
+0
-1
No files found.
dlls/msvcp90/exception.c
View file @
d18b406b
...
...
@@ -61,6 +61,7 @@ typedef struct __cxx_exception_type
void
WINAPI
_CxxThrowException
(
exception
*
,
const
cxx_exception_type
*
);
/* vtables */
extern
const
vtable_ptr
MSVCP_exception_vtable
;
extern
const
vtable_ptr
MSVCP_bad_alloc_vtable
;
extern
const
vtable_ptr
MSVCP_logic_error_vtable
;
extern
const
vtable_ptr
MSVCP_length_error_vtable
;
...
...
@@ -68,19 +69,12 @@ extern const vtable_ptr MSVCP_out_of_range_vtable;
extern
const
vtable_ptr
MSVCP_invalid_argument_vtable
;
extern
const
vtable_ptr
MSVCP_runtime_error_vtable
;
/* exception class data */
static
type_info
exception_type_info
=
{
NULL
,
/* set by set_exception_vtable */
NULL
,
".?AVexception@std@@"
};
DEFINE_THISCALL_WRAPPER
(
MSVCP_exception_ctor
,
8
)
exception
*
__thiscall
MSVCP_exception_ctor
(
exception
*
this
,
const
char
**
name
)
{
TRACE
(
"(%p %s)
\n
"
,
this
,
*
name
);
this
->
vtable
=
exception_type_info
.
vtable
;
this
->
vtable
=
&
MSVCP_exception_
vtable
;
if
(
*
name
)
{
unsigned
int
name_len
=
strlen
(
*
name
)
+
1
;
this
->
name
=
malloc
(
name_len
);
...
...
@@ -99,7 +93,7 @@ exception* __thiscall MSVCP_exception_copy_ctor(exception *this, const exception
TRACE
(
"(%p,%p)
\n
"
,
this
,
rhs
);
if
(
!
rhs
->
do_free
)
{
this
->
vtable
=
exception_type_info
.
vtable
;
this
->
vtable
=
&
MSVCP_exception_
vtable
;
this
->
name
=
rhs
->
name
;
this
->
do_free
=
FALSE
;
}
else
...
...
@@ -112,17 +106,32 @@ DEFINE_THISCALL_WRAPPER(MSVCP_exception_dtor,4)
void
__thiscall
MSVCP_exception_dtor
(
exception
*
this
)
{
TRACE
(
"(%p)
\n
"
,
this
);
this
->
vtable
=
exception_type_info
.
vtable
;
this
->
vtable
=
&
MSVCP_exception_
vtable
;
if
(
this
->
do_free
)
free
(
this
->
name
);
}
static
const
rtti_base_descriptor
exception_rtti_base_descriptor
=
{
&
exception_type_info
,
0
,
{
0
,
-
1
,
0
},
0
};
DEFINE_THISCALL_WRAPPER
(
MSVCP_exception_vector_dtor
,
8
)
void
*
__thiscall
MSVCP_exception_vector_dtor
(
exception
*
this
,
unsigned
int
flags
)
{
TRACE
(
"%p %x
\n
"
,
this
,
flags
);
if
(
flags
&
2
)
{
/* we have an array, with the number of elements stored before the first object */
int
i
,
*
ptr
=
(
int
*
)
this
-
1
;
for
(
i
=*
ptr
-
1
;
i
>=
0
;
i
--
)
MSVCP_exception_dtor
(
this
+
i
);
MSVCRT_operator_delete
(
ptr
);
}
else
{
MSVCP_exception_dtor
(
this
);
if
(
flags
&
1
)
MSVCRT_operator_delete
(
this
);
}
return
this
;
}
DEFINE_RTTI_DATA
(
exception
,
0
,
0
,
NULL
,
NULL
,
NULL
,
".?AVexception@std@@"
);
static
const
cxx_type_info
exception_cxx_type_info
=
{
0
,
...
...
@@ -148,12 +157,6 @@ static const cxx_exception_type exception_cxx_type = {
&
exception_cxx_type_table
};
void
set_exception_vtable
(
void
)
{
HMODULE
hmod
=
GetModuleHandleA
(
"msvcrt.dll"
);
exception_type_info
.
vtable
=
(
void
*
)
GetProcAddress
(
hmod
,
"??_7exception@@6B@"
);
}
/* bad_alloc class data */
typedef
exception
bad_alloc
;
...
...
@@ -591,6 +594,7 @@ const char* __thiscall MSVCP_runtime_error_what(runtime_error *this)
#ifndef __GNUC__
void
__asm_dummy_vtables
(
void
)
{
#endif
__ASM_VTABLE
(
exception
,
VTABLE_ADD_FUNC
(
MSVCP_what_exception
));
__ASM_VTABLE
(
bad_alloc
,
VTABLE_ADD_FUNC
(
MSVCP_what_exception
));
__ASM_VTABLE
(
logic_error
,
VTABLE_ADD_FUNC
(
MSVCP_logic_error_what
));
__ASM_VTABLE
(
length_error
,
VTABLE_ADD_FUNC
(
MSVCP_logic_error_what
));
...
...
dlls/msvcp90/msvcp90.h
View file @
d18b406b
...
...
@@ -166,7 +166,6 @@ typedef enum __exception_type {
EXCEPTION_RUNTIME_ERROR
}
exception_type
;
void
throw_exception
(
exception_type
,
const
char
*
);
void
set_exception_vtable
(
void
);
/* rtti */
typedef
struct
__type_info
...
...
dlls/msvcp90/msvcp90_main.c
View file @
d18b406b
...
...
@@ -89,7 +89,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return
FALSE
;
/* prefer native version */
case
DLL_PROCESS_ATTACH
:
init_cxx_funcs
();
set_exception_vtable
();
init_lockit
();
break
;
case
DLL_PROCESS_DETACH
:
...
...
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