Module:    Win32-DDE
Copyright:    Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
              All rights reserved.
License:      See License.txt in this distribution for details.
Warranty:     Distributed WITHOUT WARRANTY OF ANY KIND

// This file is automatically generated from "ddeml.h"; do not edit.

define C-subtype <HCONVLIST> ( <HANDLE> ) end;
define C-subtype <HCONV> ( <HANDLE> ) end;
define C-subtype <HSZ> ( <HANDLE> ) end;
define C-subtype <HDDEDATA> ( <HANDLE> ) end;

define C-struct <HSZPAIR>
  inline-only slot hszSvc-value    :: <HSZ>;
  inline-only slot hszTopic-value  :: <HSZ>;
  pointer-type-name: <LPHSZPAIR>;
  c-name: "struct tagHSZPAIR";
end C-struct <HSZPAIR>;
define constant <PHSZPAIR> = <LPHSZPAIR>;

define C-struct <CONVCONTEXT>
  inline-only slot cb-value        :: <UINT>;
  inline-only slot wFlags-value    :: <UINT>;
  inline-only slot wCountryID-value :: <UINT>;
  inline-only slot iCodePage-value :: <C-int>;
  inline-only slot dwLangID-value  :: <DWORD>;
  inline-only slot dwSecurity-value :: <DWORD>;
  inline-only slot qos-value       :: <SECURITY-QUALITY-OF-SERVICE>;
  pointer-type-name: <LPCONVCONTEXT>;
  c-name: "struct tagCONVCONTEXT";
end C-struct <CONVCONTEXT>;
define constant <PCONVCONTEXT> = <LPCONVCONTEXT>;

define C-struct <CONVINFO>
  inline-only slot cb-value        :: <DWORD>;
  inline-only slot hUser-value     :: <DWORD>;
  inline-only slot hConvPartner-value :: <HCONV>;
  inline-only slot hszSvcPartner-value :: <HSZ>;
  inline-only slot hszServiceReq-value :: <HSZ>;
  inline-only slot hszTopic-value  :: <HSZ>;
  inline-only slot hszItem-value   :: <HSZ>;
  inline-only slot wFmt-value      :: <UINT>;
  inline-only slot wType-value     :: <UINT>;
  inline-only slot wStatus-value   :: <UINT>;
  inline-only slot wConvst-value   :: <UINT>;
  inline-only slot wLastError-value :: <UINT>;
  inline-only slot hConvList-value :: <HCONVLIST>;
  inline-only slot ConvCtxt-value  :: <CONVCONTEXT>;
  inline-only slot hwnd-value      :: <HWND>;
  inline-only slot hwndPartner-value :: <HWND>;
  pointer-type-name: <LPCONVINFO>;
  c-name: "struct tagCONVINFO";
end C-struct <CONVINFO>;
define constant <PCONVINFO> = <LPCONVINFO>;
define inline-only constant $XST-NULL                   =    0;
define inline-only constant $XST-INCOMPLETE             =    1;
define inline-only constant $XST-CONNECTED              =    2;
define inline-only constant $XST-INIT1                  =    3;
define inline-only constant $XST-INIT2                  =    4;
define inline-only constant $XST-REQSENT                =    5;
define inline-only constant $XST-DATARCVD               =    6;
define inline-only constant $XST-POKESENT               =    7;
define inline-only constant $XST-POKEACKRCVD            =    8;
define inline-only constant $XST-EXECSENT               =    9;
define inline-only constant $XST-EXECACKRCVD            =   10;
define inline-only constant $XST-ADVSENT                =   11;
define inline-only constant $XST-UNADVSENT              =   12;
define inline-only constant $XST-ADVACKRCVD             =   13;
define inline-only constant $XST-UNADVACKRCVD           =   14;
define inline-only constant $XST-ADVDATASENT            =   15;
define inline-only constant $XST-ADVDATAACKRCVD         =   16;
define inline-only constant $CADV-LATEACK               = #xFFFF;
define inline-only constant $ST-CONNECTED               = #x0001;
define inline-only constant $ST-ADVISE                  = #x0002;
define inline-only constant $ST-ISLOCAL                 = #x0004;
define inline-only constant $ST-BLOCKED                 = #x0008;
define inline-only constant $ST-CLIENT                  = #x0010;
define inline-only constant $ST-TERMINATED              = #x0020;
define inline-only constant $ST-INLIST                  = #x0040;
define inline-only constant $ST-BLOCKNEXT               = #x0080;
define inline-only constant $ST-ISSELF                  = #x0100;
define inline-only constant $DDE-FACK                   = #x8000;
define inline-only constant $DDE-FBUSY                  = #x4000;
define inline-only constant $DDE-FDEFERUPD              = #x4000;
define inline-only constant $DDE-FACKREQ                = #x8000;
define inline-only constant $DDE-FRELEASE               = #x2000;
define inline-only constant $DDE-FREQUESTED             = #x1000;
define inline-only constant $DDE-FAPPSTATUS             = #x00ff;
define inline-only constant $DDE-FNOTPROCESSED          = #x0000;
define inline-only constant $DDE-FACKRESERVED           =
	lognot(logior($DDE-FACK, $DDE-FBUSY, $DDE-FAPPSTATUS));
