ReactOS 0.4.17-dev-1321-g5c122a9
ddeml.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagHSZPAIR
 
struct  tagCONVCONTEXT
 
struct  tagCONVINFO
 

Macros

#define CP_WINANSI   1004
 
#define CP_WINUNICODE   1200
 
#define MSGF_DDEMGR   0x8001
 
#define QID_SYNC   0xFFFFFFFF
 
#define EXPENTRY   CALLBACK
 
#define SZDDESYS_TOPIC   TEXT("System")
 
#define SZDDESYS_ITEM_TOPICS   TEXT("Topics")
 
#define SZDDESYS_ITEM_SYSITEMS   TEXT("SysItems")
 
#define SZDDESYS_ITEM_RTNMSG   TEXT("ReturnMessage")
 
#define SZDDESYS_ITEM_STATUS   TEXT("Status")
 
#define SZDDESYS_ITEM_FORMATS   TEXT("Formats")
 
#define SZDDESYS_ITEM_HELP   TEXT("Help")
 
#define SZDDE_ITEM_ITEMLIST   TEXT("TopicItemList")
 
#define XST_NULL   0
 
#define XST_INCOMPLETE   1
 
#define XST_CONNECTED   2
 
#define XST_INIT1   3
 
#define XST_INIT2   4
 
#define XST_REQSENT   5
 
#define XST_DATARCVD   6
 
#define XST_POKESENT   7
 
#define XST_POKEACKRCVD   8
 
#define XST_EXECSENT   9
 
#define XST_EXECACKRCVD   10
 
#define XST_ADVSENT   11
 
#define XST_UNADVSENT   12
 
#define XST_ADVACKRCVD   13
 
#define XST_UNADVACKRCVD   14
 
#define XST_ADVDATASENT   15
 
#define XST_ADVDATAACKRCVD   16
 
#define ST_CONNECTED   0x0001
 
#define ST_ADVISE   0x0002
 
#define ST_ISLOCAL   0x0004
 
#define ST_BLOCKED   0x0008
 
#define ST_CLIENT   0x0010
 
#define ST_TERMINATED   0x0020
 
#define ST_INLIST   0x0040
 
#define ST_BLOCKNEXT   0x0080
 
#define ST_ISSELF   0x0100
 
#define EC_ENABLEALL   0
 
#define EC_ENABLEONE   ST_BLOCKNEXT
 
#define EC_DISABLE   ST_BLOCKED
 
#define EC_QUERYWAITING   2
 
#define CBF_FAIL_SELFCONNECTIONS   0x00001000
 
#define CBF_FAIL_CONNECTIONS   0x00002000
 
#define CBF_FAIL_ADVISES   0x00004000
 
#define CBF_FAIL_EXECUTES   0x00008000
 
#define CBF_FAIL_POKES   0x00010000
 
#define CBF_FAIL_REQUESTS   0x00020000
 
#define CBF_FAIL_ALLSVRXACTIONS   0x0003f000
 
#define CBF_SKIP_CONNECT_CONFIRMS   0x00040000
 
#define CBF_SKIP_REGISTRATIONS   0x00080000
 
#define CBF_SKIP_UNREGISTRATIONS   0x00100000
 
#define CBF_SKIP_DISCONNECTS   0x00200000
 
#define CBF_SKIP_ALLNOTIFICATIONS   0x003c0000
 
#define CBR_BLOCK   ((HDDEDATA)(LONG_PTR)-1)
 
#define APPCMD_CLIENTONLY   0x00000010L
 
#define APPCMD_FILTERINITS   0x00000020L
 
#define APPCMD_MASK   0x00000FF0L
 
#define APPCLASS_STANDARD   0x00000000L
 
#define APPCLASS_MONITOR   0x00000001L
 
#define APPCLASS_MASK   0x0000000FL
 
#define MF_HSZ_INFO   0x01000000
 
#define MF_SENDMSGS   0x02000000
 
#define MF_POSTMSGS   0x04000000
 
#define MF_CALLBACKS   0x08000000
 
#define MF_ERRORS   0x10000000
 
#define MF_LINKS   0x20000000
 
#define MF_CONV   0x40000000
 
#define MF_MASK   0xFF000000
 
#define DNS_REGISTER   0x0001
 
#define DNS_UNREGISTER   0x0002
 
#define DNS_FILTERON   0x0004
 
#define DNS_FILTEROFF   0x0008
 
#define XTYPF_NOBLOCK   0x0002 /* CBR_NOBLOCK will not work */
 
#define XTYPF_NODATA   0x0004 /* DDE_FDEFERUPD */
 
#define XTYPF_ACKREQ   0x0008 /* DDE_FACKREQ */
 
#define XCLASS_MASK   0xFC00
 
#define XCLASS_BOOL   0x1000
 
#define XCLASS_DATA   0x2000
 
#define XCLASS_FLAGS   0x4000
 
#define XCLASS_NOTIFICATION   0x8000
 
#define XTYP_ERROR   (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
 
#define XTYP_ADVDATA   (0x0010 | XCLASS_FLAGS)
 
#define XTYP_ADVREQ   (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK)
 
#define XTYP_ADVSTART   (0x0030 | XCLASS_BOOL)
 
#define XTYP_ADVSTOP   (0x0040 | XCLASS_NOTIFICATION)
 
#define XTYP_EXECUTE   (0x0050 | XCLASS_FLAGS)
 
#define XTYP_CONNECT   (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
 
#define XTYP_CONNECT_CONFIRM   (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
 
#define XTYP_XACT_COMPLETE   (0x0080 | XCLASS_NOTIFICATION )
 
#define XTYP_POKE   (0x0090 | XCLASS_FLAGS)
 
#define XTYP_REGISTER   (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
 
#define XTYP_REQUEST   (0x00B0 | XCLASS_DATA )
 
#define XTYP_DISCONNECT   (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
 
#define XTYP_UNREGISTER   (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
 
#define XTYP_WILDCONNECT   (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
 
#define XTYP_MONITOR   (0x00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
 
#define XTYP_MASK   0x00F0
 
#define XTYP_SHIFT   4
 
#define TIMEOUT_ASYNC   0xFFFFFFFF
 
#define CADV_LATEACK   0xFFFF
 
#define DDE_FACK   0x8000
 
#define DDE_FBUSY   0x4000
 
#define DDE_FDEFERUPD   0x4000
 
#define DDE_FACKREQ   0x8000
 
#define DDE_FRELEASE   0x2000
 
#define DDE_FREQUESTED   0x1000
 
#define DDE_FAPPSTATUS   0x00FF
 
#define DDE_FNOTPROCESSED   0x0000
 
#define DDE_FACKRESERVED   (~(DDE_FACK | DDE_FBUSY | DDE_FAPPSTATUS))
 
#define DDE_FADVRESERVED   (~(DDE_FACKREQ | DDE_FDEFERUPD))
 
#define DDE_FDATRESERVED   (~(DDE_FACKREQ | DDE_FRELEASE | DDE_FREQUESTED))
 
#define DDE_FPOKRESERVED   (~(DDE_FRELEASE))
 
#define DMLERR_NO_ERROR   0 /* must be 0 */
 
#define DMLERR_FIRST   0x4000
 
#define DMLERR_ADVACKTIMEOUT   0x4000
 
#define DMLERR_BUSY   0x4001
 
#define DMLERR_DATAACKTIMEOUT   0x4002
 
#define DMLERR_DLL_NOT_INITIALIZED   0x4003
 
#define DMLERR_DLL_USAGE   0x4004
 
#define DMLERR_EXECACKTIMEOUT   0x4005
 
#define DMLERR_INVALIDPARAMETER   0x4006
 
#define DMLERR_LOW_MEMORY   0x4007
 
#define DMLERR_MEMORY_ERROR   0x4008
 
#define DMLERR_NOTPROCESSED   0x4009
 
#define DMLERR_NO_CONV_ESTABLISHED   0x400a
 
#define DMLERR_POKEACKTIMEOUT   0x400b
 
#define DMLERR_POSTMSG_FAILED   0x400c
 
#define DMLERR_REENTRANCY   0x400d
 
#define DMLERR_SERVER_DIED   0x400e
 
#define DMLERR_SYS_ERROR   0x400f
 
#define DMLERR_UNADVACKTIMEOUT   0x4010
 
#define DMLERR_UNFOUND_QUEUE_ID   0x4011
 
#define DMLERR_LAST   0x4011
 
#define HDATA_APPOWNED   0x0001
 
#define DdeInitialize   WINELIB_NAME_AW(DdeInitialize)
 
#define DdeQueryString   WINELIB_NAME_AW(DdeQueryString)
 
#define DdeCreateStringHandle   WINELIB_NAME_AW(DdeCreateStringHandle)
 

Typedefs

typedef HDDEDATA(CALLBACK * PFNCALLBACK) (UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, ULONG_PTR, ULONG_PTR)
 
typedef struct tagHSZPAIR HSZPAIR
 
typedef struct tagHSZPAIR * PHSZPAIR
 
typedef struct tagCONVCONTEXT CONVCONTEXT
 
typedef struct tagCONVCONTEXT * PCONVCONTEXT
 
typedef struct tagCONVINFO CONVINFO
 
typedef struct tagCONVINFO * PCONVINFO
 

Functions

 DECLARE_HANDLE (HCONVLIST)
 
 DECLARE_HANDLE (HCONV)
 
 DECLARE_HANDLE (HSZ)
 
 DECLARE_HANDLE (HDDEDATA)
 
UINT WINAPI DdeInitializeA (LPDWORD, PFNCALLBACK, DWORD, DWORD)
 
UINT WINAPI DdeInitializeW (LPDWORD, PFNCALLBACK, DWORD, DWORD)
 
BOOL WINAPI DdeUninitialize (DWORD)
 
HCONVLIST WINAPI DdeConnectList (DWORD, HSZ, HSZ, HCONVLIST, PCONVCONTEXT)
 
HCONV WINAPI DdeQueryNextServer (HCONVLIST, HCONV)
 
DWORD WINAPI DdeQueryStringA (DWORD, HSZ, LPSTR, DWORD, INT)
 
DWORD WINAPI DdeQueryStringW (DWORD, HSZ, LPWSTR, DWORD, INT)
 
BOOL WINAPI DdeDisconnectList (HCONVLIST)
 
HCONV WINAPI DdeConnect (DWORD, HSZ, HSZ, PCONVCONTEXT)
 
BOOL WINAPI DdeDisconnect (HCONV)
 
HDDEDATA WINAPI DdeCreateDataHandle (DWORD, LPBYTE, DWORD, DWORD, HSZ, UINT, UINT)
 
HCONV WINAPI DdeReconnect (HCONV)
 
HSZ WINAPI DdeCreateStringHandleA (DWORD, LPCSTR, INT)
 
HSZ WINAPI DdeCreateStringHandleW (DWORD, LPCWSTR, INT)
 
BOOL WINAPI DdeFreeStringHandle (DWORD, HSZ)
 
BOOL WINAPI DdeFreeDataHandle (HDDEDATA)
 
BOOL WINAPI DdeKeepStringHandle (DWORD, HSZ)
 
HDDEDATA WINAPI DdeClientTransaction (LPBYTE, DWORD, HCONV, HSZ, UINT, UINT, DWORD, LPDWORD)
 
BOOL WINAPI DdeAbandonTransaction (DWORD idInst, HCONV hConv, DWORD idTransaction)
 
BOOL WINAPI DdeImpersonateClient (HCONV)
 
