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
2660e6a0
Commit
2660e6a0
authored
Nov 07, 1998
by
John Richardson
Committed by
Alexandre Julliard
Nov 07, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of CoLoadLibrary, CoFreeAllLibraries,
CoFreeUnusedLibraries, CoFreeLibrary. Fixed misspelling of CoUninitialize.
parent
50af6022
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
152 additions
and
12 deletions
+152
-12
compobj.spec
if1632/compobj.spec
+1
-1
ole.h
include/ole.h
+6
-0
compobj.c
ole/compobj.c
+142
-8
ole32.spec
relay32/ole32.spec
+3
-3
No files found.
if1632/compobj.spec
View file @
2660e6a0
...
@@ -3,7 +3,7 @@ type win16
...
@@ -3,7 +3,7 @@ type win16
1 pascal CoBuildVersion() CoBuildVersion
1 pascal CoBuildVersion() CoBuildVersion
2 pascal CoInitialize(long) CoInitialize16
2 pascal CoInitialize(long) CoInitialize16
3 pascal CoUninitialize() CoUnitialize
3 pascal CoUninitialize() CoUni
ni
tialize
4 pascal CoGetMalloc(long ptr) CoGetMalloc16
4 pascal CoGetMalloc(long ptr) CoGetMalloc16
5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject16
5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject16
6 stub COREVOKECLASSOBJECT
6 stub COREVOKECLASSOBJECT
...
...
include/ole.h
View file @
2660e6a0
...
@@ -290,6 +290,12 @@ OLESTATUS WINAPI OleRevokeServerDoc(LHSERVERDOC);
...
@@ -290,6 +290,12 @@ OLESTATUS WINAPI OleRevokeServerDoc(LHSERVERDOC);
OLESTATUS
WINAPI
OleRevokeClientDoc
(
LHCLIENTDOC
);
OLESTATUS
WINAPI
OleRevokeClientDoc
(
LHCLIENTDOC
);
OLESTATUS
WINAPI
OleRevokeServer
(
LHSERVER
);
OLESTATUS
WINAPI
OleRevokeServer
(
LHSERVER
);
/* com functions */
void
WINAPI
CoFreeUnusedLibraries
(
void
);
HINSTANCE32
WINAPI
CoLoadLibrary
(
LPSTR
lpszLibName
,
BOOL32
bAutoFree
);
void
WINAPI
CoFreeUnusedLibraries
(
void
);
void
WINAPI
CoFreeAllLibraries
(
void
);
typedef
enum
tagCALLCONV
{
typedef
enum
tagCALLCONV
{
CC_CDECL
=
1
,
CC_CDECL
=
1
,
CC_MSCPASCAL
=
CC_CDECL
+
1
,
CC_MSCPASCAL
=
CC_CDECL
+
1
,
...
...
ole/compobj.c
View file @
2660e6a0
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include "dinput.h"
#include "dinput.h"
#include "d3d.h"
#include "d3d.h"
#include "dplay.h"
#include "dplay.h"
#include "windows.h"
LPMALLOC16
currentMalloc16
=
NULL
;
LPMALLOC16
currentMalloc16
=
NULL
;
...
@@ -33,13 +34,27 @@ LPMALLOC32 currentMalloc32=NULL;
...
@@ -33,13 +34,27 @@ LPMALLOC32 currentMalloc32=NULL;
HTASK16
hETask
=
0
;
HTASK16
hETask
=
0
;
WORD
Table_ETask
[
62
];
WORD
Table_ETask
[
62
];
/* this open DLL table belongs in a per process table, but my guess is that
* it shouldn't live in the kernel, so I'll put them out here in DLL
* space assuming that there is one OLE32 per process.
*/
typedef
struct
tagOpenDll
{
char
*
DllName
;
/* really only needed for debugging */
HINSTANCE32
hLibrary
;
struct
tagOpenDll
*
next
;
}
OpenDll
;
static
OpenDll
*
openDllList
=
NULL
;
/* linked list of open dlls */
/******************************************************************************
/******************************************************************************
* CoBuildVersion [COMPOBJ.1]
* CoBuildVersion [COMPOBJ.1]
*
*
* RETURNS
* RETURNS
* Current built version, hiword is majornumber, loword is minornumber
* Current built version, hiword is majornumber, loword is minornumber
*/
*/
DWORD
WINAPI
CoBuildVersion
()
DWORD
WINAPI
CoBuildVersion
(
void
)
{
{
TRACE
(
ole
,
"(void)
\n
"
);
TRACE
(
ole
,
"(void)
\n
"
);
return
(
rmm
<<
16
)
+
rup
;
return
(
rmm
<<
16
)
+
rup
;
...
@@ -63,6 +78,9 @@ HRESULT WINAPI CoInitialize16(
...
@@ -63,6 +78,9 @@ HRESULT WINAPI CoInitialize16(
HRESULT
WINAPI
CoInitialize32
(
HRESULT
WINAPI
CoInitialize32
(
LPMALLOC32
lpReserved
/* [in] pointer to win32 malloc interface */
LPMALLOC32
lpReserved
/* [in] pointer to win32 malloc interface */
)
{
)
{
/* FIXME: there really should be something here that incrememts a refcount
* but I'm supposing that it is a real COM object, so I won't bother
* creating one here. (Decrement done in CoUnitialize()) */
currentMalloc32
=
lpReserved
;
currentMalloc32
=
lpReserved
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -70,10 +88,13 @@ HRESULT WINAPI CoInitialize32(
...
@@ -70,10 +88,13 @@ HRESULT WINAPI CoInitialize32(
/***********************************************************************
/***********************************************************************
* CoUnitialize [COMPOBJ.3]
* CoUnitialize [COMPOBJ.3]
* Don't know what it does.
* Don't know what it does.
* 3-Nov-98 -- this was originally misspelled, I changed it to what I
* believe is the correct spelling
*/
*/
void
WINAPI
CoUni
tialize
(
)
void
WINAPI
CoUni
nitialize
(
void
)
{
{
TRACE
(
ole
,
"(void)
\n
"
);
TRACE
(
ole
,
"(void)
\n
"
);
CoFreeAllLibraries
();
}
}
/***********************************************************************
/***********************************************************************
...
@@ -577,20 +598,23 @@ HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
...
@@ -577,20 +598,23 @@ HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext,
return
REGDB_E_CLASSNOTREG
;
return
REGDB_E_CLASSNOTREG
;
}
}
/* open dll, call DllGetClassFactory */
/* open dll, call DllGetClassFactory */
hLibrary
=
LoadLibrary32A
(
dllName
);
hLibrary
=
CoLoadLibrary
(
dllName
,
TRUE
);
if
(
hLibrary
==
0
)
{
if
(
hLibrary
==
0
)
{
TRACE
(
ole
,
"couldn't load InprocServer32 dll %s
\n
"
,
dllName
);
TRACE
(
ole
,
"couldn't load InprocServer32 dll %s
\n
"
,
dllName
);
return
E_ACCESSDENIED
;
/* or should this be CO_E_DLLNOTFOUND? */
return
E_ACCESSDENIED
;
/* or should this be CO_E_DLLNOTFOUND? */
}
}
DllGetClassObject
=
(
DllGetClassObjectFunc
)
GetProcAddress32
(
hLibrary
,
"DllGetClassObject"
);
DllGetClassObject
=
(
DllGetClassObjectFunc
)
GetProcAddress32
(
hLibrary
,
"DllGetClassObject"
);
if
(
DllGetClassObject
==
NULL
)
{
if
(
DllGetClassObject
==
NULL
)
{
/* not sure if this should be called here CoFreeLibrary(hLibrary);*/
TRACE
(
ole
,
"couldn't find function DllGetClassObject in %s
\n
"
,
dllName
);
TRACE
(
ole
,
"couldn't find function DllGetClassObject in %s
\n
"
,
dllName
);
return
E_ACCESSDENIED
;
return
E_ACCESSDENIED
;
}
}
return
DllGetClassObject
(
rclsid
,
iid
,
ppv
);
return
DllGetClassObject
(
rclsid
,
iid
,
ppv
);
}
}
...
@@ -644,20 +668,85 @@ HRESULT WINAPI CoCreateInstance(
...
@@ -644,20 +668,85 @@ HRESULT WINAPI CoCreateInstance(
#endif
#endif
}
}
/***********************************************************************
/***********************************************************************
* CoFreeLibrary [COMPOBJ.13]
* CoFreeLibrary [COMPOBJ.13]
*/
*/
void
WINAPI
CoFreeLibrary
(
HINSTANCE32
hInst
)
void
WINAPI
CoFreeLibrary
(
HINSTANCE32
hLibrary
)
{
OpenDll
*
ptr
,
*
prev
;
OpenDll
*
tmp
;
/* lookup library in linked list */
prev
=
NULL
;
for
(
ptr
=
openDllList
;
ptr
!=
NULL
;
ptr
=
ptr
->
next
)
{
if
(
ptr
->
hLibrary
==
hLibrary
)
{
break
;
}
prev
=
ptr
;
}
if
(
ptr
==
NULL
)
{
/* shouldn't happen if user passed in a valid hLibrary */
return
;
}
/* assert: ptr points to the library entry to free */
/* free library and remove node from list */
FreeLibrary32
(
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
;
}
}
/***********************************************************************
* CoFreeAllLibraries [COMPOBJ.12]
*/
void
WINAPI
CoFreeAllLibraries
(
void
)
{
{
FIXME
(
ole
,
"(), stub !
\n
"
);
OpenDll
*
ptr
,
*
tmp
;
for
(
ptr
=
openDllList
;
ptr
!=
NULL
;
)
{
tmp
=
ptr
->
next
;
CoFreeLibrary
(
ptr
->
hLibrary
);
ptr
=
tmp
;
}
}
}
/***********************************************************************
/***********************************************************************
* CoFreeUnusedLibraries [COMPOBJ.17]
* CoFreeUnusedLibraries [COMPOBJ.17]
*/
*/
void
WINAPI
CoFreeUnusedLibraries
()
void
WINAPI
CoFreeUnusedLibraries
(
void
)
{
{
FIXME
(
ole
,
"(), stub !
\n
"
);
OpenDll
*
ptr
,
*
tmp
;
typedef
HRESULT
(
*
DllCanUnloadNowFunc
)(
void
);
DllCanUnloadNowFunc
DllCanUnloadNow
;
for
(
ptr
=
openDllList
;
ptr
!=
NULL
;
)
{
DllCanUnloadNow
=
(
DllCanUnloadNowFunc
)
GetProcAddress32
(
ptr
->
hLibrary
,
"DllCanUnloadNow"
);
if
(
DllCanUnloadNow
()
==
S_OK
)
{
tmp
=
ptr
->
next
;
CoFreeLibrary
(
ptr
->
hLibrary
);
ptr
=
tmp
;
}
else
{
ptr
=
ptr
->
next
;
}
}
}
}
/***********************************************************************
/***********************************************************************
...
@@ -702,6 +791,51 @@ VOID WINAPI CoTaskMemFree(
...
@@ -702,6 +791,51 @@ VOID WINAPI CoTaskMemFree(
}
}
/***********************************************************************
/***********************************************************************
* CoLoadLibrary (OLE32.30)
*/
HINSTANCE32
WINAPI
CoLoadLibrary
(
LPSTR
lpszLibName
,
BOOL32
bAutoFree
)
{
HINSTANCE32
hLibrary
;
OpenDll
*
ptr
;
OpenDll
*
tmp
;
TRACE
(
ole
,
"CoLoadLibrary(%p, %d
\n
"
,
lpszLibName
,
bAutoFree
);
hLibrary
=
LoadLibrary32A
(
lpszLibName
);
if
(
!
bAutoFree
)
return
hLibrary
;
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
->
next
=
NULL
;
}
else
{
/* search for this dll */
int
found
=
FALSE
;
for
(
ptr
=
openDllList
;
ptr
->
next
!=
NULL
;
ptr
=
ptr
->
next
)
{
if
(
ptr
->
hLibrary
==
hLibrary
)
{
found
=
TRUE
;
break
;
}
}
if
(
!
found
)
{
/* dll not found, add it */
tmp
=
openDllList
;
openDllList
->
next
=
(
OpenDll
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
OpenDll
));
openDllList
->
DllName
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
lpszLibName
);
openDllList
->
hLibrary
=
hLibrary
;
openDllList
->
next
=
tmp
;
}
}
return
hLibrary
;
}
/***********************************************************************
* CoInitializeWOW (OLE32.27)
* CoInitializeWOW (OLE32.27)
*/
*/
HRESULT
WINAPI
CoInitializeWOW
(
DWORD
x
,
DWORD
y
)
{
HRESULT
WINAPI
CoInitializeWOW
(
DWORD
x
,
DWORD
y
)
{
...
...
relay32/ole32.spec
View file @
2660e6a0
...
@@ -12,7 +12,7 @@ type win32
...
@@ -12,7 +12,7 @@ type win32
9 stdcall CoDosDateTimeToFileTime(long long ptr) DosDateTimeToFileTime
9 stdcall CoDosDateTimeToFileTime(long long ptr) DosDateTimeToFileTime
10 stdcall CoFileTimeNow(ptr) CoFileTimeNow
10 stdcall CoFileTimeNow(ptr) CoFileTimeNow
11 stdcall CoFileTimeToDosDateTime(ptr ptr ptr) FileTimeToDosDateTime
11 stdcall CoFileTimeToDosDateTime(ptr ptr ptr) FileTimeToDosDateTime
12 st
ub
CoFreeAllLibraries
12 st
dcall CoFreeAllLibraries()
CoFreeAllLibraries
13 stdcall CoFreeLibrary(long) CoFreeLibrary
13 stdcall CoFreeLibrary(long) CoFreeLibrary
14 stdcall CoFreeUnusedLibraries() CoFreeUnusedLibraries
14 stdcall CoFreeUnusedLibraries() CoFreeUnusedLibraries
15 stub CoGetCallerTID
15 stub CoGetCallerTID
...
@@ -30,7 +30,7 @@ type win32
...
@@ -30,7 +30,7 @@ type win32
27 stdcall CoInitializeWOW(long long) CoInitializeWOW
27 stdcall CoInitializeWOW(long long) CoInitializeWOW
28 stub CoIsHandlerConnected
28 stub CoIsHandlerConnected
29 stub CoIsOle1Class
29 stub CoIsOle1Class
30 st
ub
CoLoadLibrary
30 st
dcall CoLoadLibrary(ptr long)
CoLoadLibrary
31 stdcall CoLockObjectExternal(ptr long long) CoLockObjectExternal32
31 stdcall CoLockObjectExternal(ptr long long) CoLockObjectExternal32
32 stub CoMarshalHresult
32 stub CoMarshalHresult
33 stub CoMarshalInterThreadInterfaceInStream
33 stub CoMarshalInterThreadInterfaceInStream
...
@@ -47,7 +47,7 @@ type win32
...
@@ -47,7 +47,7 @@ type win32
44 stdcall CoTaskMemFree(ptr) CoTaskMemFree
44 stdcall CoTaskMemFree(ptr) CoTaskMemFree
45 stub CoTaskMemRealloc
45 stub CoTaskMemRealloc
46 stub CoTreatAsClass
46 stub CoTreatAsClass
47 stdcall CoUninitialize() CoUnitialize
47 stdcall CoUninitialize() CoUni
ni
tialize
48 stub CoUnloadingWOW
48 stub CoUnloadingWOW
49 stub CoUnmarshalHresult
49 stub CoUnmarshalHresult
50 stub CoUnmarshalInterface
50 stub CoUnmarshalInterface
...
...
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