ReactOS  0.4.14-dev-114-gc8cbd56
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(CALLBACKPFNCALLBACK) (UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, ULONG_PTR, ULONG_PTR)
 
typedef struct tagHSZPAIR HSZPAIR
 
typedef struct tagHSZPAIRPHSZPAIR
 
typedef struct tagCONVCONTEXT CONVCONTEXT
 
typedef struct tagCONVCONTEXTPCONVCONTEXT
 
typedef struct tagCONVINFO CONVINFO
 
typedef struct tagCONVINFOPCONVINFO
 

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 1224 of file ddeclient.c.

1225 {
1226  WDML_INSTANCE* pInstance;
1227  WDML_CONV* pConv;
1228  WDML_XACT* pXAct;
1229 
1230  if ((pInstance = WDML_GetInstance(idInst)))
1231  {
1232  if (hConv)
1233  {
1234  if ((pConv = WDML_GetConv(hConv, TRUE)) && pConv->instance == pInstance)
1235  {
1236 
1237  pXAct = pConv->transactions;
1238  while (pXAct) {
1239  WDML_XACT *nextXAct = pXAct->next;
1240 
1241  if (pXAct->dwTimeout == TIMEOUT_ASYNC &&
1242  (idTransaction == 0 || pXAct->xActID == idTransaction))
1243  {
1244  WDML_UnQueueTransaction(pConv, pXAct);
1245  WDML_FreeTransaction(pInstance, pXAct, TRUE);
1246  }
1247  pXAct = nextXAct;
1248  }
1249  }
1250  }
1251  else
1252  {
1253  for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv; pConv = pConv->next)
1254  {
1255  if (!(pConv->wStatus & ST_CONNECTED)) continue;
1256  pXAct = pConv->transactions;
1257  while (pXAct) {
1258  WDML_XACT *nextXAct = pXAct->next;
1259 
1260  if (pXAct->dwTimeout == TIMEOUT_ASYNC)
1261  {
1262  WDML_UnQueueTransaction(pConv, pXAct);
1263  WDML_FreeTransaction(pInstance, pXAct, TRUE);
1264  }
1265  pXAct = nextXAct;
1266  }
1267  }
1268  }
1269  }
1270 
1271  return TRUE;
1272 }
#define TRUE
Definition: types.h:120
struct tagWDML_CONV * next
Definition: dde_private.h:126
WDML_XACT * transactions
Definition: dde_private.h:135
#define ST_CONNECTED
Definition: ddeml.h:80
BOOL WDML_UnQueueTransaction(WDML_CONV *pConv, WDML_XACT *pXAct) DECLSPEC_HIDDEN
Definition: ddemisc.c:1947
WDML_CONV * convs[2]
Definition: dde_private.h:168
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected) DECLSPEC_HIDDEN
Definition: ddemisc.c:2230
#define TIMEOUT_ASYNC
Definition: ddeml.h:200
DWORD dwTimeout
Definition: dde_private.h:114
struct tagWDML_XACT * next
Definition: dde_private.h:110
struct tagWDML_INSTANCE * instance
Definition: dde_private.h:127
void WDML_FreeTransaction(WDML_INSTANCE *pInstance, WDML_XACT *pXAct, BOOL doFreePmt) DECLSPEC_HIDDEN
Definition: ddemisc.c:1967
WDML_INSTANCE * WDML_GetInstance(DWORD InstId) DECLSPEC_HIDDEN
Definition: ddemisc.c:1230

◆ DdeAccessData()

LPBYTE WINAPI DdeAccessData ( HDDEDATA  ,
LPDWORD   
)

Definition at line 1422 of file ddemisc.c.

1423 {
1424  HGLOBAL hMem = hData;
1425  DDE_DATAHANDLE_HEAD* pDdh;
1426 
1427  TRACE("(%p,%p)\n", hData, pcbDataSize);
1428 
1429  pDdh = GlobalLock(hMem);
1430  if (pDdh == NULL)
1431  {
1432  ERR("Failed on GlobalLock(%p)\n", hMem);
1433  return 0;
1434  }
1435 
1436  if (pcbDataSize != NULL)
1437  {
1438  *pcbDataSize = GlobalSize(hMem) - sizeof(DDE_DATAHANDLE_HEAD);
1439  }
1440  TRACE("=> %p (%lu) fmt %04x\n", pDdh + 1, GlobalSize(hMem) - sizeof(DDE_DATAHANDLE_HEAD), pDdh->cfFormat);
1441  return (LPBYTE)(pDdh + 1);
1442 }
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
struct tagDDE_DATAHANDLE_HEAD DDE_DATAHANDLE_HEAD
#define ERR(fmt,...)
Definition: debug.h:109

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  ,
LPBYTE  ,
DWORD  ,
DWORD   
)

Definition at line 1340 of file ddemisc.c.

