Should get win16drv AbortProc working. Hopefully.
[wine.git] / misc / ddeml.c
blob9916ae143dbc5a16a46aa2e1ea45d1264260a24b
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 "atom.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;
149 /*****************************************************************
150 * DdeDisconnectList (DDEML.6)
152 BOOL16 WINAPI DdeDisconnectList16( HCONVLIST hConvList )
154 return (BOOL16)DdeDisconnectList32(hConvList);
158 /******************************************************************************
159 * DdeDisconnectList32 [USER32.98] Destroys list and terminates conversations
161 * RETURNS
162 * Success: TRUE
163 * Failure: FALSE
165 BOOL32 WINAPI DdeDisconnectList32(
166 HCONVLIST hConvList) /* [in] Handle to conversation list */
168 FIXME(ddeml, "(%ld): stub\n", hConvList);
169 return TRUE;
173 /*****************************************************************
174 * DdeConnect16 (DDEML.7)
176 HCONV WINAPI DdeConnect16( DWORD idInst, HSZ hszService, HSZ hszTopic,
177 LPCONVCONTEXT16 pCC )
179 FIXME( ddeml, "empty stub\n" );
180 return 0;
184 /*****************************************************************
185 * DdeConnect32 (USER32.92)
187 HCONV WINAPI DdeConnect32( DWORD idInst, HSZ hszService, HSZ hszTopic,
188 LPCONVCONTEXT32 pCC )
190 FIXME(ddeml, "(0x%lx,%ld,%ld,%p): stub\n",idInst,hszService,hszTopic,
191 pCC);
192 return 0;
196 /*****************************************************************
197 * DdeDisconnect16 (DDEML.8)
199 BOOL16 WINAPI DdeDisconnect16( HCONV hConv )
201 return (BOOL16)DdeDisconnect32( hConv );
204 /*****************************************************************
205 * DdeSetUserHandle (DDEML.10)
207 BOOL16 WINAPI DdeSetUserHandle( HCONV hConv, DWORD id, DWORD hUser )
209 FIXME( ddeml, "(%ld,%ld,%ld): stub\n",hConv,id, hUser );
210 return 0;
213 /*****************************************************************
214 * DdeCreateDataHandle (DDEML.14)
216 HDDEDATA WINAPI DdeCreateDataHandle( DWORD idInst, LPBYTE pSrc, DWORD cb,
217 DWORD cbOff, HSZ hszItem, UINT16 wFmt,
218 UINT16 afCmd )
220 FIXME( ddeml, "(%ld,%p,%ld,%ld,%ld,%d,%d): stub\n",idInst,pSrc,cb,cbOff,
221 hszItem, wFmt, afCmd );
222 return 0;
225 /*****************************************************************
226 * DdeDisconnect32 (USER32.97)
228 BOOL32 WINAPI DdeDisconnect32( HCONV hConv )
230 FIXME( ddeml, "empty stub\n" );
231 return 0;
235 /*****************************************************************
236 * DdeReconnect (DDEML.37) (USER32.115)
238 HCONV WINAPI DdeReconnect( HCONV hConv )
240 FIXME( ddeml, "empty stub\n" );
241 return 0;
245 /*****************************************************************
246 * DdeCreateStringHandle16 (DDEML.21)
248 HSZ WINAPI DdeCreateStringHandle16( DWORD idInst, LPCSTR str, INT16 codepage )
250 return DdeCreateStringHandle32A( idInst, str, codepage );
254 /*****************************************************************
255 * DdeCreateStringHandle32A [USER32.95]
257 * RETURNS
258 * Success: String handle
259 * Failure: 0
261 HSZ WINAPI DdeCreateStringHandle32A( DWORD idInst, LPCSTR psz, INT32 codepage )
262 { TRACE(ddeml, "(%ld,%s,%d): stub\n",idInst,debugstr_a(psz),codepage);
264 if (codepage==1004) /*fixme: should be CP_WINANSI*/
265 return GlobalAddAtom32A (psz);
266 else
267 return 0;
271 /******************************************************************************
272 * DdeCreateStringHandle32W [USER32.96] Creates handle to identify string
274 * RETURNS
275 * Success: String handle
276 * Failure: 0
278 HSZ WINAPI DdeCreateStringHandle32W(
279 DWORD idInst, /* [in] Instance identifier */
280 LPCWSTR psz, /* [in] Pointer to string */
281 INT32 codepage) /* [in] Code page identifier */
283 FIXME(ddeml, "(%ld,%s,%d): stub\n",idInst,debugstr_w(psz),codepage);
284 DDE_current_handle++;
285 return DDE_current_handle;
289 /*****************************************************************
290 * DdeFreeStringHandle16 (DDEML.22)
292 BOOL16 WINAPI DdeFreeStringHandle16( DWORD idInst, HSZ hsz )
294 return (BOOL32)DdeFreeStringHandle32( idInst, hsz );
298 /*****************************************************************
299 * DdeFreeStringHandle32 (USER32.101)
300 * RETURNS: success: nonzero
301 * fail: zero
303 BOOL32 WINAPI DdeFreeStringHandle32( DWORD idInst, HSZ hsz )
304 { TRACE( ddeml, "(%ld,%ld): stub\n",idInst, hsz );
305 return GlobalDeleteAtom (hsz) ? hsz : 0;
309 /*****************************************************************
310 * DdeFreeDataHandle16 (DDEML.19)
312 BOOL16 WINAPI DdeFreeDataHandle16( HDDEDATA hData )
314 return (BOOL32)DdeFreeDataHandle32( hData );
318 /*****************************************************************
319 * DdeFreeDataHandle32 (USER32.100)
321 BOOL32 WINAPI DdeFreeDataHandle32( HDDEDATA hData )
323 FIXME( ddeml, "empty stub\n" );
324 return TRUE;
328 /*****************************************************************
329 * DdeKeepStringHandle16 (DDEML.24)
331 BOOL16 WINAPI DdeKeepStringHandle16( DWORD idInst, HSZ hsz )
333 return (BOOL32)DdeKeepStringHandle32( idInst, hsz );
337 /*****************************************************************
338 * DdeKeepStringHandle32 (USER32.108)
340 BOOL32 WINAPI DdeKeepStringHandle32( DWORD idInst, HSZ hsz )
342 FIXME( ddeml, "empty stub\n" );
343 return TRUE;
347 /*****************************************************************
348 * DdeClientTransaction16 (DDEML.11)
350 HDDEDATA WINAPI DdeClientTransaction16( LPVOID pData, DWORD cbData,
351 HCONV hConv, HSZ hszItem, UINT16 wFmt,
352 UINT16 wType, DWORD dwTimeout,
353 LPDWORD pdwResult )
355 return DdeClientTransaction32( (LPBYTE)pData, cbData, hConv, hszItem,
356 wFmt, wType, dwTimeout, pdwResult );
360 /*****************************************************************
361 * DdeClientTransaction32 (USER32.90)
363 HDDEDATA WINAPI DdeClientTransaction32( LPBYTE pData, DWORD cbData,
364 HCONV hConv, HSZ hszItem, UINT32 wFmt,
365 UINT32 wType, DWORD dwTimeout,
366 LPDWORD pdwResult )
368 FIXME( ddeml, "empty stub\n" );
369 return 0;
372 /*****************************************************************
373 * DdeAbandonTransaction (DDEML.12)
375 BOOL16 WINAPI DdeAbandonTransaction( DWORD idInst, HCONV hConv,
376 DWORD idTransaction )
378 FIXME( ddeml, "empty stub\n" );
379 return 0;
383 /*****************************************************************
384 * DdePostAdvise16 [DDEML.13]
386 BOOL16 WINAPI DdePostAdvise16( DWORD idInst, HSZ hszTopic, HSZ hszItem )
388 return (BOOL16)DdePostAdvise32(idInst, hszTopic, hszItem);
392 /******************************************************************************
393 * DdePostAdvise32 [USER32.110] Send transaction to DDE callback function.
395 * RETURNS
396 * Success: TRUE
397 * Failure: FALSE
399 BOOL32 WINAPI DdePostAdvise32(
400 DWORD idInst, /* [in] Instance identifier */
401 HSZ hszTopic, /* [in] Handle to topic name string */
402 HSZ hszItem) /* [in] Handle to item name string */
404 FIXME(ddeml, "(%ld,%ld,%ld): stub\n",idInst,hszTopic,hszItem);
405 return TRUE;
409 /*****************************************************************
410 * DdeAddData (DDEML.15)
412 HDDEDATA WINAPI DdeAddData( HDDEDATA hData, LPBYTE pSrc, DWORD cb,
413 DWORD cbOff )
415 FIXME( ddeml, "empty stub\n" );
416 return 0;
420 /******************************************************************************
421 * DdeGetData32 [USER32.102] Copies data from DDE object ot local buffer
423 * RETURNS
424 * Size of memory object associated with handle
426 DWORD WINAPI DdeGetData32(
427 HDDEDATA hData, /* [in] Handle to DDE object */
428 LPBYTE pDst, /* [in] Pointer to destination buffer */
429 DWORD cbMax, /* [in] Amount of data to copy */
430 DWORD cbOff) /* [in] Offset to beginning of data */
432 FIXME(ddeml, "(%ld,%p,%ld,%ld): stub\n",hData,pDst,cbMax,cbOff);
433 return cbMax;
437 /*****************************************************************
438 * DdeGetData16 [DDEML.16]
440 DWORD WINAPI DdeGetData16(
441 HDDEDATA hData,
442 LPBYTE pDst,
443 DWORD cbMax,
444 DWORD cbOff)
446 return DdeGetData32(hData, pDst, cbMax, cbOff);
450 /*****************************************************************
451 * DdeAccessData (DDEML.17)
453 LPBYTE WINAPI DdeAccessData( HDDEDATA hData, LPDWORD pcbDataSize )
455 FIXME( ddeml, "empty stub\n" );
456 return 0;
459 /*****************************************************************
460 * DdeUnaccessData (DDEML.18)
462 BOOL16 WINAPI DdeUnaccessData( HDDEDATA hData )
464 FIXME( ddeml, "empty stub\n" );
465 return 0;
468 /*****************************************************************
469 * DdeEnableCallback (DDEML.26)
471 BOOL16 WINAPI DdeEnableCallback( DWORD idInst, HCONV hConv, UINT16 wCmd )
473 FIXME( ddeml, "empty stub\n" );
474 return 0;
477 /*****************************************************************
478 * DdeNameService16 (DDEML.27)
480 HDDEDATA WINAPI DdeNameService16( DWORD idInst, HSZ hsz1, HSZ hsz2,
481 UINT16 afCmd )
483 return DdeNameService32( idInst, hsz1, hsz2, afCmd );
487 /******************************************************************************
488 * DdeNameService32 [USER32.109] {Un}registers service name of DDE server
490 * PARAMS
491 * idInst [I] Instance identifier
492 * hsz1 [I] Handle to service name string
493 * hsz2 [I] Reserved
494 * afCmd [I] Service name flags
496 * RETURNS
497 * Success: Non-zero
498 * Failure: 0
500 HDDEDATA WINAPI DdeNameService32( DWORD idInst, HSZ hsz1, HSZ hsz2,
501 UINT32 afCmd )
503 FIXME(ddeml, "(%ld,%ld,%ld,%d): stub\n",idInst,hsz1,hsz2,afCmd);
504 return 1;
508 /*****************************************************************
509 * DdeGetLastError16 (DDEML.20)
511 UINT16 WINAPI DdeGetLastError16( DWORD idInst )
513 return (UINT16)DdeGetLastError32( idInst );
517 /******************************************************************************
518 * DdeGetLastError32 [USER32.103] Gets most recent error code
520 * PARAMS
521 * idInst [I] Instance identifier
523 * RETURNS
524 * Last error code
526 UINT32 WINAPI DdeGetLastError32( DWORD idInst )
528 FIXME(ddeml, "(%ld): stub\n",idInst);
529 return 0;
533 /*****************************************************************
534 * DdeCmpStringHandles (DDEML.36)
536 int WINAPI DdeCmpStringHandles( HSZ hsz1, HSZ hsz2 )
538 FIXME( ddeml, "empty stub\n" );
539 return 0;
543 /*****************************************************************
544 * PackDDElParam (USER32.414)
546 * RETURNS
547 * success: nonzero
548 * failure: zero
550 UINT32 WINAPI PackDDElParam32(UINT32 msg, UINT32 uiLo, UINT32 uiHi)
552 FIXME(ddeml, "stub.\n");
553 return 0;
557 /*****************************************************************
558 * UnpackDDElParam (USER32.562)
560 * RETURNS
561 * success: nonzero
562 * failure: zero
564 UINT32 WINAPI UnpackDDElParam32(UINT32 msg, UINT32 lParam,
565 UINT32 *uiLo, UINT32 *uiHi)
567 FIXME(ddeml, "stub.\n");
568 return 0;
572 /*****************************************************************
573 * FreeDDElParam (USER32.204)
575 * RETURNS
576 * success: nonzero
577 * failure: zero
579 UINT32 WINAPI FreeDDElParam32(UINT32 msg, UINT32 lParam)
581 FIXME(ddeml, "stub.\n");
582 return 0;