Implementation of VER.DLL. Thunks up to VERSION.DLL.
[wine.git] / ole / ole2.c
blob5fa154d81a83b0d1923710dd370f5bfe8ad90df1
1 /*
2 * OLE2 library
4 * Copyright 1995 Martin von Loewis
5 */
7 #include "windows.h"
8 #include "winerror.h"
9 #include "ole2.h"
10 #include "process.h"
11 #include "debug.h"
12 #include "objbase.h"
13 #include "objidl.h"
14 #include "wine/obj_base.h"
15 #include "wine/obj_clientserver.h"
16 #include "wine/obj_storage.h"
17 #include "wine/obj_moniker.h"
19 /******************************************************************************
20 * These are static/global variables that the OLE module uses to maintain
21 * it's state.
25 * This is the lock count on the OLE library. It is controlled by the
26 * OLEInitialize/OLEUninitialize methods.
28 static ULONG s_OLEModuleLockCount = 0;
30 /******************************************************************************
31 * OleBuildVersion [OLE2.1]
33 DWORD WINAPI OleBuildVersion(void)
35 TRACE(ole,"(void)\n");
36 return (rmm<<16)+rup;
39 /***********************************************************************
40 * OleInitialize (OLE2.2) (OLE32.108)
42 HRESULT WINAPI OleInitialize(LPVOID reserved)
44 HRESULT hr;
46 TRACE(ole, "(%p)\n", reserved);
49 * The first duty of the OleInitialize is to initialize the COM libraries.
51 hr = CoInitializeEx32(NULL, COINIT_APARTMENTTHREADED);
54 * If the CoInitializeEx call failed, the OLE libraries can't be
55 * initialized.
57 if (FAILED(hr))
58 return hr;
61 * Then, it has to initialize the OLE specific modules.
62 * This includes:
63 * Clipboard
64 * Drag and Drop
65 * Object linking and Embedding
66 * In-place activation
68 if (s_OLEModuleLockCount==0)
70 /*
71 * Initialize the libraries.
73 TRACE(ole, "() - Initializing the OLE libraries\n");
77 * Then, we increase the lock count on the OLE module.
79 s_OLEModuleLockCount++;
81 return hr;
84 /******************************************************************************
85 * CoGetCurrentProcess [COMPOBJ.34] [OLE2.2][OLE32.108]
87 * NOTES
88 * Is DWORD really the correct return type for this function?
90 DWORD WINAPI CoGetCurrentProcess(void) {
91 return (DWORD)PROCESS_Current();
94 /******************************************************************************
95 * OleUninitialize [OLE2.3] [OLE32.131]
97 void WINAPI OleUninitialize(void)
99 TRACE(ole, "()\n");
102 * Decrease the lock count on the OLE module.
104 s_OLEModuleLockCount--;
107 * If we hit the bottom of the lock stack, free the libraries.
109 if (s_OLEModuleLockCount==0)
112 * Actually free the libraries.
114 TRACE(ole, "() - Freeing the last reference count\n");
118 * Then, uninitialize the COM libraries.
120 CoUninitialize32();
123 /***********************************************************************
124 * OleFlushClipboard [OLE2.76]
126 HRESULT WINAPI OleFlushClipboard(void)
128 return S_OK;
131 /***********************************************************************
132 * OleSetClipboard [OLE32.127]
134 HRESULT WINAPI OleSetClipboard(LPVOID pDataObj)
136 FIXME(ole,"(%p), stub!\n", pDataObj);
137 return S_OK;
140 /******************************************************************************
141 * CoRegisterMessageFilter32 [OLE32.38]
143 HRESULT WINAPI CoRegisterMessageFilter32(
144 LPMESSAGEFILTER lpMessageFilter, /* Pointer to interface */
145 LPMESSAGEFILTER *lplpMessageFilter /* Indirect pointer to prior instance if non-NULL */
147 FIXME(ole,"stub\n");
148 if (lplpMessageFilter) {
149 *lplpMessageFilter = NULL;
151 return S_OK;
154 /******************************************************************************
155 * OleInitializeWOW [OLE32.109]
157 HRESULT WINAPI OleInitializeWOW(DWORD x) {
158 FIXME(ole,"(0x%08lx),stub!\n",x);
159 return 0;
162 /***********************************************************************
163 * RegisterDragDrop16 (OLE2.35)
165 HRESULT WINAPI RegisterDragDrop16(
166 HWND16 hwnd,
167 LPDROPTARGET pDropTarget
169 FIXME(ole,"(0x%04x,%p),stub!\n",hwnd,pDropTarget);
170 return S_OK;
173 /***********************************************************************
174 * RegisterDragDrop32 (OLE32.139)
176 HRESULT WINAPI RegisterDragDrop32(
177 HWND32 hwnd,
178 LPDROPTARGET pDropTarget
180 FIXME(ole,"(0x%04x,%p),stub!\n",hwnd,pDropTarget);
181 return S_OK;
184 /***********************************************************************
185 * RevokeDragDrop16 (OLE2.36)
187 HRESULT WINAPI RevokeDragDrop16(
188 HWND16 hwnd
190 FIXME(ole,"(0x%04x),stub!\n",hwnd);
191 return S_OK;
194 /***********************************************************************
195 * RevokeDragDrop32 (OLE32.141)
197 HRESULT WINAPI RevokeDragDrop32(
198 HWND32 hwnd
200 FIXME(ole,"(0x%04x),stub!\n",hwnd);
201 return S_OK;
204 /***********************************************************************
205 * OleRegGetUserType (OLE32.122)
207 HRESULT WINAPI OleRegGetUserType32(
208 REFCLSID clsid,
209 DWORD dwFormOfType,
210 LPOLESTR32* pszUserType)
212 FIXME(ole,",stub!\n");
213 return S_OK;
216 /***********************************************************************
217 * DoDragDrop32 [OLE32.65]
219 HRESULT WINAPI DoDragDrop32 (
220 IDataObject *pDataObject, /* ptr to the data obj */
221 IDataObject *pDropSource, /* ptr to the source obj */
222 DWORD dwOKEffect, /* effects allowed by the source */
223 DWORD *pdwEffect) /* ptr to effects of the source */
225 FIXME(ole,"(DataObject %p, DropSource %p): stub!\n", pDataObject, pDropSource);
226 return DRAGDROP_S_DROP;