1341 {
1342  DWORD old_sz, new_sz;
1343  LPBYTE pDst;
1344 
1345  TRACE("(%p,%p,cb %d, cbOff %d)\n", hData, pSrc, cb, cbOff);
1346 
1347  pDst = DdeAccessData(hData, &old_sz);
1348  if (!pDst) return 0;
1349 
1350  new_sz = cb + cbOff;
1351  if (new_sz > old_sz)
1352  {
1353  DdeUnaccessData(hData);
1354  hData = GlobalReAlloc(hData, new_sz + sizeof(DDE_DATAHANDLE_HEAD),
1356  pDst = DdeAccessData(hData, &old_sz);
1357  }
1358 
1359  if (!pDst) return 0;
1360 
1361  memcpy(pDst + cbOff, pSrc, cb);
1362  DdeUnaccessData(hData);
1363  return hData;
1364 }
HGLOBAL NTAPI GlobalReAlloc(HGLOBAL hMem, SIZE_T dwBytes, UINT uFlags)
Definition: heapmem.c:825
unsigned char * LPBYTE
Definition: typedefs.h:52
LPBYTE WINAPI DdeAccessData(HDDEDATA hData, LPDWORD pcbDataSize)
Definition: ddemisc.c:1422
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD cb
Definition: integrity.c:41
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define GMEM_DDESHARE
Definition: winbase.h:295
BOOL WINAPI DdeUnaccessData(HDDEDATA hData)
Definition: ddemisc.c:1447
#define GMEM_MOVEABLE
Definition: winbase.h:291

◆ DdeClientTransaction()

HDDEDATA WINAPI DdeClientTransaction ( LPBYTE  ,
DWORD  ,
HCONV  ,
HSZ  ,
UINT  ,
UINT  ,
DWORD  ,
LPDWORD   
)

Definition at line 1122 of file ddeclient.c.

1124 {
1125  WDML_CONV* pConv;
1126  WDML_XACT* pXAct;
1127  HDDEDATA hDdeData;
1128 
1129  TRACE("(%p,%d,%p,%p,%x,%x,%d,%p)\n",
1130  pData, cbData, hConv, hszItem, wFmt, wType, dwTimeout, pdwResult);
1131 
1132  if (hConv == 0)
1133  {
1134  WARN("Invalid conversation handle NULL\n");
1135  return 0;
1136  }
1137 
1138  pConv = WDML_GetConv(hConv, TRUE);
1139  if (pConv == NULL)
1140  {
1141  /* cannot set error... cannot get back to DDE instance */
1142  return 0;
1143  }
1144 
1145  switch (wType)
1146  {
1147  case XTYP_EXECUTE:
1148  /* Windows simply ignores hszItem and wFmt in this case */
1149  pXAct = WDML_ClientQueueExecute(pConv, pData, cbData);
1150  if (pXAct == NULL)
1151  return 0;
1152  break;
1153  case XTYP_POKE:
1154  if (!hszItem)
1155  {
1156  pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1157  return 0;
1158  }
1159  pXAct = WDML_ClientQueuePoke(pConv, pData, cbData, wFmt, hszItem);
1160  break;
1163  case XTYP_ADVSTART:
1165  if (pData)
1166  {
1167  pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1168  return 0;
1169  }
1170  pXAct = WDML_ClientQueueAdvise(pConv, wType, wFmt, hszItem);
1171  break;
1172  case XTYP_ADVSTOP:
1173  if (pData)
1174  {
1175  pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1176  return 0;
1177  }
1178  pXAct = WDML_ClientQueueUnadvise(pConv, wFmt, hszItem);
1179  break;
1180  case XTYP_REQUEST:
1181  if (pData || !hszItem)
1182  {
1183  pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1184  return 0;
1185  }
1186  pXAct = WDML_ClientQueueRequest(pConv, wFmt, hszItem);
1187  break;
1188  default:
1189  FIXME("Unknown transaction type %04x\n", wType);
1190  /* unknown transaction type */
1191  pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
1192  return 0;
1193  }
1194 
1195  if (pXAct == NULL)
1196  {
1197  pConv->instance->lastError = DMLERR_MEMORY_ERROR;
1198  return 0;
1199  }
1200 
1201  WDML_QueueTransaction(pConv, pXAct);
1202 
1203  TRACE("pConv->wStatus %04x\n", pConv->wStatus);
1204 
1205  if (pConv->wStatus & ST_BLOCKED)
1206  {
1207  TRACE("Transactions are blocked, add to the queue and exit\n");
1208  return (HDDEDATA)1;
1209  }
1210 
1211  hDdeData = WDML_ClientHandle(pConv, pXAct, dwTimeout, pdwResult);
1212  if (dwTimeout != TIMEOUT_ASYNC)
1213  {
1214  WDML_UnQueueTransaction(pConv, pXAct);
1215  WDML_FreeTransaction(pConv->instance, pXAct, TRUE);
1216  }
1217 
1218  return hDdeData;
1219 }
#define XTYP_REQUEST
Definition: ddeml.h:191
#define TRUE
Definition: types.h:120
#define ST_BLOCKED
Definition: ddeml.h:83
#define XTYP_EXECUTE
Definition: ddeml.h:185
#define WARN(fmt,...)
Definition: debug.h:111
#define DMLERR_MEMORY_ERROR
Definition: ddeml.h:254
static WDML_XACT * WDML_ClientQueuePoke(WDML_CONV *pConv, LPVOID pData, DWORD cbData, UINT wFmt, HSZ hszItem)
Definition: ddeclient.c:696
static WDML_XACT * WDML_ClientQueueExecute(WDML_CONV *pConv, LPVOID pData, DWORD cbData)
Definition: ddeclient.c:618
HDDEDATA WDML_ClientHandle(WDML_CONV *pConv, WDML_XACT *pXAct, DWORD dwTimeout, LPDWORD pdwResult)
Definition: ddeclient.c:1090
BOOL WDML_UnQueueTransaction(WDML_CONV *pConv, WDML_XACT *pXAct) DECLSPEC_HIDDEN
Definition: ddemisc.c:1947
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected) DECLSPEC_HIDDEN
Definition: ddemisc.c:2230
#define TIMEOUT_ASYNC
Definition: ddeml.h:200
static WDML_XACT * WDML_ClientQueueRequest(WDML_CONV *pConv, UINT wFmt, HSZ hszItem)
Definition: ddeclient.c:459
#define XTYP_POKE
Definition: ddeml.h:189
#define XTYP_ADVSTOP
Definition: ddeml.h:184
void WDML_QueueTransaction(WDML_CONV *pConv, WDML_XACT *pXAct) DECLSPEC_HIDDEN
Definition: ddemisc.c:1933
#define FIXME(fmt,...)
Definition: debug.h:110
#define XTYP_ADVSTART
Definition: ddeml.h:183
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static WDML_XACT * WDML_ClientQueueUnadvise(WDML_CONV *pConv, UINT wFmt, HSZ hszItem)
Definition: ddeclient.c:385
#define XTYPF_NODATA
Definition: ddeml.h:171
static WDML_XACT * WDML_ClientQueueAdvise(WDML_CONV *pConv, UINT wType, UINT wFmt, HSZ hszItem)
Definition: ddeclient.c:289
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
Definition: wincrypt.h:6081
#define DMLERR_INVALIDPARAMETER
Definition: ddeml.h:252
struct tagWDML_INSTANCE * instance
Definition: dde_private.h:127
void WDML_FreeTransaction(WDML_INSTANCE *pInstance, WDML_XACT *pXAct, BOOL doFreePmt) DECLSPEC_HIDDEN
Definition: ddemisc.c:1967
_In_ UINT _In_ DWORD _Out_ DWORD * pdwResult
Definition: ntgdi.h:248
#define XTYPF_ACKREQ
Definition: ddeml.h:172
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827

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  ,
HSZ   
)

Definition at line 685 of file ddemisc.c.

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

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  ,
HSZ  ,
HSZ  ,
PCONVCONTEXT   
)

Definition at line 84 of file ddeclient.c.

