Added ability to specify X fonts used for Helv and Tms Rmn typefaces
[wine.git] / misc / ddeml.c
blob7f36086478d7598f72ba15130517d79ff4731f71
1 /*
2 * DDEML library
4 * Copyright 1997 Alexandre Julliard
5 * Copyright 1997 Len White
6 */
8 /* Only empty stubs for now */
10 #include "ddeml.h"
11 #include "debug.h"
12 #include "windows.h"
14 /* FIXME: What are these values? */
15 #define DMLERR_NO_ERROR 0
17 static LONG DDE_current_handle;
20 /******************************************************************************
21 * DdeInitialize16 (DDEML.2)
23 UINT16 WINAPI DdeInitialize16( LPDWORD pidInst, PFNCALLBACK16 pfnCallback,
24 DWORD afCmd, DWORD ulRes)
26 return (UINT16)DdeInitialize32A(pidInst,(PFNCALLBACK32)pfnCallback,
27 afCmd, ulRes);
31 /******************************************************************************
32 * DdeInitialize32A (USER32.106)
34 UINT32 WINAPI DdeInitialize32A( LPDWORD pidInst, PFNCALLBACK32 pfnCallback,
35 DWORD afCmd, DWORD ulRes )
37 return DdeInitialize32W(pidInst,pfnCallback,afCmd,ulRes);
41 /******************************************************************************
42 * DdeInitialize32W [USER32.107]
43 * Registers an application with the DDEML
45 * PARAMS
46 * pidInst [I] Pointer to instance identifier
47 * pfnCallback [I] Pointer to callback function
48 * afCmd [I] Set of command and filter flags
49 * ulRes [I] Reserved
51 * RETURNS
52 * Success: DMLERR_NO_ERROR
53 * Failure: DMLERR_DLL_USAGE, DMLERR_INVALIDPARAMETER, DMLERR_SYS_ERROR
55 UINT32 WINAPI DdeInitialize32W( LPDWORD pidInst, PFNCALLBACK32 pfnCallback,
56 DWORD afCmd, DWORD ulRes )
58 FIXME(ddeml, "(%p,%p,0x%lx,%ld): stub\n",pidInst,pfnCallback,afCmd,ulRes);
60 if(pidInst)
61 *pidInst = 0;
63 if( ulRes )
64 ERR(dde, "Reserved value not zero? What does this mean?\n");
66 return DMLERR_NO_ERROR;
70 /*****************************************************************
71 * DdeUninitialize16 (DDEML.3)
73 BOOL16 WINAPI DdeUninitialize16( DWORD idInst )
75 return (BOOL16)DdeUninitialize32( idInst );
79 /*****************************************************************
80 * DdeUninitialize32 [USER32.119] Frees DDEML resources
82 * PARAMS
83 * idInst [I] Instance identifier
85 * RETURNS
86 * Success: TRUE
87 * Failure: FALSE
89 BOOL32 WINAPI DdeUninitialize32( DWORD idInst )
91 FIXME(ddeml, "(%ld): stub\n", idInst);
92 return TRUE;
96 /*****************************************************************
97 * DdeConnectList16 [DDEML.4]
99 HCONVLIST WINAPI DdeConnectList16( DWORD idInst, HSZ hszService, HSZ hszTopic,
100 HCONVLIST hConvList, LPCONVCONTEXT16 pCC )
102 return DdeConnectList32(idInst, hszService, hszTopic, hConvList,
103 (LPCONVCONTEXT32)pCC);
107 /******************************************************************************
108 * DdeConnectList32 [USER32.93] Establishes conversation with DDE servers
110 * PARAMS
111 * idInst [I] Instance identifier
112 * hszService [I] Handle to service name string
113 * hszTopic [I] Handle to topic name string
114 * hConvList [I] Handle to conversation list
115 * pCC [I] Pointer to structure with context data
117 * RETURNS
118 * Success: Handle to new conversation list
119 * Failure: 0
121 HCONVLIST WINAPI DdeConnectList32( DWORD idInst, HSZ hszService, HSZ hszTopic,
122 HCONVLIST hConvList, LPCONVCONTEXT32 pCC )
124 FIXME(ddeml, "(%ld,%ld,%ld,%ld,%p): stub\n", idInst, hszService, hszTopic,
125 hConvList,pCC);
126 return 1;
130 /*****************************************************************
131 * DdeQueryNextServer16 [DDEML.5]
133 HCONV WINAPI DdeQueryNextServer16( HCONVLIST hConvList, HCONV hConvPrev )
135 return DdeQueryNextServer32(hConvList, hConvPrev);
139 /*****************************************************************
140 * DdeQueryNextServer32 [USER32.112]
142 HCONV WINAPI DdeQueryNextServer32( HCONVLIST hConvList, HCONV hConvPrev )
144 FIXME(ddeml, "(%ld,%ld): stub\n",hConvList,hConvPrev);
145 return 0;
148 /*****************************************************************
149 * DdeQueryString32A [USER32.113]
151 DWORD WINAPI DdeQueryString32A(DWORD idInst, HSZ hsz, LPSTR psz, DWORD cchMax, INT32 iCodePage)
153 FIXME(ddeml,
154 "(%ld, 0x%lx, %p, %ld, %d): stub\n",
155 idInst,
156 hsz,
157 psz,
158 cchMax,
159 iCodePage);
161 return 0;
164 /*****************************************************************
165 * DdeQueryString32W [USER32.114]
167 DWORD WINAPI DdeQueryString32W(DWORD idInst, HSZ hsz, LPWSTR psz, DWORD cchMax, INT32 iCodePage)
169 FIXME(ddeml,
170 "(%ld, 0x%lx, %p, %ld, %d): stub\n",
171 idInst,
172 hsz,
173 psz,
174 cchMax,
175 iCodePage);
177 return 0;
181 /*****************************************************************
182 * DdeDisconnectList (DDEML.6)
184 BOOL16 WINAPI DdeDisconnectList16( HCONVLIST hConvList )
186 return (BOOL16)DdeDisconnectList32(hConvList);
190 /******************************************************************************
191 * DdeDisconnectList32 [USER32.98] Destroys list and terminates conversations
193 * RETURNS
194 * Success: TRUE
195 * Failure: FALSE
197 BOOL32 WINAPI DdeDisconnectList32(
198 HCONVLIST hConvList) /* [in] Handle to conversation list */
200 FIXME(ddeml, "(%ld): stub\n", hConvList);
201 return TRUE;
205 /*****************************************************************
206 * DdeConnect16 (DDEML.7)
208 HCONV WINAPI DdeConnect16( DWORD idInst, HSZ hszService, HSZ hszTopic,
209 LPCONVCONTEXT16 pCC )
211 FIXME( ddeml, "empty stub\n" );
212 return 0;
216 /*****************************************************************
217 * DdeConnect32 (USER32.92)
219 HCONV WINAPI DdeConnect32( DWORD idInst, HSZ hszService, HSZ hszTopic,
220 LPCONVCONTEXT32 pCC )
222 FIXME(ddeml, "(0x%lx,%ld,%ld,%p): stub\n",idInst,hszService,hszTopic,
223 pCC);
224 return 0;
228 /*****************************************************************
229 * DdeDisconnect16 (DDEML.8)
231 BOOL16 WINAPI DdeDisconnect16( HCONV hConv )
233 return (BOOL16)DdeDisconnect32( hConv );
236 /*****************************************************************
237 * DdeSetUserHandle (DDEML.10)
239 BOOL16 WINAPI DdeSetUserHandle( HCONV hConv, DWORD id, DWORD hUser )
241 FIXME( ddeml, "(%ld,%ld,%ld): stub\n",hConv,id, hUser );
242 return 0;
245 /*****************************************************************
246 * DdeCreateDataHandle16 (DDEML.14)
248 HDDEDATA WINAPI DdeCreateDataHandle16( DWORD idInst, LPBYTE pSrc, DWORD cb,
249 DWORD cbOff, HSZ hszItem, UINT16 wFmt,
250 UINT16 afCmd )
252 return DdeCreateDataHandle32(idInst,
253 pSrc,
255 cbOff,
256 hszItem,
257 wFmt,
258 afCmd);
261 /*****************************************************************
262 * DdeCreateDataHandle32 (USER32.94)
264 HDDEDATA WINAPI DdeCreateDataHandle32( DWORD idInst, LPBYTE pSrc, DWORD cb,
265 DWORD cbOff, HSZ hszItem, UINT32 wFmt,
266 UINT32 afCmd )
268 FIXME( ddeml,
269 "(%ld,%p,%ld,%ld,0x%lx,%d,%d): stub\n",
270 idInst,
271 pSrc,
273 cbOff,
274 hszItem,
275 wFmt,
276 afCmd );
278 return 0;
281 /*****************************************************************
282 * DdeDisconnect32 (USER32.97)
284 BOOL32 WINAPI DdeDisconnect32( HCONV hConv )
286 FIXME( ddeml, "empty stub\n" );
287 return 0;
291 /*****************************************************************
292 * DdeReconnect (DDEML.37) (USER32.115)
294 HCONV WINAPI DdeReconnect( HCONV hConv )
296 FIXME( ddeml, "empty stub\n" );
297 return 0;
301 /*****************************************************************
302 * DdeCreateStringHandle16 (DDEML.21)
304 HSZ WINAPI DdeCreateStringHandle16( DWORD idInst, LPCSTR str, INT16 codepage )
306 return DdeCreateStringHandle32A( idInst, str, codepage );
310 /*****************************************************************
311 * DdeCreateStringHandle32A [USER32.95]
313 * RETURNS
314 * Success: String handle
315 * Failure: 0
317 HSZ WINAPI DdeCreateStringHandle32A( DWORD idInst, LPCSTR psz, INT32 codepage )
318 { TRACE(ddeml, "(%ld,%s,%d): stub\n",idInst,debugstr_a(psz),codepage);
320 if (codepage==1004) /*fixme: should be CP_WINANSI*/
321 return GlobalAddAtom32A (psz);
322 else
323 return 0;
327 /******************************************************************************
328 * DdeCreateStringHandle32W [USER32.96] Creates handle to identify string
330 * RETURNS
331 * Success: String handle
332 * Failure: 0
334 HSZ WINAPI DdeCreateStringHandle32W(
335 DWORD idInst, /* [in] Instance identifier */
336 LPCWSTR psz, /* [in] Pointer to string */
337 INT32 codepage) /* [in] Code page identifier */
339 FIXME(ddeml, "(%ld,%s,%d): stub\n",idInst,debugstr_w(psz),codepage);
340 DDE_current_handle++;
341 return DDE_current_handle;
345 /*****************************************************************
346 * DdeFreeStringHandle16 (DDEML.22)
348 BOOL16 WINAPI DdeFreeStringHandle16( DWORD idInst, HSZ hsz )
350 return (BOOL32)DdeFreeStringHandle32( idInst, hsz );
354 /*****************************************************************
355 * DdeFreeStringHandle32 (USER32.101)
356 * RETURNS: success: nonzero
357 * fail: zero
359 BOOL32 WINAPI DdeFreeStringHandle32( DWORD idInst, HSZ hsz )
360 { TRACE( ddeml, "(%ld,%ld): stub\n",idInst, hsz );
361 return GlobalDeleteAtom (hsz) ? hsz : 0;
365 /*****************************************************************
366 * DdeFreeDataHandle16 (DDEML.19)
368 BOOL16 WINAPI DdeFreeDataHandle16( HDDEDATA hData )
370 return (BOOL32)DdeFreeDataHandle32( hData );
374 /*****************************************************************
375 * DdeFreeDataHandle32 (USER32.100)
377 BOOL32 WINAPI DdeFreeDataHandle32( HDDEDATA hData )
379 FIXME( ddeml, "empty stub\n" );
380 return TRUE;
384 /*****************************************************************
385 * DdeKeepStringHandle16 (DDEML.24)
387 BOOL16 WINAPI DdeKeepStringHandle16( DWORD idInst, HSZ hsz )
389 return (BOOL32)DdeKeepStringHandle32( idInst, hsz );
393 /*****************************************************************
394 * DdeKeepStringHandle32 (USER32.108)
396 BOOL32 WINAPI DdeKeepStringHandle32( DWORD idInst, HSZ hsz )
398 FIXME( ddeml, "empty stub\n" );
399 return TRUE;
403 /*****************************************************************
404 * DdeClientTransaction16 (DDEML.11)
406 HDDEDATA WINAPI DdeClientTransaction16( LPVOID pData, DWORD cbData,
407 HCONV hConv, HSZ hszItem, UINT16 wFmt,
408 UINT16 wType, DWORD dwTimeout,
409 LPDWORD pdwResult )
411 return DdeClientTransaction32( (LPBYTE)pData, cbData, hConv, hszItem,
412 wFmt, wType, dwTimeout, pdwResult );
416 /*****************************************************************
417 * DdeClientTransaction32 (USER32.90)
419 HDDEDATA WINAPI DdeClientTransaction32( LPBYTE pData, DWORD cbData,
420 HCONV hConv, HSZ hszItem, UINT32 wFmt,
421 UINT32 wType, DWORD dwTimeout,
422 LPDWORD pdwResult )
424 FIXME( ddeml, "empty stub\n" );
425 return 0;
428 /*****************************************************************
429 * DdeAbandonTransaction (DDEML.12)
431 BOOL16 WINAPI DdeAbandonTransaction( DWORD idInst, HCONV hConv,
432 DWORD idTransaction )
434 FIXME( ddeml, "empty stub\n" );
435 return 0;
439 /*****************************************************************
440 * DdePostAdvise16 [DDEML.13]
442 BOOL16 WINAPI DdePostAdvise16( DWORD idInst, HSZ hszTopic, HSZ hszItem )
444 return (BOOL16)DdePostAdvise32(idInst, hszTopic, hszItem);
448 /******************************************************************************
449 * DdePostAdvise32 [USER32.110] Send transaction to DDE callback function.
451 * RETURNS
452 * Success: TRUE
453 * Failure: FALSE
455 BOOL32 WINAPI DdePostAdvise32(
456 DWORD idInst, /* [in] Instance identifier */
457 HSZ hszTopic, /* [in] Handle to topic name string */
458 HSZ hszItem) /* [in] Handle to item name string */
460 FIXME(ddeml, "(%ld,%ld,%ld): stub\n",idInst,hszTopic,hszItem);
461 return TRUE;
465 /*****************************************************************
466 * DdeAddData (DDEML.15)
468 HDDEDATA WINAPI DdeAddData( HDDEDATA hData, LPBYTE pSrc, DWORD cb,
469 DWORD cbOff )
471 FIXME( ddeml, "empty stub\n" );
472 return 0;
476 /******************************************************************************
477 * DdeGetData32 [USER32.102] Copies data from DDE object ot local buffer
479 * RETURNS
480 * Size of memory object associated with handle
482 DWORD WINAPI DdeGetData32(
483 HDDEDATA hData, /* [in] Handle to DDE object */
484 LPBYTE pDst, /* [in] Pointer to destination buffer */
485 DWORD cbMax, /* [in] Amount of data to copy */
486 DWORD cbOff) /* [in] Offset to beginning of data */
488 FIXME(ddeml, "(%ld,%p,%ld,%ld): stub\n",hData,pDst,cbMax,cbOff);
489 return cbMax;
493 /*****************************************************************
494 * DdeGetData16 [DDEML.16]
496 DWORD WINAPI DdeGetData16(
497 HDDEDATA hData,
498 LPBYTE pDst,
499 DWORD cbMax,
500 DWORD cbOff)
502 return DdeGetData32(hData, pDst, cbMax, cbOff);
506 /*****************************************************************
507 * DdeAccessData16 (DDEML.17)
509 LPBYTE WINAPI DdeAccessData16( HDDEDATA hData, LPDWORD pcbDataSize )
511 return DdeAccessData32(hData, pcbDataSize);
514 /*****************************************************************
515 * DdeAccessData32 (USER32.88)
517 LPBYTE WINAPI DdeAccessData32( HDDEDATA hData, LPDWORD pcbDataSize )
519 FIXME( ddeml, "(%ld,%p): stub\n", hData, pcbDataSize);
520 return 0;
523 /*****************************************************************
524 * DdeUnaccessData16 (DDEML.18)
526 BOOL16 WINAPI DdeUnaccessData16( HDDEDATA hData )
528 return DdeUnaccessData32(hData);
531 /*****************************************************************
532 * DdeUnaccessData32 (USER32.118)
534 BOOL32 WINAPI DdeUnaccessData32( HDDEDATA hData )
536 FIXME( ddeml, "(0x%lx): stub\n", hData);
538 return 0;
541 /*****************************************************************
542 * DdeEnableCallback16 (DDEML.26)
544 BOOL16 WINAPI DdeEnableCallback16( DWORD idInst, HCONV hConv, UINT16 wCmd )
546 return DdeEnableCallback32(idInst, hConv, wCmd);
549 /*****************************************************************
550 * DdeEnableCallback32 (USER32.99)
552 BOOL32 WINAPI DdeEnableCallback32( DWORD idInst, HCONV hConv, UINT32 wCmd )
554 FIXME( ddeml, "(%ld, 0x%lx, %d) stub\n", idInst, hConv, wCmd);
556 return 0;
559 /*****************************************************************
560 * DdeNameService16 (DDEML.27)
562 HDDEDATA WINAPI DdeNameService16( DWORD idInst, HSZ hsz1, HSZ hsz2,
563 UINT16 afCmd )
565 return DdeNameService32( idInst, hsz1, hsz2, afCmd );
569 /******************************************************************************
570 * DdeNameService32 [USER32.109] {Un}registers service name of DDE server
572 * PARAMS
573 * idInst [I] Instance identifier
574 * hsz1 [I] Handle to service name string
575 * hsz2 [I] Reserved
576 * afCmd [I] Service name flags
578 * RETURNS
579 * Success: Non-zero
580 * Failure: 0
582 HDDEDATA WINAPI DdeNameService32( DWORD idInst, HSZ hsz1, HSZ hsz2,
583 UINT32 afCmd )
585 FIXME(ddeml, "(%ld,%ld,%ld,%d): stub\n",idInst,hsz1,hsz2,afCmd);
586 return 1;
590 /*****************************************************************
591 * DdeGetLastError16 (DDEML.20)
593 UINT16 WINAPI DdeGetLastError16( DWORD idInst )
595 return (UINT16)DdeGetLastError32( idInst );
599 /******************************************************************************
600 * DdeGetLastError32 [USER32.103] Gets most recent error code
602 * PARAMS
603 * idInst [I] Instance identifier
605 * RETURNS
606 * Last error code
608 UINT32 WINAPI DdeGetLastError32( DWORD idInst )
610 FIXME(ddeml, "(%ld): stub\n",idInst);
611 return 0;
615 /*****************************************************************
616 * DdeCmpStringHandles16 (DDEML.36)
618 int WINAPI DdeCmpStringHandles16( HSZ hsz1, HSZ hsz2 )
620 return DdeCmpStringHandles32(hsz1, hsz2);
623 /*****************************************************************
624 * DdeCmpStringHandles32 (USER32.91)
626 int WINAPI DdeCmpStringHandles32( HSZ hsz1, HSZ hsz2 )
628 FIXME( ddeml, "(0x%lx, 0x%lx): stub\n", hsz1, hsz2 );
629 return 0;
633 /*****************************************************************
634 * PackDDElParam (USER32.414)
636 * RETURNS
637 * success: nonzero
638 * failure: zero
640 UINT32 WINAPI PackDDElParam32(UINT32 msg, UINT32 uiLo, UINT32 uiHi)
642 FIXME(ddeml, "stub.\n");
643 return 0;
647 /*****************************************************************
648 * UnpackDDElParam (USER32.562)
650 * RETURNS
651 * success: nonzero
652 * failure: zero
654 UINT32 WINAPI UnpackDDElParam32(UINT32 msg, UINT32 lParam,
655 UINT32 *uiLo, UINT32 *uiHi)
657 FIXME(ddeml, "stub.\n");
658 return 0;
662 /*****************************************************************
663 * FreeDDElParam (USER32.204)
665 * RETURNS
666 * success: nonzero
667 * failure: zero
669 UINT32 WINAPI FreeDDElParam32(UINT32 msg, UINT32 lParam)
671 FIXME(ddeml, "stub.\n");
672 return 0;