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
133d7078
Commit
133d7078
authored
Aug 22, 2000
by
Francois Jacques
Committed by
Alexandre Julliard
Aug 22, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- removed unnecessary recursion
- upon query failure on main primary lcid and secondary lcid, attempts a query on system lcid (0)
parent
8c5df7b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
27 deletions
+67
-27
typelib.c
dlls/oleaut32/typelib.c
+67
-27
No files found.
dlls/oleaut32/typelib.c
View file @
133d7078
...
...
@@ -94,35 +94,75 @@ QueryPathOfRegTypeLib(
WORD
wMaj
,
/* [in] major version */
WORD
wMin
,
/* [in] minor version */
LCID
lcid
,
/* [in] locale id */
LPBSTR
path
/* [out] path of typelib */
)
{
char
xguid
[
80
];
char
typelibkey
[
100
],
pathname
[
260
];
DWORD
plen
;
LPBSTR
path
)
/* [out] path of typelib */
{
/* don't need to ZeroMemory those arrays since sprintf and RegQueryValue add
string termination character on output strings */
TRACE
(
"
\n
"
)
;
HRESULT
hr
=
E_FAIL
;
if
(
HIWORD
(
guid
))
{
sprintf
(
typelibkey
,
"SOFTWARE
\\
Classes
\\
Typelib
\\
{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}
\\
%d.%d
\\
%lx
\\
win32"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
],
wMaj
,
wMin
,
lcid
);
}
else
{
sprintf
(
xguid
,
"<guid 0x%08lx>"
,(
DWORD
)
guid
);
FIXME
(
"(%s,%d,%d,0x%04lx,%p),stub!
\n
"
,
xguid
,
wMaj
,
wMin
,(
DWORD
)
lcid
,
path
);
return
E_FAIL
;
}
plen
=
sizeof
(
pathname
);
if
(
RegQueryValueA
(
HKEY_LOCAL_MACHINE
,
typelibkey
,
pathname
,
&
plen
))
{
/* try again without lang specific id */
if
(
SUBLANGID
(
lcid
))
return
QueryPathOfRegTypeLib
(
guid
,
wMaj
,
wMin
,
PRIMARYLANGID
(
lcid
),
path
);
FIXME
(
"key %s not found
\n
"
,
typelibkey
);
return
E_FAIL
;
}
*
path
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pathname
);
return
S_OK
;
DWORD
dwPathLen
=
_MAX_PATH
;
LCID
myLCID
=
lcid
;
char
szXGUID
[
80
];
char
szTypeLibKey
[
100
];
char
szPath
[
dwPathLen
];
if
(
!
HIWORD
(
guid
)
)
{
sprintf
(
szXGUID
,
"<guid 0x%08lx>"
,
(
DWORD
)
guid
);
FIXME
(
"(%s,%d,%d,0x%04lx,%p),stub!
\n
"
,
szXGUID
,
wMaj
,
wMin
,
(
DWORD
)
lcid
,
path
);
return
E_FAIL
;
}
while
(
hr
!=
S_OK
)
{
sprintf
(
szTypeLibKey
,
"SOFTWARE
\\
Classes
\\
Typelib
\\
{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}
\\
%d.%d
\\
%lx
\\
win32"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
],
wMaj
,
wMin
,
myLCID
);
if
(
RegQueryValueA
(
HKEY_LOCAL_MACHINE
,
szTypeLibKey
,
szPath
,
&
dwPathLen
))
{
if
(
myLCID
==
lcid
)
{
/* try with sub-langid */
myLCID
=
SUBLANGID
(
lcid
);
}
else
if
(
myLCID
==
SUBLANGID
(
lcid
))
{
/* try with system langid */
myLCID
=
0
;
}
else
{
break
;
}
}
else
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
MB_PRECOMPOSED
,
szPath
,
dwPathLen
,
NULL
,
0
);
BSTR
bstrPath
=
SysAllocStringLen
(
NULL
,
len
);
MultiByteToWideChar
(
CP_ACP
,
MB_PRECOMPOSED
,
szPath
,
dwPathLen
,
bstrPath
,
len
);
*
path
=
bstrPath
;
hr
=
S_OK
;
}
}
return
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