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
127af150
Commit
127af150
authored
Aug 25, 2010
by
Louis Lenders
Committed by
Alexandre Julliard
Aug 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscoree: Improve GetCORSytemDirectory.
parent
f317d6b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
5 deletions
+50
-5
mscoree_main.c
dlls/mscoree/mscoree_main.c
+48
-3
mscoree.c
dlls/mscoree/tests/mscoree.c
+2
-2
No files found.
dlls/mscoree/mscoree_main.c
View file @
127af150
...
...
@@ -79,6 +79,28 @@ static BOOL get_mono_path(LPWSTR path)
return
TRUE
;
}
static
BOOL
get_install_root
(
LPWSTR
install_dir
)
{
const
WCHAR
dotnet_key
[]
=
{
'S'
,
'O'
,
'F'
,
'T'
,
'W'
,
'A'
,
'R'
,
'E'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'.'
,
'N'
,
'E'
,
'T'
,
'F'
,
'r'
,
'a'
,
'm'
,
'e'
,
'w'
,
'o'
,
'r'
,
'k'
,
'\\'
,
0
};
const
WCHAR
install_root
[]
=
{
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'R'
,
'o'
,
'o'
,
't'
,
0
};
DWORD
len
;
HKEY
key
;
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
dotnet_key
,
0
,
KEY_READ
,
&
key
))
return
FALSE
;
len
=
MAX_PATH
;
if
(
RegQueryValueExW
(
key
,
install_root
,
0
,
NULL
,
(
LPBYTE
)
install_dir
,
&
len
))
{
RegCloseKey
(
key
);
return
FALSE
;
}
RegCloseKey
(
key
);
return
TRUE
;
}
static
CRITICAL_SECTION
mono_lib_cs
;
static
CRITICAL_SECTION_DEBUG
mono_lib_cs_debug
=
{
...
...
@@ -336,12 +358,35 @@ HRESULT WINAPI _CorValidateImage(PVOID* imageBase, LPCWSTR imageName)
HRESULT
WINAPI
GetCORSystemDirectory
(
LPWSTR
pbuffer
,
DWORD
cchBuffer
,
DWORD
*
dwLength
)
{
FIXME
(
"(%p, %d, %p): stub!
\n
"
,
pbuffer
,
cchBuffer
,
dwLength
);
static
const
WCHAR
slash
[]
=
{
'\\'
,
0
};
WCHAR
system_dir
[
MAX_PATH
];
WCHAR
version
[
MAX_PATH
];
FIXME
(
"(%p, %d, %p): semi-stub!
\n
"
,
pbuffer
,
cchBuffer
,
dwLength
);
if
(
!
dwLength
)
return
E_POINTER
;
*
dwLength
=
0
;
if
(
!
pbuffer
)
return
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
);
if
(
!
get_install_root
(
system_dir
))
{
ERR
(
"error reading registry key for installroot, returning empty path
\n
"
);
*
dwLength
=
0
;
}
else
{
GetCORVersion
(
version
,
MAX_PATH
,
dwLength
);
lstrcatW
(
system_dir
,
version
);
lstrcatW
(
system_dir
,
slash
);
*
dwLength
=
lstrlenW
(
system_dir
)
+
1
;
if
(
cchBuffer
<
*
dwLength
)
return
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
);
lstrcpyW
(
pbuffer
,
system_dir
);
}
return
S_OK
;
}
...
...
@@ -355,7 +400,7 @@ HRESULT WINAPI GetCORVersion(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
if
(
!
dwLength
||
!
pbuffer
)
return
E_POINTER
;
*
dwLength
=
lstrlenW
(
version
);
*
dwLength
=
lstrlenW
(
version
)
+
1
;
if
(
cchBuffer
<
*
dwLength
)
return
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
);
...
...
dlls/mscoree/tests/mscoree.c
View file @
127af150
...
...
@@ -71,10 +71,10 @@ static void test_versioninfo(void)
path_len
=
size
;
hr
=
pGetCORSystemDirectory
(
path
,
path_len
-
1
,
&
size
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
),
"GetCORSystemDirectory returned %08x
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
),
"GetCORSystemDirectory returned %08x
\n
"
,
hr
);
hr
=
pGetCORSystemDirectory
(
NULL
,
MAX_PATH
,
&
size
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
),
"GetCORSystemDirectory returned %08x
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
),
"GetCORSystemDirectory returned %08x
\n
"
,
hr
);
hr
=
pGetCORSystemDirectory
(
path
,
MAX_PATH
,
NULL
);
ok
(
hr
==
E_POINTER
,
"GetCORSystemDirectory returned %08x
\n
"
,
hr
);
...
...
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