Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
0eaa3ec9
Commit
0eaa3ec9
authored
11 years ago
by
Daniel Jelinski
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mscoree: Extract a helper function for getting file name from assembly.
parent
c8d1d4aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/mscoree/metahost.c
+41
-33
41 additions, 33 deletions
dlls/mscoree/metahost.c
dlls/mscoree/mscoree_private.h
+2
-0
2 additions, 0 deletions
dlls/mscoree/mscoree_private.h
with
43 additions
and
33 deletions
dlls/mscoree/metahost.c
+
41
−
33
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
*
a
name
,
char
**
assemblies_path
,
void
*
user_data
)
HRESULT
get_file_from_strongname
(
WCHAR
*
string
name
W
,
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
))
{
stringnameW_size
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
stringname
,
-
1
,
NULL
,
0
);
info
.
cbAssemblyInfo
=
sizeof
(
info
);
info
.
pszCurrentAssemblyPathBuf
=
assemblies_path
;
info
.
cchBuf
=
path_length
;
assemblies_path
[
0
]
=
0
;
stringnameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
stringnameW_size
*
sizeof
(
WCHAR
));
if
(
stringnameW
)
MultiByteToWideChar
(
CP_UTF8
,
0
,
stringname
,
-
1
,
stringnameW
,
stringnameW_size
);
else
hr
=
E_OUTOFMEMORY
;
hr
=
IAssemblyCache_QueryAssemblyInfo
(
asmcache
,
0
,
stringnameW
,
&
info
);
if
(
SUCCEEDED
(
hr
))
{
info
.
cbAssemblyInfo
=
sizeof
(
info
);
info
.
pszCurrentAssemblyPathBuf
=
path
;
info
.
cchBuf
=
MAX_PATH
;
path
[
0
]
=
0
;
IAssemblyCache_Release
(
asmcache
);
}
hr
=
IAssemblyCache_QueryAssemblyInfo
(
asmcache
,
0
,
stringnameW
,
&
info
)
;
}
return
hr
;
}
HeapFree
(
GetProcessHeap
(),
0
,
stringnameW
);
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
;
IAssemblyCache_Release
(
asmcache
);
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
);
hr
=
get_file_from_strongname
(
stringnameW
,
path
,
MAX_PATH
);
HeapFree
(
GetProcessHeap
(),
0
,
stringnameW
);
}
else
hr
=
E_OUTOFMEMORY
;
if
(
SUCCEEDED
(
hr
))
{
...
...
This diff is collapsed.
Click to expand it.
dlls/mscoree/mscoree_private.h
+
2
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment