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
20c40e06
Commit
20c40e06
authored
Oct 23, 2006
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 23, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Make QueryPathOfRegTypeLib test pass under Wine.
parent
a1914dbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
7 deletions
+53
-7
typelib.c
dlls/oleaut32/tests/typelib.c
+0
-4
typelib.c
dlls/oleaut32/typelib.c
+53
-3
No files found.
dlls/oleaut32/tests/typelib.c
View file @
20c40e06
...
...
@@ -541,13 +541,9 @@ static void test_QueryPathOfRegTypeLib(void)
{
1
,
0
,
TYPE_E_LIBNOTREGISTERED
,
{
0
}
},
{
3
,
0
,
S_OK
,
{
'f'
,
'a'
,
'k'
,
'e'
,
'_'
,
'3'
,
'_'
,
'0'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
}
},
{
3
,
1
,
S_OK
,
{
'f'
,
'a'
,
'k'
,
'e'
,
'_'
,
'3'
,
'_'
,
'1'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
}
},
#if 0 /* todo: enable once properly implemented */
{
3
,
22
,
S_OK
,
{
'f'
,
'a'
,
'k'
,
'e'
,
'_'
,
'3'
,
'_'
,
'3'
,
'7'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
}
},
#endif
{
3
,
37
,
S_OK
,
{
'f'
,
'a'
,
'k'
,
'e'
,
'_'
,
'3'
,
'_'
,
'3'
,
'7'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
}
},
#if 0 /* todo: enable once properly implemented */
{
3
,
40
,
S_OK
,
{
'f'
,
'a'
,
'k'
,
'e'
,
'_'
,
'3'
,
'_'
,
'3'
,
'7'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
}
},
#endif
{
4
,
0
,
TYPE_E_LIBNOTREGISTERED
,
{
0
}
}
};
static
const
WCHAR
base
[]
=
{
'f'
,
'a'
,
'k'
,
'e'
,
0
};
...
...
dlls/oleaut32/typelib.c
View file @
20c40e06
...
...
@@ -149,6 +149,55 @@ static void FromLEDWords(void *p_Val, int p_iSize)
#define FromLEDWords(X,Y)
/*nothing*/
#endif
/*
* Find a typelib key which matches a requested maj.min version.
*/
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
;
HKEY
hkey
;
memcpy
(
buffer
,
typelibW
,
sizeof
(
typelibW
)
);
StringFromGUID2
(
guid
,
buffer
+
strlenW
(
buffer
),
40
);
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
buffer
,
0
,
KEY_READ
,
&
hkey
)
!=
ERROR_SUCCESS
)
return
FALSE
;
len
=
sizeof
(
key_name
);
i
=
0
;
while
(
RegEnumKeyExA
(
hkey
,
i
++
,
key_name
,
&
len
,
NULL
,
NULL
,
NULL
,
NULL
)
==
ERROR_SUCCESS
)
{
INT
v_maj
,
v_min
;
if
(
sscanf
(
key_name
,
"%u.%u"
,
&
v_maj
,
&
v_min
)
==
2
)
{
TRACE
(
"found %s: %u.%u
\n
"
,
debugstr_w
(
buffer
),
v_maj
,
v_min
);
if
(
*
wMaj
==
v_maj
)
{
if
(
*
wMin
==
v_min
)
{
best_min
=
v_min
;
break
;
/* exact match */
}
if
(
v_min
>
best_min
)
best_min
=
v_min
;
}
}
len
=
sizeof
(
key_name
);
}
RegCloseKey
(
hkey
);
if
(
best_min
>=
0
)
{
*
wMin
=
best_min
;
return
TRUE
;
}
return
FALSE
;
}
/* get the path of a typelib key, in the form "Typelib\\<guid>\\<maj>.<min>" */
/* buffer must be at least 60 characters long */
static
WCHAR
*
get_typelib_key
(
REFGUID
guid
,
WORD
wMaj
,
WORD
wMin
,
WCHAR
*
buffer
)
...
...
@@ -230,6 +279,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
;
get_typelib_key
(
guid
,
wMaj
,
wMin
,
buffer
);
res
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
buffer
,
0
,
KEY_READ
,
&
hkey
);
...
...
@@ -708,7 +758,7 @@ HRESULT WINAPI UnRegisterTypeLib(
}
/* Try and open the key to the type library. */
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
keyName
,
0
,
KEY_READ
|
KEY_WRITE
,
&
key
)
!=
S_OK
)
{
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
keyName
,
0
,
KEY_READ
|
KEY_WRITE
,
&
key
)
!=
ERROR_SUCCESS
)
{
result
=
E_INVALIDARG
;
goto
end
;
}
...
...
@@ -742,7 +792,7 @@ HRESULT WINAPI UnRegisterTypeLib(
get_interface_key
(
&
typeAttr
->
guid
,
subKeyName
);
/* Delete its bits */
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
subKeyName
,
0
,
KEY_WRITE
,
&
subKey
)
!=
S_OK
)
{
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
subKeyName
,
0
,
KEY_WRITE
,
&
subKey
)
!=
ERROR_SUCCESS
)
{
goto
enddeleteloop
;
}
RegDeleteKeyW
(
subKey
,
ProxyStubClsidW
);
...
...
@@ -770,7 +820,7 @@ enddeleteloop:
tmpLength
=
sizeof
(
subKeyName
)
/
sizeof
(
WCHAR
);
deleteOtherStuff
=
TRUE
;
i
=
0
;
while
(
RegEnumKeyExW
(
key
,
i
++
,
subKeyName
,
&
tmpLength
,
NULL
,
NULL
,
NULL
,
NULL
)
==
S_OK
)
{
while
(
RegEnumKeyExW
(
key
,
i
++
,
subKeyName
,
&
tmpLength
,
NULL
,
NULL
,
NULL
,
NULL
)
==
ERROR_SUCCESS
)
{
tmpLength
=
sizeof
(
subKeyName
)
/
sizeof
(
WCHAR
);
/* if its not FLAGS or HELPDIR, then we must keep the rest of the key */
...
...
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