source: trunk/src/user32/dde.cpp

Last change on this file was 9701, checked in by sandervl, 23 years ago

Moved debug wrapper for DDE to dde.cpp

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