define inline-only constant $DDE-FADVRESERVED           =
	lognot(logior($DDE-FACKREQ, $DDE-FDEFERUPD));
define inline-only constant $DDE-FDATRESERVED           =
	lognot(logior($DDE-FACKREQ, $DDE-FRELEASE, $DDE-FREQUESTED));
define inline-only constant $DDE-FPOKRESERVED           =
	lognot($DDE-FRELEASE);
define inline-only constant $MSGF-DDEMGR                = #x8001;
define inline-only constant $CP-WINANSI                 = 1004;
define inline-only constant $CP-WINUNICODE              = 1200;
define inline-only constant $XTYPF-NOBLOCK              = #x0002;
define inline-only constant $XTYPF-NODATA               = #x0004;
define inline-only constant $XTYPF-ACKREQ               = #x0008;
define inline-only constant $XCLASS-MASK                = #xFC00;
define inline-only constant $XCLASS-BOOL                = #x1000;
define inline-only constant $XCLASS-DATA                = #x2000;
define inline-only constant $XCLASS-FLAGS               = #x4000;
define inline-only constant $XCLASS-NOTIFICATION        = #x8000;
define inline-only constant $XTYP-ERROR                 =
	logior(#x0000, $XCLASS-NOTIFICATION, $XTYPF-NOBLOCK);
define inline-only constant $XTYP-ADVDATA               =
	logior(#x0010, $XCLASS-FLAGS);
define inline-only constant $XTYP-ADVREQ                =
	logior(#x0020, $XCLASS-DATA, $XTYPF-NOBLOCK);
define inline-only constant $XTYP-ADVSTART              =
	logior(#x0030, $XCLASS-BOOL);
define inline-only constant $XTYP-ADVSTOP               =
	logior(#x0040, $XCLASS-NOTIFICATION);
define inline-only constant $XTYP-EXECUTE               =
	logior(#x0050, $XCLASS-FLAGS);
define inline-only constant $XTYP-CONNECT               =
	logior(#x0060, $XCLASS-BOOL, $XTYPF-NOBLOCK);
define inline-only constant $XTYP-CONNECT-CONFIRM       =
	logior(#x0070, $XCLASS-NOTIFICATION, $XTYPF-NOBLOCK);
define inline-only constant $XTYP-XACT-COMPLETE         =
	logior(#x0080, $XCLASS-NOTIFICATION);
define inline-only constant $XTYP-POKE                  =
	logior(#x0090, $XCLASS-FLAGS);
define inline-only constant $XTYP-REGISTER              =
	logior(#x00A0, $XCLASS-NOTIFICATION, $XTYPF-NOBLOCK);
define inline-only constant $XTYP-REQUEST               =
	logior(#x00B0, $XCLASS-DATA);
define inline-only constant $XTYP-DISCONNECT            =
	logior(#x00C0, $XCLASS-NOTIFICATION, $XTYPF-NOBLOCK);
define inline-only constant $XTYP-UNREGISTER            =
	logior(#x00D0, $XCLASS-NOTIFICATION, $XTYPF-NOBLOCK);
define inline-only constant $XTYP-WILDCONNECT           =
	logior(#x00E0, $XCLASS-DATA, $XTYPF-NOBLOCK);
define inline-only constant $XTYP-MASK                  = #x00F0;
define inline-only constant $XTYP-SHIFT                 =    4;
define inline-only constant $TIMEOUT-ASYNC              = $FFFFFFFF;
define inline-only constant $QID-SYNC                   = $FFFFFFFF;
define constant $SZDDESYS-TOPIC          = "System";
define constant $SZDDESYS-ITEM-TOPICS    = "Topics";
define constant $SZDDESYS-ITEM-SYSITEMS  = "SysItems";
define constant $SZDDESYS-ITEM-RTNMSG    = "ReturnMessage";
define constant $SZDDESYS-ITEM-STATUS    = "Status";
define constant $SZDDESYS-ITEM-FORMATS   = "Formats";
define constant $SZDDESYS-ITEM-HELP      = "Help";
define constant $SZDDE-ITEM-ITEMLIST     = "TopicItemList";

define C-subtype <PFNCALLBACK> ( <C-function-pointer> ) end;
define macro <PFNCALLBACK>-callback-wrapper
 { <PFNCALLBACK>-callback-wrapper(?new:name,?old:name) } =>
 { define C-callable-wrapper ?new of ?old
  parameter wType      :: <UINT>;
  parameter wFmt       :: <UINT>;
  parameter hConv      :: <HCONV>;
  parameter hsz1       :: <HSZ>;
  parameter hsz2       :: <HSZ>;
  parameter hData      :: <HDDEDATA>;
  parameter dwData1    :: <DWORD>;
  parameter dwData2    :: <DWORD>;
  result value :: <HDDEDATA>;
  c-modifiers: "__stdcall";
 end C-callable-wrapper }
end;
define inline-only constant $CBR-BLOCK                  =
	make(<HDDEDATA>, address: lognot(0));

define inline-only C-function DdeInitialize
  parameter pidInst    :: <LPDWORD>;
  parameter pfnCallback :: <PFNCALLBACK>;
  parameter afCmd      :: <DWORD>;
  parameter ulRes      :: <DWORD>;
  result value :: <UINT>;
  c-name: "DdeInitializeA", c-modifiers: "__stdcall";
end;
define inline-only constant $CBF-FAIL-SELFCONNECTIONS   = #x00001000;
define inline-only constant $CBF-FAIL-CONNECTIONS       = #x00002000;
define inline-only constant $CBF-FAIL-ADVISES           = #x00004000;
define inline-only constant $CBF-FAIL-EXECUTES          = #x00008000;
define inline-only constant $CBF-FAIL-POKES             = #x00010000;
define inline-only constant $CBF-FAIL-REQUESTS          = #x00020000;
define inline-only constant $CBF-FAIL-ALLSVRXACTIONS    = #x0003f000;
define inline-only constant $CBF-SKIP-CONNECT-CONFIRMS  = #x00040000;
define inline-only constant $CBF-SKIP-REGISTRATIONS     = #x00080000;
define inline-only constant $CBF-SKIP-UNREGISTRATIONS   = #x00100000;
define inline-only constant $CBF-SKIP-DISCONNECTS       = #x00200000;
define inline-only constant $CBF-SKIP-ALLNOTIFICATIONS  = #x003c0000;
define inline-only constant $APPCMD-CLIENTONLY          = #x00000010;
define inline-only constant $APPCMD-FILTERINITS         = #x00000020;
define inline-only constant $APPCMD-MASK                = #x00000FF0;
define inline-only constant $APPCLASS-STANDARD          = #x00000000;
define inline-only constant $APPCLASS-MASK              = #x0000000F;

define inline-only C-function DdeUninitialize
  parameter idInst     :: <DWORD>;
  result value :: <BOOL>;
  c-name: "DdeUninitialize", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeConnectList
  parameter idInst     :: <DWORD>;
  parameter hszService :: <HSZ>;
  parameter hszTopic   :: <HSZ>;
  parameter hConvList  :: <HCONVLIST>;
  parameter pCC        :: <PCONVCONTEXT>;
  result value :: <HCONVLIST>;
  c-name: "DdeConnectList", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeQueryNextServer
  parameter hConvList  :: <HCONVLIST>;
  parameter hConvPrev  :: <HCONV>;
  result value :: <HCONV>;
  c-name: "DdeQueryNextServer", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeDisconnectList
  parameter hConvList  :: <HCONVLIST>;
  result value :: <BOOL>;
  c-name: "DdeDisconnectList", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeConnect
  parameter idInst     :: <DWORD>;
  parameter hszService :: <HSZ>;
  parameter hszTopic   :: <HSZ>;
  parameter pCC        :: <PCONVCONTEXT>;
  result value :: <HCONV>;
  c-name: "DdeConnect", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeDisconnect
  parameter hConv      :: <HCONV>;
  result value :: <BOOL>;
  c-name: "DdeDisconnect", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeReconnect
  parameter hConv      :: <HCONV>;
  result value :: <HCONV>;
  c-name: "DdeReconnect", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeQueryConvInfo
  parameter hConv      :: <HCONV>;
  parameter idTransaction :: <DWORD>;
  parameter pConvInfo  :: <PCONVINFO>;
  result value :: <UINT>;
  c-name: "DdeQueryConvInfo", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeSetUserHandle
  parameter hConv      :: <HCONV>;
  parameter id         :: <DWORD>;
  parameter hUser      :: <DWORD>;
  result value :: <BOOL>;
  c-name: "DdeSetUserHandle", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeAbandonTransaction
  parameter idInst     :: <DWORD>;
  parameter hConv      :: <HCONV>;
  parameter idTransaction :: <DWORD>;
  result value :: <BOOL>;
  c-name: "DdeAbandonTransaction", c-modifiers: "__stdcall";
end;

define inline-only C-function DdePostAdvise
  parameter idInst     :: <DWORD>;
  parameter hszTopic   :: <HSZ>;
  parameter hszItem    :: <HSZ>;
  result value :: <BOOL>;
  c-name: "DdePostAdvise", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeEnableCallback
  parameter idInst     :: <DWORD>;
  parameter hConv      :: <HCONV>;
  parameter wCmd       :: <UINT>;
  result value :: <BOOL>;
  c-name: "DdeEnableCallback", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeImpersonateClient
  parameter hConv      :: <HCONV>;
  result value :: <BOOL>;
  c-name: "DdeImpersonateClient", c-modifiers: "__stdcall";
end;
define inline-only constant $EC-ENABLEALL               =    0;
define inline-only constant $EC-QUERYWAITING            =    2;

define inline-only C-function DdeNameService
  parameter idInst     :: <DWORD>;
  parameter hsz1       :: <HSZ>;
  parameter hsz2       :: <HSZ>;
  parameter afCmd      :: <UINT>;
  result value :: <HDDEDATA>;
  c-name: "DdeNameService", c-modifiers: "__stdcall";
end;
define inline-only constant $DNS-REGISTER               = #x0001;
define inline-only constant $DNS-UNREGISTER             = #x0002;
define inline-only constant $DNS-FILTERON               = #x0004;
define inline-only constant $DNS-FILTEROFF              = #x0008;

define inline-only C-function DdeClientTransaction
  parameter pData      :: <LPBYTE>;
  parameter cbData     :: <DWORD>;
  parameter hConv      :: <HCONV>;
  parameter hszItem    :: <HSZ>;
  parameter wFmt       :: <UINT>;
  parameter wType      :: <UINT>;
  parameter dwTimeout  :: <DWORD>;
  output parameter pdwResult :: <LPDWORD>;
  result value :: <HDDEDATA>;
  c-name: "DdeClientTransaction", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeCreateDataHandle
  parameter idInst     :: <DWORD>;
  parameter pSrc       :: <LPBYTE>;
  parameter cb         :: <DWORD>;
  parameter cbOff      :: <DWORD>;
  parameter hszItem    :: <HSZ>;
  parameter wFmt       :: <UINT>;
  parameter afCmd      :: <UINT>;
  result value :: <HDDEDATA>;
  c-name: "DdeCreateDataHandle", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeAddData
  parameter hData      :: <HDDEDATA>;
  parameter pSrc       :: <LPBYTE>;
  parameter cb         :: <DWORD>;
  parameter cbOff      :: <DWORD>;
  result value :: <HDDEDATA>;
  c-name: "DdeAddData", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeGetData
  parameter hData      :: <HDDEDATA>;
  parameter pDst       :: <LPBYTE>;
  parameter cbMax      :: <DWORD>;
  parameter cbOff      :: <DWORD>;
  result value :: <DWORD>;
  c-name: "DdeGetData", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeAccessData
  parameter hData      :: <HDDEDATA>;
  output parameter pcbDataSize :: <LPDWORD>;
  result value :: <LPBYTE>;
  c-name: "DdeAccessData", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeUnaccessData
  parameter hData      :: <HDDEDATA>;
  result value :: <BOOL>;
  c-name: "DdeUnaccessData", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeFreeDataHandle
  parameter hData      :: <HDDEDATA>;
  result value :: <BOOL>;
  c-name: "DdeFreeDataHandle", c-modifiers: "__stdcall";
end;
define inline-only constant $HDATA-APPOWNED             = #x0001;

define inline-only C-function DdeGetLastError
  parameter idInst     :: <DWORD>;
  result value :: <UINT>;
  c-name: "DdeGetLastError", c-modifiers: "__stdcall";
end;
define inline-only constant $DMLERR-NO-ERROR            =    0;
define inline-only constant $DMLERR-FIRST               = #x4000;
define inline-only constant $DMLERR-ADVACKTIMEOUT       = #x4000;
define inline-only constant $DMLERR-BUSY                = #x4001;
define inline-only constant $DMLERR-DATAACKTIMEOUT      = #x4002;
define inline-only constant $DMLERR-DLL-NOT-INITIALIZED = #x4003;
define inline-only constant $DMLERR-DLL-USAGE           = #x4004;
define inline-only constant $DMLERR-EXECACKTIMEOUT      = #x4005;
define inline-only constant $DMLERR-INVALIDPARAMETER    = #x4006;
define inline-only constant $DMLERR-LOW-MEMORY          = #x4007;
define inline-only constant $DMLERR-MEMORY-ERROR        = #x4008;
define inline-only constant $DMLERR-NOTPROCESSED        = #x4009;
define inline-only constant $DMLERR-NO-CONV-ESTABLISHED = #x400a;
define inline-only constant $DMLERR-POKEACKTIMEOUT      = #x400b;
define inline-only constant $DMLERR-POSTMSG-FAILED      = #x400c;
define inline-only constant $DMLERR-REENTRANCY          = #x400d;
define inline-only constant $DMLERR-SERVER-DIED         = #x400e;
define inline-only constant $DMLERR-SYS-ERROR           = #x400f;
define inline-only constant $DMLERR-UNADVACKTIMEOUT     = #x4010;
define inline-only constant $DMLERR-UNFOUND-QUEUE-ID    = #x4011;
define inline-only constant $DMLERR-LAST                = #x4011;

define inline-only C-function DdeCreateStringHandle
  parameter idInst     :: <DWORD>;
  parameter psz        :: <LPCSTR>;
  parameter iCodePage  :: <C-int>;
  result value :: <HSZ>;
  c-name: "DdeCreateStringHandleA", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeQueryString
  parameter idInst     :: <DWORD>;
  parameter hsz        :: <HSZ>;
  parameter psz        :: <LPSTR>;
  parameter cchMax     :: <DWORD>;
  parameter iCodePage  :: <C-int>;
  result value :: <DWORD>;
  c-name: "DdeQueryStringA", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeFreeStringHandle
  parameter idInst     :: <DWORD>;
  parameter hsz        :: <HSZ>;
  result value :: <BOOL>;
  c-name: "DdeFreeStringHandle", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeKeepStringHandle
  parameter idInst     :: <DWORD>;
  parameter hsz        :: <HSZ>;
  result value :: <BOOL>;
  c-name: "DdeKeepStringHandle", c-modifiers: "__stdcall";
end;

define inline-only C-function DdeCmpStringHandles
  parameter hsz1       :: <HSZ>;
  parameter hsz2       :: <HSZ>;
  result value :: <C-int>;
  c-name: "DdeCmpStringHandles", c-modifiers: "__stdcall";
end;

define inline-only constant $CP-WINNEUTRAL = $CP-WINANSI;
define inline-only constant $EC-ENABLEONE = $ST-BLOCKNEXT;
define inline-only constant $EC-DISABLE  = $ST-BLOCKED;