86 {
87  HWND hwndClient;
88  WDML_INSTANCE* pInstance;
89  WDML_CONV* pConv;
90  ATOM aSrv = 0, aTpc = 0;
91 
92  TRACE("(0x%x,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC);
93 
94  pInstance = WDML_GetInstance(idInst);
95  if (!pInstance)
96  return NULL;
97 
98  /* make sure this conv is never created */
99  pConv = WDML_FindConv(pInstance, WDML_CLIENT_SIDE, hszService, hszTopic);
100  if (pConv != NULL)
101  {
102  ERR("This Conv already exists: (%p)\n", pConv);
103  return NULL;
104  }
105 
106  /* we need to establish a conversation with
107  server, so create a window for it */
108 
109  if (pInstance->unicode)
110  {
111  WNDCLASSEXW wndclass;
112 
113  wndclass.cbSize = sizeof(wndclass);
114  wndclass.style = 0;
115  wndclass.lpfnWndProc = WDML_ClientProc;
116  wndclass.cbClsExtra = 0;
117  wndclass.cbWndExtra = 2 * sizeof(ULONG_PTR);
118  wndclass.hInstance = 0;
119  wndclass.hIcon = 0;
120  wndclass.hCursor = 0;
121  wndclass.hbrBackground = 0;
122  wndclass.lpszMenuName = NULL;
124  wndclass.hIconSm = 0;
125 
126  RegisterClassExW(&wndclass);
127 
128  hwndClient = CreateWindowW(WDML_szClientConvClassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0);
129  }
130  else
131  {
132  WNDCLASSEXA wndclass;
133 
134  wndclass.cbSize = sizeof(wndclass);
135  wndclass.style = 0;
136  wndclass.lpfnWndProc = WDML_ClientProc;
137  wndclass.cbClsExtra = 0;
138  wndclass.cbWndExtra = 2 * sizeof(ULONG_PTR);
139  wndclass.hInstance = 0;
140  wndclass.hIcon = 0;
141  wndclass.hCursor = 0;
142  wndclass.hbrBackground = 0;
143  wndclass.lpszMenuName = NULL;
145  wndclass.hIconSm = 0;
146 
147  RegisterClassExA(&wndclass);
148 
149  hwndClient = CreateWindowA(WDML_szClientConvClassA, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0);
150  }
151 
152  SetWindowLongPtrW(hwndClient, GWL_WDML_INSTANCE, (ULONG_PTR)pInstance);
153 
154  if (hszService)
155  {
156  aSrv = WDML_MakeAtomFromHsz(hszService);
157  if (!aSrv) goto theEnd;
158  }
159  if (hszTopic)
160  {
162  if (!aTpc) goto theEnd;
163  }
164 
165  /* note: sent messages shall not use packing */
167  SMTO_ABORTIFHUNG, 0, NULL );
168 
169  pInstance = WDML_GetInstance(idInst);
170  if (!pInstance)
171  {
172  goto theEnd;
173  }
174 
175  /* At this point, Client WM_DDE_ACK should have saved hwndServer
176  for this instance id and hwndClient if server responds.
177  So get HCONV and return it. And add it to conv list */
178  pConv = WDML_GetConvFromWnd(hwndClient);
179  if (pConv == NULL || pConv->hwndServer == 0)
180  {
181  WARN("Done with INITIATE, but no Server window available\n");
182  pConv = NULL;
184  goto theEnd;
185  }
186  TRACE("Connected to Server window (%p)\n", pConv->hwndServer);
187  pConv->wConvst = XST_CONNECTED;
188 
189  /* finish init of pConv */
190  if (pCC != NULL)
191  {
192  pConv->convContext = *pCC;
193  }
194  else
195  {
196  memset(&pConv->convContext, 0, sizeof(pConv->convContext));
197  pConv->convContext.cb = sizeof(pConv->convContext);
198  pConv->convContext.iCodePage = (pInstance->unicode) ? CP_WINUNICODE : CP_WINANSI;
199  }
200 
201  theEnd:
202 
203  if (aSrv) GlobalDeleteAtom(aSrv);
204  if (aTpc) GlobalDeleteAtom(aTpc);
205  return (HCONV)pConv;
206 }
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:454
UINT style
Definition: winuser.h:3176
LPCSTR lpszMenuName
Definition: winuser.h:3184
int cbWndExtra
Definition: winuser.h:3194
HCURSOR hCursor
Definition: winuser.h:3182
WNDPROC lpfnWndProc
Definition: winuser.h:3177
#define XST_CONNECTED
Definition: ddeml.h:64
LPCSTR lpszClassName
Definition: winuser.h:3185
WORD ATOM
Definition: dimm.idl:113
#define WARN(fmt,...)
Definition: debug.h:111
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
ATOM WDML_MakeAtomFromHsz(HSZ hsz) DECLSPEC_HIDDEN
Definition: ddemisc.c:325
HICON hIcon
Definition: winuser.h:3196
UINT_PTR WPARAM
Definition: windef.h:207
HICON hIconSm
Definition: winuser.h:3186
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4217
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1209
uint32_t ULONG_PTR
Definition: typedefs.h:63
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LPCWSTR lpszMenuName
Definition: winuser.h:3199
HINSTANCE hInstance
Definition: winuser.h:3180
const char WDML_szClientConvClassA[]
Definition: ddeclient.c:31
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4216
INT iCodePage
Definition: ddeml.h:310
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3175
int cbClsExtra
Definition: winuser.h:3193
HBRUSH hbrBackground
Definition: winuser.h:3183
LPCWSTR lpszClassName
Definition: winuser.h:3200
#define TRACE(s)
Definition: solgame.cpp:4
HBRUSH hbrBackground
Definition: winuser.h:3198
UINT cbSize
Definition: winuser.h:3190
CONVCONTEXT convContext
Definition: dde_private.h:132
int cbWndExtra
Definition: winuser.h:3179
HINSTANCE hInstance
Definition: winuser.h:3195
#define GWL_WDML_INSTANCE
Definition: dde_private.h:259
HICON hIcon
Definition: winuser.h:3181
HCURSOR hCursor
Definition: winuser.h:3197
static LRESULT CALLBACK WDML_ClientProc(HWND, UINT, WPARAM, LPARAM)
Definition: ddeclient.c:1279
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
UINT style
Definition: winuser.h:3191
static HSZ hszTopic
Definition: shlexec.c:155
WNDPROC lpfnWndProc
Definition: winuser.h:3192
#define ERR(fmt,...)
Definition: debug.h:109
int cbClsExtra
Definition: winuser.h:3178
#define CP_WINANSI
Definition: ddeml.h:32
WDML_CONV * WDML_FindConv(WDML_INSTANCE *pInstance, WDML_SIDE side, HSZ hszService, HSZ hszTopic) DECLSPEC_HIDDEN
Definition: ddemisc.c:2048
#define CP_WINUNICODE
Definition: ddeml.h:33
#define WS_POPUP
Definition: pedump.c:616
LRESULT WINAPI SendMessageTimeoutW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)
HICON hIconSm
Definition: winuser.h:3201
#define WM_DDE_INITIATE
Definition: dde.h:37
WDML_INSTANCE * WDML_GetInstance(DWORD InstId) DECLSPEC_HIDDEN
Definition: ddemisc.c:1230
#define ULONG_PTR
Definition: config.h:101
#define SetWindowLongPtrW
Definition: winuser.h:5247
const WCHAR WDML_szClientConvClassW[]
Definition: ddeclient.c:32
#define DMLERR_NO_CONV_ESTABLISHED
Definition: ddeml.h:256
#define memset(x, y, z)
Definition: compat.h:39
#define HWND_BROADCAST
Definition: winuser.h:1190
WDML_CONV * WDML_GetConvFromWnd(HWND hWnd) DECLSPEC_HIDDEN
Definition: ddemisc.c:2265

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  ,
HSZ  ,
HSZ  ,
HCONVLIST  ,
PCONVCONTEXT   
)

Definition at line 48 of file ddeclient.c.

50 {
51  FIXME("(%d,%p,%p,%p,%p): stub\n", idInst, hszService, hszTopic, hConvList, pCC);
52  return (HCONVLIST)1;
53 }
#define FIXME(fmt,...)
Definition: debug.h:110
static HSZ hszTopic
Definition: shlexec.c:155

◆ DdeCreateDataHandle()

HDDEDATA WINAPI DdeCreateDataHandle ( DWORD  ,
LPBYTE  ,
DWORD  ,
DWORD  ,
HSZ  ,
UINT  ,
UINT   
)

Definition at line 1275 of file ddemisc.c.

1277 {
1278 
1279  /* Other than check for validity we will ignore for now idInst, hszItem.
1280  * The purpose of these arguments still need to be investigated.
1281  */
1282 
1283  WDML_INSTANCE* pInstance;
1284  HGLOBAL hMem;
1285  LPBYTE pByte;
1286  DDE_DATAHANDLE_HEAD* pDdh;
1287  WCHAR psz[MAX_BUFFER_LEN];
1288 
1289  pInstance = WDML_GetInstance(idInst);
1290  if (pInstance == NULL)
1291  {
1293  return NULL;
1294  }
1295 
1296  if (!GetAtomNameW(HSZ2ATOM(hszItem), psz, MAX_BUFFER_LEN))
1297  {
1298  psz[0] = HSZ2ATOM(hszItem);
1299  psz[1] = 0;
1300  }
1301 
1302  TRACE("(%d,%p,cb %d, cbOff %d,%p <%s>,fmt %04x,%x)\n",
1303  idInst, pSrc, cb, cbOff, hszItem, debugstr_w(psz), wFmt, afCmd);
1304 
1305  if (afCmd != 0 && afCmd != HDATA_APPOWNED)
1306  return 0;
1307 
1308  /* we use the first 4 bytes to store the size */
1309  if (!(hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, cb + cbOff + sizeof(DDE_DATAHANDLE_HEAD))))
1310  {
1311  ERR("GlobalAlloc failed\n");
1312  return 0;
1313  }
1314 
1315  pDdh = GlobalLock(hMem);
1316  if (!pDdh)
1317  {
1318  GlobalFree(hMem);
1319  return 0;
1320  }
1321 
1322  pDdh->cfFormat = wFmt;
1323  pDdh->bAppOwned = (afCmd == HDATA_APPOWNED);
1324 
1325  pByte = (LPBYTE)(pDdh + 1);
1326  if (pSrc)
1327  {
1328  memcpy(pByte, pSrc + cbOff, cb);
1329  }
1330  GlobalUnlock(hMem);
1331 
1332  TRACE("=> %p\n", hMem);
1333  return hMem;
1334 }
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
#define HSZ2ATOM(hsz)
Definition: ddemisc.c:34
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
UINT WINAPI GetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
Definition: atom.c:589
#define MAX_BUFFER_LEN
Definition: dde_private.h:34
unsigned char * LPBYTE
Definition: typedefs.h:52
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
static DWORD cb
Definition: integrity.c:41
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERR(fmt,...)
Definition: debug.h:109
#define DMLERR_INVALIDPARAMETER
Definition: ddeml.h:252
static void WDML_SetAllLastError(DWORD lastError)
Definition: ddemisc.c:279
#define HDATA_APPOWNED
Definition: ddeml.h:267
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define GMEM_DDESHARE
Definition: winbase.h:295
#define GMEM_MOVEABLE
Definition: winbase.h:291

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  ,
LPCSTR  ,
INT   
)

