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