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
0eaa3ec9
Commit
0eaa3ec9
authored
Jun 04, 2013
by
Daniel Jelinski
Committed by
Alexandre Julliard
Jun 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscoree: Extract a helper function for getting file name from assembly.
parent
c8d1d4aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
30 deletions
+40
-30
metahost.c
dlls/mscoree/metahost.c
+38
-30
mscoree_private.h
dlls/mscoree/mscoree_private.h
+2
-0
No files found.
dlls/mscoree/metahost.c
View file @
0eaa3ec9
...
...
@@ -1210,31 +1210,15 @@ HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj)
return
ICLRMetaHost_QueryInterface
(
&
GlobalCLRMetaHost
.
ICLRMetaHost_iface
,
riid
,
ppobj
);
}
static
MonoAssembly
*
mono_assembly_search_hook_fn
(
MonoAssemblyName
*
aname
,
char
**
assemblies_path
,
void
*
user_data
)
HRESULT
get_file_from_strongname
(
WCHAR
*
stringnameW
,
WCHAR
*
assemblies_path
,
int
path_length
)
{
loaded_mono
*
mono
=
user_data
;
HRESULT
hr
=
S_OK
;
MonoAssembly
*
result
=
NULL
;
char
*
stringname
=
NULL
;
LPWSTR
stringnameW
;
int
stringnameW_size
;
IAssemblyCache
*
asmcache
;
ASSEMBLY_INFO
info
;
WCHAR
path
[
MAX_PATH
];
char
*
pathA
;
MonoImageOpenStatus
stat
;
static
WCHAR
fusiondll
[]
=
{
'f'
,
'u'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
HMODULE
hfusion
=
NULL
;
static
HRESULT
(
WINAPI
*
pCreateAssemblyCache
)(
IAssemblyCache
**
,
DWORD
);
stringname
=
mono
->
mono_stringify_assembly_name
(
aname
);
TRACE
(
"%s
\n
"
,
debugstr_a
(
stringname
));
if
(
!
stringname
)
return
NULL
;
/* FIXME: We should search the given paths before the GAC. */
if
(
!
pCreateAssemblyCache
)
{
hr
=
LoadLibraryShim
(
fusiondll
,
NULL
,
NULL
,
&
hfusion
);
...
...
@@ -1252,28 +1236,52 @@ static MonoAssembly* mono_assembly_search_hook_fn(MonoAssemblyName *aname, char
if
(
SUCCEEDED
(
hr
))
{
info
.
cbAssemblyInfo
=
sizeof
(
info
);
info
.
pszCurrentAssemblyPathBuf
=
assemblies_path
;
info
.
cchBuf
=
path_length
;
assemblies_path
[
0
]
=
0
;
hr
=
IAssemblyCache_QueryAssemblyInfo
(
asmcache
,
0
,
stringnameW
,
&
info
);
IAssemblyCache_Release
(
asmcache
);
}
return
hr
;
}
static
MonoAssembly
*
mono_assembly_search_hook_fn
(
MonoAssemblyName
*
aname
,
char
**
assemblies_path
,
void
*
user_data
)
{
loaded_mono
*
mono
=
user_data
;
HRESULT
hr
;
MonoAssembly
*
result
=
NULL
;
char
*
stringname
=
NULL
;
LPWSTR
stringnameW
;
int
stringnameW_size
;
WCHAR
path
[
MAX_PATH
];
char
*
pathA
;
MonoImageOpenStatus
stat
;
stringname
=
mono
->
mono_stringify_assembly_name
(
aname
);
TRACE
(
"%s
\n
"
,
debugstr_a
(
stringname
));
if
(
!
stringname
)
return
NULL
;
/* FIXME: We should search the given paths before the GAC. */
stringnameW_size
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
stringname
,
-
1
,
NULL
,
0
);
stringnameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
stringnameW_size
*
sizeof
(
WCHAR
));
if
(
stringnameW
)
MultiByteToWideChar
(
CP_UTF8
,
0
,
stringname
,
-
1
,
stringnameW
,
stringnameW_size
);
else
hr
=
E_OUTOFMEMORY
;
if
(
SUCCEEDED
(
hr
))
{
info
.
cbAssemblyInfo
=
sizeof
(
info
);
info
.
pszCurrentAssemblyPathBuf
=
path
;
info
.
cchBuf
=
MAX_PATH
;
path
[
0
]
=
0
;
MultiByteToWideChar
(
CP_UTF8
,
0
,
stringname
,
-
1
,
stringnameW
,
stringnameW_size
);
hr
=
IAssemblyCache_QueryAssemblyInfo
(
asmcache
,
0
,
stringnameW
,
&
info
);
}
hr
=
get_file_from_strongname
(
stringnameW
,
path
,
MAX_PATH
);
HeapFree
(
GetProcessHeap
(),
0
,
stringnameW
);
IAssemblyCache_Release
(
asmcache
);
}
else
hr
=
E_OUTOFMEMORY
;
if
(
SUCCEEDED
(
hr
))
{
...
...
dlls/mscoree/mscoree_private.h
View file @
0eaa3ec9
...
...
@@ -204,6 +204,8 @@ extern HRESULT CorDebug_Create(ICLRRuntimeHost *runtimehost, IUnknown** ppUnk) D
extern
HRESULT
create_monodata
(
REFIID
riid
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_file_from_strongname
(
WCHAR
*
stringnameW
,
WCHAR
*
assemblies_path
,
int
path_length
)
DECLSPEC_HIDDEN
;
extern
void
runtimehost_init
(
void
);
extern
void
runtimehost_uninit
(
void
);
...
...
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