Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
09ee5d0a
Commit
09ee5d0a
authored
Mar 04, 2000
by
Marcus Meissner
Committed by
Alexandre Julliard
Mar 04, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CoLoadLibrary gets UNICODE, not ASCII strings. (spotted by Lawson
Whitney), removed the dllName component of the openDlls. Added some debugstr_guid().
parent
4d8d8b56
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
27 deletions
+24
-27
compobj.c
dlls/ole32/compobj.c
+23
-24
ole.h
include/ole.h
+1
-1
obj_base.h
include/wine/obj_base.h
+0
-2
No files found.
dlls/ole32/compobj.c
View file @
09ee5d0a
...
...
@@ -170,7 +170,6 @@ static RegisteredClass* firstRegisteredClass = NULL;
* space assuming that there is one OLE32 per process.
*/
typedef
struct
tagOpenDll
{
char
*
DllName
;
/* really only needed for debugging */
HINSTANCE
hLibrary
;
struct
tagOpenDll
*
next
;
}
OpenDll
;
...
...
@@ -1291,10 +1290,9 @@ HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
LPVOID
pvReserved
,
REFIID
iid
,
LPVOID
*
ppv
)
{
LPUNKNOWN
regClassObject
;
char
xclsid
[
50
],
xiid
[
50
];
HRESULT
hres
=
E_UNEXPECTED
;
char
dllName
[
MAX_PATH
+
1
];
char
xclsid
[
80
];
WCHAR
dllName
[
MAX_PATH
+
1
];
DWORD
dllNameLen
=
sizeof
(
dllName
);
HINSTANCE
hLibrary
;
typedef
HRESULT
(
CALLBACK
*
DllGetClassObjectFunc
)(
REFCLSID
clsid
,
...
...
@@ -1302,8 +1300,11 @@ HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
DllGetClassObjectFunc
DllGetClassObject
;
WINE_StringFromCLSID
((
LPCLSID
)
rclsid
,
xclsid
);
WINE_StringFromCLSID
((
LPCLSID
)
iid
,
xiid
);
TRACE
(
"
\n\t
CLSID:
\t
%s,
\n\t
IID:
\t
%s
\n
"
,
xclsid
,
xiid
);
TRACE
(
"
\n\t
CLSID:
\t
%s,
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
iid
)
);
/*
* First, try and see if we can't match the class ID with one of the
...
...
@@ -1335,6 +1336,8 @@ HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
if
((
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
)
&
dwClsContext
)
{
HKEY
CLSIDkey
,
key
;
WCHAR
valname
[]
=
{
'I'
,
'n'
,
'p'
,
'r'
,
'o'
,
'c'
,
'S'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
'3'
,
'2'
,
0
};
/* lookup CLSID in registry key HKCR/CLSID */
hres
=
RegOpenKeyExA
(
HKEY_CLASSES_ROOT
,
"CLSID"
,
0
,
...
...
@@ -1347,23 +1350,28 @@ HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
RegCloseKey
(
CLSIDkey
);
return
REGDB_E_CLASSNOTREG
;
}
hres
=
RegQueryValueA
(
key
,
"InprocServer32"
,
dllName
,
&
dllNameLen
);
memset
(
dllName
,
0
,
sizeof
(
dllName
));
hres
=
RegQueryValueW
(
key
,
valname
,
dllName
,
&
dllNameLen
);
if
(
hres
)
{
ERR
(
"RegQueryValue of %s failed with hres %lx
\n
"
,
debugstr_w
(
dllName
),
hres
);
return
REGDB_E_CLASSNOTREG
;
/* FIXME: check retval */
}
RegCloseKey
(
key
);
RegCloseKey
(
CLSIDkey
);
if
(
hres
!=
ERROR_SUCCESS
)
return
REGDB_E_READREGDB
;
TRACE
(
"found InprocServer32 dll %s
\n
"
,
d
llName
);
TRACE
(
"found InprocServer32 dll %s
\n
"
,
d
ebugstr_w
(
dllName
)
);
/* open dll, call DllGetClassFactory */
hLibrary
=
CoLoadLibrary
(
dllName
,
TRUE
);
if
(
hLibrary
==
0
)
{
TRACE
(
"couldn't load InprocServer32 dll %s
\n
"
,
dllName
);
FIXME
(
"couldn't load InprocServer32 dll %s
\n
"
,
debugstr_w
(
dllName
)
);
return
E_ACCESSDENIED
;
/* or should this be CO_E_DLLNOTFOUND? */
}
DllGetClassObject
=
(
DllGetClassObjectFunc
)
GetProcAddress
(
hLibrary
,
"DllGetClassObject"
);
if
(
!
DllGetClassObject
)
{
/* not sure if this should be called here CoFreeLibrary(hLibrary);*/
TRACE
(
"couldn't find function DllGetClassObject in %s
\n
"
,
dllName
);
FIXME
(
"couldn't find function DllGetClassObject in %s
\n
"
,
debugstr_w
(
dllName
)
);
return
E_ACCESSDENIED
;
}
...
...
@@ -1634,12 +1642,10 @@ void WINAPI CoFreeLibrary(HINSTANCE hLibrary)
FreeLibrary
(
hLibrary
);
if
(
ptr
==
openDllList
)
{
tmp
=
openDllList
->
next
;
HeapFree
(
GetProcessHeap
(),
0
,
openDllList
->
DllName
);
HeapFree
(
GetProcessHeap
(),
0
,
openDllList
);
openDllList
=
tmp
;
}
else
{
tmp
=
ptr
->
next
;
HeapFree
(
GetProcessHeap
(),
0
,
ptr
->
DllName
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
prev
->
next
=
tmp
;
}
...
...
@@ -1751,15 +1757,15 @@ LPVOID WINAPI CoTaskMemRealloc(
/***********************************************************************
* CoLoadLibrary (OLE32.30)
*/
HINSTANCE
WINAPI
CoLoadLibrary
(
LPOLESTR
16
lpszLibName
,
BOOL
bAutoFree
)
HINSTANCE
WINAPI
CoLoadLibrary
(
LPOLESTR
lpszLibName
,
BOOL
bAutoFree
)
{
HINSTANCE
hLibrary
;
OpenDll
*
ptr
;
OpenDll
*
tmp
;
TRACE
(
"CoLoadLibrary(%p, %d
\n
"
,
lpszLibName
,
bAutoFree
);
TRACE
(
"CoLoadLibrary(%p, %d
\n
"
,
debugstr_w
(
lpszLibName
)
,
bAutoFree
);
hLibrary
=
LoadLibraryEx
A
(
lpszLibName
,
0
,
LOAD_WITH_ALTERED_SEARCH_PATH
);
hLibrary
=
LoadLibraryEx
W
(
lpszLibName
,
0
,
LOAD_WITH_ALTERED_SEARCH_PATH
);
if
(
!
bAutoFree
)
return
hLibrary
;
...
...
@@ -1767,8 +1773,7 @@ HINSTANCE WINAPI CoLoadLibrary(LPOLESTR16 lpszLibName, BOOL bAutoFree)
if
(
openDllList
==
NULL
)
{
/* empty list -- add first node */
openDllList
=
(
OpenDll
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
OpenDll
));
openDllList
->
DllName
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
lpszLibName
);
openDllList
->
hLibrary
=
hLibrary
;
openDllList
->
hLibrary
=
hLibrary
;
openDllList
->
next
=
NULL
;
}
else
{
/* search for this dll */
...
...
@@ -1783,7 +1788,6 @@ HINSTANCE WINAPI CoLoadLibrary(LPOLESTR16 lpszLibName, BOOL bAutoFree)
/* dll not found, add it */
tmp
=
openDllList
;
openDllList
=
(
OpenDll
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
OpenDll
));
openDllList
->
DllName
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
lpszLibName
);
openDllList
->
hLibrary
=
hLibrary
;
openDllList
->
next
=
tmp
;
}
...
...
@@ -1866,13 +1870,8 @@ HRESULT WINAPI CoSetState(LPDWORD state)
*/
HRESULT
WINAPI
OLE32_DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
iid
,
LPVOID
*
ppv
)
{
char
xclsid
[
50
],
xiid
[
50
];
WINE_StringFromCLSID
((
LPCLSID
)
rclsid
,
xclsid
);
WINE_StringFromCLSID
((
LPCLSID
)
iid
,
xiid
);
FIXME
(
"
\n\t
CLSID:
\t
%s,
\n\t
IID:
\t
%s
\n
"
,
xclsid
,
xiid
);
FIXME
(
"
\n\t
CLSID:
\t
%s,
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
iid
));
*
ppv
=
NULL
;
return
CLASS_E_CLASSNOTAVAILABLE
;
}
...
...
include/ole.h
View file @
09ee5d0a
...
...
@@ -275,7 +275,7 @@ OLESTATUS WINAPI OleCreateFromClip16(
/* com functions */
void
WINAPI
CoFreeUnusedLibraries
(
void
);
HINSTANCE
WINAPI
CoLoadLibrary
(
LPSTR
lpszLibName
,
BOOL
bAutoFree
);
HINSTANCE
WINAPI
CoLoadLibrary
(
LP
OLE
STR
lpszLibName
,
BOOL
bAutoFree
);
void
WINAPI
CoFreeUnusedLibraries
(
void
);
void
WINAPI
CoFreeAllLibraries
(
void
);
...
...
include/wine/obj_base.h
View file @
09ee5d0a
...
...
@@ -868,8 +868,6 @@ typedef enum tagCOINIT
/* FIXME: not implemented */
BOOL
WINAPI
CoIsOle1Class
(
REFCLSID
rclsid
);
HINSTANCE
WINAPI
CoLoadLibrary
(
LPOLESTR16
lpszLibName
,
BOOL
bAutoFree
);
HRESULT
WINAPI
CoLockObjectExternal16
(
LPUNKNOWN
pUnk
,
BOOL16
fLock
,
BOOL16
fLastUnlockReleases
);
HRESULT
WINAPI
CoLockObjectExternal
(
LPUNKNOWN
pUnk
,
BOOL
fLock
,
BOOL
fLastUnlockReleases
);
...
...
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