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
3b4d2780
Commit
3b4d2780
authored
Apr 23, 2012
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscoree: Always call mono_thread_attach before invoking managed code.
parent
87e75a03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
corruntimehost.c
dlls/mscoree/corruntimehost.c
+11
-1
metahost.c
dlls/mscoree/metahost.c
+1
-0
mscoree_private.h
dlls/mscoree/mscoree_private.h
+2
-0
No files found.
dlls/mscoree/corruntimehost.c
View file @
3b4d2780
...
...
@@ -148,6 +148,8 @@ static HRESULT RuntimeHost_GetIUnknownForDomain(RuntimeHost *This, MonoDomain *d
MonoObject
*
appdomain_object
;
IUnknown
*
unk
;
This
->
mono
->
mono_thread_attach
(
domain
);
assembly
=
This
->
mono
->
mono_domain_assembly_open
(
domain
,
"mscorlib"
);
if
(
!
assembly
)
{
...
...
@@ -560,6 +562,8 @@ static HRESULT WINAPI CLRRuntimeHost_ExecuteInDefaultAppDomain(ICLRRuntimeHost*
hr
=
E_FAIL
;
This
->
mono
->
mono_thread_attach
(
domain
);
filenameA
=
WtoA
(
pwzAssemblyPath
);
assembly
=
This
->
mono
->
mono_domain_assembly_open
(
domain
,
filenameA
);
if
(
!
assembly
)
...
...
@@ -658,6 +662,8 @@ HRESULT RuntimeHost_CreateManagedInstance(RuntimeHost *This, LPCWSTR name,
if
(
SUCCEEDED
(
hr
))
{
This
->
mono
->
mono_thread_attach
(
domain
);
type
=
This
->
mono
->
mono_reflection_type_from_name
(
nameA
,
NULL
);
if
(
!
type
)
{
...
...
@@ -705,7 +711,9 @@ HRESULT RuntimeHost_CreateManagedInstance(RuntimeHost *This, LPCWSTR name,
*
* NOTE: The IUnknown* is created with a reference to the object.
* Until they have a reference, objects must be in the stack to prevent the
* garbage collector from freeing them. */
* garbage collector from freeing them.
*
* mono_thread_attach must have already been called for this thread. */
HRESULT
RuntimeHost_GetIUnknownForObject
(
RuntimeHost
*
This
,
MonoObject
*
obj
,
IUnknown
**
ppUnk
)
{
...
...
@@ -1025,6 +1033,8 @@ HRESULT create_monodata(REFIID riid, LPVOID *ppObj )
hr
=
CLASS_E_CLASSNOTAVAILABLE
;
host
->
mono
->
mono_thread_attach
(
domain
);
filenameA
=
WtoA
(
filename
);
assembly
=
host
->
mono
->
mono_domain_assembly_open
(
domain
,
filenameA
);
HeapFree
(
GetProcessHeap
(),
0
,
filenameA
);
...
...
dlls/mscoree/metahost.c
View file @
3b4d2780
...
...
@@ -186,6 +186,7 @@ static HRESULT load_mono(CLRRuntimeInfo *This, loaded_mono **result)
LOAD_MONO_FUNCTION
(
mono_set_dirs
);
LOAD_MONO_FUNCTION
(
mono_stringify_assembly_name
);
LOAD_MONO_FUNCTION
(
mono_string_new
);
LOAD_MONO_FUNCTION
(
mono_thread_attach
);
/* GLib imports obsoleted by the 2.0 ABI */
if
(
This
->
mono_abi_version
==
1
)
...
...
dlls/mscoree/mscoree_private.h
View file @
3b4d2780
...
...
@@ -44,6 +44,7 @@ typedef struct _MonoObject MonoObject;
typedef
struct
_MonoString
MonoString
;
typedef
struct
_MonoMethod
MonoMethod
;
typedef
struct
_MonoProfiler
MonoProfiler
;
typedef
struct
_MonoThread
MonoThread
;
typedef
struct
loaded_mono
loaded_mono
;
typedef
struct
RuntimeHost
RuntimeHost
;
...
...
@@ -163,6 +164,7 @@ struct loaded_mono
void
(
CDECL
*
mono_thread_suspend_all_other_threads
)(
void
);
void
(
CDECL
*
mono_threads_set_shutting_down
)(
void
);
MonoString
*
(
CDECL
*
mono_string_new
)(
MonoDomain
*
domain
,
const
char
*
str
);
MonoThread
*
(
CDECL
*
mono_thread_attach
)(
MonoDomain
*
domain
);
};
/* loaded runtime interfaces */
...
...
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