1999-09-10 15:52:12 +02:00
|
|
|
/*
|
|
|
|
* OLEAUT32
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <string.h>
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "wingdi.h"
|
1999-09-10 15:52:12 +02:00
|
|
|
#include "winuser.h"
|
|
|
|
#include "winerror.h"
|
2000-08-03 06:22:35 +02:00
|
|
|
|
1999-09-10 15:52:12 +02:00
|
|
|
#include "heap.h"
|
|
|
|
#include "ldt.h"
|
|
|
|
#include "debugtools.h"
|
|
|
|
|
2000-08-03 06:22:35 +02:00
|
|
|
#include "initguid.h"
|
|
|
|
#include "oleauto.h"
|
|
|
|
#include "olectl.h"
|
|
|
|
|
2000-01-23 04:15:25 +01:00
|
|
|
DEFAULT_DEBUG_CHANNEL(ole);
|
|
|
|
|
|
|
|
static WCHAR _delimiter[2] = {'!',0}; /* default delimiter apparently */
|
|
|
|
static WCHAR *pdelimiter = &_delimiter[0];
|
1999-09-10 15:52:12 +02:00
|
|
|
|
2000-03-24 21:46:04 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* RegisterActiveObject
|
|
|
|
*/
|
1999-10-13 14:19:09 +02:00
|
|
|
HRESULT WINAPI RegisterActiveObject(
|
|
|
|
LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister
|
|
|
|
) {
|
2000-01-23 04:15:25 +01:00
|
|
|
WCHAR guidbuf[80];
|
|
|
|
HRESULT ret;
|
|
|
|
LPRUNNINGOBJECTTABLE runobtable;
|
|
|
|
LPMONIKER moniker;
|
|
|
|
|
|
|
|
StringFromGUID2(rcid,guidbuf,39);
|
|
|
|
ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
|
|
|
|
if (FAILED(ret))
|
|
|
|
return ret;
|
|
|
|
ret = GetRunningObjectTable(0,&runobtable);
|
|
|
|
if (FAILED(ret)) {
|
|
|
|
IMoniker_Release(moniker);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
ret = IRunningObjectTable_Register(runobtable,dwFlags,punk,moniker,pdwRegister);
|
|
|
|
IRunningObjectTable_Release(runobtable);
|
|
|
|
IMoniker_Release(moniker);
|
|
|
|
return ret;
|
1999-10-13 14:19:09 +02:00
|
|
|
}
|
|
|
|
|
2000-03-24 21:46:04 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* RevokeActiveObject
|
|
|
|
*/
|
1999-10-13 14:19:09 +02:00
|
|
|
HRESULT WINAPI RevokeActiveObject(DWORD xregister,LPVOID reserved)
|
1999-09-10 15:52:12 +02:00
|
|
|
{
|
2000-01-23 04:15:25 +01:00
|
|
|
LPRUNNINGOBJECTTABLE runobtable;
|
|
|
|
HRESULT ret;
|
|
|
|
|
|
|
|
ret = GetRunningObjectTable(0,&runobtable);
|
|
|
|
if (FAILED(ret)) return ret;
|
|
|
|
ret = IRunningObjectTable_Revoke(runobtable,xregister);
|
|
|
|
if (SUCCEEDED(ret)) ret = S_OK;
|
|
|
|
IRunningObjectTable_Release(runobtable);
|
|
|
|
return ret;
|
1999-10-13 14:19:09 +02:00
|
|
|
}
|
|
|
|
|
2000-03-24 21:46:04 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* GetActiveObject
|
|
|
|
*/
|
1999-10-13 14:19:09 +02:00
|
|
|
HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
|
|
|
|
{
|
2000-01-23 04:15:25 +01:00
|
|
|
WCHAR guidbuf[80];
|
|
|
|
HRESULT ret;
|
|
|
|
LPRUNNINGOBJECTTABLE runobtable;
|
|
|
|
LPMONIKER moniker;
|
|
|
|
|
|
|
|
StringFromGUID2(rcid,guidbuf,39);
|
|
|
|
ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
|
|
|
|
if (FAILED(ret))
|
|
|
|
return ret;
|
|
|
|
ret = GetRunningObjectTable(0,&runobtable);
|
|
|
|
if (FAILED(ret)) {
|
|
|
|
IMoniker_Release(moniker);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
ret = IRunningObjectTable_GetObject(runobtable,moniker,ppunk);
|
|
|
|
IRunningObjectTable_Release(runobtable);
|
|
|
|
IMoniker_Release(moniker);
|
|
|
|
return ret;
|
1999-09-10 15:52:12 +02:00
|
|
|
}
|
1999-12-06 00:52:56 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* OaBuildVersion [OLEAUT32.170]
|
|
|
|
*
|
|
|
|
* known OLEAUT32.DLL versions:
|
|
|
|
* OLE 2.1 NT 1993-95 10 3023
|
|
|
|
* OLE 2.1 10 3027
|
|
|
|
* OLE 2.20 W95/NT 1993-96 20 4112
|
|
|
|
* OLE 2.20 W95/NT 1993-96 20 4118
|
|
|
|
* OLE 2.20 W95/NT 1993-96 20 4122
|
|
|
|
* OLE 2.30 W95/NT 1993-98 30 4265
|
|
|
|
* OLE 2.40 NT?? 1993-98 40 4267
|
|
|
|
* OLE 2.40 W98 SE orig. file 1993-98 40 4275
|
|
|
|
*/
|
|
|
|
UINT WINAPI OaBuildVersion()
|
|
|
|
{
|
|
|
|
FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n");
|
2000-08-14 16:35:01 +02:00
|
|
|
switch(GetVersion() & 0x8000ffff) /* mask off build number */
|
1999-12-06 00:52:56 +01:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
case 0x80000a03: /* WIN31 */
|
1999-12-06 00:52:56 +01:00
|
|
|
return MAKELONG(4049, 20); /* from Win32s 1.1e */
|
2000-08-14 16:35:01 +02:00
|
|
|
case 0x80000004: /* WIN95 */
|
1999-12-06 00:52:56 +01:00
|
|
|
return MAKELONG(4265, 30);
|
2000-08-14 16:35:01 +02:00
|
|
|
case 0x80000a04: /* WIN98 */
|
1999-12-06 00:52:56 +01:00
|
|
|
return MAKELONG(4275, 40); /* value of W98 SE; orig. W98 AFAIK has 4265, 30 just as W95 */
|
2000-08-14 16:35:01 +02:00
|
|
|
case 0x00003303: /* NT351 */
|
1999-12-06 00:52:56 +01:00
|
|
|
return MAKELONG(4265, 30); /* value borrowed from Win95 */
|
2000-08-14 16:35:01 +02:00
|
|
|
case 0x00000004: /* NT40 */
|
1999-12-06 00:52:56 +01:00
|
|
|
return MAKELONG(4122, 20); /* ouch ! Quite old, I guess */
|
2000-08-14 16:35:01 +02:00
|
|
|
default:
|
1999-12-06 00:52:56 +01:00
|
|
|
ERR("Version value not known yet. Please investigate it !\n");
|
|
|
|
return 0x0;
|
|
|
|
}
|
|
|
|
}
|
2000-03-26 15:36:40 +02:00
|
|
|
|
2000-03-28 22:22:59 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* DllRegisterServer
|
|
|
|
*/
|
2000-03-26 15:36:40 +02:00
|
|
|
HRESULT WINAPI OLEAUT32_DllRegisterServer() {
|
|
|
|
FIXME("stub!\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
2000-03-28 22:22:59 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllUnregisterServer
|
|
|
|
*/
|
2000-03-26 15:36:40 +02:00
|
|
|
HRESULT WINAPI OLEAUT32_DllUnregisterServer() {
|
|
|
|
FIXME("stub!\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|