BOOL WINAPI DdePostAdvise (DWORD, HSZ, HSZ)
 
HDDEDATA WINAPI DdeAddData (HDDEDATA, LPBYTE, DWORD, DWORD)
 
DWORD WINAPI DdeGetData (HDDEDATA, LPBYTE, DWORD, DWORD)
 
LPBYTE WINAPI DdeAccessData (HDDEDATA, LPDWORD)
 
BOOL WINAPI DdeUnaccessData (HDDEDATA)
 
BOOL WINAPI DdeEnableCallback (DWORD, HCONV, UINT)
 
INT WINAPI DdeCmpStringHandles (HSZ, HSZ)
 
BOOL WINAPI DdeSetUserHandle (HCONV, DWORD, DWORD)
 
HDDEDATA WINAPI DdeNameService (DWORD, HSZ, HSZ, UINT)
 
UINT WINAPI DdeGetLastError (DWORD)
 
UINT WINAPI DdeQueryConvInfo (HCONV, DWORD, PCONVINFO)
 

Macro Definition Documentation

◆ APPCLASS_MASK

#define APPCLASS_MASK   0x0000000FL

Definition at line 132 of file ddeml.h.

◆ APPCLASS_MONITOR

#define APPCLASS_MONITOR   0x00000001L

Definition at line 131 of file ddeml.h.

◆ APPCLASS_STANDARD

#define APPCLASS_STANDARD   0x00000000L

Definition at line 130 of file ddeml.h.

◆ APPCMD_CLIENTONLY

#define APPCMD_CLIENTONLY   0x00000010L

Definition at line 122 of file ddeml.h.

◆ APPCMD_FILTERINITS

#define APPCMD_FILTERINITS   0x00000020L

Definition at line 123 of file ddeml.h.

◆ APPCMD_MASK

#define APPCMD_MASK   0x00000FF0L

Definition at line 124 of file ddeml.h.

◆ CADV_LATEACK

#define CADV_LATEACK   0xFFFF

Definition at line 202 of file ddeml.h.

◆ CBF_FAIL_ADVISES

#define CBF_FAIL_ADVISES   0x00004000

Definition at line 105 of file ddeml.h.

◆ CBF_FAIL_ALLSVRXACTIONS

#define CBF_FAIL_ALLSVRXACTIONS   0x0003f000

Definition at line 109 of file ddeml.h.

◆ CBF_FAIL_CONNECTIONS

#define CBF_FAIL_CONNECTIONS   0x00002000

Definition at line 104 of file ddeml.h.

◆ CBF_FAIL_EXECUTES

#define CBF_FAIL_EXECUTES   0x00008000

Definition at line 106 of file ddeml.h.

◆ CBF_FAIL_POKES

#define CBF_FAIL_POKES   0x00010000

Definition at line 107 of file ddeml.h.

◆ CBF_FAIL_REQUESTS

#define CBF_FAIL_REQUESTS   0x00020000

Definition at line 108 of file ddeml.h.

◆ CBF_FAIL_SELFCONNECTIONS

#define CBF_FAIL_SELFCONNECTIONS   0x00001000

Definition at line 103 of file ddeml.h.

◆ CBF_SKIP_ALLNOTIFICATIONS

#define CBF_SKIP_ALLNOTIFICATIONS   0x003c0000

Definition at line 115 of file ddeml.h.

◆ CBF_SKIP_CONNECT_CONFIRMS

#define CBF_SKIP_CONNECT_CONFIRMS   0x00040000

Definition at line 111 of file ddeml.h.

◆ CBF_SKIP_DISCONNECTS

#define CBF_SKIP_DISCONNECTS   0x00200000

Definition at line 114 of file ddeml.h.

◆ CBF_SKIP_REGISTRATIONS

#define CBF_SKIP_REGISTRATIONS   0x00080000

Definition at line 112 of file ddeml.h.

◆ CBF_SKIP_UNREGISTRATIONS

#define CBF_SKIP_UNREGISTRATIONS   0x00100000

Definition at line 113 of file ddeml.h.

◆ CBR_BLOCK

#define CBR_BLOCK   ((HDDEDATA)(LONG_PTR)-1)

Definition at line 117 of file ddeml.h.

◆ CP_WINANSI

#define CP_WINANSI   1004

Definition at line 32 of file ddeml.h.

◆ CP_WINUNICODE

#define CP_WINUNICODE   1200

Definition at line 33 of file ddeml.h.

◆ DDE_FACK

#define DDE_FACK   0x8000

Definition at line 216 of file ddeml.h.

◆ DDE_FACKREQ

#define DDE_FACKREQ   0x8000

Definition at line 219 of file ddeml.h.

◆ DDE_FACKRESERVED

#define DDE_FACKRESERVED   (~(DDE_FACK | DDE_FBUSY | DDE_FAPPSTATUS))

Definition at line 225 of file ddeml.h.

◆ DDE_FADVRESERVED

#define DDE_FADVRESERVED   (~(DDE_FACKREQ | DDE_FDEFERUPD))

Definition at line 226 of file ddeml.h.

◆ DDE_FAPPSTATUS

#define DDE_FAPPSTATUS   0x00FF

Definition at line 222 of file ddeml.h.

◆ DDE_FBUSY

#define DDE_FBUSY   0x4000

Definition at line 217 of file ddeml.h.

◆ DDE_FDATRESERVED

#define DDE_FDATRESERVED   (~(DDE_FACKREQ | DDE_FRELEASE | DDE_FREQUESTED))

Definition at line 227 of file ddeml.h.

◆ DDE_FDEFERUPD

#define DDE_FDEFERUPD   0x4000

Definition at line 218 of file ddeml.h.

◆ DDE_FNOTPROCESSED

#define DDE_FNOTPROCESSED   0x0000

Definition at line 223 of file ddeml.h.

◆ DDE_FPOKRESERVED

#define DDE_FPOKRESERVED   (~(DDE_FRELEASE))

Definition at line 228 of file ddeml.h.

◆ DDE_FRELEASE

#define DDE_FRELEASE   0x2000

Definition at line 220 of file ddeml.h.

◆ DDE_FREQUESTED

#define DDE_FREQUESTED   0x1000

Definition at line 221 of file ddeml.h.

◆ DdeCreateStringHandle

#define DdeCreateStringHandle   WINELIB_NAME_AW(DdeCreateStringHandle)

Definition at line 354 of file ddeml.h.

◆ DdeInitialize

#define DdeInitialize   WINELIB_NAME_AW(DdeInitialize)

Definition at line 340 of file ddeml.h.

◆ DdeQueryString

#define DdeQueryString   WINELIB_NAME_AW(DdeQueryString)

Definition at line 346 of file ddeml.h.

◆ DMLERR_ADVACKTIMEOUT

#define DMLERR_ADVACKTIMEOUT   0x4000

Definition at line 246 of file ddeml.h.

◆ DMLERR_BUSY

#define DMLERR_BUSY   0x4001

Definition at line 247 of file ddeml.h.

◆ DMLERR_DATAACKTIMEOUT

#define DMLERR_DATAACKTIMEOUT   0x4002

Definition at line 248 of file ddeml.h.

◆ DMLERR_DLL_NOT_INITIALIZED

#define DMLERR_DLL_NOT_INITIALIZED   0x4003

Definition at line 249 of file ddeml.h.

◆ DMLERR_DLL_USAGE

#define DMLERR_DLL_USAGE   0x4004

Definition at line 250 of file ddeml.h.

◆ DMLERR_EXECACKTIMEOUT

#define DMLERR_EXECACKTIMEOUT   0x4005

Definition at line 251 of file ddeml.h.

◆ DMLERR_FIRST

#define DMLERR_FIRST   0x4000

Definition at line 244 of file ddeml.h.

◆ DMLERR_INVALIDPARAMETER

#define DMLERR_INVALIDPARAMETER   0x4006

Definition at line 252 of file ddeml.h.

◆ DMLERR_LAST

#define DMLERR_LAST   0x4011

Definition at line 265 of file ddeml.h.

◆ DMLERR_LOW_MEMORY

#define DMLERR_LOW_MEMORY   0x4007

Definition at line 253 of file ddeml.h.

◆ DMLERR_MEMORY_ERROR

#define DMLERR_MEMORY_ERROR   0x4008

Definition at line 254 of file ddeml.h.

◆ DMLERR_NO_CONV_ESTABLISHED

#define DMLERR_NO_CONV_ESTABLISHED   0x400a

Definition at line 256 of file ddeml.h.

◆ DMLERR_NO_ERROR

#define DMLERR_NO_ERROR   0 /* must be 0 */

Definition at line 242 of file ddeml.h.

◆ DMLERR_NOTPROCESSED

#define DMLERR_NOTPROCESSED   0x4009

Definition at line 255 of file ddeml.h.

◆ DMLERR_POKEACKTIMEOUT

#define DMLERR_POKEACKTIMEOUT   0x400b

Definition at line 257 of file ddeml.h.

◆ DMLERR_POSTMSG_FAILED

#define DMLERR_POSTMSG_FAILED   0x400c

Definition at line 258 of file ddeml.h.

◆ DMLERR_REENTRANCY

#define DMLERR_REENTRANCY   0x400d

Definition at line 259 of file ddeml.h.

◆ DMLERR_SERVER_DIED

#define DMLERR_SERVER_DIED   0x400e

Definition at line 260 of file ddeml.h.

◆ DMLERR_SYS_ERROR

#define DMLERR_SYS_ERROR   0x400f

Definition at line 261 of file ddeml.h.

◆ DMLERR_UNADVACKTIMEOUT

#define DMLERR_UNADVACKTIMEOUT   0x4010

Definition at line 262 of file ddeml.h.

◆ DMLERR_UNFOUND_QUEUE_ID

#define DMLERR_UNFOUND_QUEUE_ID   0x4011

Definition at line 263 of file ddeml.h.

◆ DNS_FILTEROFF

#define DNS_FILTEROFF   0x0008

Definition at line 155 of file ddeml.h.

◆ DNS_FILTERON

#define DNS_FILTERON   0x0004

Definition at line 154 of file ddeml.h.

◆ DNS_REGISTER

#define DNS_REGISTER   0x0001

Definition at line 152 of file ddeml.h.

◆ DNS_UNREGISTER

#define DNS_UNREGISTER   0x0002

Definition at line 153 of file ddeml.h.

◆ EC_DISABLE

#define EC_DISABLE   ST_BLOCKED

Definition at line 96 of file ddeml.h.

◆ EC_ENABLEALL

#define EC_ENABLEALL   0

Definition at line 94 of file ddeml.h.

◆ EC_ENABLEONE

#define EC_ENABLEONE   ST_BLOCKNEXT

Definition at line 95 of file ddeml.h.

◆ EC_QUERYWAITING

#define EC_QUERYWAITING   2

Definition at line 97 of file ddeml.h.

◆ EXPENTRY

#define EXPENTRY   CALLBACK

Definition at line 45 of file ddeml.h.

◆ HDATA_APPOWNED

#define HDATA_APPOWNED   0x0001

Definition at line 267 of file ddeml.h.

◆ MF_CALLBACKS

#define MF_CALLBACKS   0x08000000

Definition at line 141 of file ddeml.h.

◆ MF_CONV

#define MF_CONV   0x40000000

Definition at line 144 of file ddeml.h.

◆ MF_ERRORS

#define MF_ERRORS   0x10000000

Definition at line 142 of file ddeml.h.

