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
6bd08872
Commit
6bd08872
authored
May 19, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
May 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscoree: Implement ICorRuntimeHost_GetDefaultDomain.
parent
692a7593
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
2 deletions
+77
-2
corruntimehost.c
dlls/mscoree/corruntimehost.c
+77
-2
No files found.
dlls/mscoree/corruntimehost.c
View file @
6bd08872
...
...
@@ -39,6 +39,10 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mscoree
);
#include "initguid.h"
DEFINE_GUID
(
IID__AppDomain
,
0x05f696dc
,
0x2b29
,
0x3663
,
0xad
,
0x8b
,
0xc4
,
0x38
,
0x9c
,
0xf2
,
0xa7
,
0x13
);
struct
RuntimeHost
{
const
struct
ICorRuntimeHostVtbl
*
lpVtbl
;
...
...
@@ -142,6 +146,65 @@ static void RuntimeHost_DeleteDomain(RuntimeHost *This, MonoDomain *domain)
LeaveCriticalSection
(
&
This
->
lock
);
}
static
HRESULT
RuntimeHost_GetIUnknownForDomain
(
RuntimeHost
*
This
,
MonoDomain
*
domain
,
IUnknown
**
punk
)
{
HRESULT
hr
;
void
*
args
[
0
];
MonoAssembly
*
assembly
;
MonoImage
*
image
;
MonoClass
*
klass
;
MonoMethod
*
method
;
MonoObject
*
appdomain_object
;
IUnknown
*
unk
;
assembly
=
This
->
mono
->
mono_domain_assembly_open
(
domain
,
"mscorlib"
);
if
(
!
assembly
)
{
ERR
(
"Cannot load mscorlib
\n
"
);
return
E_FAIL
;
}
image
=
This
->
mono
->
mono_assembly_get_image
(
assembly
);
if
(
!
image
)
{
ERR
(
"Couldn't get assembly image
\n
"
);
return
E_FAIL
;
}
klass
=
This
->
mono
->
mono_class_from_name
(
image
,
"System"
,
"AppDomain"
);
if
(
!
klass
)
{
ERR
(
"Couldn't get class from image
\n
"
);
return
E_FAIL
;
}
method
=
This
->
mono
->
mono_class_get_method_from_name
(
klass
,
"get_CurrentDomain"
,
0
);
if
(
!
method
)
{
ERR
(
"Couldn't get method from class
\n
"
);
return
E_FAIL
;
}
args
[
0
]
=
NULL
;
appdomain_object
=
This
->
mono
->
mono_runtime_invoke
(
method
,
NULL
,
args
,
NULL
);
if
(
!
appdomain_object
)
{
ERR
(
"Couldn't get result pointer
\n
"
);
return
E_FAIL
;
}
hr
=
RuntimeHost_GetIUnknownForObject
(
This
,
appdomain_object
,
&
unk
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID__AppDomain
,
(
void
**
)
punk
);
IUnknown_Release
(
unk
);
}
return
hr
;
}
static
inline
RuntimeHost
*
impl_from_ICLRRuntimeHost
(
ICLRRuntimeHost
*
iface
)
{
return
(
RuntimeHost
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
RuntimeHost
,
lpCLRHostVtbl
));
...
...
@@ -277,8 +340,20 @@ static HRESULT WINAPI corruntimehost_GetDefaultDomain(
ICorRuntimeHost
*
iface
,
IUnknown
**
pAppDomain
)
{
FIXME
(
"stub %p
\n
"
,
iface
);
return
E_NOTIMPL
;
RuntimeHost
*
This
=
impl_from_ICorRuntimeHost
(
iface
);
HRESULT
hr
;
MonoDomain
*
domain
;
TRACE
(
"(%p)
\n
"
,
iface
);
hr
=
RuntimeHost_GetDefaultDomain
(
This
,
&
domain
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
RuntimeHost_GetIUnknownForDomain
(
This
,
domain
,
pAppDomain
);
}
return
hr
;
}
static
HRESULT
WINAPI
corruntimehost_EnumDomains
(
...
...
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