Definition at line 577 of file ddemisc.c.

578 {
579  HSZ hsz = 0;
580  WDML_INSTANCE* pInstance;
581 
582  TRACE("(%d,%s,%d)\n", idInst, debugstr_a(psz), codepage);
583 
584  pInstance = WDML_GetInstance(idInst);
585  if (pInstance == NULL)
587  else
588  {
589  if (codepage == 0) codepage = CP_WINANSI;
590  hsz = WDML_CreateString(pInstance, psz, codepage);
591  }
592 
593  return hsz;
594 }
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
static HSZ WDML_CreateString(WDML_INSTANCE *pInstance, LPCVOID ptr, int codepage)
Definition: ddemisc.c:550
int codepage
Definition: win_iconv.c:156
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define DMLERR_INVALIDPARAMETER
Definition: ddeml.h:252
static void WDML_SetAllLastError(DWORD lastError)
Definition: ddemisc.c:279
#define CP_WINANSI
Definition: ddeml.h:32

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  ,
LPCWSTR  ,
INT   
)

Definition at line 608 of file ddemisc.c.

609 {
610  WDML_INSTANCE* pInstance;
611  HSZ hsz = 0;
612 
613  pInstance = WDML_GetInstance(idInst);
614  if (pInstance == NULL)
616  else
617  {
618  if (codepage == 0) codepage = CP_WINUNICODE;
619  hsz = WDML_CreateString(pInstance, psz, codepage);
620  }
621 
622  return hsz;
623 }
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
static HSZ WDML_CreateString(WDML_INSTANCE *pInstance, LPCVOID ptr, int codepage)
Definition: ddemisc.c:550
int codepage
Definition: win_iconv.c:156
smooth NULL
Definition: ftsmooth.c:416
#define DMLERR_INVALIDPARAMETER
Definition: ddeml.h:252
static void WDML_SetAllLastError(DWORD lastError)
Definition: ddemisc.c:279
#define CP_WINUNICODE
Definition: ddeml.h:33

Referenced by dde_connect(), init_dde(), ShellDDEInit(), test_dde_aw_transaction(), test_DdeCreateDataHandle(), test_DdeCreateStringHandleW(), test_end_to_end_client(), WDML_AddServer(), and WDML_MakeHszFromAtom().

◆ DdeDisconnect()

BOOL WINAPI DdeDisconnect ( HCONV  )

Definition at line 1363 of file ddeclient.c.

1364 {
1365  WDML_CONV* pConv;
1366  WDML_XACT* pXAct;
1367  BOOL ret = FALSE;
1368 
1369  TRACE("(%p)\n", hConv);
1370 
1371  if (hConv == 0)
1372  {
1373  WARN("DdeDisconnect(): hConv = 0\n");
1374  return FALSE;
1375  }
1376 
1377  pConv = WDML_GetConv(hConv, TRUE);
1378  if (pConv != NULL)
1379  {
1380  if (pConv->wStatus & ST_CLIENT)
1381  {
1382  /* FIXME: should abandon all pending transactions */
1383  pXAct = WDML_ClientQueueTerminate(pConv);
1384  if (pXAct != NULL)
1385  {
1386  if (PostMessageW(pConv->hwndServer, pXAct->ddeMsg,
1387  (WPARAM)pConv->hwndClient, pXAct->lParam))
1388  {
1389  WDML_SyncWaitTransactionReply(hConv, 10000, pXAct, NULL);
1390  ret = TRUE;
1391  }
1392  else
1393  pConv->instance->lastError = DMLERR_POSTMSG_FAILED;
1394 
1395  WDML_FreeTransaction(pConv->instance, pXAct, TRUE);
1396  /* still have to destroy data associated with conversation */
1398  }
1399  else
1400  {
1401  FIXME("Not implemented yet for a server side conversation\n");
1402  }
1403  }
1404  }
1405 
1406  return ret;
1407 }
#define TRUE
Definition: types.h:120
#define ST_CLIENT
Definition: ddeml.h:84
#define WARN(fmt,...)
Definition: debug.h:111
static WDML_XACT * WDML_ClientQueueTerminate(WDML_CONV *pConv)
Definition: ddeclient.c:781
UINT_PTR WPARAM
Definition: windef.h:207
#define DMLERR_POSTMSG_FAILED
Definition: ddeml.h:258
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected) DECLSPEC_HIDDEN
Definition: ddemisc.c:2230
LPARAM lParam
Definition: dde_private.h:121
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
int ret
struct tagWDML_INSTANCE * instance
Definition: dde_private.h:127
void WDML_FreeTransaction(WDML_INSTANCE *pInstance, WDML_XACT *pXAct, BOOL doFreePmt) DECLSPEC_HIDDEN
Definition: ddemisc.c:1967
static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, const WDML_XACT *pXAct, DWORD *ack)
Definition: ddeclient.c:1007
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
void WDML_RemoveConv(WDML_CONV *pConv, WDML_SIDE side) DECLSPEC_HIDDEN
Definition: ddemisc.c:2070

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  )

Definition at line 75 of file ddeclient.c.

76 {
77  FIXME("(%p): stub\n", hConvList);
78  return TRUE;
79 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:110

◆ DdeEnableCallback()

BOOL WINAPI DdeEnableCallback ( DWORD  ,
HCONV  ,
UINT   
)

Definition at line 2178 of file ddemisc.c.

2179 {
2180  BOOL ret = FALSE;
2181  WDML_CONV *pConv;
2182 
2183  TRACE("(%d, %p, %04x)\n", idInst, hConv, wCmd);
2184 
2185  if (hConv)
2186  {
2187  pConv = WDML_GetConv(hConv, TRUE);
2188 
2189  if (pConv && pConv->instance->instanceID == idInst)
2190  ret = WDML_EnableCallback(pConv, wCmd);
2191  }
2192  else
2193  {
2194  WDML_INSTANCE *pInstance = WDML_GetInstance(idInst);
2195 
2196  if (!pInstance)
2197  return FALSE;
2198 
2199  TRACE("adding flags %04x to instance %p\n", wCmd, pInstance);
2200  pInstance->wStatus |= wCmd;
2201 
2202  if (wCmd == EC_DISABLE)
2203  {
2204  pInstance->wStatus |= ST_BLOCKED;
2205  TRACE("EC_DISABLE: inst %p status flags %04x\n", pInstance, pInstance->wStatus);
2206  }
2207  else if (wCmd == EC_ENABLEALL)
2208  {
2209  pInstance->wStatus &= ~ST_BLOCKED;
2210  TRACE("EC_ENABLEALL: inst %p status flags %04x\n", pInstance, pInstance->wStatus);
2211  }
2212 
2213  ret = TRUE;
2214 
2215  for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv != NULL; pConv = pConv->next)
2216  {
2217  ret = WDML_EnableCallback(pConv, wCmd);
2218  if (ret && wCmd == EC_QUERYWAITING) break;
2219  }
2220  }
2221 
2222  return ret;
2223 }
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
static BOOL WDML_EnableCallback(WDML_CONV *pConv, UINT wCmd)
Definition: ddemisc.c:2127
#define TRUE
Definition: types.h:120
struct tagWDML_CONV * next
Definition: dde_private.h:126
#define ST_BLOCKED
Definition: ddeml.h:83
#define EC_QUERYWAITING
Definition: ddeml.h:97
WDML_CONV * convs[2]
Definition: dde_private.h:168
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected)
Definition: ddemisc.c:2230
int ret
struct tagWDML_INSTANCE * instance
Definition: dde_private.h:127
#define EC_DISABLE
Definition: ddeml.h:96
#define EC_ENABLEALL
Definition: ddeml.h:94

◆ DdeFreeDataHandle()

BOOL WINAPI DdeFreeDataHandle ( HDDEDATA  )

Definition at line 1461 of file ddemisc.c.