◆ MF_HSZ_INFO

#define MF_HSZ_INFO   0x01000000

Definition at line 138 of file ddeml.h.

◆ MF_LINKS

#define MF_LINKS   0x20000000

Definition at line 143 of file ddeml.h.

◆ MF_MASK

#define MF_MASK   0xFF000000

Definition at line 146 of file ddeml.h.

◆ MF_POSTMSGS

#define MF_POSTMSGS   0x04000000

Definition at line 140 of file ddeml.h.

◆ MF_SENDMSGS

#define MF_SENDMSGS   0x02000000

Definition at line 139 of file ddeml.h.

◆ MSGF_DDEMGR

#define MSGF_DDEMGR   0x8001

Definition at line 38 of file ddeml.h.

◆ QID_SYNC

#define QID_SYNC   0xFFFFFFFF

Definition at line 40 of file ddeml.h.

◆ ST_ADVISE

#define ST_ADVISE   0x0002

Definition at line 81 of file ddeml.h.

◆ ST_BLOCKED

#define ST_BLOCKED   0x0008

Definition at line 83 of file ddeml.h.

◆ ST_BLOCKNEXT

#define ST_BLOCKNEXT   0x0080

Definition at line 87 of file ddeml.h.

◆ ST_CLIENT

#define ST_CLIENT   0x0010

Definition at line 84 of file ddeml.h.

◆ ST_CONNECTED

#define ST_CONNECTED   0x0001

Definition at line 80 of file ddeml.h.

◆ ST_INLIST

#define ST_INLIST   0x0040

Definition at line 86 of file ddeml.h.

◆ ST_ISLOCAL

#define ST_ISLOCAL   0x0004

Definition at line 82 of file ddeml.h.

◆ ST_ISSELF

#define ST_ISSELF   0x0100

Definition at line 88 of file ddeml.h.

◆ ST_TERMINATED

#define ST_TERMINATED   0x0020

Definition at line 85 of file ddeml.h.

◆ SZDDE_ITEM_ITEMLIST

#define SZDDE_ITEM_ITEMLIST   TEXT("TopicItemList")

Definition at line 54 of file ddeml.h.

◆ SZDDESYS_ITEM_FORMATS

#define SZDDESYS_ITEM_FORMATS   TEXT("Formats")

Definition at line 52 of file ddeml.h.

◆ SZDDESYS_ITEM_HELP

#define SZDDESYS_ITEM_HELP   TEXT("Help")

Definition at line 53 of file ddeml.h.

◆ SZDDESYS_ITEM_RTNMSG

#define SZDDESYS_ITEM_RTNMSG   TEXT("ReturnMessage")

Definition at line 50 of file ddeml.h.

◆ SZDDESYS_ITEM_STATUS

#define SZDDESYS_ITEM_STATUS   TEXT("Status")

Definition at line 51 of file ddeml.h.

◆ SZDDESYS_ITEM_SYSITEMS

#define SZDDESYS_ITEM_SYSITEMS   TEXT("SysItems")

Definition at line 49 of file ddeml.h.

◆ SZDDESYS_ITEM_TOPICS

#define SZDDESYS_ITEM_TOPICS   TEXT("Topics")

Definition at line 48 of file ddeml.h.

◆ SZDDESYS_TOPIC

#define SZDDESYS_TOPIC   TEXT("System")

Definition at line 47 of file ddeml.h.

◆ TIMEOUT_ASYNC

#define TIMEOUT_ASYNC   0xFFFFFFFF

Definition at line 200 of file ddeml.h.

◆ XCLASS_BOOL

#define XCLASS_BOOL   0x1000

Definition at line 175 of file ddeml.h.

◆ XCLASS_DATA

#define XCLASS_DATA   0x2000

Definition at line 176 of file ddeml.h.

◆ XCLASS_FLAGS

#define XCLASS_FLAGS   0x4000

Definition at line 177 of file ddeml.h.

◆ XCLASS_MASK

#define XCLASS_MASK   0xFC00

Definition at line 174 of file ddeml.h.

◆ XCLASS_NOTIFICATION

#define XCLASS_NOTIFICATION   0x8000

Definition at line 178 of file ddeml.h.

◆ XST_ADVACKRCVD

#define XST_ADVACKRCVD   13

Definition at line 75 of file ddeml.h.

◆ XST_ADVDATAACKRCVD

#define XST_ADVDATAACKRCVD   16

Definition at line 78 of file ddeml.h.

◆ XST_ADVDATASENT

#define XST_ADVDATASENT   15

Definition at line 77 of file ddeml.h.

◆ XST_ADVSENT

#define XST_ADVSENT   11

Definition at line 73 of file ddeml.h.

◆ XST_CONNECTED

#define XST_CONNECTED   2

Definition at line 64 of file ddeml.h.

◆ XST_DATARCVD

#define XST_DATARCVD   6

Definition at line 68 of file ddeml.h.

◆ XST_EXECACKRCVD

#define XST_EXECACKRCVD   10

Definition at line 72 of file ddeml.h.

◆ XST_EXECSENT

#define XST_EXECSENT   9

Definition at line 71 of file ddeml.h.

◆ XST_INCOMPLETE

#define XST_INCOMPLETE   1

Definition at line 63 of file ddeml.h.

◆ XST_INIT1

#define XST_INIT1   3

Definition at line 65 of file ddeml.h.

◆ XST_INIT2

#define XST_INIT2   4

Definition at line 66 of file ddeml.h.

◆ XST_NULL

#define XST_NULL   0

Definition at line 62 of file ddeml.h.

◆ XST_POKEACKRCVD

#define XST_POKEACKRCVD   8

Definition at line 70 of file ddeml.h.

◆ XST_POKESENT

#define XST_POKESENT   7

Definition at line 69 of file ddeml.h.

◆ XST_REQSENT

#define XST_REQSENT   5

Definition at line 67 of file ddeml.h.

◆ XST_UNADVACKRCVD

#define XST_UNADVACKRCVD   14

Definition at line 76 of file ddeml.h.

◆ XST_UNADVSENT

#define XST_UNADVSENT   12

Definition at line 74 of file ddeml.h.

◆ XTYP_ADVDATA

#define XTYP_ADVDATA   (0x0010 | XCLASS_FLAGS)

Definition at line 181 of file ddeml.h.

◆ XTYP_ADVREQ

#define XTYP_ADVREQ   (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK)

Definition at line 182 of file ddeml.h.

◆ XTYP_ADVSTART

#define XTYP_ADVSTART   (0x0030 | XCLASS_BOOL)

Definition at line 183 of file ddeml.h.

◆ XTYP_ADVSTOP

#define XTYP_ADVSTOP   (0x0040 | XCLASS_NOTIFICATION)

Definition at line 184 of file ddeml.h.

◆ XTYP_CONNECT

#define XTYP_CONNECT   (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)

Definition at line 186 of file ddeml.h.

◆ XTYP_CONNECT_CONFIRM

#define XTYP_CONNECT_CONFIRM   (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)

Definition at line 187 of file ddeml.h.

◆ XTYP_DISCONNECT

#define XTYP_DISCONNECT   (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )

Definition at line 192 of file ddeml.h.

◆ XTYP_ERROR

#define XTYP_ERROR   (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)

Definition at line 180 of file ddeml.h.

◆ XTYP_EXECUTE

#define XTYP_EXECUTE   (0x0050 | XCLASS_FLAGS)

Definition at line 185 of file ddeml.h.

◆ XTYP_MASK

#define XTYP_MASK   0x00F0

Definition at line 197 of file ddeml.h.

◆ XTYP_MONITOR

#define XTYP_MONITOR   (0x00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)

Definition at line 195 of file ddeml.h.

◆ XTYP_POKE

#define XTYP_POKE   (0x0090 | XCLASS_FLAGS)

Definition at line 189 of file ddeml.h.

◆ XTYP_REGISTER

#define XTYP_REGISTER   (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )

Definition at line 190 of file ddeml.h.

◆ XTYP_REQUEST

#define XTYP_REQUEST   (0x00B0 | XCLASS_DATA )

Definition at line 191 of file ddeml.h.

◆ XTYP_SHIFT

#define XTYP_SHIFT   4

Definition at line 198 of file ddeml.h.

◆ XTYP_UNREGISTER

#define XTYP_UNREGISTER   (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )

Definition at line 193 of file ddeml.h.

◆ XTYP_WILDCONNECT

#define XTYP_WILDCONNECT   (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)

Definition at line 194 of file ddeml.h.

◆ XTYP_XACT_COMPLETE

#define XTYP_XACT_COMPLETE   (0x0080 | XCLASS_NOTIFICATION )

Definition at line 188 of file ddeml.h.

◆ XTYPF_ACKREQ

#define XTYPF_ACKREQ   0x0008 /* DDE_FACKREQ */

Definition at line 172 of file ddeml.h.

◆ XTYPF_NOBLOCK

#define XTYPF_NOBLOCK   0x0002 /* CBR_NOBLOCK will not work */

Definition at line 170 of file ddeml.h.

◆ XTYPF_NODATA

#define XTYPF_NODATA   0x0004 /* DDE_FDEFERUPD */

Definition at line 171 of file ddeml.h.

Typedef Documentation

◆ CONVCONTEXT

◆ CONVINFO

◆ HSZPAIR

◆ PCONVCONTEXT

◆ PCONVINFO

◆ PFNCALLBACK

typedef HDDEDATA(CALLBACK * PFNCALLBACK) (UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, ULONG_PTR, ULONG_PTR)

Definition at line 290 of file ddeml.h.

◆ PHSZPAIR

Function Documentation

◆ DdeAbandonTransaction()

BOOL WINAPI DdeAbandonTransaction ( DWORD  idInst,
HCONV  hConv,
DWORD  idTransaction 
)

Definition at line 1229 of file ddeclient.c.

1230{
1232 WDML_CONV* pConv;
1233 WDML_XACT* pXAct;
1234
1235 if ((pInstance = WDML_GetInstance(idInst)))
1236 {
1237 if (hConv)
1238 {
1239 if ((pConv = WDML_GetConv(hConv, TRUE)) && pConv->instance == pInstance)
1240 {
1241
1242 pXAct = pConv->transactions;
1243 while (pXAct) {
1244 WDML_XACT *nextXAct = pXAct->next;
1245
1246 if (pXAct->dwTimeout == TIMEOUT_ASYNC &&
1247 (idTransaction == 0 || pXAct->xActID == idTransaction))
1248 {
1249 WDML_UnQueueTransaction(pConv, pXAct);
1251 }
1252 pXAct = nextXAct;
1253 }
1254 }
1255 }
1256 else
1257 {
1258 for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv; pConv = pConv->next)
1259 {
1260 if (!(pConv->wStatus & ST_CONNECTED)) continue;
1261 pXAct = pConv->transactions;
1262 while (pXAct) {
1263 WDML_XACT *nextXAct = pXAct->next;
1264
1265 if (pXAct->dwTimeout == TIMEOUT_ASYNC)
1266 {
1267 WDML_UnQueueTransaction(pConv, pXAct);
1269 }
1270 pXAct = nextXAct;
1271 }
1272 }
1273 }
1274 }
1275
1276 return TRUE;
1277}
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected)
Definition: ddemisc.c:2239
void WDML_FreeTransaction(WDML_INSTANCE *pInstance, WDML_XACT *pXAct, BOOL doFreePmt)
Definition: ddemisc.c:1975
BOOL WDML_UnQueueTransaction(WDML_CONV *pConv, WDML_XACT *pXAct)
Definition: ddemisc.c:1955
@ WDML_CLIENT_SIDE
Definition: dde_private.h:184
WDML_INSTANCE * WDML_GetInstance(DWORD InstId)
Definition: ddemisc.c:1234
#define ST_CONNECTED
Definition: ddeml.h:80
#define TIMEOUT_ASYNC
Definition: ddeml.h:200
#define TRUE
Definition: types.h:120
FxWmiInstanceExternal * pInstance
Definition: fxwmiapi.cpp:117
struct tagWDML_CONV * next
Definition: dde_private.h:129
WDML_XACT * transactions
Definition: dde_private.h:138
struct tagWDML_INSTANCE * instance
Definition: dde_private.h:130
struct tagWDML_XACT * next
Definition: dde_private.h:113
DWORD dwTimeout
Definition: dde_private.h:117

