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
a7bda5c2
Commit
a7bda5c2
authored
Sep 28, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscoree: Implement ICLRMetaHost_GetRuntime.
parent
ad9507b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
9 deletions
+81
-9
corruntimehost.c
dlls/mscoree/corruntimehost.c
+2
-0
metahost.c
dlls/mscoree/metahost.c
+72
-6
metahost.c
dlls/mscoree/tests/metahost.c
+7
-3
No files found.
dlls/mscoree/corruntimehost.c
View file @
a7bda5c2
...
...
@@ -290,6 +290,8 @@ HRESULT RuntimeHost_Construct(const CLRRuntimeInfo *runtime_version,
This
->
mono
=
loaded_mono
;
This
->
legacy
=
FALSE
;
*
result
=
This
;
return
S_OK
;
}
...
...
dlls/mscoree/metahost.c
View file @
a7bda5c2
...
...
@@ -31,6 +31,7 @@
#include "winreg.h"
#include "ole2.h"
#include "corerror.h"
#include "mscoree.h"
#include "metahost.h"
#include "mscoree_private.h"
...
...
@@ -86,15 +87,11 @@ static HRESULT CLRRuntimeInfo_GetRuntimeHost(CLRRuntimeInfo *This, RuntimeHost *
EnterCriticalSection
(
&
runtime_list_cs
);
if
(
!
This
->
loaded_runtime
)
goto
end
;
hr
=
load_mono
(
This
,
&
ploaded_mono
);
if
(
SUCCEEDED
(
hr
))
hr
=
RuntimeHost_Construct
(
This
,
ploaded_mono
,
&
This
->
loaded_runtime
);
end:
LeaveCriticalSection
(
&
runtime_list_cs
);
if
(
SUCCEEDED
(
hr
))
...
...
@@ -662,12 +659,81 @@ static ULONG WINAPI CLRMetaHost_Release(ICLRMetaHost* iface)
return
1
;
}
static
BOOL
parse_runtime_version
(
LPCWSTR
version
,
DWORD
*
major
,
DWORD
*
minor
,
DWORD
*
build
)
{
*
major
=
0
;
*
minor
=
0
;
*
build
=
0
;
if
(
version
[
0
]
==
'v'
)
{
version
++
;
if
(
!
isdigit
(
*
version
))
return
FALSE
;
while
(
isdigit
(
*
version
))
*
major
=
*
major
*
10
+
(
*
version
++
-
'0'
);
if
(
*
version
==
0
)
return
TRUE
;
if
(
*
version
++
!=
'.'
||
!
isdigit
(
*
version
))
return
FALSE
;
while
(
isdigit
(
*
version
))
*
minor
=
*
minor
*
10
+
(
*
version
++
-
'0'
);
if
(
*
version
==
0
)
return
TRUE
;
if
(
*
version
++
!=
'.'
||
!
isdigit
(
*
version
))
return
FALSE
;
while
(
isdigit
(
*
version
))
*
build
=
*
build
*
10
+
(
*
version
++
-
'0'
);
return
*
version
==
0
;
}
else
return
FALSE
;
}
static
HRESULT
WINAPI
CLRMetaHost_GetRuntime
(
ICLRMetaHost
*
iface
,
LPCWSTR
pwzVersion
,
REFIID
iid
,
LPVOID
*
ppRuntime
)
{
FIXME
(
"%s %s %p
\n
"
,
debugstr_w
(
pwzVersion
),
debugstr_guid
(
iid
),
ppRuntime
);
int
i
;
DWORD
major
,
minor
,
build
;
return
E_NOTIMPL
;
TRACE
(
"%s %s %p
\n
"
,
debugstr_w
(
pwzVersion
),
debugstr_guid
(
iid
),
ppRuntime
);
if
(
!
pwzVersion
)
return
E_POINTER
;
if
(
!
parse_runtime_version
(
pwzVersion
,
&
major
,
&
minor
,
&
build
))
{
ERR
(
"Cannot parse %s
\n
"
,
debugstr_w
(
pwzVersion
));
return
CLR_E_SHIM_RUNTIME
;
}
find_runtimes
();
for
(
i
=
0
;
i
<
NUM_RUNTIMES
;
i
++
)
{
if
(
runtimes
[
i
].
major
==
major
&&
runtimes
[
i
].
minor
==
minor
&&
runtimes
[
i
].
build
==
build
)
{
if
(
runtimes
[
i
].
mono_abi_version
)
return
IUnknown_QueryInterface
((
IUnknown
*
)
&
runtimes
[
i
],
iid
,
ppRuntime
);
else
{
ERR
(
"Mono is missing %s runtime
\n
"
,
debugstr_w
(
pwzVersion
));
return
CLR_E_SHIM_RUNTIME
;
}
}
}
FIXME
(
"Unrecognized version %s
\n
"
,
debugstr_w
(
pwzVersion
));
return
CLR_E_SHIM_RUNTIME
;
}
static
HRESULT
WINAPI
CLRMetaHost_GetVersionFromFile
(
ICLRMetaHost
*
iface
,
...
...
dlls/mscoree/tests/metahost.c
View file @
a7bda5c2
...
...
@@ -118,10 +118,14 @@ void test_getruntime(void)
WCHAR
buf
[
MAX_PATH
];
hr
=
ICLRMetaHost_GetRuntime
(
metahost
,
NULL
,
&
IID_ICLRRuntimeInfo
,
(
void
**
)
&
info
);
todo_wine
ok
(
hr
==
E_POINTER
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
hr
=
ICLRMetaHost_GetRuntime
(
metahost
,
twodotzero
,
&
IID_ICLRRuntimeInfo
,
(
void
**
)
&
info
);
todo_wine
ok
(
hr
==
S_OK
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
if
(
hr
==
CLR_E_SHIM_RUNTIME
)
/* FIXME: Get Mono properly packaged so we can fail here. */
todo_wine
ok
(
hr
==
S_OK
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
else
ok
(
hr
==
S_OK
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
count
=
MAX_PATH
;
...
...
@@ -134,7 +138,7 @@ void test_getruntime(void)
/* Versions must match exactly. */
hr
=
ICLRMetaHost_GetRuntime
(
metahost
,
twodotzerodotzero
,
&
IID_ICLRRuntimeInfo
,
(
void
**
)
&
info
);
todo_wine
ok
(
hr
==
CLR_E_SHIM_RUNTIME
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
ok
(
hr
==
CLR_E_SHIM_RUNTIME
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
}
START_TEST
(
metahost
)
...
...
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