rpcrt4: Make a variable static.
[wine] / dlls / olesvr32 / olesvr_main.c
1 /*
2  *      OLESVR library
3  *
4  *      Copyright 1995  Martin von Loewis
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 /*      At the moment, these are only empty stubs.
22  */
23
24 #include "config.h"
25
26 #include <stdarg.h>
27
28 #include "windef.h"
29 #include "winbase.h"
30 #include "wine/windef16.h"
31 #include "objbase.h"
32 #include "wine/debug.h"
33
34 WINE_DEFAULT_DEBUG_CHANNEL(ole);
35
36 typedef enum
37 {
38     OLE_OK,
39     OLE_WAIT_FOR_RELEASE,
40     OLE_BUSY,
41     OLE_ERROR_PROTECT_ONLY,
42     OLE_ERROR_MEMORY,
43     OLE_ERROR_STREAM,
44     OLE_ERROR_STATIC,
45     OLE_ERROR_BLANK,
46     OLE_ERROR_DRAW,
47     OLE_ERROR_METAFILE,
48     OLE_ERROR_ABORT,
49     OLE_ERROR_CLIPBOARD,
50     OLE_ERROR_FORMAT,
51     OLE_ERROR_OBJECT,
52     OLE_ERROR_OPTION,
53     OLE_ERROR_PROTOCOL,
54     OLE_ERROR_ADDRESS,
55     OLE_ERROR_NOT_EQUAL,
56     OLE_ERROR_HANDLE,
57     OLE_ERROR_GENERIC,
58     OLE_ERROR_CLASS,
59     OLE_ERROR_SYNTAX,
60     OLE_ERROR_DATATYPE,
61     OLE_ERROR_PALETTE,
62     OLE_ERROR_NOT_LINK,
63     OLE_ERROR_NOT_EMPTY,
64     OLE_ERROR_SIZE,
65     OLE_ERROR_DRIVE,
66     OLE_ERROR_NETWORK,
67     OLE_ERROR_NAME,
68     OLE_ERROR_TEMPLATE,
69     OLE_ERROR_NEW,
70     OLE_ERROR_EDIT,
71     OLE_ERROR_OPEN,
72     OLE_ERROR_NOT_OPEN,
73     OLE_ERROR_LAUNCH,
74     OLE_ERROR_COMM,
75     OLE_ERROR_TERMINATE,
76     OLE_ERROR_COMMAND,
77     OLE_ERROR_SHOW,
78     OLE_ERROR_DOVERB,
79     OLE_ERROR_ADVISE_NATIVE,
80     OLE_ERROR_ADVISE_PICT,
81     OLE_ERROR_ADVISE_RENAME,
82     OLE_ERROR_POKE_NATIVE,
83     OLE_ERROR_REQUEST_NATIVE,
84     OLE_ERROR_REQUEST_PICT,
85     OLE_ERROR_SERVER_BLOCKED,
86     OLE_ERROR_REGISTRATION,
87     OLE_ERROR_ALREADY_REGISTERED,
88     OLE_ERROR_TASK,
89     OLE_ERROR_OUTOFDATE,
90     OLE_ERROR_CANT_UPDATE_CLIENT,
91     OLE_ERROR_UPDATE,
92     OLE_ERROR_SETDATA_FORMAT,
93     OLE_ERROR_STATIC_FROM_OTHER_OS,
94     OLE_WARN_DELETE_DATA = 1000
95 } OLESTATUS;
96
97 typedef enum {
98     OLE_SERVER_MULTI,
99     OLE_SERVER_SINGLE
100 } OLE_SERVER_USE;
101
102 typedef LONG LHSERVER;
103 typedef LONG LHSERVERDOC;
104 typedef LPCSTR LPCOLESTR16;
105
106 typedef struct _OLESERVERDOC *LPOLESERVERDOC;
107
108 struct _OLESERVERDOCVTBL;
109 typedef struct _OLESERVERDOC
110 {
111     const struct _OLESERVERDOCVTBL *lpvtbl;
112     /* server provided state info */
113 } OLESERVERDOC;
114
115 typedef struct _OLESERVER *LPOLESERVER;
116 typedef struct _OLESERVERVTBL
117 {
118     OLESTATUS (CALLBACK *Open)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPOLESERVERDOC *);
119     OLESTATUS (CALLBACK *Create)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC*);
120     OLESTATUS (CALLBACK *CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
121     OLESTATUS (CALLBACK *Edit)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
122     OLESTATUS (CALLBACK *Exit)(LPOLESERVER);
123     OLESTATUS (CALLBACK *Release)(LPOLESERVER);
124     OLESTATUS (CALLBACK *Execute)(LPOLESERVER);
125 } OLESERVERVTBL, *LPOLESERVERVTBL;
126
127 typedef struct _OLESERVER
128 {
129     const OLESERVERVTBL *lpvtbl;
130     /* server specific data */
131 } OLESERVER;
132
133 static LONG OLE_current_handle;
134
135 /******************************************************************************
136  *              OleRegisterServer       [OLESVR.2]
137  */
138 OLESTATUS WINAPI OleRegisterServer16( LPCSTR name, LPOLESERVER serverStruct,
139                                       LHSERVER *hRet, HINSTANCE16 hServer,
140                                       OLE_SERVER_USE use )
141 {
142     FIXME("(%s,...): stub\n",name);
143     *hRet=++OLE_current_handle;
144     /* return OLE_ERROR_MEMORY, OLE_ERROR_PROTECT_ONLY if you want it fail*/
145     return OLE_OK;
146 }
147
148 /******************************************************************************
149  *              OleBlockServer  [OLESVR.4]
150  */
151 OLESTATUS WINAPI OleBlockServer16(LHSERVER hServer)
152 {
153     FIXME("(%d): stub\n",hServer);
154     return OLE_OK;
155 }
156
157 /******************************************************************************
158  *              OleBlockServer  [OLESVR32.4]
159  */
160 OLESTATUS WINAPI OleBlockServer(LHSERVER hServer)
161 {
162     FIXME("(%d): stub\n",hServer);
163     return OLE_OK;
164 }
165
166 /******************************************************************************
167  *              OleUnblockServer        [OLESVR.5]
168  */
169 OLESTATUS WINAPI OleUnblockServer16(LHSERVER hServer, BOOL16 *block)
170 {
171     FIXME("(%d): stub\n",hServer);
172     /* no more blocked messages :) */
173     *block=FALSE;
174     return OLE_OK;
175 }
176
177 /******************************************************************************
178  *              OleUnblockServer        [OLESVR32.5]
179  */
180 OLESTATUS WINAPI OleUnblockServer(LHSERVER hServer, BOOL *block)
181 {
182     FIXME("(%d): stub\n",hServer);
183     /* no more blocked messages :) */
184     *block=FALSE;
185     return OLE_OK;
186 }
187
188 /***********************************************************************
189  *              OleRegisterServerDoc    [OLESVR.6]
190  */
191 OLESTATUS WINAPI OleRegisterServerDoc16( LHSERVER hServer, LPCSTR docname,
192                                          LPOLESERVERDOC document,
193                                          LHSERVERDOC *hRet)
194 {
195     FIXME("(%d,%s): stub\n",hServer, docname);
196     *hRet=++OLE_current_handle;
197     return OLE_OK;
198 }
199
200 /******************************************************************************
201  *              OleRevokeServerDoc      [OLESVR.7]
202  */
203 OLESTATUS WINAPI OleRevokeServerDoc16(LHSERVERDOC hServerDoc)
204 {
205     FIXME("%d  - stub\n",hServerDoc);
206     return OLE_OK;
207 }
208
209 /******************************************************************************
210  *              OleRevokeServerDoc      [OLESVR32.7]
211  */
212 OLESTATUS WINAPI OleRevokeServerDoc(LHSERVERDOC hServerDoc)
213 {
214     FIXME("(%d): stub\n",hServerDoc);
215     return OLE_OK;
216 }
217
218 /******************************************************************************
219  *              OleRevokeServer [OLESVR.3]
220  */
221 OLESTATUS WINAPI OleRevokeServer16(LHSERVER hServer)
222 {
223     FIXME("%d - stub\n",hServer);
224     return OLE_OK;
225 }
226
227 /******************************************************************************
228  * OleRegisterServer [OLESVR32.2]
229  */
230 OLESTATUS WINAPI OleRegisterServer(LPCSTR svrname,LPOLESERVER olesvr,LHSERVER* hRet,HINSTANCE hinst,OLE_SERVER_USE osu) {
231         FIXME("(%s,%p,%p,%p,%d): stub!\n",svrname,olesvr,hRet,hinst,osu);
232         *hRet=++OLE_current_handle;
233         return OLE_OK;
234 }
235
236 /******************************************************************************
237  * OleRegisterServerDoc [OLESVR32.6]
238  */
239 OLESTATUS WINAPI OleRegisterServerDoc( LHSERVER hServer, LPCSTR docname,
240                                          LPOLESERVERDOC document,
241                                          LHSERVERDOC *hRet)
242 {
243     FIXME("(%d,%s): stub\n", hServer, docname);
244     *hRet=++OLE_current_handle;
245     return OLE_OK;
246 }
247
248 /******************************************************************************
249  *              OleRenameServerDoc      [OLESVR.8]
250  *
251  */
252 OLESTATUS WINAPI OleRenameServerDoc16(LHSERVERDOC hDoc, LPCSTR newName)
253 {
254     FIXME("(%d,%s): stub.\n", hDoc, newName);
255     return OLE_OK;
256 }
257
258 /******************************************************************************
259  *              OleRenameServerDoc      [OLESVR32.8]
260  *
261  */
262 OLESTATUS WINAPI OleRenameServerDoc(LHSERVERDOC hDoc, LPCSTR newName)
263 {
264     FIXME("(%d,%s): stub.\n",hDoc, newName);
265     return OLE_OK;
266 }
267
268 /******************************************************************************
269  *              OleRevertServerDoc      [OLESVR.9]
270  *
271  */
272 OLESTATUS WINAPI OleRevertServerDoc16(LHSERVERDOC hDoc)
273 {
274     FIXME("(%d): stub.\n", hDoc);
275     return OLE_OK;
276 }
277
278 /******************************************************************************
279  *              OleRevertServerDoc      [OLESVR32.9]
280  *
281  */
282 OLESTATUS WINAPI OleRevertServerDoc(LHSERVERDOC hDoc)
283 {
284     FIXME("(%d): stub.\n", hDoc);
285     return OLE_OK;
286 }
287
288 /******************************************************************************
289  *              OleSavedServerDoc       [OLESVR.10]
290  *
291  */
292 OLESTATUS WINAPI OleSavedServerDoc16(LHSERVERDOC hDoc)
293 {
294     FIXME("(%d): stub.\n", hDoc);
295     return OLE_OK;
296 }
297
298 /******************************************************************************
299  *              OleSavedServerDoc       [OLESVR32.10]
300  *
301  */
302 OLESTATUS WINAPI OleSavedServerDoc(LHSERVERDOC hDoc)
303 {
304     FIXME("(%d): stub.\n", hDoc);
305     return OLE_OK;
306 }