◆ DdeAccessData()

LPBYTE WINAPI DdeAccessData ( HDDEDATA  hData,
LPDWORD  pcbDataSize 
)

Definition at line 1427 of file ddemisc.c.

1428{
1429 HGLOBAL hMem = hData;
1430 DDE_DATAHANDLE_HEAD* pDdh;
1431
1432 TRACE("(%p,%p)\n", hData, pcbDataSize);
1433
1434 pDdh = GlobalLock(hMem);
1435 if (pDdh == NULL)
1436 {
1437 ERR("Failed on GlobalLock(%p)\n", hMem);
1438 return 0;
1439 }
1440
1441 if (pcbDataSize != NULL)
1442 {
1443 *pcbDataSize = GlobalSize(hMem) - sizeof(DDE_DATAHANDLE_HEAD);
1444 }
1445 TRACE("=> %p (%Iu) fmt %04x\n", pDdh + 1, GlobalSize(hMem) - sizeof(DDE_DATAHANDLE_HEAD), pDdh->cfFormat);
1446 return (LPBYTE)(pDdh + 1);
1447}
#define ERR(fmt,...)
Definition: precomp.h:57
struct tagDDE_DATAHANDLE_HEAD DDE_DATAHANDLE_HEAD
#define NULL
Definition: types.h:112
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
static ERESOURCE GlobalLock
Definition: sys_arch.c:8
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by Dde_OnExecute(), DdeAddData(), DdeGetData(), map_A_to_W(), map_W_to_A(), server_ddeml_callback(), test_DdeCreateDataHandle(), test_ddeml_client(), WDML_ClientQueueExecute(), and WDML_ServerNameProc().

◆ DdeAddData()

HDDEDATA WINAPI DdeAddData ( HDDEDATA  hData,
LPBYTE  pSrc,
DWORD  cb,
DWORD  cbOff 
)

Definition at line 1345 of file ddemisc.c.

