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
8b8af9c8
Commit
8b8af9c8
authored
Sep 14, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Sep 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winetest: Add the ability to retrieve the dll path for com dlls from the registry.
parent
c5b2acfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
14 deletions
+73
-14
main.c
programs/winetest/main.c
+73
-14
No files found.
programs/winetest/main.c
View file @
8b8af9c8
...
...
@@ -544,6 +544,68 @@ EnumTestFileProc (HMODULE hModule, LPCTSTR lpszType,
return
TRUE
;
}
static
const
struct
clsid_mapping
{
const
char
*
name
;
CLSID
clsid
;
}
clsid_list
[]
=
{
{
"oledb32"
,
{
0xc8b522d1
,
0x5cf3
,
0x11ce
,
{
0xad
,
0xe5
,
0x00
,
0xaa
,
0x00
,
0x44
,
0x77
,
0x3d
}}},
{
NULL
,
{
0
,
0
,
0
,
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}}}
};
static
BOOL
get_main_clsid
(
const
char
*
name
,
CLSID
*
clsid
)
{
const
struct
clsid_mapping
*
mapping
;
for
(
mapping
=
clsid_list
;
mapping
->
name
;
mapping
++
)
{
if
(
!
strcasecmp
(
name
,
mapping
->
name
))
{
*
clsid
=
mapping
->
clsid
;
return
TRUE
;
}
}
return
FALSE
;
}
static
HMODULE
load_com_dll
(
const
char
*
name
)
{
HMODULE
dll
=
NULL
;
HKEY
hkey
;
char
keyname
[
100
];
char
dllname
[
MAX_PATH
];
CLSID
clsid
;
if
(
!
get_main_clsid
(
name
,
&
clsid
))
return
NULL
;
sprintf
(
keyname
,
"CLSID
\\
{%08x-%04x-%04x-%02x%2x-%02x%2x%02x%2x%02x%2x}
\\
InprocServer32"
,
clsid
.
Data1
,
clsid
.
Data2
,
clsid
.
Data3
,
clsid
.
Data4
[
0
],
clsid
.
Data4
[
1
],
clsid
.
Data4
[
2
],
clsid
.
Data4
[
3
],
clsid
.
Data4
[
4
],
clsid
.
Data4
[
5
],
clsid
.
Data4
[
6
],
clsid
.
Data4
[
7
]);
if
(
RegOpenKeyA
(
HKEY_CLASSES_ROOT
,
keyname
,
&
hkey
)
==
ERROR_SUCCESS
)
{
LONG
size
=
sizeof
(
dllname
);
if
(
RegQueryValueA
(
hkey
,
NULL
,
dllname
,
&
size
)
==
ERROR_SUCCESS
)
dll
=
LoadLibraryExA
(
dllname
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
RegCloseKey
(
hkey
);
}
return
dll
;
}
static
void
get_dll_path
(
HMODULE
dll
,
char
**
path
,
char
*
filename
)
{
char
dllpath
[
MAX_PATH
];
GetModuleFileNameA
(
dll
,
dllpath
,
MAX_PATH
);
strcpy
(
filename
,
dllpath
);
*
strrchr
(
dllpath
,
'\\'
)
=
'\0'
;
*
path
=
heap_strdup
(
dllpath
);
}
static
BOOL
CALLBACK
extract_test_proc
(
HMODULE
hModule
,
LPCTSTR
lpszType
,
LPTSTR
lpszName
,
LONG_PTR
lParam
)
...
...
@@ -565,27 +627,24 @@ extract_test_proc (HMODULE hModule, LPCTSTR lpszType,
wine_tests
[
nr_of_files
].
maindllpath
=
NULL
;
strcpy
(
filename
,
dllname
);
dll
=
LoadLibraryExA
(
dllname
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
if
(
!
dll
)
{
dll
=
load_com_dll
(
dllname
);
if
(
dll
)
get_dll_path
(
dll
,
&
wine_tests
[
nr_of_files
].
maindllpath
,
filename
);
}
if
(
!
dll
&&
pLoadLibraryShim
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
dllname
,
-
1
,
dllnameW
,
MAX_PATH
);
if
(
FAILED
(
pLoadLibraryShim
(
dllnameW
,
NULL
,
NULL
,
&
dll
)
))
dll
=
0
;
else
{
char
dllpath
[
MAX_PATH
];
/* We have a dll that cannot be found through LoadLibraryExA. This
* is the case for .NET provided dll's. We will add the directory
* where the dll resides to the PATH variable when dealing with
* the tests for this dll.
*/
GetModuleFileNameA
(
dll
,
dllpath
,
MAX_PATH
);
strcpy
(
filename
,
dllpath
);
*
strrchr
(
dllpath
,
'\\'
)
=
'\0'
;
wine_tests
[
nr_of_files
].
maindllpath
=
heap_strdup
(
dllpath
);
}
get_dll_path
(
dll
,
&
wine_tests
[
nr_of_files
].
maindllpath
,
filename
);
}
if
(
!
dll
)
{
if
(
!
dll
)
{
xprintf
(
" %s=dll is missing
\n
"
,
dllname
);
return
TRUE
;
}
...
...
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