1462 {
1463  TRACE("(%p)\n", hData);
1464 
1465  /* 1 is the handle value returned by an asynchronous operation. */
1466  if (hData == (HDDEDATA)1)
1467  return TRUE;
1468 
1469  return GlobalFree(hData) == 0;
1470 }
#define TRUE
Definition: types.h:120
#define TRACE(s)
Definition: solgame.cpp:4
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611

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  ,
HSZ   
)

Definition at line 631 of file ddemisc.c.

632 {
633  WDML_INSTANCE* pInstance;
634  BOOL ret = FALSE;
635 
636  TRACE("(%d,%p):\n", idInst, hsz);
637 
638  /* First check instance
639  */
640  pInstance = WDML_GetInstance(idInst);
641  if (pInstance)
642  ret = WDML_DecHSZ(pInstance, hsz);
643 
644  return ret;
645 }
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
BOOL WDML_DecHSZ(WDML_INSTANCE *pInstance, HSZ hsz)
Definition: ddemisc.c:380
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
int ret

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  ,
LPBYTE  ,
DWORD  ,
DWORD   
)

Definition at line 1379 of file ddemisc.c.

1380 {
1381  DWORD dwSize, dwRet;
1382  LPBYTE pByte;
1383 
1384  TRACE("(%p,%p,%d,%d)\n", hData, pDst, cbMax, cbOff);
1385 
1386  pByte = DdeAccessData(hData, &dwSize);
1387 
1388  if (pByte)
1389  {
1390  if (!pDst)
1391  {
1392  dwRet = dwSize;
1393  }
1394  else if (cbOff + cbMax < dwSize)
1395  {
1396  dwRet = cbMax;
1397  }
1398  else if (cbOff < dwSize)
1399  {
1400  dwRet = dwSize - cbOff;
1401  }
1402  else
1403  {
1404  dwRet = 0;
1405  }
1406  if (pDst && dwRet != 0)
1407  {
1408  memcpy(pDst, pByte + cbOff, dwRet);
1409  }
1410  DdeUnaccessData(hData);
1411  }
1412  else
1413  {
1414  dwRet = 0;
1415  }
1416  return dwRet;
1417 }
unsigned char * LPBYTE
Definition: typedefs.h:52
LPBYTE WINAPI DdeAccessData(HDDEDATA hData, LPDWORD pcbDataSize)
Definition: ddemisc.c:1422
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL WINAPI DdeUnaccessData(HDDEDATA hData)
Definition: ddemisc.c:1447
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

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

◆ DdeGetLastError()

UINT WINAPI DdeGetLastError ( DWORD  )

Definition at line 253 of file ddemisc.c.

254 {
256  WDML_INSTANCE* pInstance;
257 
258  /* First check instance
259  */
260  pInstance = WDML_GetInstance(idInst);
261  if (pInstance == NULL)
262  {
264  }
265  else
266  {
267  error_code = pInstance->lastError;
268  pInstance->lastError = 0;
269  }
270 
271  return error_code;
272 }
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
static int error_code[8]
Definition: odbccp32.c:62
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DMLERR_INVALIDPARAMETER
Definition: ddeml.h:252

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  )

Definition at line 1412 of file ddeclient.c.

1413 {
1414  WDML_CONV* pConv;
1415  BOOL ret = FALSE;
1416 
1417  TRACE("(%p)\n", hConv);
1418 
1419  pConv = WDML_GetConv(hConv, TRUE);
1420  if (pConv)
1421  {
1423  }
1424  return ret;
1425 }
#define TRUE
Definition: types.h:120
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected) DECLSPEC_HIDDEN
Definition: ddemisc.c:2230
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI ImpersonateDdeClientWindow(HWND hWndClient, HWND hWndServer)
Definition: ddemisc.c:221
int ret

◆ DdeInitializeA()

UINT WINAPI DdeInitializeA ( LPDWORD  ,
PFNCALLBACK  ,
DWORD  ,
DWORD   
)

Definition at line 1075 of file ddemisc.c.

1077 {
1078  return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, FALSE);
1079 }
static UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes, BOOL bUnicode)
Definition: ddemisc.c:827

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  ,
PFNCALLBACK  ,
DWORD  ,
DWORD   
)

Definition at line 1095 of file ddemisc.c.

1097 {
1098  return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, TRUE);
1099 }
#define TRUE
Definition: types.h:120
static UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes, BOOL bUnicode)
Definition: ddemisc.c:827

Referenced by dde_connect(), init_dde(), ShellDDEInit(), START_TEST(), test_dde_aw_transaction(), test_DdeCreateStringHandle(), test_end_to_end_client(), and test_end_to_end_server().

◆ DdeKeepStringHandle()

BOOL WINAPI DdeKeepStringHandle ( DWORD  ,
HSZ   
)

Definition at line 654 of file ddemisc.c.

655 {
656  WDML_INSTANCE* pInstance;
657  BOOL ret = FALSE;
658 
659  TRACE("(%d,%p):\n", idInst, hsz);
660 
661  /* First check instance
662  */
663  pInstance = WDML_GetInstance(idInst);
664  if (pInstance)
665  ret = WDML_IncHSZ(pInstance, hsz);
666 
667  return ret;
668 }
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
BOOL WDML_IncHSZ(WDML_INSTANCE *pInstance, HSZ hsz)
Definition: ddemisc.c:362
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
int ret

◆ DdeNameService()

HDDEDATA WINAPI DdeNameService ( DWORD  ,
HSZ  ,
HSZ  ,
UINT   
)

Definition at line 154 of file ddeserver.c.

