Release 970120
[wine] / misc / compobj.c
1 /*
2  *      COMPOBJ library
3  *
4  *      Copyright 1995  Martin von Loewis
5  */
6
7 /*      At the moment, these are only empty stubs.
8  */
9
10 #include "ole.h"
11 #include "ole2.h"
12 #include "stddebug.h"
13 #include "debug.h"
14
15 DWORD currentMalloc=0;
16
17 /***********************************************************************
18  *           CoBuildVersion [COMPOBJ.1]
19  */
20 DWORD CoBuildVersion()
21 {
22         dprintf_ole(stddeb,"CoBuildVersion()\n");
23         return (rmm<<16)+rup;
24 }
25
26 /***********************************************************************
27  *           CoInitialize       [COMPOBJ.2]
28  * lpReserved is an IMalloc pointer in 16bit OLE. We just stored it as-is.
29  */
30 HRESULT CoInitialize(DWORD lpReserved)
31 {
32         dprintf_ole(stdnimp,"CoInitialize\n");
33         /* remember the LPMALLOC, maybe somebody wants to read it later on */
34         currentMalloc = lpReserved;
35         return S_OK;
36 }
37
38 /***********************************************************************
39  *           CoUnitialize   [COMPOBJ.3]
40  */
41 void CoUnitialize()
42 {
43         dprintf_ole(stdnimp,"CoUnitialize()\n");
44 }
45
46 /***********************************************************************
47  *           CoGetMalloc    [COMPOBJ.4]
48  */
49 HRESULT CoGetMalloc(DWORD dwMemContext, DWORD * lpMalloc)
50 {
51         if(currentMalloc)
52         {
53                 *lpMalloc = currentMalloc;
54                 return S_OK;
55         }
56         *lpMalloc = 0;
57         /* 16-bit E_NOTIMPL */
58         return 0x80000001L;
59 }
60
61 /***********************************************************************
62  *           CoDisconnectObject
63  */
64 OLESTATUS CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
65 {
66     dprintf_ole(stdnimp,"CoDisconnectObject:%p %lx\n",lpUnk,reserved);
67     return OLE_OK;
68 }