1346{
1347 DWORD old_sz, new_sz;
1348 LPBYTE pDst;
1349
1350 TRACE("(%p,%p,cb %ld, cbOff %ld)\n", hData, pSrc, cb, cbOff);
1351
1352 pDst = DdeAccessData(hData, &old_sz);
1353 if (!pDst) return 0;
1354
1355 new_sz = cb + cbOff;
1356 if (new_sz > old_sz)
1357 {
1358 DdeUnaccessData(hData);
1359 hData = GlobalReAlloc(hData, new_sz + sizeof(DDE_DATAHANDLE_HEAD),
1361 pDst = DdeAccessData(hData, &old_sz);
1362 }
1363
1364 if (!pDst) return 0;
1365
1366 memcpy(pDst + cbOff, pSrc, cb);
1367 DdeUnaccessData(hData);
1368 return hData;
1369}
BOOL WINAPI DdeUnaccessData(HDDEDATA hData)
Definition: ddemisc.c:1452
LPBYTE WINAPI DdeAccessData(HDDEDATA hData, LPDWORD pcbDataSize)
Definition: ddemisc.c:1427
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
unsigned long DWORD
Definition: ntddk_ex.h:95
HGLOBAL NTAPI GlobalReAlloc(HGLOBAL hMem, SIZE_T dwBytes, UINT uFlags)
Definition: heapmem.c:825
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define GMEM_MOVEABLE
Definition: winbase.h:318
#define GMEM_DDESHARE
Definition: winbase.h:322

◆ DdeClientTransaction()

HDDEDATA WINAPI DdeClientTransaction ( LPBYTE  pData,
DWORD  cbData,
HCONV  hConv,
HSZ  hszItem,
UINT  wFmt,
UINT  wType,
DWORD  dwTimeout,
LPDWORD  pdwResult 
)

Definition at line 1127 of file ddeclient.c.

1129{
1130 WDML_CONV* pConv;
1131 WDML_XACT* pXAct;
1132 HDDEDATA hDdeData;
1133
1134 TRACE("(%p,%ld,%p,%p,%x,%x,%ld,%p)\n",
1135 pData, cbData, hConv, hszItem, wFmt, wType, dwTimeout, pdwResult);
1136
1137 if (hConv == 0)
1138 {
1139 WARN("Invalid conversation handle NULL\n");
1140 return 0;
1141 }
1142
1143 pConv = WDML_GetConv(hConv, TRUE);
1144 if (pConv == NULL)
1145 {
1146 /* cannot set error... cannot get back to DDE instance */
1147 return 0;
1148 }
1149
1150 switch (wType)
1151 {
1152 case XTYP_EXECUTE:
1153 /* Windows simply ignores hszItem and wFmt in this case */
1154 pXAct = WDML_ClientQueueExecute(pConv, pData, cbData);
1155 if (pXAct == NULL)
1156 return 0;
1157 break;
1158 case XTYP_POKE:
1159 if (!hszItem)
1160 {
1161 pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1162 return 0;
1163 }
1164 pXAct = WDML_ClientQueuePoke(pConv, pData, cbData, wFmt, hszItem);
1165 break;
1168 case XTYP_ADVSTART:
1170 if (pData)
1171 {
1172 pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1173 return 0;
1174 }
1175 pXAct = WDML_ClientQueueAdvise(pConv, wType, wFmt, hszItem);
1176 break;
1177 case XTYP_ADVSTOP:
1178 if (pData)
1179 {
1180 pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1181 return 0;
1182 }
1183 pXAct = WDML_ClientQueueUnadvise(pConv, wFmt, hszItem);
1184 break;
1185 case XTYP_REQUEST:
1186 if (pData || !hszItem)
1187 {
1188 pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1189 return 0;
1190 }
1191 pXAct = WDML_ClientQueueRequest(pConv, wFmt, hszItem);
1192 break;
1193 default:
1194 FIXME("Unknown transaction type %04x\n", wType);
1195 /* unknown transaction type */
1196 pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1197 return 0;
1198 }
1199
1200 if (pXAct == NULL)
1201 {
1202 pConv->instance->lastError = DMLERR_MEMORY_ERROR;
1203 return 0;
1204 }
1205
1206 WDML_QueueTransaction(pConv, pXAct);
1207
1208 TRACE("pConv->wStatus %04lx\n", pConv->wStatus);
1209
1210 if (pConv->wStatus & ST_BLOCKED)
1211 {
1212 TRACE("Transactions are blocked, add to the queue and exit\n");
1213 return (HDDEDATA)1;
1214 }
1215
1216 hDdeData = WDML_ClientHandle(pConv, pXAct, dwTimeout, pdwResult);
1217 if (dwTimeout != TIMEOUT_ASYNC)
1218 {
1219 WDML_UnQueueTransaction(pConv, pXAct);
1220 WDML_FreeTransaction(pConv->instance, pXAct, TRUE);
1221 }
1222
1223 return hDdeData;
1224}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
void WDML_QueueTransaction(WDML_CONV *pConv, WDML_XACT *pXAct)
Definition: ddemisc.c:1941
static WDML_XACT * WDML_ClientQueueRequest(WDML_CONV *pConv, UINT wFmt, HSZ hszItem)
Definition: ddeclient.c:464
static WDML_XACT * WDML_ClientQueueExecute(WDML_CONV *pConv, LPVOID pData, DWORD cbData)
Definition: ddeclient.c:623
static WDML_XACT * WDML_ClientQueueUnadvise(WDML_CONV *pConv, UINT wFmt, HSZ hszItem)
Definition: ddeclient.c:390
HDDEDATA WDML_ClientHandle(WDML_CONV *pConv, WDML_XACT *pXAct, DWORD dwTimeout, LPDWORD pdwResult)
Definition: ddeclient.c:1095
static WDML_XACT * WDML_ClientQueueAdvise(WDML_CONV *pConv, UINT wType, UINT wFmt, HSZ hszItem)
Definition: ddeclient.c:294
static WDML_XACT * WDML_ClientQueuePoke(WDML_CONV *pConv, LPVOID pData, DWORD cbData, UINT wFmt, HSZ hszItem)
Definition: ddeclient.c:701
#define XTYPF_NODATA
Definition: ddeml.h:171
#define XTYP_ADVSTART
Definition: ddeml.h:183
#define XTYP_REQUEST
Definition: ddeml.h:191
#define XTYP_ADVSTOP
Definition: ddeml.h:184
#define DMLERR_MEMORY_ERROR
Definition: ddeml.h:254
#define XTYP_POKE
Definition: ddeml.h:189
#define ST_BLOCKED
Definition: ddeml.h:83
#define XTYP_EXECUTE
Definition: ddeml.h:185
#define XTYPF_ACKREQ
Definition: ddeml.h:172
#define DMLERR_INVALIDPARAMETER
Definition: ddeml.h:252
_In_ UINT _In_ DWORD _Out_ DWORD * pdwResult
Definition: ntgdi.h:270
PCBYTE PBYTE SIZE_T cbData
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830

Referenced by dde_connect(), dde_execute(), dde_request(), DdeReconnect(), test_dde_aw_transaction(), test_ddeml_client(), test_end_to_end_client(), and test_initialisation().

◆ DdeCmpStringHandles()

INT WINAPI DdeCmpStringHandles ( HSZ  hsz1,
HSZ  hsz2 
)

Definition at line 689 of file ddemisc.c.

690{
691 WCHAR psz1[MAX_BUFFER_LEN];
692 WCHAR psz2[MAX_BUFFER_LEN];
693 int ret = 0;
694 int ret1, ret2;
695
696 ret1 = GetAtomNameW(HSZ2ATOM(hsz1), psz1, MAX_BUFFER_LEN);
697 ret2 = GetAtomNameW(HSZ2ATOM(hsz2), psz2, MAX_BUFFER_LEN);
698
699 TRACE("(%p<%s> %p<%s>);\n", hsz1, debugstr_w(psz1), hsz2, debugstr_w(psz2));
700
701 /* Make sure we found both strings. */
702 if (ret1 == 0 && ret2 == 0)
703 {
704 /* If both are not found, return both "zero strings". */
705 ret = 0;
706 }
707 else if (ret1 == 0)
708 {
709 /* If hsz1 is a not found, return hsz1 is "zero string". */
710 ret = -1;
711 }
712 else if (ret2 == 0)
713 {
714 /* If hsz2 is a not found, return hsz2 is "zero string". */
715 ret = 1;
716 }
717 else
718 {
719 /* Compare the two strings we got (case insensitive). */
720 ret = lstrcmpiW(psz1, psz2);
721 /* Since strcmp returns any number smaller than
722 * 0 when the first string is found to be less than
723 * the second one we must make sure we are returning
724 * the proper values.
725 */
726 if (ret < 0)
727 {
728 ret = -1;
729 }
730 else if (ret > 0)
731 {
732 ret = 1;
733 }
734 }
735
736 return ret;
737}
#define MAX_BUFFER_LEN
Definition: dde_private.h:37
#define HSZ2ATOM(hsz)
Definition: ddemisc.c:34
UINT WINAPI GetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
Definition: atom.c:569
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
return ret
Definition: mutex.c:147
#define debugstr_w
Definition: kernel32.h:32
short WCHAR
Definition: pedump.c:58

Referenced by dde_proc(), ddeCb(), DdePostAdvise(), WDML_FindConv(), WDML_FindLink(), WDML_HandleAdviseReply(), WDML_HandlePokeReply(), WDML_HandleRequestReply(), WDML_HandleUnadviseReply(), WDML_RemoveLink(), WDML_RemoveServer(), and WDML_ServerNameProc().

◆ DdeConnect()

HCONV WINAPI DdeConnect ( DWORD  idInst,
HSZ  hszService,
HSZ  hszTopic,
PCONVCONTEXT  pCC 
)

Definition at line 89 of file ddeclient.c.

91{
92 HWND hwndClient;
94 WDML_CONV* pConv;
95 ATOM aSrv = 0, aTpc = 0;
96
97 TRACE("(0x%lx,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC);
98
100 if (!pInstance)
101 return NULL;
102
103 /* make sure this conv is never created */
104 pConv = WDML_FindConv(pInstance, WDML_CLIENT_SIDE, hszService, hszTopic);
105 if (pConv != NULL)
106 {
107 ERR("This Conv already exists: (%p)\n", pConv);
108 return NULL;
109 }
110
111 /* we need to establish a conversation with
112 server, so create a window for it */
113
114 if (pInstance->unicode)
115 {
116 WNDCLASSEXW wndclass;
117
118 wndclass.cbSize = sizeof(wndclass);
119 wndclass.style = 0;
120 wndclass.lpfnWndProc = WDML_ClientProc;
121 wndclass.cbClsExtra = 0;
122 wndclass.cbWndExtra = 2 * sizeof(ULONG_PTR);
123 wndclass.hInstance = 0;
124 wndclass.hIcon = 0;
125 wndclass.hCursor = 0;
126 wndclass.hbrBackground = 0;
127 wndclass.lpszMenuName = NULL;
129 wndclass.hIconSm = 0;
130
131 RegisterClassExW(&wndclass);
132
133 hwndClient = CreateWindowW(WDML_szClientConvClassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0);
134 }
135 else
136 {
137 WNDCLASSEXA wndclass;
138
139 wndclass.cbSize = sizeof(wndclass);
140 wndclass.style = 0;
141 wndclass.lpfnWndProc = WDML_ClientProc;
142 wndclass.cbClsExtra = 0;
143 wndclass.cbWndExtra = 2 * sizeof(ULONG_PTR);
144 wndclass.hInstance = 0;
145 wndclass.hIcon = 0;
146 wndclass.hCursor = 0;
147 wndclass.hbrBackground = 0;
148 wndclass.lpszMenuName = NULL;
150 wndclass.hIconSm = 0;
151
152 RegisterClassExA(&wndclass);
153
154 hwndClient = CreateWindowA(WDML_szClientConvClassA, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0);
155 }
156
158
159 if (hszService)
160 {
161 aSrv = WDML_MakeAtomFromHsz(hszService);
162 if (!aSrv) goto theEnd;
163 }
164 if (hszTopic)
165 {
167 if (!aTpc) goto theEnd;
168 }
169
170 /* note: sent messages shall not use packing */
173
174 pInstance = WDML_GetInstance(idInst);
175 if (!pInstance)
176 {
177 goto theEnd;
178 }
179
180 /* At this point, Client WM_DDE_ACK should have saved hwndServer
181 for this instance id and hwndClient if server responds.
182 So get HCONV and return it. And add it to conv list */
183 pConv = WDML_GetConvFromWnd(hwndClient);
184 if (pConv == NULL || pConv->hwndServer == 0)
185 {
186 WARN("Done with INITIATE, but no Server window available\n");
187 pConv = NULL;
189 goto theEnd;
190 }
191 TRACE("Connected to Server window (%p)\n", pConv->hwndServer);
192 pConv->wConvst = XST_CONNECTED;
193
194 /* finish init of pConv */
195 if (pCC != NULL)
196 {
197 pConv->convContext = *pCC;
198 }
199 else
200 {
201 memset(&pConv->convContext, 0, sizeof(pConv->convContext));
202 pConv->convContext.cb = sizeof(pConv->convContext);
204 }
205
206 theEnd:
207
208 if (aSrv) GlobalDeleteAtom(aSrv);
209 if (aTpc) GlobalDeleteAtom(aTpc);
210 return (HCONV)pConv;
211}
#define WM_DDE_INITIATE
Definition: dde.h:37
ATOM WDML_MakeAtomFromHsz(HSZ hsz)
Definition: ddemisc.c:329
WDML_CONV * WDML_FindConv(WDML_INSTANCE *pInstance, WDML_SIDE side, HSZ hszService, HSZ hszTopic)
Definition: ddemisc.c:2056
WDML_CONV * WDML_GetConvFromWnd(HWND hWnd)
Definition: ddemisc.c:2274
#define GWL_WDML_INSTANCE
Definition: dde_private.h:262
static LRESULT CALLBACK WDML_ClientProc(HWND, UINT, WPARAM, LPARAM)
Definition: ddeclient.c:1284
const WCHAR WDML_szClientConvClassW[]
Definition: ddeclient.c:36
const char WDML_szClientConvClassA[]
Definition: ddeclient.c:35
#define XST_CONNECTED
Definition: ddeml.h:64
#define CP_WINANSI
Definition: ddeml.h:32
#define CP_WINUNICODE
Definition: ddeml.h:33
#define DMLERR_NO_CONV_ESTABLISHED
Definition: ddeml.h:256
WORD ATOM
Definition: dimm.idl:113
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:444
#define ULONG_PTR
Definition: config.h:101
UINT_PTR WPARAM
Definition: minwindef.h:174
#define WS_POPUP
Definition: pedump.c:616
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4469
#define HWND_BROADCAST
Definition: winuser.h:1215
LRESULT WINAPI SendMessageTimeoutW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4470
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1234
#define SetWindowLongPtrW
Definition: winuser.h:5512
#define memset(x, y, z)
Definition: compat.h:39
static HSZ hszTopic
Definition: shlexec.c:148
int cbClsExtra
Definition: winuser.h:3312
HINSTANCE hInstance
Definition: winuser.h:3314
HCURSOR hCursor
Definition: winuser.h:3316
LPCSTR lpszMenuName
Definition: winuser.h:3318
HICON hIconSm
Definition: winuser.h:3320
UINT style
Definition: winuser.h:3310
int cbWndExtra
Definition: winuser.h:3313
UINT cbSize
Definition: winuser.h:3309
WNDPROC lpfnWndProc
Definition: winuser.h:3311
LPCSTR lpszClassName
Definition: winuser.h:3319
HICON hIcon
Definition: winuser.h:3315
HBRUSH hbrBackground
Definition: winuser.h:3317
LPCWSTR lpszClassName
Definition: winuser.h:3334
LPCWSTR lpszMenuName
Definition: winuser.h:3333
HBRUSH hbrBackground
Definition: winuser.h:3332
WNDPROC lpfnWndProc
Definition: winuser.h:3326
UINT cbSize
Definition: winuser.h:3324
int cbWndExtra
Definition: winuser.h:3328
HCURSOR hCursor
Definition: winuser.h:3331
HICON hIconSm
Definition: winuser.h:3335
HINSTANCE hInstance
Definition: winuser.h:3329
UINT style
Definition: winuser.h:3325
int cbClsExtra
Definition: winuser.h:3327
HICON hIcon
Definition: winuser.h:3330
INT iCodePage
Definition: ddeml.h:310
CONVCONTEXT convContext
Definition: dde_private.h:135
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by dde_connect(), START_TEST(), test_dde_aw_transaction(), test_ddeml_client(), test_end_to_end_client(), and test_initialisation().

◆ DdeConnectList()

HCONVLIST WINAPI DdeConnectList ( DWORD  idInst,
HSZ  hszService,
HSZ  hszTopic,
HCONVLIST  hConvList,
PCONVCONTEXT  pCC 
)

Definition at line 53 of file ddeclient.c.

55{
56 FIXME("(%ld,%p,%p,%p,%p): stub\n", idInst, hszService, hszTopic, hConvList, pCC);
57 return (HCONVLIST)1;
58}

◆ DdeCreateDataHandle()

HDDEDATA WINAPI DdeCreateDataHandle ( DWORD  idInst,
LPBYTE  pSrc,
DWORD  cb,
DWORD  cbOff,
HSZ  hszItem,
UINT  wFmt,
UINT  afCmd 
)

Definition at line 1279 of file ddemisc.c.

1281{
1282
1283 /* Other than check for validity we will ignore for now idInst, hszItem.
1284 * The purpose of these arguments still need to be investigated.
1285 */
1286
1288 HGLOBAL hMem;
1289 LPBYTE pByte;
1290 DDE_DATAHANDLE_HEAD* pDdh;
1291 WCHAR psz[MAX_BUFFER_LEN];
1292
1293 pInstance = WDML_GetInstance(idInst);
1294 if (pInstance == NULL)
1295 {
1297 return NULL;
1298 }
1299
1300 if (!GetAtomNameW(HSZ2ATOM(hszItem), psz, MAX_BUFFER_LEN))
1301 {
1302 psz[0] = HSZ2ATOM(hszItem);
1303 psz[1] = 0;
1304 }
1305
1306 TRACE("(%ld,%p,cb %ld, cbOff %ld,%p <%s>,fmt %04x,%x)\n",
1307 idInst, pSrc, cb, cbOff, hszItem, debugstr_w(psz), wFmt, afCmd);
1308
1309 if (afCmd != 0 && afCmd != HDATA_APPOWNED)
1310 return 0;
1311
1312 /* we use the first 4 bytes to store the size */
1313 if (!(hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, cb + cbOff + sizeof(DDE_DATAHANDLE_HEAD))))
1314 {
1315 ERR("GlobalAlloc failed\n");
1316 return 0;
1317 }
1318
1319 pDdh = GlobalLock(hMem);
1320 if (!pDdh)
1321 {
1322 GlobalFree(hMem);
1323 return 0;
1324 }
1325
1326 pDdh->cfFormat = wFmt;
1327 pDdh->bAppOwned = (afCmd == HDATA_APPOWNED);
1328
1329 pByte = (LPBYTE)(pDdh + 1);
1330 if (pSrc)
1331 {
1332 if (cbOff) memset(pByte, 0, cbOff);
1333 memcpy(pByte + cbOff, pSrc, cb);
1334 }
1335 GlobalUnlock(hMem);
1336
1337 TRACE("=> %p\n", hMem);
1338 return hMem;
1339}
static void WDML_SetAllLastError(DWORD lastError)
Definition: ddemisc.c:283
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1234
#define HDATA_APPOWNED
Definition: ddeml.h:267
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368

Referenced by dde_execute(), map_A_to_W(), map_W_to_A(), server_ddeml_callback(), test_DdeCreateDataHandle(), test_ddeml_client(), WDML_Global2DataHandle(), WDML_ServerHandleExecute(), and WDML_ServerHandlePoke().

◆ DdeCreateStringHandleA()

HSZ WINAPI DdeCreateStringHandleA ( DWORD  idInst,
LPCSTR  psz,
INT  codepage 
)

Definition at line 581 of file ddemisc.c.

582{
583 HSZ hsz = 0;
585
586 TRACE("(%ld,%s,%d)\n", idInst, debugstr_a(psz), codepage);
587
588 pInstance = WDML_GetInstance(idInst);
589 if (pInstance == NULL)
591 else
592 {
593 if (codepage == 0) codepage = CP_WINANSI;
595 }
596
597 return hsz;
598}
static HSZ WDML_CreateString(WDML_INSTANCE *pInstance, LPCVOID ptr, int codepage)
Definition: ddemisc.c:554
#define debugstr_a
Definition: kernel32.h:31
int codepage
Definition: win_iconv.c:156

Referenced by dde_request(), doChild(), START_TEST(), test_dde_default_app(), test_DdeCreateDataHandle(), test_ddeml_client(), test_ddeml_server(), test_end_to_end_client(), test_end_to_end_server(), and test_initialisation().

◆ DdeCreateStringHandleW()

HSZ WINAPI DdeCreateStringHandleW ( DWORD  idInst,
LPCWSTR  psz,
INT  codepage 
)

◆ DdeDisconnect()

BOOL WINAPI DdeDisconnect ( HCONV  hConv)

Definition at line 1368 of file ddeclient.c.

1369{
1370 WDML_CONV* pConv;
1371 WDML_XACT* pXAct;
1372 BOOL ret = FALSE;
1373
1374 TRACE("(%p)\n", hConv);
1375
1376 if (hConv == 0)
1377 {
1378 WARN("DdeDisconnect(): hConv = 0\n");
1379 return FALSE;
1380 }
1381
1382 pConv = WDML_GetConv(hConv, TRUE);
1383 if (pConv != NULL)
1384 {
1385 if (pConv->wStatus & ST_CLIENT)
1386 {
1387 /* FIXME: should abandon all pending transactions */
1388 pXAct = WDML_ClientQueueTerminate(pConv);
1389 if (pXAct != NULL)
1390 {
1391 if (PostMessageW(pConv->hwndServer, pXAct->ddeMsg,
1392 (WPARAM)pConv->hwndClient, pXAct->lParam))
1393 {
1394 WDML_SyncWaitTransactionReply(hConv, 10000, pXAct, NULL);
1395 ret = TRUE;
1396 }
1397 else
1398 pConv->instance->lastError = DMLERR_POSTMSG_FAILED;
1399
1400 WDML_FreeTransaction(pConv->instance, pXAct, TRUE);
1401 /* still have to destroy data associated with conversation */
1403 }
1404 else
1405 {
1406 FIXME("Not implemented yet for a server side conversation\n");
1407 }
1408 }
1409 }
1410
1411 return ret;
1412}
void WDML_RemoveConv(WDML_CONV *pConv, WDML_SIDE side)
Definition: ddemisc.c:2078
static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, const WDML_XACT *pXAct, DWORD *ack)
Definition: ddeclient.c:1012
static WDML_XACT * WDML_ClientQueueTerminate(WDML_CONV *pConv)
Definition: ddeclient.c:786
#define ST_CLIENT
Definition: ddeml.h:84
#define DMLERR_POSTMSG_FAILED
Definition: ddeml.h:258
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: dde_private.h:124

