source: trunk/src/oleaut32/oleaut.c@ 6648

Last change on this file since 6648 was 6648, checked in by bird, 24 years ago

Added $Id:$ keyword.

File size: 4.7 KB
Line 
1/* $Id: oleaut.c,v 1.2 2001-09-05 13:19:00 bird Exp $ */
2/*
3 * OLEAUT32
4 *
5 */
6#include <string.h>
7
8#include "windef.h"
9#include "winbase.h"
10#include "wingdi.h"
11#include "winuser.h"
12#include "winerror.h"
13
14#include "ole2.h"
15#include "heap.h"
16#include "debugtools.h"
17
18DEFAULT_DEBUG_CHANNEL(ole);
19
20static WCHAR _delimiter[2] = {'!',0}; /* default delimiter apparently */
21static WCHAR *pdelimiter = &_delimiter[0];
22
23/***********************************************************************
24 * RegisterActiveObject (OLEAUT32.33)
25 */
26HRESULT WINAPI RegisterActiveObject(
27 LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister
28) {
29 WCHAR guidbuf[80];
30 HRESULT ret;
31 LPRUNNINGOBJECTTABLE runobtable;
32 LPMONIKER moniker;
33
34 StringFromGUID2(rcid,guidbuf,39);
35#ifdef __WIN32OS2__
36 dprintf(("RegisterActiveObject %x %ls (%x) %x %x", punk, guidbuf, rcid, dwFlags, pdwRegister));
37#endif
38 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
39 if (FAILED(ret))
40 return ret;
41 ret = GetRunningObjectTable(0,&runobtable);
42 if (FAILED(ret)) {
43 IMoniker_Release(moniker);
44 return ret;
45 }
46 ret = IRunningObjectTable_Register(runobtable,dwFlags,punk,moniker,pdwRegister);
47 IRunningObjectTable_Release(runobtable);
48 IMoniker_Release(moniker);
49 return ret;
50}
51
52/***********************************************************************
53 * RevokeActiveObject (OLEAUT32.34)
54 */
55HRESULT WINAPI RevokeActiveObject(DWORD xregister,LPVOID reserved)
56{
57 LPRUNNINGOBJECTTABLE runobtable;
58 HRESULT ret;
59
60#ifdef __WIN32OS2__
61 dprintf(("RevokeActiveObject %x %x", xregister, reserved));
62#endif
63
64 ret = GetRunningObjectTable(0,&runobtable);
65 if (FAILED(ret)) return ret;
66 ret = IRunningObjectTable_Revoke(runobtable,xregister);
67 if (SUCCEEDED(ret)) ret = S_OK;
68 IRunningObjectTable_Release(runobtable);
69 return ret;
70}
71
72/***********************************************************************
73 * GetActiveObject (OLEAUT32.35)
74 */
75HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
76{
77 WCHAR guidbuf[80];
78 HRESULT ret;
79 LPRUNNINGOBJECTTABLE runobtable;
80 LPMONIKER moniker;
81
82 StringFromGUID2(rcid,guidbuf,39);
83#ifdef __WIN32OS2__
84 dprintf(("GetActiveObject %ls (%x) %x %x", guidbuf, rcid, preserved, ppunk));
85#endif
86 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
87 if (FAILED(ret))
88 return ret;
89 ret = GetRunningObjectTable(0,&runobtable);
90 if (FAILED(ret)) {
91 IMoniker_Release(moniker);
92 return ret;
93 }
94 ret = IRunningObjectTable_GetObject(runobtable,moniker,ppunk);
95 IRunningObjectTable_Release(runobtable);
96 IMoniker_Release(moniker);
97 return ret;
98}
99
100/***********************************************************************
101 * OaBuildVersion [OLEAUT32.170]
102 *
103 * known OLEAUT32.DLL versions:
104 * OLE 2.1 NT 1993-95 10 3023
105 * OLE 2.1 10 3027
106 * OLE 2.20 W95/NT 1993-96 20 4112
107 * OLE 2.20 W95/NT 1993-96 20 4118
108 * OLE 2.20 W95/NT 1993-96 20 4122
109 * OLE 2.30 W95/NT 1993-98 30 4265
110 * OLE 2.40 NT?? 1993-98 40 4267
111 * OLE 2.40 W98 SE orig. file 1993-98 40 4275
112 */
113UINT WINAPI OaBuildVersion()
114{
115#ifdef __WIN32OS2__
116 dprintf(("OaBuildVersion %x", GetVersion() & 0x8000ffff));
117#else
118 FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n");
119#endif
120 switch(GetVersion() & 0x8000ffff) /* mask off build number */
121 {
122 case 0x80000a03: /* WIN31 */
123 return MAKELONG(4049, 20); /* from Win32s 1.1e */
124 case 0x80000004: /* WIN95 */
125 return MAKELONG(4265, 30);
126 case 0x80000a04: /* WIN98 */
127 return MAKELONG(4275, 40); /* value of W98 SE; orig. W98 AFAIK has 4265, 30 just as W95 */
128 case 0x00003303: /* NT351 */
129 return MAKELONG(4265, 30); /* value borrowed from Win95 */
130 case 0x00000004: /* NT40 */
131#ifdef __WIN32OS2__
132 return 0x2810b5; //returned by NT4, SP6
133#else
134 return MAKELONG(4122, 20); /* ouch ! Quite old, I guess */
135#endif
136 default:
137 ERR("Version value not known yet. Please investigate it !\n");
138 return 0x0;
139 }
140}
141
142#ifndef __WIN32OS2__
143/***********************************************************************
144 * DllRegisterServer
145 */
146HRESULT WINAPI OLEAUT32_DllRegisterServer() {
147 FIXME("stub!\n");
148 return S_OK;
149}
150
151/***********************************************************************
152 * DllUnregisterServer
153 */
154HRESULT WINAPI OLEAUT32_DllUnregisterServer() {
155 FIXME("stub!\n");
156 return S_OK;
157}
158#endif //__WIN32OS2__
Note: See TracBrowser for help on using the repository browser.