155 {
156  WDML_SERVER* pServer;
157  WDML_INSTANCE* pInstance;
158  HWND hwndServer;
159  WNDCLASSEXW wndclass;
160 
161  TRACE("(%d,%p,%p,%x)\n", idInst, hsz1, hsz2, afCmd);
162 
163  /* First check instance
164  */
165  pInstance = WDML_GetInstance(idInst);
166  if (pInstance == NULL)
167  {
168  TRACE("Instance not found as initialised\n");
169  /* Nothing has been initialised - exit now ! can return TRUE since effect is the same */
170  return NULL;
171  }
172 
173  if (hsz2 != 0L)
174  {
175  /* Illegal, reserved parameter
176  */
177  pInstance->lastError = DMLERR_INVALIDPARAMETER;
178  WARN("Reserved parameter no-zero !!\n");
179  return NULL;
180  }
181  if (hsz1 == 0 && !(afCmd & DNS_UNREGISTER))
182  {
183  /* don't know if we should check this but it makes sense
184  * why supply REGISTER or filter flags if de-registering all
185  */
186  TRACE("General unregister unexpected flags\n");
187  pInstance->lastError = DMLERR_INVALIDPARAMETER;
188  return NULL;
189  }
190 
191  switch (afCmd & (DNS_REGISTER | DNS_UNREGISTER))
192  {
193  case DNS_REGISTER:
194  pServer = WDML_FindServer(pInstance, hsz1, 0);
195  if (pServer)
196  {
197  ERR("Trying to register already registered service!\n");
198  pInstance->lastError = DMLERR_DLL_USAGE;
199  return NULL;
200  }
201 
202  TRACE("Adding service name\n");
203 
204  WDML_IncHSZ(pInstance, hsz1);
205 
206  pServer = WDML_AddServer(pInstance, hsz1, 0);
207 
209  pServer->atomService, pServer->atomServiceSpec);
210 
211  wndclass.cbSize = sizeof(wndclass);
212  wndclass.style = 0;
213  wndclass.lpfnWndProc = WDML_ServerNameProc;
214  wndclass.cbClsExtra = 0;
215  wndclass.cbWndExtra = 2 * sizeof(ULONG_PTR);
216  wndclass.hInstance = 0;
217  wndclass.hIcon = 0;
218  wndclass.hCursor = 0;
219  wndclass.hbrBackground = 0;
220  wndclass.lpszMenuName = NULL;
221  wndclass.lpszClassName = szServerNameClass;
222  wndclass.hIconSm = 0;
223 
224  RegisterClassExW(&wndclass);
225 
226  hwndServer = CreateWindowW(szServerNameClass, NULL,
227  WS_POPUP, 0, 0, 0, 0,
228  0, 0, 0, 0);
229 
230  SetWindowLongPtrW(hwndServer, GWL_WDML_INSTANCE, (ULONG_PTR)pInstance);
231  SetWindowLongPtrW(hwndServer, GWL_WDML_SERVER, (ULONG_PTR)pServer);
232  TRACE("Created nameServer=%p for instance=%08x\n", hwndServer, idInst);
233 
234  pServer->hwndServer = hwndServer;
235  break;
236 
237  case DNS_UNREGISTER:
238  if (hsz1 == 0L)
239  {
240  /* General unregister situation
241  * terminate all server side pending conversations
242  */
243  while (pInstance->servers)
244  WDML_RemoveServer(pInstance, pInstance->servers->hszService, 0);
245  pInstance->servers = NULL;
246  TRACE("General de-register - finished\n");
247  }
248  else
249  {
250  WDML_RemoveServer(pInstance, hsz1, 0L);
251  }
252  break;
253  }
254 
255  if (afCmd & (DNS_FILTERON | DNS_FILTEROFF))
256  {
257  /* Set filter flags on to hold notifications of connection
258  */
259  pServer = WDML_FindServer(pInstance, hsz1, 0);
260  if (!pServer)
261  {
262  /* trying to filter where no service names !!
263  */
264  pInstance->lastError = DMLERR_DLL_USAGE;
265  return NULL;
266  }
267  else
268  {
269  pServer->filterOn = (afCmd & DNS_FILTERON) != 0;
270  }
271  }
272  return (HDDEDATA)TRUE;
273 }
#define DNS_UNREGISTER
Definition: ddeml.h:153
#define TRUE
Definition: types.h:120
int cbWndExtra
Definition: winuser.h:3194
#define DNS_FILTERON
Definition: ddeml.h:154
#define WARN(fmt,...)
Definition: debug.h:111
#define GWL_WDML_SERVER
Definition: dde_private.h:261
static const WCHAR szServerNameClass[]
Definition: ddeserver.c:30
HICON hIcon
Definition: winuser.h:3196
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4217
#define DNS_REGISTER
Definition: ddeml.h:152
ATOM atomServiceSpec
Definition: dde_private.h:104
WDML_SERVER * WDML_FindServer(WDML_INSTANCE *pInstance, HSZ hszService, HSZ hszTopic) DECLSPEC_HIDDEN
Definition: ddemisc.c:1729
uint32_t ULONG_PTR
Definition: typedefs.h:63
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LPCWSTR lpszMenuName
Definition: winuser.h:3199
WDML_SERVER * WDML_AddServer(WDML_INSTANCE *pInstance, HSZ hszService, HSZ hszTopic) DECLSPEC_HIDDEN
Definition: ddemisc.c:1638
void WDML_RemoveServer(WDML_INSTANCE *pInstance, HSZ hszService, HSZ hszTopic) DECLSPEC_HIDDEN
Definition: ddemisc.c:1670
smooth NULL
Definition: ftsmooth.c:416
int cbClsExtra
Definition: winuser.h:3193
LPCWSTR lpszClassName
Definition: winuser.h:3200
void WDML_BroadcastDDEWindows(LPCWSTR clsName, UINT uMsg, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN
Definition: ddemisc.c:2502
#define TRACE(s)
Definition: solgame.cpp:4
#define DNS_FILTEROFF
Definition: ddeml.h:155
HBRUSH hbrBackground
Definition: winuser.h:3198
UINT cbSize
Definition: winuser.h:3190
static LRESULT CALLBACK WDML_ServerNameProc(HWND, UINT, WPARAM, LPARAM)
Definition: ddeserver.c:365
HINSTANCE hInstance
Definition: winuser.h:3195
#define GWL_WDML_INSTANCE
Definition: dde_private.h:259
static const WCHAR L[]
Definition: oid.c:1250
HCURSOR hCursor
Definition: winuser.h:3197
#define DMLERR_DLL_USAGE
Definition: ddeml.h:250
UINT style
Definition: winuser.h:3191
WNDPROC lpfnWndProc
Definition: winuser.h:3192
const WCHAR WDML_szEventClass[]
Definition: ddemisc.c:38
#define ERR(fmt,...)
Definition: debug.h:109
#define DMLERR_INVALIDPARAMETER
Definition: ddeml.h:252
#define WM_WDML_REGISTER
Definition: dde_private.h:248
#define WS_POPUP
Definition: pedump.c:616
HICON hIconSm
Definition: winuser.h:3201
WDML_INSTANCE * WDML_GetInstance(DWORD InstId) DECLSPEC_HIDDEN
Definition: ddemisc.c:1230
#define ULONG_PTR
Definition: config.h:101
#define SetWindowLongPtrW
Definition: winuser.h:5247
BOOL WDML_IncHSZ(WDML_INSTANCE *pInstance, HSZ hsz) DECLSPEC_HIDDEN
Definition: ddemisc.c:362
WDML_SERVER * servers
Definition: dde_private.h:167

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  ,
HSZ  ,
HSZ   
)

Definition at line 49 of file ddeserver.c.

50 {
51  WDML_INSTANCE* pInstance;
52  WDML_LINK* pLink;
53  HDDEDATA hDdeData;
54  HGLOBAL hItemData;
55  WDML_CONV* pConv;
56  ATOM atom;
57  UINT count;
58 
59  TRACE("(%d,%p,%p)\n", idInst, hszTopic, hszItem);
60 
61  pInstance = WDML_GetInstance(idInst);
62 
63  if (pInstance == NULL)
64  return FALSE;
65 
66  atom = WDML_MakeAtomFromHsz(hszItem);
67  if (!atom) return FALSE;
68 
69  /* first compute the number of links which will trigger a message */
70  count = 0;
71  for (pLink = pInstance->links[WDML_SERVER_SIDE]; pLink != NULL; pLink = pLink->next)
72  {
73  if (DdeCmpStringHandles(hszItem, pLink->hszItem) == 0)
74  {
75  count++;
76  }
77  }
78  if (count >= CADV_LATEACK)
79  {
80  FIXME("too high value for count\n");
81  count &= 0xFFFF;
82  }
83 
84  for (pLink = pInstance->links[WDML_SERVER_SIDE]; pLink != NULL; pLink = pLink->next)
85  {
86  if (DdeCmpStringHandles(hszItem, pLink->hszItem) == 0)
87  {
88  hDdeData = WDML_InvokeCallback(pInstance, XTYP_ADVREQ, pLink->uFmt, pLink->hConv,
89  hszTopic, hszItem, 0, --count, 0);
90 
91  if (hDdeData == CBR_BLOCK)
92  {
93  /* MS doc is not consistent here */
94  FIXME("CBR_BLOCK returned for ADVREQ\n");
95  continue;
96  }
97  if (hDdeData)
98  {
99  if (pLink->transactionType & XTYPF_NODATA)
100  {
101  TRACE("no data\n");
102  hItemData = 0;
103  }
104  else
105  {
106  TRACE("with data\n");
107 
108  hItemData = WDML_DataHandle2Global(hDdeData, FALSE, FALSE, FALSE, FALSE);
109  }
110 
111  pConv = WDML_GetConv(pLink->hConv, TRUE);
112 
113  if (pConv == NULL)
114  {
115  if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
116  goto theError;
117  }
118 
119  if (!PostMessageW(pConv->hwndClient, WM_DDE_DATA, (WPARAM)pConv->hwndServer,
120  PackDDElParam(WM_DDE_DATA, (UINT_PTR)hItemData, atom)))
121  {
122  ERR("post message failed\n");
123  pConv->wStatus &= ~ST_CONNECTED;
124  pConv->instance->lastError = DMLERR_POSTMSG_FAILED;
125  if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
126  GlobalFree(hItemData);
127  goto theError;
128  }
129  if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
130  }
131  }
132  }
133  return TRUE;
134 
135  theError:
136  GlobalDeleteAtom(atom);
137  return FALSE;
138 }
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:454
#define TRUE
Definition: types.h:120
WORD ATOM
Definition: dimm.idl:113
GLuint GLuint GLsizei count
Definition: gl.h:1545
ATOM WDML_MakeAtomFromHsz(HSZ hsz) DECLSPEC_HIDDEN
Definition: ddemisc.c:325
#define ST_CONNECTED
Definition: ddeml.h:80
LPARAM WINAPI PackDDElParam(UINT, UINT_PTR, UINT_PTR)
Definition: ddemisc.c:63
UINT_PTR WPARAM
Definition: windef.h:207
#define DMLERR_POSTMSG_FAILED
Definition: ddeml.h:258
BOOL WINAPI DdeFreeDataHandle(HDDEDATA)
Definition: ddemisc.c:1461
#define CADV_LATEACK
Definition: ddeml.h:202
#define CBR_BLOCK
Definition: ddeml.h:117
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected) DECLSPEC_HIDDEN
Definition: ddemisc.c:2230
#define WM_DDE_DATA
Definition: dde.h:42
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
INT WINAPI DdeCmpStringHandles(HSZ, HSZ)
Definition: ddemisc.c:685
#define XTYP_ADVREQ
Definition: ddeml.h:182
#define TRACE(s)
Definition: solgame.cpp:4
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define XTYPF_NODATA
Definition: ddeml.h:171
WDML_LINK * links[2]
Definition: dde_private.h:169
static HSZ hszTopic
Definition: shlexec.c:155
#define ERR(fmt,...)
Definition: debug.h:109
HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, BOOL fDeferUpd, BOOL dAckReq) DECLSPEC_HIDDEN
Definition: ddemisc.c:1563
struct tagWDML_INSTANCE * instance
Definition: dde_private.h:127
BOOL WDML_IsAppOwned(HDDEDATA hDdeData) DECLSPEC_HIDDEN
Definition: ddemisc.c:1477
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WDML_INSTANCE * WDML_GetInstance(DWORD InstId) DECLSPEC_HIDDEN
Definition: ddemisc.c:1230
HDDEDATA WDML_InvokeCallback(WDML_INSTANCE *pInst, UINT uType, UINT uFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hdata, ULONG_PTR dwData1, ULONG_PTR dwData2) DECLSPEC_HIDDEN
Definition: ddemisc.c:1206

