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
61882324
Commit
61882324
authored
Nov 14, 1998
by
Marcus Meissner
Committed by
Alexandre Julliard
Nov 14, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(CoGetClassObject) one missing CALLBACK, extremely simplified clsid
lookup (Registry is case insensitive).
parent
42e68a6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
50 deletions
+15
-50
compobj.c
ole/compobj.c
+15
-50
No files found.
ole/compobj.c
View file @
61882324
...
...
@@ -728,18 +728,14 @@ HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
{
char
xclsid
[
50
],
xiid
[
50
];
HRESULT
hres
=
E_UNEXPECTED
;
char
dllName
[
MAX_PATH
+
1
];
LONG
dllNameLen
=
MAX_PATH
+
1
;
LONG
dllNameLen
=
sizeof
(
dllName
)
;
HINSTANCE32
hLibrary
;
typedef
HRESULT
(
*
DllGetClassObjectFunc
)(
REFCLSID
clsid
,
typedef
HRESULT
(
CALLBACK
*
DllGetClassObjectFunc
)(
REFCLSID
clsid
,
REFIID
iid
,
LPVOID
*
ppv
);
DllGetClassObjectFunc
DllGetClassObject
;
HKEY
CLSIDkey
;
char
buf
[
MAX_PATH
+
1
];
int
i
;
int
found
;
WINE_StringFromCLSID
((
LPCLSID
)
rclsid
,
xclsid
);
WINE_StringFromCLSID
((
LPCLSID
)
iid
,
xiid
);
TRACE
(
ole
,
"
\n\t
CLSID:
\t
%s,
\n\t
IID:
\t
%s
\n
"
,
xclsid
,
xiid
);
...
...
@@ -751,72 +747,41 @@ HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
}
if
((
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
)
&
dwClsContext
)
{
HKEY
CLSIDkey
,
key
;
/* lookup CLSID in registry key HKCR/CLSID */
hres
=
RegOpenKeyEx32A
(
HKEY_CLASSES_ROOT
,
"CLSID"
,
0
,
KEY_ENUMERATE_SUB_KEYS
,
&
CLSIDkey
);
if
(
hres
!=
ERROR_SUCCESS
)
{
return
REGDB_E_READREGDB
;
}
KEY_READ
,
&
CLSIDkey
);
/* search all the subkeys for a match to xclsid */
found
=
FALSE
;
for
(
i
=
0
;
i
<
100000
;
i
++
)
{
char
clsidKeyPath
[
MAX_PATH
+
1
];
HKEY
key
;
LONG
res
;
res
=
RegEnumKey32A
(
CLSIDkey
,
i
,
buf
,
MAX_PATH
);
if
(
res
==
ERROR_NO_MORE_ITEMS
)
break
;
if
(
res
!=
ERROR_SUCCESS
)
continue
;
sprintf
(
clsidKeyPath
,
"CLSID
\\
%s"
,
buf
);
if
(
lstrcmpi32A
(
buf
,
xclsid
)
!=
0
)
continue
;
res
=
RegOpenKeyEx32A
(
HKEY_CLASSES_ROOT
,
clsidKeyPath
,
0
,
KEY_QUERY_VALUE
,
&
key
);
if
(
res
!=
ERROR_SUCCESS
)
{
if
(
hres
!=
ERROR_SUCCESS
)
return
REGDB_E_READREGDB
;
hres
=
RegOpenKeyEx32A
(
HKEY_CLASSES_ROOT
,
xclsid
,
0
,
KEY_QUERY_VALUE
,
&
key
);
if
(
hres
!=
ERROR_SUCCESS
)
{
RegCloseKey
(
CLSIDkey
);
return
REGDB_E_CLASSNOTREG
;
}
hres
=
RegQueryValue32A
(
key
,
"InprocServer32"
,
dllName
,
&
dllNameLen
);
if
(
res
!=
ERROR_SUCCESS
)
{
RegCloseKey
(
key
);
RegCloseKey
(
CLSIDkey
);
if
(
hres
!=
ERROR_SUCCESS
)
return
REGDB_E_READREGDB
;
}
TRACE
(
ole
,
"found InprocServer32 dll %s
\n
"
,
dllName
);
found
=
TRUE
;
break
;
}
if
(
!
found
)
{
return
REGDB_E_CLASSNOTREG
;
}
/* open dll, call DllGetClassFactory */
hLibrary
=
CoLoadLibrary
(
dllName
,
TRUE
);
if
(
hLibrary
==
0
)
{
TRACE
(
ole
,
"couldn't load InprocServer32 dll %s
\n
"
,
dllName
);
return
E_ACCESSDENIED
;
/* or should this be CO_E_DLLNOTFOUND? */
}
DllGetClassObject
=
(
DllGetClassObjectFunc
)
GetProcAddress32
(
hLibrary
,
"DllGetClassObject"
);
if
(
DllGetClassObject
==
NULL
)
{
if
(
!
DllGetClassObject
)
{
/* not sure if this should be called here CoFreeLibrary(hLibrary);*/
TRACE
(
ole
,
"couldn't find function DllGetClassObject in %s
\n
"
,
dllName
);
return
E_ACCESSDENIED
;
}
return
DllGetClassObject
(
rclsid
,
iid
,
ppv
);
}
return
hres
;
}
...
...
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