Referenced by dde_connect(), DdeUninitialize(), START_TEST(), test_dde_aw_transaction(), test_ddeml_client(), test_end_to_end_client(), and test_initialisation().

◆ DdeDisconnectList()

BOOL WINAPI DdeDisconnectList ( HCONVLIST  hConvList)

Definition at line 80 of file ddeclient.c.

81{
82 FIXME("(%p): stub\n", hConvList);
83 return TRUE;
84}

◆ DdeEnableCallback()

BOOL WINAPI DdeEnableCallback ( DWORD  idInst,
HCONV  hConv,
UINT  wCmd 
)

Definition at line 2187 of file ddemisc.c.

2188{
2189 BOOL ret = FALSE;
2190 WDML_CONV *pConv;
2191
2192 TRACE("(%ld, %p, %04x)\n", idInst, hConv, wCmd);
2193
2194 if (hConv)
2195 {
2196 pConv = WDML_GetConv(hConv, TRUE);
2197
2198 if (pConv && pConv->instance->instanceID == idInst)
2199 ret = WDML_EnableCallback(pConv, wCmd);
2200 }
2201 else
2202 {
2204
2205 if (!pInstance)
2206 return FALSE;
2207
2208 TRACE("adding flags %04x to instance %p\n", wCmd, pInstance);
2209 pInstance->wStatus |= wCmd;
2210
2211 if (wCmd == EC_DISABLE)
2212 {
2213 pInstance->wStatus |= ST_BLOCKED;
2214 TRACE("EC_DISABLE: inst %p status flags %04lx\n", pInstance, pInstance->wStatus);
2215 }
2216 else if (wCmd == EC_ENABLEALL)
2217 {
2218 pInstance->wStatus &= ~ST_BLOCKED;
2219 TRACE("EC_ENABLEALL: inst %p status flags %04lx\n", pInstance, pInstance->wStatus);
2220 }
2221
2222 ret = TRUE;
2223
2224 for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv != NULL; pConv = pConv->next)
2225 {
2226 ret = WDML_EnableCallback(pConv, wCmd);
2227 if (ret && wCmd == EC_QUERYWAITING) break;
2228 }
2229 }
2230
2231 return ret;
2232}
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected)
Definition: ddemisc.c:2239
static BOOL WDML_EnableCallback(WDML_CONV *pConv, UINT wCmd)
Definition: ddemisc.c:2136
#define EC_ENABLEALL
Definition: ddeml.h:94
#define EC_DISABLE
Definition: ddeml.h:96
#define EC_QUERYWAITING
Definition: ddeml.h:97

◆ DdeFreeDataHandle()

BOOL WINAPI DdeFreeDataHandle ( HDDEDATA  hData)

Definition at line 1466 of file ddemisc.c.

1467{
1468 TRACE("(%p)\n", hData);
1469
1470 /* 1 is the handle value returned by an asynchronous operation. */
1471 if (hData == (HDDEDATA)1)
1472 return TRUE;
1473
1474 return GlobalFree(hData) == 0;
1475}

Referenced by dde_connect(), ddeCb(), DdePostAdvise(), test_DdeCreateDataHandle(), test_ddeml_client(), WDML_HandleIncomingData(), WDML_ServerHandlePoke(), WDML_ServerHandleRequest(), and WDML_ServerNameProc().

◆ DdeFreeStringHandle()

BOOL WINAPI DdeFreeStringHandle ( DWORD  idInst,
HSZ  hsz 
)

Definition at line 635 of file ddemisc.c.

636{
638 BOOL ret = FALSE;
639
640 TRACE("(%ld,%p):\n", idInst, hsz);
641
642 /* First check instance
643 */
644 pInstance = WDML_GetInstance(idInst);
645 if (pInstance)
646 ret = WDML_DecHSZ(pInstance, hsz);
647
648 return ret;
649}
BOOL WDML_DecHSZ(WDML_INSTANCE *pInstance, HSZ hsz)
Definition: ddemisc.c:384

Referenced by doChild(), release_dde(), ShellDDEInit(), START_TEST(), test_dde_aw_transaction(), test_dde_default_app(), test_DdeCreateStringHandleW(), test_ddeml_client(), test_end_to_end_client(), test_initialisation(), and WDML_FreeAllHSZ().

◆ DdeGetData()

DWORD WINAPI DdeGetData ( HDDEDATA  hData,
LPBYTE  pDst,
DWORD  cbMax,
DWORD  cbOff 
)

Definition at line 1384 of file ddemisc.c.

1385{
1386 DWORD dwSize, dwRet;
1387 LPBYTE pByte;
1388
1389 TRACE("(%p,%p,%ld,%ld)\n", hData, pDst, cbMax, cbOff);
1390
1391 pByte = DdeAccessData(hData, &dwSize);
1392
1393 if (pByte)
1394 {
1395 if (!pDst)
1396 {
1397 dwRet = dwSize;
1398 }
1399 else if (cbOff + cbMax < dwSize)
1400 {
1401 dwRet = cbMax;
1402 }
1403 else if (cbOff < dwSize)
1404 {
1405 dwRet = dwSize - cbOff;
1406 }
1407 else
1408 {
1409 dwRet = 0;
1410 }
1411 if (pDst && dwRet != 0)
1412 {
1413 memcpy(pDst, pByte + cbOff, dwRet);
1414 }
1415 DdeUnaccessData(hData);
1416 }
1417 else
1418 {
1419 dwRet = 0;
1420 }
1421 return dwRet;
1422}
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by dde_proc(), dde_request(), ddeCb(), server_ddeml_callback(), and server_end_to_end_callback().

◆ DdeGetLastError()

UINT WINAPI DdeGetLastError ( DWORD  idInst)

Definition at line 257 of file ddemisc.c.

258{
261
262 /* First check instance
263 */
264 pInstance = WDML_GetInstance(idInst);
265 if (pInstance == NULL)
266 {
268 }
269 else
270 {
271 error_code = pInstance->lastError;
272 pInstance->lastError = 0;
273 }
274
275 return error_code;
276}
static int error_code[8]
Definition: odbccp32.c:53

Referenced by dde_connect(), dde_execute(), dde_request(), init_dde(), START_TEST(), test_dde_aw_transaction(), test_DdeCreateDataHandle(), test_DdeCreateStringHandle(), test_DdeCreateStringHandleW(), test_ddeml_client(), test_end_to_end_client(), test_initialisation(), and test_request_groups().

◆ DdeImpersonateClient()

BOOL WINAPI DdeImpersonateClient ( HCONV  hConv)

Definition at line 1417 of file ddeclient.c.

1418{
1419 WDML_CONV* pConv;
1420 BOOL ret = FALSE;
1421
1422 TRACE("(%p)\n", hConv);
1423
1424 pConv = WDML_GetConv(hConv, TRUE);
1425 if (pConv)
1426 {
1428 }
1429 return ret;
1430}
BOOL WINAPI ImpersonateDdeClientWindow(HWND hWndClient, HWND hWndServer)
Definition: ddemisc.c:225

◆ DdeInitializeA()

UINT WINAPI DdeInitializeA ( LPDWORD  pidInst,
PFNCALLBACK  pfnCallback,
DWORD  afCmd,
DWORD  ulRes 
)

Definition at line 1079 of file ddemisc.c.

1081{
1082 return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, FALSE);
1083}
static UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes, BOOL bUnicode)
Definition: ddemisc.c:831
_In_opt_ void _In_ DWORD _In_opt_ LPTHREAD_START_ROUTINE pfnCallback
Definition: shlwapi.h:66

Referenced by dde_connect(), doChild(), START_TEST(), test_dde_aw_transaction(), test_dde_default_app(), test_DdeCreateDataHandle(), test_ddeml_client(), test_ddeml_server(), test_end_to_end_client(), test_end_to_end_server(), and test_initialisation().

◆ DdeInitializeW()

UINT WINAPI DdeInitializeW ( LPDWORD  pidInst,
PFNCALLBACK  pfnCallback,
DWORD  afCmd,
DWORD  ulRes 
)

◆ DdeKeepStringHandle()

