15 #include "wine/obj_oleaut.h"
16 #include "wine/obj_olefont.h"
17 #include "debugtools.h"
19 DEFAULT_DEBUG_CHANNEL(ole);
21 static WCHAR _delimiter[2] = {'!',0}; /* default delimiter apparently */
22 static WCHAR *pdelimiter = &_delimiter[0];
24 /***********************************************************************
25 * RegisterActiveObject (OLEAUT32.33)
27 HRESULT WINAPI RegisterActiveObject(
28 LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister
32 LPRUNNINGOBJECTTABLE runobtable;
35 StringFromGUID2(rcid,guidbuf,39);
36 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
39 ret = GetRunningObjectTable(0,&runobtable);
41 IMoniker_Release(moniker);
44 ret = IRunningObjectTable_Register(runobtable,dwFlags,punk,moniker,pdwRegister);
45 IRunningObjectTable_Release(runobtable);
46 IMoniker_Release(moniker);
50 /***********************************************************************
51 * RevokeActiveObject (OLEAUT32.34)
53 HRESULT WINAPI RevokeActiveObject(DWORD xregister,LPVOID reserved)
55 LPRUNNINGOBJECTTABLE runobtable;
58 ret = GetRunningObjectTable(0,&runobtable);
59 if (FAILED(ret)) return ret;
60 ret = IRunningObjectTable_Revoke(runobtable,xregister);
61 if (SUCCEEDED(ret)) ret = S_OK;
62 IRunningObjectTable_Release(runobtable);
66 /***********************************************************************
67 * GetActiveObject (OLEAUT32.35)
69 HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
73 LPRUNNINGOBJECTTABLE runobtable;
76 StringFromGUID2(rcid,guidbuf,39);
77 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
80 ret = GetRunningObjectTable(0,&runobtable);
82 IMoniker_Release(moniker);
85 ret = IRunningObjectTable_GetObject(runobtable,moniker,ppunk);
86 IRunningObjectTable_Release(runobtable);
87 IMoniker_Release(moniker);
91 /***********************************************************************
92 * OaBuildVersion [OLEAUT32.170]
94 * known OLEAUT32.DLL versions:
95 * OLE 2.1 NT 1993-95 10 3023
97 * OLE 2.20 W95/NT 1993-96 20 4112
98 * OLE 2.20 W95/NT 1993-96 20 4118
99 * OLE 2.20 W95/NT 1993-96 20 4122
100 * OLE 2.30 W95/NT 1993-98 30 4265
101 * OLE 2.40 NT?? 1993-98 40 4267
102 * OLE 2.40 W98 SE orig. file 1993-98 40 4275
104 UINT WINAPI OaBuildVersion()
106 FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n");
107 switch(GetVersion() & 0x8000ffff) /* mask off build number */
109 case 0x80000a03: /* WIN31 */
110 return MAKELONG(4049, 20); /* from Win32s 1.1e */
111 case 0x80000004: /* WIN95 */
112 return MAKELONG(4265, 30);
113 case 0x80000a04: /* WIN98 */
114 return MAKELONG(4275, 40); /* value of W98 SE; orig. W98 AFAIK has 4265, 30 just as W95 */
115 case 0x00003303: /* NT351 */
116 return MAKELONG(4265, 30); /* value borrowed from Win95 */
117 case 0x00000004: /* NT40 */
118 return MAKELONG(4122, 20); /* ouch ! Quite old, I guess */
120 ERR("Version value not known yet. Please investigate it !\n");
125 /***********************************************************************
126 * DllRegisterServer (OLEAUT32.320)
128 HRESULT WINAPI OLEAUT32_DllRegisterServer() {
133 /***********************************************************************
134 * DllUnregisterServer (OLEAUT32.321)
136 HRESULT WINAPI OLEAUT32_DllUnregisterServer() {
141 extern void _get_STDFONT_CF(LPVOID);
143 /***********************************************************************
144 * DllGetClassObject (OLEAUT32.1)
146 HRESULT WINAPI OLEAUT32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
149 if (IsEqualGUID(rclsid,&CLSID_StdFont)) {
150 if (IsEqualGUID(iid,&IID_IClassFactory)) {
151 _get_STDFONT_CF(ppv);
152 IClassFactory_AddRef((IClassFactory*)*ppv);
156 FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
157 return CLASS_E_CLASSNOTAVAILABLE;
160 /***********************************************************************
161 * DllCanUnloadNow (OLEAUT32.410)
163 HRESULT WINAPI OLEAUT32_DllCanUnloadNow() {
164 FIXME("(), stub!\n");