◆ DdeQueryConvInfo()

UINT WINAPI DdeQueryConvInfo ( HCONV  ,
DWORD  ,
PCONVINFO   
)

Definition at line 2426 of file ddemisc.c.

2427 {
2428  UINT ret = lpConvInfo->cb;
2429  CONVINFO ci;
2430  WDML_CONV* pConv;
2431 
2432  TRACE("(%p,%x,%p)\n", hConv, id, lpConvInfo);
2433 
2434  if (!hConv)
2435  {
2436  FIXME("hConv is NULL\n");
2437  return 0;
2438  }
2439 
2440  pConv = WDML_GetConv(hConv, FALSE);
2441  if (pConv != NULL)
2442  {
2443  if (!WDML_GetLocalConvInfo(pConv, &ci, id))
2444  ret = 0;
2445  }
2446  else
2447  {
2448  if ((ULONG_PTR)hConv & 1)
2449  {
2450  pConv = WDML_GetConv((HCONV)((ULONG_PTR)hConv & ~1), FALSE);
2451  if (pConv != NULL)
2452  FIXME("Request on remote conversation information is not implemented yet\n");
2453  }
2454  ret = 0;
2455  }
2456 
2457  if (ret != 0)
2458  {
2459  ci.cb = lpConvInfo->cb;
2460  memcpy(lpConvInfo, &ci, min((size_t)lpConvInfo->cb, sizeof(ci)));
2461  }
2462  return ret;
2463 }
static BOOL WDML_GetLocalConvInfo(WDML_CONV *pConv, CONVINFO *ci, DWORD id)
Definition: ddemisc.c:2349
DWORD cb
Definition: ddeml.h:317
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected)
Definition: ddemisc.c:2230
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50

Referenced by test_dde_aw_transaction().

◆ DdeQueryNextServer()

HCONV WINAPI DdeQueryNextServer ( HCONVLIST  ,
HCONV   
)

Definition at line 58 of file ddeclient.c.

59 {
60  FIXME("(%p,%p): stub\n", hConvList, hConvPrev);
61  return 0;
62 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ DdeQueryStringA()

DWORD WINAPI DdeQueryStringA ( DWORD  ,
HSZ  ,
LPSTR  ,
DWORD  ,
INT   
)

Definition at line 501 of file ddemisc.c.

502 {
503  DWORD ret = 0;
504  WDML_INSTANCE* pInstance;
505 
506  TRACE("(%d, %p, %p, %d, %d)\n", idInst, hsz, psz, cchMax, iCodePage);
507 
508  /* First check instance
509  */
510  pInstance = WDML_GetInstance(idInst);
511  if (pInstance != NULL)
512  {
513  if (iCodePage == 0) iCodePage = CP_WINANSI;
514  ret = WDML_QueryString(pInstance, hsz, psz, cchMax, iCodePage);
515  }
516 
517  TRACE("returning %d (%s)\n", ret, debugstr_a(psz));
518  return ret;
519 }
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT cchMax
int ret
#define CP_WINANSI
Definition: ddeml.h:32
static int WDML_QueryString(WDML_INSTANCE *pInstance, HSZ hsz, LPVOID ptr, DWORD cchMax, int codepage)
Definition: ddemisc.c:461

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

◆ DdeQueryStringW()

DWORD WINAPI DdeQueryStringW ( DWORD  ,
HSZ  ,
LPWSTR  ,
DWORD  ,
INT   
)

Definition at line 525 of file ddemisc.c.

526 {
527  DWORD ret = 0;
528  WDML_INSTANCE* pInstance;
529 
530  TRACE("(%d, %p, %p, %d, %d)\n", idInst, hsz, psz, cchMax, iCodePage);
531 
532  /* First check instance
533  */
534  pInstance = WDML_GetInstance(idInst);
535  if (pInstance != NULL)
536  {
537  if (iCodePage == 0) iCodePage = CP_WINUNICODE;
538  ret = WDML_QueryString(pInstance, hsz, psz, cchMax, iCodePage);
539  }
540 
541  TRACE("returning %d (%s)\n", ret, debugstr_w(psz));
542  return ret;
543 }
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT cchMax
int ret
static int WDML_QueryString(WDML_INSTANCE *pInstance, HSZ hsz, LPVOID ptr, DWORD cchMax, int codepage)
Definition: ddemisc.c:461
#define CP_WINUNICODE
Definition: ddeml.h:33

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

◆ DdeReconnect()

HCONV WINAPI DdeReconnect ( HCONV  )

Definition at line 212 of file ddeclient.c.

213 {
214  WDML_CONV* pConv;
215  WDML_CONV* pNewConv = NULL;
216  ATOM aSrv = 0, aTpc = 0;
217 
218  TRACE("(%p)\n", hConv);
219 
220  pConv = WDML_GetConv(hConv, FALSE);
221  if (pConv != NULL && (pConv->wStatus & ST_CLIENT))
222  {
223  BOOL ret;
224 
225  /* to reestablish a connection, we have to make sure that:
226  * 1/ pConv is the conversation attached to the client window (it wouldn't be
227  * if a call to DdeReconnect would have already been done...)
228  * FIXME: is this really an error ???
229  * 2/ the pConv conversation had really been deconnected
230  */
231  if (pConv == WDML_GetConvFromWnd(pConv->hwndClient) &&
232  (pConv->wStatus & ST_TERMINATED) && !(pConv->wStatus & ST_CONNECTED))
233  {
234  HWND hwndClient = pConv->hwndClient;
235  HWND hwndServer = pConv->hwndServer;
236 
238 
239  aSrv = WDML_MakeAtomFromHsz(pConv->hszService);
240  aTpc = WDML_MakeAtomFromHsz(pConv->hszTopic);
241  if (!aSrv || !aTpc) goto theEnd;
242 
243  /* note: sent messages shall not use packing */
244  ret = SendMessageW(hwndServer, WM_DDE_INITIATE, (WPARAM)hwndClient,
245  MAKELPARAM(aSrv, aTpc));
246 
247  pConv = WDML_GetConv(hConv, FALSE);
248  if (pConv == NULL)
249  {
250  FIXME("Should fail reconnection\n");
251  goto theEnd;
252  }
253 
254  if (ret && (pNewConv = WDML_GetConvFromWnd(pConv->hwndClient)) != NULL)
255  {
256  /* re-establish all links... */
257  WDML_LINK* pLink;
258 
259  for (pLink = pConv->instance->links[WDML_CLIENT_SIDE]; pLink; pLink = pLink->next)
260  {
261  if (pLink->hConv == hConv)
262  {
263  /* try to reestablish the links... */
264  DdeClientTransaction(NULL, 0, (HCONV)pNewConv, pLink->hszItem, pLink->uFmt,
265  pLink->transactionType, 1000, NULL);
266  }
267  }
268  }
269  else
270  {
271  /* reset the conversation as it was */
273  }
274  }
275  }
276 
277  theEnd:
278 
279  if (aSrv) GlobalDeleteAtom(aSrv);
280  if (aTpc) GlobalDeleteAtom(aTpc);
281  return (HCONV)pNewConv;
282 }
HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HSZ hszItem, UINT wFmt, UINT wType, DWORD dwTimeout, LPDWORD pdwResult)
Definition: ddeclient.c:1122
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:454
#define ST_CLIENT
Definition: ddeml.h:84
WORD ATOM
Definition: dimm.idl:113
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
ATOM WDML_MakeAtomFromHsz(HSZ hsz) DECLSPEC_HIDDEN
Definition: ddemisc.c:325
#define ST_CONNECTED
Definition: ddeml.h:80
UINT_PTR WPARAM
Definition: windef.h:207
uint32_t ULONG_PTR
Definition: typedefs.h:63
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected) DECLSPEC_HIDDEN
Definition: ddemisc.c:2230
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define GWL_WDML_CONVERSATION
Definition: dde_private.h:260
struct tagWDML_INSTANCE * instance
Definition: dde_private.h:127
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_DDE_INITIATE
Definition: dde.h:37
#define ST_TERMINATED
Definition: ddeml.h:85
#define SetWindowLongPtrW
Definition: winuser.h:5247
WDML_CONV * WDML_GetConvFromWnd(HWND hWnd) DECLSPEC_HIDDEN
Definition: ddemisc.c:2265