BOOL WINAPI DdeKeepStringHandle ( DWORD  idInst,
HSZ  hsz 
)

Definition at line 658 of file ddemisc.c.

659{
661 BOOL ret = FALSE;
662
663 TRACE("(%ld,%p):\n", idInst, hsz);
664
665 /* First check instance
666 */
667 pInstance = WDML_GetInstance(idInst);
668 if (pInstance)
669 ret = WDML_IncHSZ(pInstance, hsz);
670
671 return ret;
672}
BOOL WDML_IncHSZ(WDML_INSTANCE *pInstance, HSZ hsz)
Definition: ddemisc.c:366

◆ DdeNameService()

HDDEDATA WINAPI DdeNameService ( DWORD  idInst,
HSZ  hsz1,
HSZ  hsz2,
UINT  afCmd 
)

Definition at line 159 of file ddeserver.c.

160{
161 WDML_SERVER* pServer;
163 HWND hwndServer;
164 WNDCLASSEXW wndclass;
165
166 TRACE("(%ld,%p,%p,%x)\n", idInst, hsz1, hsz2, afCmd);
167
168 /* First check instance
169 */
170 pInstance = WDML_GetInstance(idInst);
171 if (pInstance == NULL)
172 {
173 TRACE("Instance not found as initialised\n");
174 /* Nothing has been initialised - exit now ! can return TRUE since effect is the same */
175 return NULL;
176 }
177
178 if (hsz2 != 0L)
179 {
180 /* Illegal, reserved parameter
181 */
183 WARN("Reserved parameter no-zero !!\n");
184 return NULL;
185 }
186 if (hsz1 == 0 && !(afCmd & DNS_UNREGISTER))
187 {
188 /* don't know if we should check this but it makes sense
189 * why supply REGISTER or filter flags if de-registering all
190 */
191 TRACE("General unregister unexpected flags\n");
193 return NULL;
194 }
195
196 switch (afCmd & (DNS_REGISTER | DNS_UNREGISTER))
197 {
198 case DNS_REGISTER:
199 pServer = WDML_FindServer(pInstance, hsz1, 0);
200 if (pServer)
201 {
202 ERR("Trying to register already registered service!\n");
203 pInstance->lastError = DMLERR_DLL_USAGE;
204 return NULL;
205 }
206
207 TRACE("Adding service name\n");
208
209 WDML_IncHSZ(pInstance, hsz1);
210
211 pServer = WDML_AddServer(pInstance, hsz1, 0);
212
214 pServer->atomService, pServer->atomServiceSpec);
215
216 wndclass.cbSize = sizeof(wndclass);
217 wndclass.style = 0;
219 wndclass.cbClsExtra = 0;
220 wndclass.cbWndExtra = 2 * sizeof(ULONG_PTR);
221 wndclass.hInstance = 0;
222 wndclass.hIcon = 0;
223 wndclass.hCursor = 0;
224 wndclass.hbrBackground = 0;
225 wndclass.lpszMenuName = NULL;
226#ifdef __REACTOS__
227 wndclass.lpszClassName = szServerNameClass;
228#else
229 wndclass.lpszClassName = L"WineDdeServerName";
230#endif
231 wndclass.hIconSm = 0;
232
233 RegisterClassExW(&wndclass);
234
235#ifdef __REACTOS__
236 hwndServer = CreateWindowW(szServerNameClass, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0);
237#else
238 hwndServer = CreateWindowW(L"WineDdeServerName", NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0);
239#endif
241 SetWindowLongPtrW(hwndServer, GWL_WDML_SERVER, (ULONG_PTR)pServer);
242 TRACE("Created nameServer=%p for instance=%08lx\n", hwndServer, idInst);
243
244 pServer->hwndServer = hwndServer;
245 break;
246
247 case DNS_UNREGISTER:
248 if (hsz1 == 0L)
249 {
250 /* General unregister situation
251 * terminate all server side pending conversations
252 */
253 while (pInstance->servers)
254 WDML_RemoveServer(pInstance, pInstance->servers->hszService, 0);
255 pInstance->servers = NULL;
256 TRACE("General de-register - finished\n");
257 }
258 else
259 {
261 }
262 break;
263 }
264
265 if (afCmd & (DNS_FILTERON | DNS_FILTEROFF))
266 {
267 /* Set filter flags on to hold notifications of connection
268 */
269 pServer = WDML_FindServer(pInstance, hsz1, 0);
270 if (!pServer)
271 {
272 /* trying to filter where no service names !!
273 */
274 pInstance->lastError = DMLERR_DLL_USAGE;
275 return NULL;
276 }
277 else
278 {
279 pServer->filterOn = (afCmd & DNS_FILTERON) != 0;
280 }
281 }
282 return (HDDEDATA)TRUE;
283}
const WCHAR WDML_szEventClass[]
Definition: ddemisc.c:41
#define GWL_WDML_SERVER
Definition: dde_private.h:264
BOOL WDML_IncHSZ(WDML_INSTANCE *pInstance, HSZ hsz)
Definition: ddemisc.c:366
WDML_SERVER * WDML_AddServer(WDML_INSTANCE *pInstance, HSZ hszService, HSZ hszTopic)
Definition: ddemisc.c:1643
void WDML_RemoveServer(WDML_INSTANCE *pInstance, HSZ hszService, HSZ hszTopic)
Definition: ddemisc.c:1678
#define WM_WDML_REGISTER
Definition: dde_private.h:251
WDML_SERVER * WDML_FindServer(WDML_INSTANCE *pInstance, HSZ hszService, HSZ hszTopic)
Definition: ddemisc.c:1737
void WDML_BroadcastDDEWindows(LPCWSTR clsName, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ddemisc.c:2511
#define DNS_FILTEROFF
Definition: ddeml.h:155
#define DNS_UNREGISTER
Definition: ddeml.h:153
#define DNS_REGISTER
Definition: ddeml.h:152
#define DMLERR_DLL_USAGE
Definition: ddeml.h:250
#define DNS_FILTERON
Definition: ddeml.h:154
static LRESULT CALLBACK WDML_ServerNameProc(HWND, UINT, WPARAM, LPARAM)
Definition: ddeserver.c:375
#define L(x)
Definition: resources.c:13
ATOM atomServiceSpec
Definition: dde_private.h:107

Referenced by DdeUninitialize(), doChild(), init_dde(), release_dde(), ShellDDEInit(), test_dde_default_app(), test_ddeml_server(), and test_end_to_end_server().

◆ DdePostAdvise()

BOOL WINAPI DdePostAdvise ( DWORD  idInst,
HSZ  hszTopic,
HSZ  hszItem 
)

Definition at line 54 of file ddeserver.c.

55{
57 WDML_LINK* pLink;
58 HDDEDATA hDdeData;
59 HGLOBAL hItemData;
60 WDML_CONV* pConv;
61 ATOM atom;
62 UINT count;
63
64 TRACE("(%ld,%p,%p)\n", idInst, hszTopic, hszItem);
65
67
68 if (pInstance == NULL)
69 return FALSE;
70
71 atom = WDML_MakeAtomFromHsz(hszItem);
72 if (!atom) return FALSE;
73
74 /* first compute the number of links which will trigger a message */
75 count = 0;
76 for (pLink = pInstance->links[WDML_SERVER_SIDE]; pLink != NULL; pLink = pLink->next)
77 {
78 if (DdeCmpStringHandles(hszItem, pLink->hszItem) == 0)
79 {
80 count++;
81 }
82 }
83 if (count >= CADV_LATEACK)
84 {
85 FIXME("too high value for count\n");
86 count &= 0xFFFF;
87 }
88
89 for (pLink = pInstance->links[WDML_SERVER_SIDE]; pLink != NULL; pLink = pLink->next)
90 {
91 if (DdeCmpStringHandles(hszItem, pLink->hszItem) == 0)
92 {
93 hDdeData = WDML_InvokeCallback(pInstance, XTYP_ADVREQ, pLink->uFmt, pLink->hConv,
94 hszTopic, hszItem, 0, --count, 0);
95
96 if (hDdeData == CBR_BLOCK)
97 {
98 /* MS doc is not consistent here */
99 FIXME("CBR_BLOCK returned for ADVREQ\n");
100 continue;
101 }
102 if (hDdeData)
103 {
104 if (pLink->transactionType & XTYPF_NODATA)
105 {
106 TRACE("no data\n");
107 hItemData = 0;
108 }
109 else
110 {
111 TRACE("with data\n");
112
113 hItemData = WDML_DataHandle2Global(hDdeData, FALSE, FALSE, FALSE, FALSE);
114 }
115
116 pConv = WDML_GetConv(pLink->hConv, TRUE);
117
118 if (pConv == NULL)
119 {
120 if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
121 goto theError;
122 }
123
125 PackDDElParam(WM_DDE_DATA, (UINT_PTR)hItemData, atom)))
126 {
127 ERR("post message failed\n");
128 pConv->wStatus &= ~ST_CONNECTED;
129 pConv->instance->lastError = DMLERR_POSTMSG_FAILED;
130 if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
131 GlobalFree(hItemData);
132 goto theError;
133 }
134 if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
135 }
136 }
137 }
138 return TRUE;
139
140 theError:
141 GlobalDeleteAtom(atom);
142 return FALSE;
143}
#define WM_DDE_DATA
Definition: dde.h:42
LPARAM WINAPI PackDDElParam(UINT, UINT_PTR, UINT_PTR)
Definition: ddemisc.c:67
BOOL WDML_IsAppOwned(HDDEDATA hDdeData)
Definition: ddemisc.c:1482
HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, BOOL fDeferUpd, BOOL dAckReq)
Definition: ddemisc.c:1568
HDDEDATA WDML_InvokeCallback(WDML_INSTANCE *pInst, UINT uType, UINT uFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hdata, ULONG_PTR dwData1, ULONG_PTR dwData2)
Definition: ddemisc.c:1210
@ WDML_SERVER_SIDE
Definition: dde_private.h:184
#define XTYP_ADVREQ
Definition: ddeml.h:182
INT WINAPI DdeCmpStringHandles(HSZ, HSZ)
Definition: ddemisc.c:689
#define CBR_BLOCK
Definition: ddeml.h:117
#define CADV_LATEACK
Definition: ddeml.h:202
BOOL WINAPI DdeFreeDataHandle(HDDEDATA)
Definition: ddemisc.c:1466
GLuint GLuint GLsizei count
Definition: gl.h:1545
unsigned int UINT
Definition: sysinfo.c:13
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274

◆ DdeQueryConvInfo()

UINT WINAPI DdeQueryConvInfo ( HCONV  hConv,
DWORD  id,
PCONVINFO  lpConvInfo 
)

Definition at line 2435 of file ddemisc.c.

2436{
2437 UINT ret = lpConvInfo->cb;
2438 CONVINFO ci;
2439 WDML_CONV* pConv;
2440
2441 TRACE("(%p,%lx,%p)\n", hConv, id, lpConvInfo);
2442
2443 if (!hConv)
2444 {
2445 FIXME("hConv is NULL\n");
2446 return 0;
2447 }
2448
2449 pConv = WDML_GetConv(hConv, FALSE);
2450 if (pConv != NULL)
2451 {
2452 if (!WDML_GetLocalConvInfo(pConv, &ci, id))
2453 ret = 0;
2454 }
2455 else
2456 {
2457 if ((ULONG_PTR)hConv & 1)
2458 {
2459 pConv = WDML_GetConv((HCONV)((ULONG_PTR)hConv & ~1), FALSE);
2460 if (pConv != NULL)
2461 FIXME("Request on remote conversation information is not implemented yet\n");
2462 }
2463 ret = 0;
2464 }
2465
2466 if (ret != 0)
2467 {
2468 ci.cb = lpConvInfo->cb;
2469 memcpy(lpConvInfo, &ci, min((size_t)lpConvInfo->cb, sizeof(ci)));
2470 }
2471 return ret;
2472}
static BOOL WDML_GetLocalConvInfo(WDML_CONV *pConv, CONVINFO *ci, DWORD id)
Definition: ddemisc.c:2358
#define min(a, b)
Definition: monoChain.cc:55
DWORD cb
Definition: ddeml.h:317

