15 #include "wine/obj_oleaut.h"
16 #include "wine/obj_olefont.h"
20 #include "debugtools.h"
22 DEFAULT_DEBUG_CHANNEL(ole);
24 static WCHAR _delimiter[2] = {'!',0}; /* default delimiter apparently */
25 static WCHAR *pdelimiter = &_delimiter[0];
27 /***********************************************************************
28 * RegisterActiveObject (OLEAUT32.33)
30 HRESULT WINAPI RegisterActiveObject(
31 LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister
35 LPRUNNINGOBJECTTABLE runobtable;
38 StringFromGUID2(rcid,guidbuf,39);
39 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
42 ret = GetRunningObjectTable(0,&runobtable);
44 IMoniker_Release(moniker);
47 ret = IRunningObjectTable_Register(runobtable,dwFlags,punk,moniker,pdwRegister);
48 IRunningObjectTable_Release(runobtable);
49 IMoniker_Release(moniker);
53 /***********************************************************************
54 * RevokeActiveObject (OLEAUT32.34)
56 HRESULT WINAPI RevokeActiveObject(DWORD xregister,LPVOID reserved)
58 LPRUNNINGOBJECTTABLE runobtable;
61 ret = GetRunningObjectTable(0,&runobtable);
62 if (FAILED(ret)) return ret;
63 ret = IRunningObjectTable_Revoke(runobtable,xregister);
64 if (SUCCEEDED(ret)) ret = S_OK;
65 IRunningObjectTable_Release(runobtable);
69 /***********************************************************************
70 * GetActiveObject (OLEAUT32.35)
72 HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
76 LPRUNNINGOBJECTTABLE runobtable;
79 StringFromGUID2(rcid,guidbuf,39);
80 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
83 ret = GetRunningObjectTable(0,&runobtable);
85 IMoniker_Release(moniker);
88 ret = IRunningObjectTable_GetObject(runobtable,moniker,ppunk);
89 IRunningObjectTable_Release(runobtable);
90 IMoniker_Release(moniker);
95 /***********************************************************************
96 * OaBuildVersion [OLEAUT32.170]
98 * known OLEAUT32.DLL versions:
99 * OLE 2.1 NT 1993-95 10 3023
101 * Win32s 1.1e 20 4049
102 * OLE 2.20 W95/NT 1993-96 20 4112
103 * OLE 2.20 W95/NT 1993-96 20 4118
104 * OLE 2.20 W95/NT 1993-96 20 4122
105 * OLE 2.30 W95/NT 1993-98 30 4265
106 * OLE 2.40 NT?? 1993-98 40 4267
107 * OLE 2.40 W98 SE orig. file 1993-98 40 4275
108 * OLE 2.40 W2K orig. file 1993-XX 40 4514
110 * I just decided to use version 2.20 for Win3.1, 2.30 for Win95 & NT 3.51,
111 * and 2.40 for all newer OSs. The build number is maximum, i.e. 0xffff.
113 UINT WINAPI OaBuildVersion()
115 switch(GetVersion() & 0x8000ffff) /* mask off build number */
117 case 0x80000a03: /* WIN31 */
118 return MAKELONG(0xffff, 20);
119 case 0x00003303: /* NT351 */
120 return MAKELONG(0xffff, 30);
121 case 0x80000004: /* WIN95; I'd like to use the "standard" w95 minor
122 version here (30), but as we still use w95
123 as default winver (which is good IMHO), I better
124 play safe and use the latest value for w95 for now.
125 Change this as soon as default winver gets changed
126 to something more recent */
127 case 0x80000a04: /* WIN98 */
128 case 0x00000004: /* NT40 */
129 case 0x00000005: /* W2K */
130 return MAKELONG(0xffff, 40);
132 ERR("Version value not known yet. Please investigate it !\n");
137 /***********************************************************************
138 * DllRegisterServer (OLEAUT32.320)
140 HRESULT WINAPI OLEAUT32_DllRegisterServer() {
145 /***********************************************************************
146 * DllUnregisterServer (OLEAUT32.321)
148 HRESULT WINAPI OLEAUT32_DllUnregisterServer() {
153 extern void _get_STDFONT_CF(LPVOID);
155 /***********************************************************************
156 * DllGetClassObject (OLEAUT32.1)
158 HRESULT WINAPI OLEAUT32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
161 if (IsEqualGUID(rclsid,&CLSID_StdFont)) {
162 if (IsEqualGUID(iid,&IID_IClassFactory)) {
163 _get_STDFONT_CF(ppv);
164 IClassFactory_AddRef((IClassFactory*)*ppv);
168 if (IsEqualGUID(rclsid,&CLSID_PSOAInterface)) {
169 if (S_OK==TypeLibFac_DllGetClassObject(rclsid,iid,ppv))
173 FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
174 return CLASS_E_CLASSNOTAVAILABLE;
177 /***********************************************************************
178 * DllCanUnloadNow (OLEAUT32.410)
180 HRESULT WINAPI OLEAUT32_DllCanUnloadNow() {
181 FIXME("(), stub!\n");