15 #include "debugtools.h"
17 DEFAULT_DEBUG_CHANNEL(ole);
19 static WCHAR _delimiter[2] = {'!',0}; /* default delimiter apparently */
20 static WCHAR *pdelimiter = &_delimiter[0];
22 /***********************************************************************
23 * RegisterActiveObject
25 HRESULT WINAPI RegisterActiveObject(
26 LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister
30 LPRUNNINGOBJECTTABLE runobtable;
33 StringFromGUID2(rcid,guidbuf,39);
34 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
37 ret = GetRunningObjectTable(0,&runobtable);
39 IMoniker_Release(moniker);
42 ret = IRunningObjectTable_Register(runobtable,dwFlags,punk,moniker,pdwRegister);
43 IRunningObjectTable_Release(runobtable);
44 IMoniker_Release(moniker);
48 /***********************************************************************
51 HRESULT WINAPI RevokeActiveObject(DWORD xregister,LPVOID reserved)
53 LPRUNNINGOBJECTTABLE runobtable;
56 ret = GetRunningObjectTable(0,&runobtable);
57 if (FAILED(ret)) return ret;
58 ret = IRunningObjectTable_Revoke(runobtable,xregister);
59 if (SUCCEEDED(ret)) ret = S_OK;
60 IRunningObjectTable_Release(runobtable);
64 /***********************************************************************
67 HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
71 LPRUNNINGOBJECTTABLE runobtable;
74 StringFromGUID2(rcid,guidbuf,39);
75 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
78 ret = GetRunningObjectTable(0,&runobtable);
80 IMoniker_Release(moniker);
83 ret = IRunningObjectTable_GetObject(runobtable,moniker,ppunk);
84 IRunningObjectTable_Release(runobtable);
85 IMoniker_Release(moniker);
89 /***********************************************************************
90 * OaBuildVersion [OLEAUT32.170]
92 * known OLEAUT32.DLL versions:
93 * OLE 2.1 NT 1993-95 10 3023
95 * OLE 2.20 W95/NT 1993-96 20 4112
96 * OLE 2.20 W95/NT 1993-96 20 4118
97 * OLE 2.20 W95/NT 1993-96 20 4122
98 * OLE 2.30 W95/NT 1993-98 30 4265
99 * OLE 2.40 NT?? 1993-98 40 4267
100 * OLE 2.40 W98 SE orig. file 1993-98 40 4275
102 UINT WINAPI OaBuildVersion()
104 FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n");
105 switch(GetVersion() & 0x8000ffff) /* mask off build number */
107 case 0x80000a03: /* WIN31 */
108 return MAKELONG(4049, 20); /* from Win32s 1.1e */
109 case 0x80000004: /* WIN95 */
110 return MAKELONG(4265, 30);
111 case 0x80000a04: /* WIN98 */
112 return MAKELONG(4275, 40); /* value of W98 SE; orig. W98 AFAIK has 4265, 30 just as W95 */
113 case 0x00003303: /* NT351 */
114 return MAKELONG(4265, 30); /* value borrowed from Win95 */
115 case 0x00000004: /* NT40 */
116 return MAKELONG(4122, 20); /* ouch ! Quite old, I guess */
118 ERR("Version value not known yet. Please investigate it !\n");
123 /***********************************************************************
126 HRESULT WINAPI OLEAUT32_DllRegisterServer() {
131 /***********************************************************************
132 * DllUnregisterServer
134 HRESULT WINAPI OLEAUT32_DllUnregisterServer() {