4 * Copyright 1999, 2000 Marcus Meissner
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #include "wine/obj_oleaut.h"
32 #include "wine/obj_olefont.h"
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(ole);
40 static WCHAR _delimiter[2] = {'!',0}; /* default delimiter apparently */
41 static WCHAR *pdelimiter = &_delimiter[0];
43 /***********************************************************************
44 * RegisterActiveObject (OLEAUT32.33)
46 HRESULT WINAPI RegisterActiveObject(
47 LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister
51 LPRUNNINGOBJECTTABLE runobtable;
54 StringFromGUID2(rcid,guidbuf,39);
55 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
58 ret = GetRunningObjectTable(0,&runobtable);
60 IMoniker_Release(moniker);
63 ret = IRunningObjectTable_Register(runobtable,dwFlags,punk,moniker,pdwRegister);
64 IRunningObjectTable_Release(runobtable);
65 IMoniker_Release(moniker);
69 /***********************************************************************
70 * RevokeActiveObject (OLEAUT32.34)
72 HRESULT WINAPI RevokeActiveObject(DWORD xregister,LPVOID reserved)
74 LPRUNNINGOBJECTTABLE runobtable;
77 ret = GetRunningObjectTable(0,&runobtable);
78 if (FAILED(ret)) return ret;
79 ret = IRunningObjectTable_Revoke(runobtable,xregister);
80 if (SUCCEEDED(ret)) ret = S_OK;
81 IRunningObjectTable_Release(runobtable);
85 /***********************************************************************
86 * GetActiveObject (OLEAUT32.35)
88 HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
92 LPRUNNINGOBJECTTABLE runobtable;
95 StringFromGUID2(rcid,guidbuf,39);
96 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
99 ret = GetRunningObjectTable(0,&runobtable);
101 IMoniker_Release(moniker);
104 ret = IRunningObjectTable_GetObject(runobtable,moniker,ppunk);
105 IRunningObjectTable_Release(runobtable);
106 IMoniker_Release(moniker);
111 /***********************************************************************
112 * OaBuildVersion [OLEAUT32.170]
114 * known OLEAUT32.DLL versions:
115 * OLE 2.1 NT 1993-95 10 3023
117 * Win32s 1.1e 20 4049
118 * OLE 2.20 W95/NT 1993-96 20 4112
119 * OLE 2.20 W95/NT 1993-96 20 4118
120 * OLE 2.20 W95/NT 1993-96 20 4122
121 * OLE 2.30 W95/NT 1993-98 30 4265
122 * OLE 2.40 NT?? 1993-98 40 4267
123 * OLE 2.40 W98 SE orig. file 1993-98 40 4275
124 * OLE 2.40 W2K orig. file 1993-XX 40 4514
126 * I just decided to use version 2.20 for Win3.1, 2.30 for Win95 & NT 3.51,
127 * and 2.40 for all newer OSs. The build number is maximum, i.e. 0xffff.
129 UINT WINAPI OaBuildVersion()
131 switch(GetVersion() & 0x8000ffff) /* mask off build number */
133 case 0x80000a03: /* WIN31 */
134 return MAKELONG(0xffff, 20);
135 case 0x00003303: /* NT351 */
136 return MAKELONG(0xffff, 30);
137 case 0x80000004: /* WIN95; I'd like to use the "standard" w95 minor
138 version here (30), but as we still use w95
139 as default winver (which is good IMHO), I better
140 play safe and use the latest value for w95 for now.
141 Change this as soon as default winver gets changed
142 to something more recent */
143 case 0x80000a04: /* WIN98 */
144 case 0x00000004: /* NT40 */
145 case 0x00000005: /* W2K */
146 return MAKELONG(0xffff, 40);
148 ERR("Version value not known yet. Please investigate it !\n");
153 /***********************************************************************
154 * DllRegisterServer (OLEAUT32.320)
156 HRESULT WINAPI OLEAUT32_DllRegisterServer() {
161 /***********************************************************************
162 * DllUnregisterServer (OLEAUT32.321)
164 HRESULT WINAPI OLEAUT32_DllUnregisterServer() {
169 extern void _get_STDFONT_CF(LPVOID);
171 /***********************************************************************
172 * DllGetClassObject (OLEAUT32.1)
174 HRESULT WINAPI OLEAUT32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
177 if (IsEqualGUID(rclsid,&CLSID_StdFont)) {
178 if (IsEqualGUID(iid,&IID_IClassFactory)) {
179 _get_STDFONT_CF(ppv);
180 IClassFactory_AddRef((IClassFactory*)*ppv);
184 if (IsEqualGUID(rclsid,&CLSID_PSOAInterface)) {
185 if (S_OK==TypeLibFac_DllGetClassObject(rclsid,iid,ppv))
189 FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
190 return CLASS_E_CLASSNOTAVAILABLE;
193 /***********************************************************************
194 * DllCanUnloadNow (OLEAUT32.410)
196 HRESULT WINAPI OLEAUT32_DllCanUnloadNow() {
197 FIXME("(), stub!\n");