10 #include "winversion.h"
12 #include "wine/obj_base.h"
13 #include "wine/obj_moniker.h"
16 #include "debugtools.h"
18 DEFAULT_DEBUG_CHANNEL(ole);
20 static WCHAR _delimiter[2] = {'!',0}; /* default delimiter apparently */
21 static WCHAR *pdelimiter = &_delimiter[0];
23 HRESULT WINAPI RegisterActiveObject(
24 LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister
28 LPRUNNINGOBJECTTABLE runobtable;
31 StringFromGUID2(rcid,guidbuf,39);
32 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
35 ret = GetRunningObjectTable(0,&runobtable);
37 IMoniker_Release(moniker);
40 ret = IRunningObjectTable_Register(runobtable,dwFlags,punk,moniker,pdwRegister);
41 IRunningObjectTable_Release(runobtable);
42 IMoniker_Release(moniker);
46 HRESULT WINAPI RevokeActiveObject(DWORD xregister,LPVOID reserved)
48 LPRUNNINGOBJECTTABLE runobtable;
51 ret = GetRunningObjectTable(0,&runobtable);
52 if (FAILED(ret)) return ret;
53 ret = IRunningObjectTable_Revoke(runobtable,xregister);
54 if (SUCCEEDED(ret)) ret = S_OK;
55 IRunningObjectTable_Release(runobtable);
59 HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
63 LPRUNNINGOBJECTTABLE runobtable;
66 StringFromGUID2(rcid,guidbuf,39);
67 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
70 ret = GetRunningObjectTable(0,&runobtable);
72 IMoniker_Release(moniker);
75 ret = IRunningObjectTable_GetObject(runobtable,moniker,ppunk);
76 IRunningObjectTable_Release(runobtable);
77 IMoniker_Release(moniker);
81 /***********************************************************************
82 * OaBuildVersion [OLEAUT32.170]
84 * known OLEAUT32.DLL versions:
85 * OLE 2.1 NT 1993-95 10 3023
87 * OLE 2.20 W95/NT 1993-96 20 4112
88 * OLE 2.20 W95/NT 1993-96 20 4118
89 * OLE 2.20 W95/NT 1993-96 20 4122
90 * OLE 2.30 W95/NT 1993-98 30 4265
91 * OLE 2.40 NT?? 1993-98 40 4267
92 * OLE 2.40 W98 SE orig. file 1993-98 40 4275
94 UINT WINAPI OaBuildVersion()
96 FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n");
97 switch(VERSION_GetVersion())
100 return MAKELONG(4049, 20); /* from Win32s 1.1e */
102 return MAKELONG(4265, 30);
104 return MAKELONG(4275, 40); /* value of W98 SE; orig. W98 AFAIK has 4265, 30 just as W95 */
106 return MAKELONG(4265, 30); /* value borrowed from Win95 */
108 return MAKELONG(4122, 20); /* ouch ! Quite old, I guess */
110 ERR("Version value not known yet. Please investigate it !\n");