1 | /* $Id: dde.cpp,v 1.12 2001-04-04 09:01:24 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Win32 default window API functions for OS/2
|
---|
5 | *
|
---|
6 | * Copyright 1998 Sander van Leeuwen
|
---|
7 | *
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | *
|
---|
11 | */
|
---|
12 | #include <os2win.h>
|
---|
13 | #include <misc.h>
|
---|
14 | #include <unicode.h>
|
---|
15 |
|
---|
16 | #define DBG_LOCALLOG DBG_dde
|
---|
17 | #include "dbglocal.h"
|
---|
18 |
|
---|
19 | //******************************************************************************
|
---|
20 | //******************************************************************************
|
---|
21 | BOOL WIN32API DdeAbandonTransaction( DWORD arg1, HCONV arg2, DWORD arg3)
|
---|
22 | {
|
---|
23 | dprintf(("USER32: DdeAbandonTransaction\n"));
|
---|
24 | return O32_DdeAbandonTransaction(arg1, arg2, arg3);
|
---|
25 | }
|
---|
26 | //******************************************************************************
|
---|
27 | //******************************************************************************
|
---|
28 | PBYTE WIN32API DdeAccessData(HDDEDATA arg1, PDWORD arg2)
|
---|
29 | {
|
---|
30 | dprintf(("USER32: DdeAccessData\n"));
|
---|
31 | return O32_DdeAccessData(arg1, arg2);
|
---|
32 | }
|
---|
33 | //******************************************************************************
|
---|
34 | //******************************************************************************
|
---|
35 | HDDEDATA WIN32API DdeAddData( HDDEDATA arg1, PVOID arg2, DWORD arg3, DWORD arg4)
|
---|
36 | {
|
---|
37 | dprintf(("USER32: DdeAddData"));
|
---|
38 | return O32_DdeAddData(arg1, arg2, arg3, arg4);
|
---|
39 | }
|
---|
40 | //******************************************************************************
|
---|
41 | //******************************************************************************
|
---|
42 | HDDEDATA WIN32API DdeClientTransaction(PVOID arg1, DWORD arg2, HCONV arg3,
|
---|
43 | HSZ arg4, UINT arg5, UINT arg6, DWORD arg7,
|
---|
44 | PDWORD arg8)
|
---|
45 | {
|
---|
46 | dprintf(("USER32: DdeClientTransaction\n"));
|
---|
47 |
|
---|
48 | return O32_DdeClientTransaction(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
|
---|
49 | }
|
---|
50 | //******************************************************************************
|
---|
51 | //******************************************************************************
|
---|
52 | int WIN32API DdeCmpStringHandles( HSZ arg1, HSZ arg2)
|
---|
53 | {
|
---|
54 |
|
---|
55 | dprintf(("USER32: DdeCmpStringHandles\n"));
|
---|
56 |
|
---|
57 | return O32_DdeCmpStringHandles(arg1, arg2);
|
---|
58 | }
|
---|
59 | //******************************************************************************
|
---|
60 | //******************************************************************************
|
---|
61 | HCONV WIN32API DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic,
|
---|
62 | LPCONVCONTEXT pCC)
|
---|
63 | {
|
---|
64 | HCONV rc;
|
---|
65 |
|
---|
66 | rc = O32_DdeConnect(idInst, hszService, hszTopic, pCC);
|
---|
67 | dprintf(("USER32: DdeConnect %x %x %x %x returned %d (%x)", idInst, hszService, hszTopic, pCC, rc, DdeGetLastError(idInst)));
|
---|
68 | return rc;
|
---|
69 | }
|
---|
70 | //******************************************************************************
|
---|
71 | //******************************************************************************
|
---|
72 | HCONVLIST WIN32API DdeConnectList(DWORD arg1, HSZ arg2, HSZ arg3, HCONVLIST arg4, LPCONVCONTEXT arg5)
|
---|
73 | {
|
---|
74 |
|
---|
75 | dprintf(("USER32: DdeConnectList\n"));
|
---|
76 |
|
---|
77 | return O32_DdeConnectList(arg1, arg2, arg3, arg4, arg5);
|
---|
78 | }
|
---|
79 | //******************************************************************************
|
---|
80 | //******************************************************************************
|
---|
81 | HDDEDATA WIN32API DdeCreateDataHandle(DWORD arg1, PVOID arg2, DWORD arg3, DWORD arg4,
|
---|
82 | HSZ arg5, UINT arg6, UINT arg7)
|
---|
83 | {
|
---|
84 | dprintf(("USER32: DdeCreateDataHandle\n"));
|
---|
85 | return O32_DdeCreateDataHandle(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
|
---|
86 | }
|
---|
87 | //******************************************************************************
|
---|
88 | //******************************************************************************
|
---|
89 | HSZ WIN32API DdeCreateStringHandleA(DWORD idInst, LPCSTR lpszString, int codepage)
|
---|
90 | {
|
---|
91 | HSZ rc;
|
---|
92 |
|
---|
93 | rc = O32_DdeCreateStringHandle(idInst, lpszString, codepage);
|
---|
94 | dprintf(("USER32: DdeCreateStringHandleA %x %s %x returned %x", idInst, lpszString, codepage, rc));
|
---|
95 | return rc;
|
---|
96 | }
|
---|
97 | //******************************************************************************
|
---|
98 | //******************************************************************************
|
---|
99 | HSZ WIN32API DdeCreateStringHandleW(DWORD arg1, LPCWSTR arg2, int arg3)
|
---|
100 | {
|
---|
101 | char *astring = UnicodeToAsciiString((LPWSTR)arg2);
|
---|
102 | HSZ rc;
|
---|
103 |
|
---|
104 | dprintf(("USER32: DdeCreateStringHandleW DOESN'T WORK\n"));
|
---|
105 | rc = O32_DdeCreateStringHandle(arg1, astring, arg3);
|
---|
106 | FreeAsciiString(astring);
|
---|
107 | return rc;
|
---|
108 | }
|
---|
109 | //******************************************************************************
|
---|
110 | //******************************************************************************
|
---|
111 | BOOL WIN32API DdeDisconnect(HCONV arg1)
|
---|
112 | {
|
---|
113 |
|
---|
114 | dprintf(("USER32: DdeDisconnect\n"));
|
---|
115 |
|
---|
116 | return O32_DdeDisconnect(arg1);
|
---|
117 | }
|
---|
118 | //******************************************************************************
|
---|
119 | //******************************************************************************
|
---|
120 | BOOL WIN32API DdeDisconnectList( HCONVLIST arg1)
|
---|
121 | {
|
---|
122 |
|
---|
123 | dprintf(("USER32: DdeDisconnectList\n"));
|
---|
124 |
|
---|
125 | return O32_DdeDisconnectList(arg1);
|
---|
126 | }
|
---|
127 | //******************************************************************************
|
---|
128 | //******************************************************************************
|
---|
129 | BOOL WIN32API DdeEnableCallback(DWORD arg1, HCONV arg2, UINT arg3)
|
---|
130 | {
|
---|
131 |
|
---|
132 | dprintf(("USER32: DdeEnableCallback\n"));
|
---|
133 |
|
---|
134 | return O32_DdeEnableCallback(arg1, arg2, arg3);
|
---|
135 | }
|
---|
136 | //******************************************************************************
|
---|
137 | //******************************************************************************
|
---|
138 | BOOL WIN32API DdeFreeDataHandle( HDDEDATA arg1)
|
---|
139 | {
|
---|
140 |
|
---|
141 | dprintf(("USER32: DdeFreeDataHandle\n"));
|
---|
142 |
|
---|
143 | return O32_DdeFreeDataHandle(arg1);
|
---|
144 | }
|
---|
145 | //******************************************************************************
|
---|
146 | //******************************************************************************
|
---|
147 | BOOL WIN32API DdeFreeStringHandle(DWORD arg1, HSZ arg2)
|
---|
148 | {
|
---|
149 |
|
---|
150 | dprintf(("USER32: DdeFreeStringHandle\n"));
|
---|
151 |
|
---|
152 | return O32_DdeFreeStringHandle(arg1, arg2);
|
---|
153 | }
|
---|
154 | //******************************************************************************
|
---|
155 | //******************************************************************************
|
---|
156 | DWORD WIN32API DdeGetData( HDDEDATA arg1, PVOID arg2, DWORD arg3, DWORD arg4)
|
---|
157 | {
|
---|
158 |
|
---|
159 | dprintf(("USER32: DdeGetData\n"));
|
---|
160 |
|
---|
161 | return O32_DdeGetData(arg1, arg2, arg3, arg4);
|
---|
162 | }
|
---|
163 | //******************************************************************************
|
---|
164 | //******************************************************************************
|
---|
165 | UINT WIN32API DdeGetLastError(DWORD arg1)
|
---|
166 | {
|
---|
167 |
|
---|
168 | dprintf(("USER32: DdeGetLastError\n"));
|
---|
169 |
|
---|
170 | return O32_DdeGetLastError(arg1);
|
---|
171 | }
|
---|
172 | //******************************************************************************
|
---|
173 | //******************************************************************************
|
---|
174 | HDDEDATA EXPENTRY_O32 DdeCallback(UINT uType, UINT uFmt, HCONV hconv, HSZ hsz1,
|
---|
175 | HSZ hsz2, HDDEDATA hdata, DWORD dwData1,
|
---|
176 | DWORD dwData2)
|
---|
177 | {
|
---|
178 | dprintf(("DdeCallback %x %x %x %x %x %x %x %x", uType, uFmt, hconv, hsz1, hsz2,
|
---|
179 | hdata, dwData1, dwData2));
|
---|
180 | return 0;
|
---|
181 | }
|
---|
182 | //******************************************************************************
|
---|
183 | //******************************************************************************
|
---|
184 | UINT WIN32API DdeInitializeA(PDWORD lpidInst, PFNCALLBACK pfnCallback,
|
---|
185 | DWORD afCmd, DWORD ulRes)
|
---|
186 | {
|
---|
187 | UINT ret;
|
---|
188 |
|
---|
189 | // ret = O32_DdeInitialize(lpidInst, pfnCallback, afCmd, ulRes);
|
---|
190 | ret = O32_DdeInitialize(lpidInst, (PFNCALLBACK_O32)DdeCallback, afCmd, ulRes);
|
---|
191 | dprintf(("USER32: DdeInitialize %x %x %x %x returned %x", lpidInst, pfnCallback, afCmd, ulRes, ret));
|
---|
192 | return ret;
|
---|
193 | }
|
---|
194 | //******************************************************************************
|
---|
195 | //******************************************************************************
|
---|
196 | UINT WIN32API DdeInitializeW(PDWORD lpidInst, PFNCALLBACK pfnCallback,
|
---|
197 | DWORD afCmd, DWORD ulRes)
|
---|
198 | {
|
---|
199 | UINT ret;
|
---|
200 |
|
---|
201 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
202 | ret = O32_DdeInitialize(lpidInst, (PFNCALLBACK_O32)DdeCallback, afCmd, ulRes);
|
---|
203 | dprintf(("USER32: DdeInitializeW %x %x %x %x returned %x", lpidInst, pfnCallback, afCmd, ulRes, ret));
|
---|
204 | return ret;
|
---|
205 | // return O32_DdeInitialize(arg1, arg2, arg3, arg4);
|
---|
206 | }
|
---|
207 | //******************************************************************************
|
---|
208 | //******************************************************************************
|
---|
209 | BOOL WIN32API DdeKeepStringHandle(DWORD arg1, HSZ arg2)
|
---|
210 | {
|
---|
211 |
|
---|
212 | dprintf(("USER32: DdeKeepStringHandle\n"));
|
---|
213 |
|
---|
214 | return O32_DdeKeepStringHandle(arg1, arg2);
|
---|
215 | }
|
---|
216 | //******************************************************************************
|
---|
217 | //******************************************************************************
|
---|
218 | HDDEDATA WIN32API DdeNameService( DWORD arg1, HSZ arg2, HSZ arg3, UINT arg4)
|
---|
219 | {
|
---|
220 |
|
---|
221 | dprintf(("USER32: DdeNameService\n"));
|
---|
222 |
|
---|
223 | return O32_DdeNameService(arg1, arg2, arg3, arg4);
|
---|
224 | }
|
---|
225 | //******************************************************************************
|
---|
226 | //******************************************************************************
|
---|
227 | BOOL WIN32API DdePostAdvise(DWORD arg1, HSZ arg2, HSZ arg3)
|
---|
228 | {
|
---|
229 |
|
---|
230 | dprintf(("USER32: DdePostAdvise\n"));
|
---|
231 |
|
---|
232 | return O32_DdePostAdvise(arg1, arg2, arg3);
|
---|
233 | }
|
---|
234 | //******************************************************************************
|
---|
235 | //******************************************************************************
|
---|
236 | UINT WIN32API DdeQueryConvInfo( HCONV arg1, DWORD arg2, LPCONVINFO arg3)
|
---|
237 | {
|
---|
238 |
|
---|
239 | dprintf(("USER32: DdeQueryConvInfo\n"));
|
---|
240 |
|
---|
241 | return O32_DdeQueryConvInfo(arg1, arg2, arg3);
|
---|
242 | }
|
---|
243 | //******************************************************************************
|
---|
244 | //******************************************************************************
|
---|
245 | HCONV WIN32API DdeQueryNextServer( HCONVLIST arg1, HCONV arg2)
|
---|
246 | {
|
---|
247 |
|
---|
248 | dprintf(("USER32: DdeQueryNextServer\n"));
|
---|
249 |
|
---|
250 | return O32_DdeQueryNextServer(arg1, arg2);
|
---|
251 | }
|
---|
252 | //******************************************************************************
|
---|
253 | //******************************************************************************
|
---|
254 | DWORD WIN32API DdeQueryStringA(DWORD arg1, HSZ arg2, LPSTR arg3, DWORD arg4, int arg5)
|
---|
255 | {
|
---|
256 |
|
---|
257 | dprintf(("USER32: DdeQueryStringA\n"));
|
---|
258 |
|
---|
259 | return O32_DdeQueryString(arg1, arg2, arg3, arg4, arg5);
|
---|
260 | }
|
---|
261 | //******************************************************************************
|
---|
262 | //******************************************************************************
|
---|
263 | DWORD WIN32API DdeQueryStringW(DWORD arg1, HSZ arg2, LPWSTR arg3, DWORD arg4, int arg5)
|
---|
264 | {
|
---|
265 | char *astring = UnicodeToAsciiString(arg3);
|
---|
266 | DWORD rc;
|
---|
267 |
|
---|
268 | dprintf(("USER32: DdeQueryStringW\n"));
|
---|
269 | rc = O32_DdeQueryString(arg1, arg2, astring, arg4, arg5);
|
---|
270 | FreeAsciiString(astring);
|
---|
271 | return rc;
|
---|
272 | }
|
---|
273 | //******************************************************************************
|
---|
274 | //******************************************************************************
|
---|
275 | HCONV WIN32API DdeReconnect( HCONV arg1)
|
---|
276 | {
|
---|
277 |
|
---|
278 | dprintf(("USER32: DdeReconnect\n"));
|
---|
279 |
|
---|
280 | return O32_DdeReconnect(arg1);
|
---|
281 | }
|
---|
282 | //******************************************************************************
|
---|
283 | //******************************************************************************
|
---|
284 | BOOL WIN32API DdeSetUserHandle( HCONV arg1, DWORD arg2, DWORD arg3)
|
---|
285 | {
|
---|
286 |
|
---|
287 | dprintf(("USER32: DdeSetUserHandle\n"));
|
---|
288 |
|
---|
289 | return O32_DdeSetUserHandle(arg1, arg2, arg3);
|
---|
290 | }
|
---|
291 | //******************************************************************************
|
---|
292 | //******************************************************************************
|
---|
293 | BOOL WIN32API DdeUnaccessData( HDDEDATA arg1)
|
---|
294 | {
|
---|
295 |
|
---|
296 | dprintf(("USER32: DdeUnaccessData\n"));
|
---|
297 |
|
---|
298 | return O32_DdeUnaccessData(arg1);
|
---|
299 | }
|
---|
300 | //******************************************************************************
|
---|
301 | //******************************************************************************
|
---|
302 | BOOL WIN32API DdeUninitialize(DWORD arg1)
|
---|
303 | {
|
---|
304 |
|
---|
305 | dprintf(("USER32: DdeUninitialize\n"));
|
---|
306 |
|
---|
307 | return O32_DdeUninitialize(arg1);
|
---|
308 | }
|
---|
309 | //******************************************************************************
|
---|
310 | //******************************************************************************
|
---|
311 | BOOL WIN32API FreeDDElParam( UINT arg1, LONG arg2)
|
---|
312 | {
|
---|
313 |
|
---|
314 | dprintf(("USER32: FreeDDElParam\n"));
|
---|
315 |
|
---|
316 | return O32_FreeDDElParam(arg1, arg2);
|
---|
317 | }
|
---|
318 | //******************************************************************************
|
---|
319 | //******************************************************************************
|
---|
320 | LONG WIN32API PackDDElParam(UINT arg1, UINT arg2, UINT arg3)
|
---|
321 | {
|
---|
322 |
|
---|
323 | dprintf(("USER32: PackDDElParam\n"));
|
---|
324 |
|
---|
325 | return O32_PackDDElParam(arg1, arg2, arg3);
|
---|
326 | }
|
---|
327 | //******************************************************************************
|
---|
328 | //******************************************************************************
|
---|
329 | UINT WIN32API ReuseDDElParam( UINT arg1, UINT arg2, UINT arg3, UINT arg4, UINT arg5)
|
---|
330 | {
|
---|
331 |
|
---|
332 | dprintf(("USER32: ReuseDDElParam\n"));
|
---|
333 |
|
---|
334 | return O32_ReuseDDElParam(arg1, arg2, arg3, arg4, arg5);
|
---|
335 | }
|
---|
336 | //******************************************************************************
|
---|
337 | //******************************************************************************
|
---|
338 | BOOL WIN32API UnpackDDElParam(UINT arg1, UINT arg2, LPUINT arg3, LPUINT arg4)
|
---|
339 | {
|
---|
340 |
|
---|
341 | dprintf(("USER32: UnpackDDElParam\n"));
|
---|
342 |
|
---|
343 | return O32_UnpackDDElParam(arg1, arg2, arg3, arg4);
|
---|
344 | }
|
---|
345 | //******************************************************************************
|
---|
346 | //******************************************************************************
|
---|
347 | /*****************************************************************************
|
---|
348 | * Name : BOOL WIN32API DdeImpersonateClient
|
---|
349 | * Purpose : The DdeImpersonateClient function impersonates a dynamic data
|
---|
350 | * exchange (DDE) client application in a DDE client conversation.
|
---|
351 | * Parameters: HCONV hConv handle of the DDE conversation
|
---|
352 | * Variables :
|
---|
353 | * Result : If the function succeeds, the return value is TRUE.
|
---|
354 | * If the function fails, the return value is FALSE. To get
|
---|
355 | * extended error information, call GetLastError.
|
---|
356 | * Remark :
|
---|
357 | * Status : UNTESTED STUB
|
---|
358 | *
|
---|
359 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
360 | *****************************************************************************/
|
---|
361 |
|
---|
362 | BOOL WIN32API DdeImpersonateClient(HCONV hConv)
|
---|
363 | {
|
---|
364 | dprintf(("USER32:DdeImpersonateClient (%08x) not implemented.\n",
|
---|
365 | hConv));
|
---|
366 |
|
---|
367 | return (TRUE);
|
---|
368 | }
|
---|
369 |
|
---|
370 |
|
---|
371 | /*****************************************************************************
|
---|
372 | * Name : BOOL WIN32API DdeSetQualityOfService
|
---|
373 | * Purpose : The DdeSetQualityOfService function specifies the quality of
|
---|
374 | * service a raw DDE application desires for future DDE conversations
|
---|
375 | * it initiates.
|
---|
376 | * Parameters:
|
---|
377 | * Variables :
|
---|
378 | * Result : If the function succeeds, the return value is TRUE.
|
---|
379 | * If the function fails, the return value is FALSE. To get
|
---|
380 | * extended error information, call GetLastError.
|
---|
381 | * Remark :
|
---|
382 | * Status : UNTESTED STUB
|
---|
383 | *
|
---|
384 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
385 | *****************************************************************************/
|
---|
386 |
|
---|
387 | BOOL WIN32API DdeSetQualityOfService (HWND hwndClient,
|
---|
388 | CONST SECURITY_QUALITY_OF_SERVICE *pqosNew,
|
---|
389 | PSECURITY_QUALITY_OF_SERVICE pqosPrev)
|
---|
390 | {
|
---|
391 | dprintf(("USER32:DdeSetQualityOfService(%08xh,%08xh,%08x) not implemented.\n",
|
---|
392 | hwndClient,
|
---|
393 | pqosNew,
|
---|
394 | pqosPrev));
|
---|
395 |
|
---|
396 | return (FALSE);
|
---|
397 | }
|
---|
398 | /*****************************************************************************
|
---|
399 | * Name : BOOL WIN32API ImpersonateDdeClientWindow
|
---|
400 | * Purpose : The ImpersonateDdeClientWindow function enables a DDE server
|
---|
401 | * application to impersonate a DDE client application's security
|
---|
402 | * context in order to protect secure server data from unauthorized
|
---|
403 | * DDE clients.
|
---|
404 | * Parameters: HWND hWndClient handle of DDE client window
|
---|
405 | * HWND hWndServer handle of DDE server window
|
---|
406 | * Variables :
|
---|
407 | * Result : If the function succeeds, the return value is TRUE.
|
---|
408 | * If the function fails, the return value is FALSE. To get extended
|
---|
409 | * error information, call GetLastError.
|
---|
410 | * Remark :
|
---|
411 | * Status : UNTESTED STUB
|
---|
412 | *
|
---|
413 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
414 | *****************************************************************************/
|
---|
415 |
|
---|
416 | BOOL WIN32API ImpersonateDdeClientWindow(HWND hWndClient,
|
---|
417 | HWND hWndServer)
|
---|
418 | {
|
---|
419 | dprintf(("USER32:ImpersonateDdeClientWindow (%08xh,%08x) not implemented.\n",
|
---|
420 | hWndClient,
|
---|
421 | hWndServer));
|
---|
422 |
|
---|
423 | return (FALSE);
|
---|
424 | }
|
---|