◆ DdeSetUserHandle()

BOOL WINAPI DdeSetUserHandle ( HCONV  ,
DWORD  ,
DWORD   
)

Definition at line 2314 of file ddemisc.c.

2315 {
2316  WDML_CONV* pConv;
2317 
2318  pConv = WDML_GetConv(hConv, FALSE);
2319  if (pConv == NULL)
2320  return FALSE;
2321 
2322  if (id == QID_SYNC)
2323  {
2324  pConv->hUser = hUser;
2325  }
2326  else
2327  {
2328  WDML_XACT* pXAct;
2329 
2330  pXAct = WDML_FindTransaction(pConv, id);
2331  if (pXAct)
2332  {
2333  pXAct->hUser = hUser;
2334  }
2335  else
2336  {
2337  pConv->instance->lastError = DMLERR_UNFOUND_QUEUE_ID;
2338  return FALSE;
2339  }
2340  }
2341  return TRUE;
2342 }
#define TRUE
Definition: types.h:120
static WDML_XACT * WDML_FindTransaction(WDML_CONV *pConv, DWORD tid)
Definition: ddemisc.c:1984
#define DMLERR_UNFOUND_QUEUE_ID
Definition: ddeml.h:263
smooth NULL
Definition: ftsmooth.c:416
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected)
Definition: ddemisc.c:2230
struct tagWDML_INSTANCE * instance
Definition: dde_private.h:127
#define QID_SYNC
Definition: ddeml.h:40

◆ DdeUnaccessData()

BOOL WINAPI DdeUnaccessData ( HDDEDATA  )

Definition at line 1447 of file ddemisc.c.

1448 {
1449  HGLOBAL hMem = hData;
1450 
1451  TRACE("(%p)\n", hData);
1452 
1453  GlobalUnlock(hMem);
1454 
1455  return TRUE;
1456 }
#define TRUE
Definition: types.h:120
#define TRACE(s)
Definition: solgame.cpp:4
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190

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

◆ DdeUninitialize()

BOOL WINAPI DdeUninitialize ( DWORD  )

Definition at line 1112 of file ddemisc.c.

1113 {
1114  /* Stage one - check if we have a handle for this instance
1115  */
1116  WDML_INSTANCE* pInstance;
1117  WDML_CONV* pConv;
1118  WDML_CONV* pConvNext;
1119 
1120  TRACE("(%d)\n", idInst);
1121 
1122  /* First check instance
1123  */
1124  pInstance = WDML_GetInstance(idInst);
1125  if (pInstance == NULL)
1126  {
1127  /*
1128  * Needs something here to record NOT_INITIALIZED ready for DdeGetLastError
1129  */
1130  return FALSE;
1131  }
1132 
1133  /* first terminate all conversations client side
1134  * this shall close existing links...
1135  */
1136  for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv != NULL; pConv = pConvNext)
1137  {
1138  pConvNext = pConv->next;
1139  DdeDisconnect((HCONV)pConv);
1140  }
1141  if (pInstance->convs[WDML_CLIENT_SIDE])
1142  FIXME("still pending conversations\n");
1143 
1144  /* then unregister all known service names */
1145  DdeNameService(idInst, 0, 0, DNS_UNREGISTER);
1146 
1147  /* Free the nodes that were not freed by this instance
1148  * and remove the nodes from the list of HSZ nodes.
1149  */
1150  WDML_FreeAllHSZ(pInstance);
1151 
1152  DestroyWindow(pInstance->hwndEvent);
1153 
1154  /* OK now delete the instance handle itself */
1155 
1156  if (WDML_InstanceList == pInstance)
1157  {
1158  /* special case - the first/only entry */
1159  WDML_InstanceList = pInstance->next;
1160  }
1161  else
1162  {
1163  /* general case, remove entry */
1164  WDML_INSTANCE* inst;
1165 
1166  for (inst = WDML_InstanceList; inst->next != pInstance; inst = inst->next);
1167  inst->next = pInstance->next;
1168  }
1169  /* release the heap entry
1170  */
1171  HeapFree(GetProcessHeap(), 0, pInstance);
1172 
1173  return TRUE;
1174 }
#define DNS_UNREGISTER
Definition: ddeml.h:153
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
Definition: ddemisc.c:1230
#define TRUE
Definition: types.h:120
struct tagWDML_CONV * next
Definition: dde_private.h:126
static WDML_INSTANCE * WDML_InstanceList
Definition: ddemisc.c:36
static void WDML_FreeAllHSZ(WDML_INSTANCE *pInstance)
Definition: ddemisc.c:419
BOOL WINAPI DestroyWindow(_In_ HWND)
WDML_CONV * convs[2]
Definition: dde_private.h:168
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI DdeDisconnect(HCONV)
Definition: ddeclient.c:1363
#define GetProcessHeap()
Definition: compat.h:395
HDDEDATA WINAPI DdeNameService(DWORD, HSZ, HSZ, UINT)
Definition: ddeserver.c:154
struct tagWDML_INSTANCE * next
Definition: dde_private.h:154
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by dde_connect(), doChild(), release_dde(), ShellDDEInit(), START_TEST(), 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 ( HCONVLIST  )

◆ DECLARE_HANDLE() [2/4]

DECLARE_HANDLE ( HCONV  )

◆ DECLARE_HANDLE() [3/4]

DECLARE_HANDLE ( HSZ  )

◆ DECLARE_HANDLE() [4/4]

DECLARE_HANDLE ( HDDEDATA  )