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
69ec6b4c
Commit
69ec6b4c
authored
Apr 13, 2009
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Add some additional tests for QueryPathOfRegTypeLib, make them pass under Wine.
parent
f2e2e3e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
typelib.c
dlls/oleaut32/tests/typelib.c
+5
-0
typelib.c
dlls/oleaut32/typelib.c
+26
-6
No files found.
dlls/oleaut32/tests/typelib.c
View file @
69ec6b4c
...
...
@@ -638,6 +638,10 @@ static void test_QueryPathOfRegTypeLib(void)
{
3
,
22
,
S_OK
,
{
'f'
,
'a'
,
'k'
,
'e'
,
'_'
,
'3'
,
'_'
,
'3'
,
'7'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
}
},
{
3
,
37
,
S_OK
,
{
'f'
,
'a'
,
'k'
,
'e'
,
'_'
,
'3'
,
'_'
,
'3'
,
'7'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
}
},
{
3
,
40
,
S_OK
,
{
'f'
,
'a'
,
'k'
,
'e'
,
'_'
,
'3'
,
'_'
,
'3'
,
'7'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
}
},
{
0xffff
,
0xffff
,
S_OK
,
{
'f'
,
'a'
,
'k'
,
'e'
,
'_'
,
'5'
,
'_'
,
'3'
,
'7'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
}
},
{
0xffff
,
0
,
TYPE_E_LIBNOTREGISTERED
,
{
0
}
},
{
3
,
0xffff
,
TYPE_E_LIBNOTREGISTERED
,
{
0
}
},
{
5
,
0xffff
,
TYPE_E_LIBNOTREGISTERED
,
{
0
}
},
{
4
,
0
,
TYPE_E_LIBNOTREGISTERED
,
{
0
}
}
};
static
const
WCHAR
base
[]
=
{
'f'
,
'a'
,
'k'
,
'e'
,
0
};
...
...
@@ -657,6 +661,7 @@ static void test_QueryPathOfRegTypeLib(void)
if
(
!
do_typelib_reg_key
(
&
uid
,
3
,
0
,
base
,
0
))
return
;
if
(
!
do_typelib_reg_key
(
&
uid
,
3
,
1
,
base
,
0
))
return
;
if
(
!
do_typelib_reg_key
(
&
uid
,
3
,
37
,
base
,
0
))
return
;
if
(
!
do_typelib_reg_key
(
&
uid
,
5
,
37
,
base
,
0
))
return
;
for
(
i
=
0
;
i
<
sizeof
(
td
)
/
sizeof
(
td
[
0
]);
i
++
)
{
...
...
dlls/oleaut32/typelib.c
View file @
69ec6b4c
...
...
@@ -168,13 +168,13 @@ static void FromLEDWords(void *p_Val, int p_iSize)
/*
* Find a typelib key which matches a requested maj.min version.
*/
static
BOOL
find_typelib_key
(
REFGUID
guid
,
WORD
wMaj
,
WORD
*
wMin
)
static
BOOL
find_typelib_key
(
REFGUID
guid
,
WORD
*
wMaj
,
WORD
*
wMin
)
{
static
const
WCHAR
typelibW
[]
=
{
'T'
,
'y'
,
'p'
,
'e'
,
'l'
,
'i'
,
'b'
,
'\\'
,
0
};
WCHAR
buffer
[
60
];
char
key_name
[
16
];
DWORD
len
,
i
;
INT
best_min
=
-
1
;
INT
best_m
aj
=
-
1
,
best_m
in
=
-
1
;
HKEY
hkey
;
memcpy
(
buffer
,
typelibW
,
sizeof
(
typelibW
)
);
...
...
@@ -193,20 +193,40 @@ static BOOL find_typelib_key( REFGUID guid, WORD wMaj, WORD *wMin )
{
TRACE
(
"found %s: %x.%x
\n
"
,
debugstr_w
(
buffer
),
v_maj
,
v_min
);
if
(
wMaj
==
v_maj
)
if
(
*
wMaj
==
0xffff
&&
*
wMin
==
0xffff
)
{
if
(
v_maj
>
best_maj
)
best_maj
=
v_maj
;
if
(
v_min
>
best_min
)
best_min
=
v_min
;
}
else
if
(
*
wMaj
==
v_maj
)
{
best_maj
=
v_maj
;
if
(
*
wMin
==
v_min
)
{
best_min
=
v_min
;
break
;
/* exact match */
}
if
(
v_min
>
best_min
)
best_min
=
v_min
;
if
(
*
wMin
!=
0xffff
&&
v_min
>
best_min
)
best_min
=
v_min
;
}
}
len
=
sizeof
(
key_name
);
}
RegCloseKey
(
hkey
);
if
(
best_min
>=
0
)
TRACE
(
"found best_maj %d, best_min %d
\n
"
,
best_maj
,
best_min
);
if
(
*
wMaj
==
0xffff
&&
*
wMin
==
0xffff
)
{
if
(
best_maj
>=
0
&&
best_min
>=
0
)
{
*
wMaj
=
best_maj
;
*
wMin
=
best_min
;
return
TRUE
;
}
}
if
(
*
wMaj
==
best_maj
&&
best_min
>=
0
)
{
*
wMin
=
best_min
;
return
TRUE
;
...
...
@@ -295,7 +315,7 @@ HRESULT WINAPI QueryPathOfRegTypeLib(
TRACE_
(
typelib
)(
"(%s, %x.%x, 0x%x, %p)
\n
"
,
debugstr_guid
(
guid
),
wMaj
,
wMin
,
lcid
,
path
);
if
(
!
find_typelib_key
(
guid
,
wMaj
,
&
wMin
))
return
TYPE_E_LIBNOTREGISTERED
;
if
(
!
find_typelib_key
(
guid
,
&
wMaj
,
&
wMin
))
return
TYPE_E_LIBNOTREGISTERED
;
get_typelib_key
(
guid
,
wMaj
,
wMin
,
buffer
);
res
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
buffer
,
0
,
KEY_READ
,
&
hkey
);
...
...
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