Referenced by test_dde_aw_transaction().

◆ DdeQueryNextServer()

HCONV WINAPI DdeQueryNextServer ( HCONVLIST  hConvList,
HCONV  hConvPrev 
)

Definition at line 63 of file ddeclient.c.

64{
65 FIXME("(%p,%p): stub\n", hConvList, hConvPrev);
66 return 0;
67}

◆ DdeQueryStringA()

DWORD WINAPI DdeQueryStringA ( DWORD  idInst,
HSZ  hsz,
LPSTR  psz,
DWORD  cchMax,
INT  iCodePage 
)

Definition at line 505 of file ddemisc.c.

506{
507 DWORD ret = 0;
509
510 TRACE("(%ld, %p, %p, %ld, %d)\n", idInst, hsz, psz, cchMax, iCodePage);
511
512 /* First check instance
513 */
514 pInstance = WDML_GetInstance(idInst);
515 if (pInstance != NULL)
516 {
517 if (iCodePage == 0) iCodePage = CP_WINANSI;
518 ret = WDML_QueryString(pInstance, hsz, psz, cchMax, iCodePage);
519 }
520
521 TRACE("returning %ld (%s)\n", ret, debugstr_a(psz));
522 return ret;
523}
UINT cchMax
static int WDML_QueryString(WDML_INSTANCE *pInstance, HSZ hsz, LPVOID ptr, DWORD cchMax, int codepage)
Definition: ddemisc.c:465

Referenced by ddeCb(), server_ddeml_callback(), server_end_to_end_callback(), and test_DdeCreateStringHandleW().

◆ DdeQueryStringW()

DWORD WINAPI DdeQueryStringW ( DWORD  idInst,
HSZ  hsz,
LPWSTR  psz,
DWORD  cchMax,
INT  iCodePage 
)

Definition at line 529 of file ddemisc.c.

530{
531 DWORD ret = 0;
533
534 TRACE("(%ld, %p, %p, %ld, %d)\n", idInst, hsz, psz, cchMax, iCodePage);
535
536 /* First check instance
537 */
538 pInstance = WDML_GetInstance(idInst);
539 if (pInstance != NULL)
540 {
541 if (iCodePage == 0) iCodePage = CP_WINUNICODE;
542 ret = WDML_QueryString(pInstance, hsz, psz, cchMax, iCodePage);
543 }
544
545 TRACE("returning %ld (%s)\n", ret, debugstr_w(psz));
546 return ret;
547}

Referenced by Dde_OnConnect(), Dde_OnConnectConfirm(), Dde_OnExecute(), Dde_OnRequest(), Dde_OnWildConnect(), test_DdeCreateStringHandleW(), and WDML_AddServer().

◆ DdeReconnect()

HCONV WINAPI DdeReconnect ( HCONV  hConv)

Definition at line 217 of file ddeclient.c.

218{
219 WDML_CONV* pConv;
220 WDML_CONV* pNewConv = NULL;
221 ATOM aSrv = 0, aTpc = 0;
222
223 TRACE("(%p)\n", hConv);
224
225 pConv = WDML_GetConv(hConv, FALSE);
226 if (pConv != NULL && (pConv->wStatus & ST_CLIENT))
227 {
228 BOOL ret;
229
230 /* to reestablish a connection, we have to make sure that:
231 * 1/ pConv is the conversation attached to the client window (it wouldn't be
232 * if a call to DdeReconnect would have already been done...)
233 * FIXME: is this really an error ???
234 * 2/ the pConv conversation had really been deconnected
235 */
236 if (pConv == WDML_GetConvFromWnd(pConv->hwndClient) &&
237 (pConv->wStatus & ST_TERMINATED) && !(pConv->wStatus & ST_CONNECTED))
238 {
239 HWND hwndClient = pConv->hwndClient;
240 HWND hwndServer = pConv->hwndServer;
241
243
244 aSrv = WDML_MakeAtomFromHsz(pConv->hszService);
245 aTpc = WDML_MakeAtomFromHsz(pConv->hszTopic);
246 if (!aSrv || !aTpc) goto theEnd;
247
248 /* note: sent messages shall not use packing */
249 ret = SendMessageW(hwndServer, WM_DDE_INITIATE, (WPARAM)hwndClient,
250 MAKELPARAM(aSrv, aTpc));
251
252 pConv = WDML_GetConv(hConv, FALSE);
253 if (pConv == NULL)
254 {
255 FIXME("Should fail reconnection\n");
256 goto theEnd;
257 }
258
259 if (ret && (pNewConv = WDML_GetConvFromWnd(pConv->hwndClient)) != NULL)
260 {
261 /* re-establish all links... */
262 WDML_LINK* pLink;
263
264 for (pLink = pConv->instance->links[WDML_CLIENT_SIDE]; pLink; pLink = pLink->next)
265 {
266 if (pLink->hConv == hConv)
267 {
268 /* try to reestablish the links... */
269 DdeClientTransaction(NULL, 0, (HCONV)pNewConv, pLink->hszItem, pLink->uFmt,
270 pLink->transactionType, 1000, NULL);
271 }
272 }
273 }
274 else
275 {
276 /* reset the conversation as it was */
278 }
279 }
280 }
281
282 theEnd:
283
284 if (aSrv) GlobalDeleteAtom(aSrv);
285 if (aTpc) GlobalDeleteAtom(aTpc);
286 return (HCONV)pNewConv;
287}
#define GWL_WDML_CONVERSATION
Definition: dde_private.h:263
HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HSZ hszItem, UINT wFmt, UINT wType, DWORD dwTimeout, LPDWORD pdwResult)
Definition: ddeclient.c:1127
#define ST_TERMINATED
Definition: ddeml.h:85
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ DdeSetUserHandle()

BOOL WINAPI DdeSetUserHandle ( HCONV  hConv,
DWORD  id,
DWORD  hUser 
)

Definition at line 2323 of file ddemisc.c.

2324{
2325 WDML_CONV* pConv;
2326
2327 pConv = WDML_GetConv(hConv, FALSE);
2328 if (pConv == NULL)
2329 return FALSE;
2330
2331 if (id == QID_SYNC)
2332 {
2333 pConv->hUser = hUser;
2334 }
2335 else
2336 {
2337 WDML_XACT* pXAct;
2338
2339 pXAct = WDML_FindTransaction(pConv, id);
2340 if (pXAct)
2341 {
2342 pXAct->hUser = hUser;
2343 }
2344 else
2345 {
2346 pConv->instance->lastError = DMLERR_UNFOUND_QUEUE_ID;
2347 return FALSE;
2348 }
2349 }
2350 return TRUE;
2351}
static WDML_XACT * WDML_FindTransaction(WDML_CONV *pConv, DWORD tid)
Definition: ddemisc.c:1992
#define DMLERR_UNFOUND_QUEUE_ID
Definition: ddeml.h:263
#define QID_SYNC
Definition: ddeml.h:40

◆ DdeUnaccessData()

BOOL WINAPI DdeUnaccessData ( HDDEDATA  hData)

Definition at line 1452 of file ddemisc.c.

1453{
1454 HGLOBAL hMem = hData;
1455
1456 TRACE("(%p)\n", hData);
1457
1458 GlobalUnlock(hMem);
1459
1460 return TRUE;
1461}

Referenced by Dde_OnExecute(), DdeAddData(), DdeGetData(), server_ddeml_callback(), test_DdeCreateDataHandle(), test_ddeml_client(), WDML_ClientQueueExecute(), and WDML_ServerNameProc().

◆ DdeUninitialize()

BOOL WINAPI DdeUninitialize ( DWORD  idInst)

Definition at line 1116 of file ddemisc.c.

1117{
1118 /* Stage one - check if we have a handle for this instance
1119 */
1121 WDML_CONV* pConv;
1122 WDML_CONV* pConvNext;
1123
1124 TRACE("(%ld)\n", idInst);
1125
1126 /* First check instance
1127 */
1128 pInstance = WDML_GetInstance(idInst);
1129 if (pInstance == NULL)
1130 {
1131 /*
1132 * Needs something here to record NOT_INITIALIZED ready for DdeGetLastError
1133 */
1134 return FALSE;
1135 }
1136
1137 /* first terminate all conversations client side
1138 * this shall close existing links...
1139 */
1140 for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv != NULL; pConv = pConvNext)
1141 {
1142 pConvNext = pConv->next;
1143 DdeDisconnect((HCONV)pConv);
1144 }
1145 if (pInstance->convs[WDML_CLIENT_SIDE])
1146 FIXME("still pending conversations\n");
1147
1148 /* then unregister all known service names */
1149 DdeNameService(idInst, 0, 0, DNS_UNREGISTER);
1150
1151 /* Free the nodes that were not freed by this instance
1152 * and remove the nodes from the list of HSZ nodes.
1153 */
1155
1156 NtUserDestroyWindow( pInstance->hwndEvent );
1157
1158 /* OK now delete the instance handle itself */
1159
1161 {
1162 /* special case - the first/only entry */
1164 }
1165 else
1166 {
1167 /* general case, remove entry */
1168 WDML_INSTANCE* inst;
1169
1170 for (inst = WDML_InstanceList; inst->next != pInstance; inst = inst->next);
1171 inst->next = pInstance->next;
1172 }
1173 /* release the heap entry
1174 */
1176
1177 return TRUE;
1178}
static void WDML_FreeAllHSZ(WDML_INSTANCE *pInstance)
Definition: ddemisc.c:423
static WDML_INSTANCE * WDML_InstanceList
Definition: ddemisc.c:36
BOOL WINAPI DdeDisconnect(HCONV)
Definition: ddeclient.c:1368
HDDEDATA WINAPI DdeNameService(DWORD, HSZ, HSZ, UINT)
Definition: ddeserver.c:159
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
BOOLEAN NTAPI NtUserDestroyWindow(HWND Wnd)
Definition: window.c:3041
struct tagWDML_INSTANCE * next
Definition: dde_private.h:157

Referenced by dde_connect(), doChild(), release_dde(), ShellDDEInit(), START_TEST(), test_dde_aw_transaction(), test_dde_default_app(), test_DdeCreateDataHandle(), test_DdeCreateStringHandle(), test_ddeml_client(), test_ddeml_server(), test_end_to_end_client(), test_end_to_end_server(), test_initialisation(), and WDML_NotifyThreadDetach().

◆ DECLARE_HANDLE() [1/4]

DECLARE_HANDLE ( HCONV  )

◆ DECLARE_HANDLE() [2/4]

DECLARE_HANDLE ( HCONVLIST  )

◆ DECLARE_HANDLE() [3/4]

DECLARE_HANDLE ( HDDEDATA  )

◆ DECLARE_HANDLE() [4/4]

DECLARE_HANDLE ( HSZ  )