dde 0.2.9 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -5
- data/.gitignore +21 -22
- data/LICENSE +20 -20
- data/README.rdoc +19 -19
- data/Rakefile +60 -60
- data/VERSION +1 -1
- data/bin/dde_main +32 -32
- data/dde.gemspec +99 -99
- data/doc/ddeml.d.txt +374 -374
- data/doc/types.txt +159 -159
- data/exp/exp_client.rb +44 -44
- data/exp/exp_dde_monitor.rb +18 -18
- data/exp/exp_dde_server.rb +36 -36
- data/exp/exp_lib.rb +38 -38
- data/exp/exp_server.rb +44 -44
- data/features/dde.feature +9 -9
- data/features/support/env.rb +4 -4
- data/lib/dde.rb +9 -9
- data/lib/dde/app.rb +91 -91
- data/lib/dde/client.rb +102 -102
- data/lib/dde/dde_string.rb +32 -32
- data/lib/dde/monitor.rb +93 -93
- data/lib/dde/server.rb +40 -40
- data/lib/dde/xl_server.rb +89 -89
- data/lib/dde/xl_table.rb +190 -190
- data/spec/dde/app_shared.rb +84 -84
- data/spec/dde/app_spec.rb +7 -7
- data/spec/dde/client_spec.rb +199 -199
- data/spec/dde/dde_string_spec.rb +39 -39
- data/spec/dde/monitor_spec.rb +33 -33
- data/spec/dde/server_shared.rb +91 -91
- data/spec/dde/server_spec.rb +36 -36
- data/spec/dde/xl_server_spec.rb +63 -63
- data/spec/dde/xl_table_spec.rb +50 -50
- data/spec/spec.opts +2 -2
- data/spec/spec_helper.rb +21 -25
- metadata +35 -18
data/doc/ddeml.d.txt
CHANGED
@@ -1,374 +1,374 @@
|
|
1
|
-
/***********************************************************************\
|
2
|
-
* ddeml.d *
|
3
|
-
* *
|
4
|
-
* Windows API header module *
|
5
|
-
* *
|
6
|
-
* Translated from MinGW Windows headers *
|
7
|
-
* by Stewart Gordon *
|
8
|
-
* *
|
9
|
-
* Placed into public domain *
|
10
|
-
\***********************************************************************/
|
11
|
-
module win32.ddeml;
|
12
|
-
pragma(lib, "user32.lib");
|
13
|
-
|
14
|
-
private import win32.basetsd, win32.windef, win32.winnt;
|
15
|
-
|
16
|
-
enum : int {
|
17
|
-
CP_WINANSI = 1004,
|
18
|
-
CP_WINUNICODE = 1200
|
19
|
-
}
|
20
|
-
|
21
|
-
enum : UINT {
|
22
|
-
XTYPF_NOBLOCK = 2,
|
23
|
-
XTYPF_NODATA = 4,
|
24
|
-
XTYPF_ACKREQ = 8
|
25
|
-
}
|
26
|
-
|
27
|
-
enum : UINT {
|
28
|
-
XCLASS_MASK = 0xFC00,
|
29
|
-
XCLASS_BOOL = 0x1000,
|
30
|
-
XCLASS_DATA = 0x2000,
|
31
|
-
XCLASS_FLAGS = 0x4000,
|
32
|
-
XCLASS_NOTIFICATION = 0x8000
|
33
|
-
}
|
34
|
-
|
35
|
-
enum : UINT {
|
36
|
-
XST_NULL,
|
37
|
-
XST_INCOMPLETE,
|
38
|
-
XST_CONNECTED,
|
39
|
-
XST_INIT1,
|
40
|
-
XST_INIT2,
|
41
|
-
XST_REQSENT,
|
42
|
-
XST_DATARCVD,
|
43
|
-
XST_POKESENT,
|
44
|
-
XST_POKEACKRCVD,
|
45
|
-
XST_EXECSENT,
|
46
|
-
XST_EXECACKRCVD,
|
47
|
-
XST_ADVSENT,
|
48
|
-
XST_UNADVSENT,
|
49
|
-
XST_ADVACKRCVD,
|
50
|
-
XST_UNADVACKRCVD,
|
51
|
-
XST_ADVDATASENT,
|
52
|
-
XST_ADVDATAACKRCVD // = 16
|
53
|
-
}
|
54
|
-
|
55
|
-
enum : UINT {
|
56
|
-
XTYP_ERROR = XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
57
|
-
XTYP_ADVDATA = 0x0010 | XCLASS_FLAGS,
|
58
|
-
XTYP_ADVREQ = 0x0020 | XCLASS_DATA | XTYPF_NOBLOCK,
|
59
|
-
XTYP_ADVSTART = 0x0030 | XCLASS_BOOL,
|
60
|
-
XTYP_ADVSTOP = 0x0040 | XCLASS_NOTIFICATION,
|
61
|
-
XTYP_EXECUTE = 0x0050 | XCLASS_FLAGS,
|
62
|
-
XTYP_CONNECT = 0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK,
|
63
|
-
XTYP_CONNECT_CONFIRM = 0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
64
|
-
XTYP_XACT_COMPLETE = 0x0080 | XCLASS_NOTIFICATION,
|
65
|
-
XTYP_POKE = 0x0090 | XCLASS_FLAGS,
|
66
|
-
XTYP_REGISTER = 0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
67
|
-
XTYP_REQUEST = 0x00B0 | XCLASS_DATA,
|
68
|
-
XTYP_DISCONNECT = 0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
69
|
-
XTYP_UNREGISTER = 0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
70
|
-
XTYP_WILDCONNECT = 0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK,
|
71
|
-
XTYP_MONITOR = 0X00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
72
|
-
XTYP_MASK = 0x00F0,
|
73
|
-
XTYP_SHIFT = 4
|
74
|
-
}
|
75
|
-
|
76
|
-
/+
|
77
|
-
#define TIMEOUT_ASYNC 0xFFFFFFFF
|
78
|
-
#define QID_SYNC 0xFFFFFFFF
|
79
|
-
+/
|
80
|
-
|
81
|
-
enum : UINT {
|
82
|
-
ST_CONNECTED = 1,
|
83
|
-
ST_ADVISE = 2,
|
84
|
-
ST_ISLOCAL = 4,
|
85
|
-
ST_BLOCKED = 8,
|
86
|
-
ST_CLIENT = 16,
|
87
|
-
ST_TERMINATED = 32,
|
88
|
-
ST_INLIST = 64,
|
89
|
-
ST_BLOCKNEXT = 128,
|
90
|
-
ST_ISSELF = 256
|
91
|
-
}
|
92
|
-
|
93
|
-
/+
|
94
|
-
#define CADV_LATEACK 0xFFFF
|
95
|
-
+/
|
96
|
-
|
97
|
-
enum : UINT {
|
98
|
-
DMLERR_NO_ERROR = 0,
|
99
|
-
DMLERR_FIRST = 0x4000,
|
100
|
-
DMLERR_ADVACKTIMEOUT = DMLERR_FIRST,
|
101
|
-
DMLERR_BUSY,
|
102
|
-
DMLERR_DATAACKTIMEOUT,
|
103
|
-
DMLERR_DLL_NOT_INITIALIZED,
|
104
|
-
DMLERR_DLL_USAGE,
|
105
|
-
DMLERR_EXECACKTIMEOUT,
|
106
|
-
DMLERR_INVALIDPARAMETER,
|
107
|
-
DMLERR_LOW_MEMORY,
|
108
|
-
DMLERR_MEMORY_ERROR,
|
109
|
-
DMLERR_NOTPROCESSED,
|
110
|
-
DMLERR_NO_CONV_ESTABLISHED,
|
111
|
-
DMLERR_POKEACKTIMEOUT,
|
112
|
-
DMLERR_POSTMSG_FAILED,
|
113
|
-
DMLERR_REENTRANCY,
|
114
|
-
DMLERR_SERVER_DIED,
|
115
|
-
DMLERR_SYS_ERROR,
|
116
|
-
DMLERR_UNADVACKTIMEOUT,
|
117
|
-
DMLERR_UNFOUND_QUEUE_ID, // = 0x4011
|
118
|
-
DMLERR_LAST = DMLERR_UNFOUND_QUEUE_ID
|
119
|
-
}
|
120
|
-
|
121
|
-
/+
|
122
|
-
#define DDE_FACK 0x8000
|
123
|
-
#define DDE_FBUSY 0x4000
|
124
|
-
#define DDE_FDEFERUPD 0x4000
|
125
|
-
#define DDE_FACKREQ 0x8000
|
126
|
-
#define DDE_FRELEASE 0x2000
|
127
|
-
#define DDE_FREQUESTED 0x1000
|
128
|
-
#define DDE_FAPPSTATUS 0x00ff
|
129
|
-
#define DDE_FNOTPROCESSED 0
|
130
|
-
#define DDE_FACKRESERVED (~(DDE_FACK|DDE_FBUSY|DDE_FAPPSTATUS))
|
131
|
-
#define DDE_FADVRESERVED (~(DDE_FACKREQ|DDE_FDEFERUPD))
|
132
|
-
#define DDE_FDATRESERVED (~(DDE_FACKREQ|DDE_FRELEASE|DDE_FREQUESTED))
|
133
|
-
#define DDE_FPOKRESERVED (~DDE_FRELEASE)
|
134
|
-
#define MSGF_DDEMGR 0x8001
|
135
|
-
#define CBR_BLOCK ((HDDEDATA)0xffffffff)
|
136
|
-
+/
|
137
|
-
|
138
|
-
const DWORD
|
139
|
-
APPCLASS_STANDARD = 0,
|
140
|
-
APPCLASS_MONITOR = 0x00000001,
|
141
|
-
APPCLASS_MASK = 0x0000000F,
|
142
|
-
APPCMD_CLIENTONLY = 0x00000010,
|
143
|
-
APPCMD_FILTERINITS = 0x00000020,
|
144
|
-
APPCMD_MASK = 0x00000FF0,
|
145
|
-
CBF_FAIL_SELFCONNECTIONS = 0x00001000,
|
146
|
-
CBF_FAIL_CONNECTIONS = 0x00002000,
|
147
|
-
CBF_FAIL_ADVISES = 0x00004000,
|
148
|
-
CBF_FAIL_EXECUTES = 0x00008000,
|
149
|
-
CBF_FAIL_POKES = 0x00010000,
|
150
|
-
CBF_FAIL_REQUESTS = 0x00020000,
|
151
|
-
CBF_FAIL_ALLSVRXACTIONS = 0x0003f000,
|
152
|
-
CBF_SKIP_CONNECT_CONFIRMS = 0x00040000,
|
153
|
-
CBF_SKIP_REGISTRATIONS = 0x00080000,
|
154
|
-
CBF_SKIP_UNREGISTRATIONS = 0x00100000,
|
155
|
-
CBF_SKIP_DISCONNECTS = 0x00200000,
|
156
|
-
CBF_SKIP_ALLNOTIFICATIONS = 0x003c0000,
|
157
|
-
MF_HSZ_INFO = 0x01000000,
|
158
|
-
MF_SENDMSGS = 0x02000000,
|
159
|
-
MF_POSTMSGS = 0x04000000,
|
160
|
-
MF_CALLBACKS = 0x08000000,
|
161
|
-
MF_ERRORS = 0x10000000,
|
162
|
-
MF_LINKS = 0x20000000,
|
163
|
-
MF_CONV = 0x40000000,
|
164
|
-
MF_MASK = 0xFF000000;
|
165
|
-
|
166
|
-
enum : UINT {
|
167
|
-
EC_ENABLEALL = 0,
|
168
|
-
EC_ENABLEONE = ST_BLOCKNEXT,
|
169
|
-
EC_DISABLE = ST_BLOCKED,
|
170
|
-
EC_QUERYWAITING = 2
|
171
|
-
}
|
172
|
-
|
173
|
-
enum : UINT {
|
174
|
-
DNS_REGISTER = 1,
|
175
|
-
DNS_UNREGISTER = 2,
|
176
|
-
DNS_FILTERON = 4,
|
177
|
-
DNS_FILTEROFF = 8
|
178
|
-
}
|
179
|
-
|
180
|
-
/+
|
181
|
-
#define HDATA_APPOWNED 1
|
182
|
-
#define MAX_MONITORS 4
|
183
|
-
+/
|
184
|
-
|
185
|
-
enum : int {
|
186
|
-
MH_CREATE = 1,
|
187
|
-
MH_KEEP = 2,
|
188
|
-
MH_DELETE = 3,
|
189
|
-
MH_CLEANUP = 4
|
190
|
-
}
|
191
|
-
|
192
|
-
alias HANDLE HCONVLIST, HCONV, HSZ, HDDEDATA;
|
193
|
-
|
194
|
-
extern (Windows) alias HDDEDATA
|
195
|
-
function(UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD) PFNCALLBACK;
|
196
|
-
|
197
|
-
struct HSZPAIR {
|
198
|
-
HSZ hszSvc;
|
199
|
-
HSZ hszTopic;
|
200
|
-
}
|
201
|
-
alias HSZPAIR* PHSZPAIR;
|
202
|
-
|
203
|
-
struct CONVCONTEXT {
|
204
|
-
UINT cb = CONVCONTEXT.sizeof;
|
205
|
-
UINT wFlags;
|
206
|
-
UINT wCountryID;
|
207
|
-
int iCodePage;
|
208
|
-
DWORD dwLangID;
|
209
|
-
DWORD dwSecurity;
|
210
|
-
SECURITY_QUALITY_OF_SERVICE qos;
|
211
|
-
}
|
212
|
-
alias CONVCONTEXT* PCONVCONTEXT;
|
213
|
-
|
214
|
-
struct CONVINFO {
|
215
|
-
DWORD cb = CONVINFO.sizeof;
|
216
|
-
DWORD hUser;
|
217
|
-
HCONV hConvPartner;
|
218
|
-
HSZ hszSvcPartner;
|
219
|
-
HSZ hszServiceReq;
|
220
|
-
HSZ hszTopic;
|
221
|
-
HSZ hszItem;
|
222
|
-
UINT wFmt;
|
223
|
-
UINT wType;
|
224
|
-
UINT wStatus;
|
225
|
-
UINT wConvst;
|
226
|
-
UINT wLastError;
|
227
|
-
HCONVLIST hConvList;
|
228
|
-
CONVCONTEXT ConvCtxt;
|
229
|
-
HWND hwnd;
|
230
|
-
HWND hwndPartner;
|
231
|
-
}
|
232
|
-
alias CONVINFO* PCONVINFO;
|
233
|
-
|
234
|
-
struct DDEML_MSG_HOOK_DATA {
|
235
|
-
UINT uiLo;
|
236
|
-
UINT uiHi;
|
237
|
-
DWORD cbData;
|
238
|
-
DWORD[8] Data;
|
239
|
-
}
|
240
|
-
|
241
|
-
struct MONHSZSTRUCT {
|
242
|
-
UINT cb = MONHSZSTRUCT.sizeof;
|
243
|
-
int fsAction;
|
244
|
-
DWORD dwTime;
|
245
|
-
HSZ hsz;
|
246
|
-
HANDLE hTask;
|
247
|
-
TCHAR[1] _str;
|
248
|
-
|
249
|
-
TCHAR* str() { return _str.ptr; }
|
250
|
-
}
|
251
|
-
alias MONHSZSTRUCT* PMONHSZSTRUCT;
|
252
|
-
|
253
|
-
struct MONLINKSTRUCT {
|
254
|
-
UINT cb = MONLINKSTRUCT.sizeof;
|
255
|
-
DWORD dwTime;
|
256
|
-
HANDLE hTask;
|
257
|
-
BOOL fEstablished;
|
258
|
-
BOOL fNoData;
|
259
|
-
HSZ hszSvc;
|
260
|
-
HSZ hszTopic;
|
261
|
-
HSZ hszItem;
|
262
|
-
UINT wFmt;
|
263
|
-
BOOL fServer;
|
264
|
-
HCONV hConvServer;
|
265
|
-
HCONV hConvClient;
|
266
|
-
}
|
267
|
-
alias MONLINKSTRUCT* PMONLINKSTRUCT;
|
268
|
-
|
269
|
-
struct MONCONVSTRUCT {
|
270
|
-
UINT cb = MONCONVSTRUCT.sizeof;
|
271
|
-
BOOL fConnect;
|
272
|
-
DWORD dwTime;
|
273
|
-
HANDLE hTask;
|
274
|
-
HSZ hszSvc;
|
275
|
-
HSZ hszTopic;
|
276
|
-
HCONV hConvClient;
|
277
|
-
HCONV hConvServer;
|
278
|
-
}
|
279
|
-
alias MONCONVSTRUCT* PMONCONVSTRUCT;
|
280
|
-
|
281
|
-
struct MONCBSTRUCT {
|
282
|
-
UINT cb = MONCBSTRUCT.sizeof;
|
283
|
-
DWORD dwTime;
|
284
|
-
HANDLE hTask;
|
285
|
-
DWORD dwRet;
|
286
|
-
UINT wType;
|
287
|
-
UINT wFmt;
|
288
|
-
HCONV hConv;
|
289
|
-
HSZ hsz1;
|
290
|
-
HSZ hsz2;
|
291
|
-
HDDEDATA hData;
|
292
|
-
ULONG_PTR dwData1;
|
293
|
-
ULONG_PTR dwData2;
|
294
|
-
CONVCONTEXT cc;
|
295
|
-
DWORD cbData;
|
296
|
-
DWORD[8] Data;
|
297
|
-
}
|
298
|
-
alias MONCBSTRUCT* PMONCBSTRUCT;
|
299
|
-
|
300
|
-
struct MONERRSTRUCT {
|
301
|
-
UINT cb = MONERRSTRUCT.sizeof;
|
302
|
-
UINT wLastError;
|
303
|
-
DWORD dwTime;
|
304
|
-
HANDLE hTask;
|
305
|
-
}
|
306
|
-
alias MONERRSTRUCT* PMONERRSTRUCT;
|
307
|
-
|
308
|
-
struct MONMSGSTRUCT {
|
309
|
-
UINT cb = MONMSGSTRUCT.sizeof;
|
310
|
-
HWND hwndTo;
|
311
|
-
DWORD dwTime;
|
312
|
-
HANDLE hTask;
|
313
|
-
UINT wMsg;
|
314
|
-
WPARAM wParam;
|
315
|
-
LPARAM lParam;
|
316
|
-
DDEML_MSG_HOOK_DATA dmhd;
|
317
|
-
}
|
318
|
-
alias MONMSGSTRUCT* PMONMSGSTRUCT;
|
319
|
-
|
320
|
-
extern (Windows) {
|
321
|
-
BOOL DdeAbandonTransaction(DWORD, HCONV, DWORD);
|
322
|
-
PBYTE DdeAccessData(HDDEDATA, PDWORD);
|
323
|
-
|
324
|
-
|
325
|
-
DWORD, PDWORD);
|
326
|
-
int DdeCmpStringHandles(HSZ, HSZ);
|
327
|
-
HCONV DdeConnect(DWORD, HSZ, HSZ, PCONVCONTEXT);
|
328
|
-
HCONVLIST DdeConnectList(DWORD, HSZ, HSZ, HCONVLIST, PCONVCONTEXT);
|
329
|
-
|
330
|
-
UINT);
|
331
|
-
HSZ DdeCreateStringHandleA(DWORD, LPSTR, int);
|
332
|
-
HSZ DdeCreateStringHandleW(DWORD, LPWSTR, int);
|
333
|
-
BOOL DdeDisconnect(HCONV);
|
334
|
-
BOOL DdeDisconnectList(HCONVLIST);
|
335
|
-
BOOL DdeEnableCallback(DWORD, HCONV, UINT);
|
336
|
-
BOOL DdeFreeDataHandle(
|
337
|
-
BOOL DdeFreeStringHandle(DWORD, HSZ);
|
338
|
-
DWORD DdeGetData(
|
339
|
-
UINT DdeGetLastError(DWORD);
|
340
|
-
BOOL DdeImpersonateClient(HCONV);
|
341
|
-
UINT DdeInitializeA(PDWORD, PFNCALLBACK, DWORD, DWORD);
|
342
|
-
UINT DdeInitializeW(PDWORD, PFNCALLBACK, DWORD, DWORD);
|
343
|
-
BOOL DdeKeepStringHandle(DWORD, HSZ);
|
344
|
-
|
345
|
-
BOOL DdePostAdvise(DWORD, HSZ, HSZ);
|
346
|
-
UINT DdeQueryConvInfo(HCONV, DWORD, PCONVINFO);
|
347
|
-
HCONV DdeQueryNextServer(HCONVLIST, HCONV);
|
348
|
-
DWORD DdeQueryStringA(DWORD, HSZ, LPSTR, DWORD, int);
|
349
|
-
DWORD DdeQueryStringW(DWORD, HSZ, LPWSTR, DWORD, int);
|
350
|
-
HCONV DdeReconnect(HCONV);
|
351
|
-
BOOL DdeSetUserHandle(HCONV, DWORD, DWORD);
|
352
|
-
BOOL DdeUnaccessData(
|
353
|
-
BOOL DdeUninitialize(DWORD);
|
354
|
-
}
|
355
|
-
|
356
|
-
const TCHAR[]
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
version (Unicode) {
|
367
|
-
alias DdeCreateStringHandleW DdeCreateStringHandle;
|
368
|
-
alias DdeInitializeW DdeInitialize;
|
369
|
-
alias DdeQueryStringW DdeQueryString;
|
370
|
-
} else {
|
371
|
-
alias DdeCreateStringHandleA DdeCreateStringHandle;
|
372
|
-
alias DdeInitializeA DdeInitialize;
|
373
|
-
alias DdeQueryStringA DdeQueryString;
|
374
|
-
}
|
1
|
+
/***********************************************************************\
|
2
|
+
* ddeml.d *
|
3
|
+
* *
|
4
|
+
* Windows API header module *
|
5
|
+
* *
|
6
|
+
* Translated from MinGW Windows headers *
|
7
|
+
* by Stewart Gordon *
|
8
|
+
* *
|
9
|
+
* Placed into public domain *
|
10
|
+
\***********************************************************************/
|
11
|
+
module win32.ddeml;
|
12
|
+
pragma(lib, "user32.lib");
|
13
|
+
|
14
|
+
private import win32.basetsd, win32.windef, win32.winnt;
|
15
|
+
|
16
|
+
enum : int {
|
17
|
+
CP_WINANSI = 1004,
|
18
|
+
CP_WINUNICODE = 1200
|
19
|
+
}
|
20
|
+
|
21
|
+
enum : UINT {
|
22
|
+
XTYPF_NOBLOCK = 2,
|
23
|
+
XTYPF_NODATA = 4,
|
24
|
+
XTYPF_ACKREQ = 8
|
25
|
+
}
|
26
|
+
|
27
|
+
enum : UINT {
|
28
|
+
XCLASS_MASK = 0xFC00,
|
29
|
+
XCLASS_BOOL = 0x1000,
|
30
|
+
XCLASS_DATA = 0x2000,
|
31
|
+
XCLASS_FLAGS = 0x4000,
|
32
|
+
XCLASS_NOTIFICATION = 0x8000
|
33
|
+
}
|
34
|
+
|
35
|
+
enum : UINT {
|
36
|
+
XST_NULL,
|
37
|
+
XST_INCOMPLETE,
|
38
|
+
XST_CONNECTED,
|
39
|
+
XST_INIT1,
|
40
|
+
XST_INIT2,
|
41
|
+
XST_REQSENT,
|
42
|
+
XST_DATARCVD,
|
43
|
+
XST_POKESENT,
|
44
|
+
XST_POKEACKRCVD,
|
45
|
+
XST_EXECSENT,
|
46
|
+
XST_EXECACKRCVD,
|
47
|
+
XST_ADVSENT,
|
48
|
+
XST_UNADVSENT,
|
49
|
+
XST_ADVACKRCVD,
|
50
|
+
XST_UNADVACKRCVD,
|
51
|
+
XST_ADVDATASENT,
|
52
|
+
XST_ADVDATAACKRCVD // = 16
|
53
|
+
}
|
54
|
+
|
55
|
+
enum : UINT {
|
56
|
+
XTYP_ERROR = XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
57
|
+
XTYP_ADVDATA = 0x0010 | XCLASS_FLAGS,
|
58
|
+
XTYP_ADVREQ = 0x0020 | XCLASS_DATA | XTYPF_NOBLOCK,
|
59
|
+
XTYP_ADVSTART = 0x0030 | XCLASS_BOOL,
|
60
|
+
XTYP_ADVSTOP = 0x0040 | XCLASS_NOTIFICATION,
|
61
|
+
XTYP_EXECUTE = 0x0050 | XCLASS_FLAGS,
|
62
|
+
XTYP_CONNECT = 0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK,
|
63
|
+
XTYP_CONNECT_CONFIRM = 0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
64
|
+
XTYP_XACT_COMPLETE = 0x0080 | XCLASS_NOTIFICATION,
|
65
|
+
XTYP_POKE = 0x0090 | XCLASS_FLAGS,
|
66
|
+
XTYP_REGISTER = 0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
67
|
+
XTYP_REQUEST = 0x00B0 | XCLASS_DATA,
|
68
|
+
XTYP_DISCONNECT = 0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
69
|
+
XTYP_UNREGISTER = 0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
70
|
+
XTYP_WILDCONNECT = 0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK,
|
71
|
+
XTYP_MONITOR = 0X00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK,
|
72
|
+
XTYP_MASK = 0x00F0,
|
73
|
+
XTYP_SHIFT = 4
|
74
|
+
}
|
75
|
+
|
76
|
+
/+
|
77
|
+
#define TIMEOUT_ASYNC 0xFFFFFFFF
|
78
|
+
#define QID_SYNC 0xFFFFFFFF
|
79
|
+
+/
|
80
|
+
|
81
|
+
enum : UINT {
|
82
|
+
ST_CONNECTED = 1,
|
83
|
+
ST_ADVISE = 2,
|
84
|
+
ST_ISLOCAL = 4,
|
85
|
+
ST_BLOCKED = 8,
|
86
|
+
ST_CLIENT = 16,
|
87
|
+
ST_TERMINATED = 32,
|
88
|
+
ST_INLIST = 64,
|
89
|
+
ST_BLOCKNEXT = 128,
|
90
|
+
ST_ISSELF = 256
|
91
|
+
}
|
92
|
+
|
93
|
+
/+
|
94
|
+
#define CADV_LATEACK 0xFFFF
|
95
|
+
+/
|
96
|
+
|
97
|
+
enum : UINT {
|
98
|
+
DMLERR_NO_ERROR = 0,
|
99
|
+
DMLERR_FIRST = 0x4000,
|
100
|
+
DMLERR_ADVACKTIMEOUT = DMLERR_FIRST,
|
101
|
+
DMLERR_BUSY,
|
102
|
+
DMLERR_DATAACKTIMEOUT,
|
103
|
+
DMLERR_DLL_NOT_INITIALIZED,
|
104
|
+
DMLERR_DLL_USAGE,
|
105
|
+
DMLERR_EXECACKTIMEOUT,
|
106
|
+
DMLERR_INVALIDPARAMETER,
|
107
|
+
DMLERR_LOW_MEMORY,
|
108
|
+
DMLERR_MEMORY_ERROR,
|
109
|
+
DMLERR_NOTPROCESSED,
|
110
|
+
DMLERR_NO_CONV_ESTABLISHED,
|
111
|
+
DMLERR_POKEACKTIMEOUT,
|
112
|
+
DMLERR_POSTMSG_FAILED,
|
113
|
+
DMLERR_REENTRANCY,
|
114
|
+
DMLERR_SERVER_DIED,
|
115
|
+
DMLERR_SYS_ERROR,
|
116
|
+
DMLERR_UNADVACKTIMEOUT,
|
117
|
+
DMLERR_UNFOUND_QUEUE_ID, // = 0x4011
|
118
|
+
DMLERR_LAST = DMLERR_UNFOUND_QUEUE_ID
|
119
|
+
}
|
120
|
+
|
121
|
+
/+
|
122
|
+
#define DDE_FACK 0x8000
|
123
|
+
#define DDE_FBUSY 0x4000
|
124
|
+
#define DDE_FDEFERUPD 0x4000
|
125
|
+
#define DDE_FACKREQ 0x8000
|
126
|
+
#define DDE_FRELEASE 0x2000
|
127
|
+
#define DDE_FREQUESTED 0x1000
|
128
|
+
#define DDE_FAPPSTATUS 0x00ff
|
129
|
+
#define DDE_FNOTPROCESSED 0
|
130
|
+
#define DDE_FACKRESERVED (~(DDE_FACK|DDE_FBUSY|DDE_FAPPSTATUS))
|
131
|
+
#define DDE_FADVRESERVED (~(DDE_FACKREQ|DDE_FDEFERUPD))
|
132
|
+
#define DDE_FDATRESERVED (~(DDE_FACKREQ|DDE_FRELEASE|DDE_FREQUESTED))
|
133
|
+
#define DDE_FPOKRESERVED (~DDE_FRELEASE)
|
134
|
+
#define MSGF_DDEMGR 0x8001
|
135
|
+
#define CBR_BLOCK ((HDDEDATA)0xffffffff)
|
136
|
+
+/
|
137
|
+
|
138
|
+
const DWORD
|
139
|
+
APPCLASS_STANDARD = 0,
|
140
|
+
APPCLASS_MONITOR = 0x00000001,
|
141
|
+
APPCLASS_MASK = 0x0000000F,
|
142
|
+
APPCMD_CLIENTONLY = 0x00000010,
|
143
|
+
APPCMD_FILTERINITS = 0x00000020,
|
144
|
+
APPCMD_MASK = 0x00000FF0,
|
145
|
+
CBF_FAIL_SELFCONNECTIONS = 0x00001000,
|
146
|
+
CBF_FAIL_CONNECTIONS = 0x00002000,
|
147
|
+
CBF_FAIL_ADVISES = 0x00004000,
|
148
|
+
CBF_FAIL_EXECUTES = 0x00008000,
|
149
|
+
CBF_FAIL_POKES = 0x00010000,
|
150
|
+
CBF_FAIL_REQUESTS = 0x00020000,
|
151
|
+
CBF_FAIL_ALLSVRXACTIONS = 0x0003f000,
|
152
|
+
CBF_SKIP_CONNECT_CONFIRMS = 0x00040000,
|
153
|
+
CBF_SKIP_REGISTRATIONS = 0x00080000,
|
154
|
+
CBF_SKIP_UNREGISTRATIONS = 0x00100000,
|
155
|
+
CBF_SKIP_DISCONNECTS = 0x00200000,
|
156
|
+
CBF_SKIP_ALLNOTIFICATIONS = 0x003c0000,
|
157
|
+
MF_HSZ_INFO = 0x01000000,
|
158
|
+
MF_SENDMSGS = 0x02000000,
|
159
|
+
MF_POSTMSGS = 0x04000000,
|
160
|
+
MF_CALLBACKS = 0x08000000,
|
161
|
+
MF_ERRORS = 0x10000000,
|
162
|
+
MF_LINKS = 0x20000000,
|
163
|
+
MF_CONV = 0x40000000,
|
164
|
+
MF_MASK = 0xFF000000;
|
165
|
+
|
166
|
+
enum : UINT {
|
167
|
+
EC_ENABLEALL = 0,
|
168
|
+
EC_ENABLEONE = ST_BLOCKNEXT,
|
169
|
+
EC_DISABLE = ST_BLOCKED,
|
170
|
+
EC_QUERYWAITING = 2
|
171
|
+
}
|
172
|
+
|
173
|
+
enum : UINT {
|
174
|
+
DNS_REGISTER = 1,
|
175
|
+
DNS_UNREGISTER = 2,
|
176
|
+
DNS_FILTERON = 4,
|
177
|
+
DNS_FILTEROFF = 8
|
178
|
+
}
|
179
|
+
|
180
|
+
/+
|
181
|
+
#define HDATA_APPOWNED 1
|
182
|
+
#define MAX_MONITORS 4
|
183
|
+
+/
|
184
|
+
|
185
|
+
enum : int {
|
186
|
+
MH_CREATE = 1,
|
187
|
+
MH_KEEP = 2,
|
188
|
+
MH_DELETE = 3,
|
189
|
+
MH_CLEANUP = 4
|
190
|
+
}
|
191
|
+
|
192
|
+
alias HANDLE HCONVLIST, HCONV, HSZ, HDDEDATA;
|
193
|
+
|
194
|
+
extern (Windows) alias HDDEDATA
|
195
|
+
function(UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD) PFNCALLBACK;
|
196
|
+
|
197
|
+
struct HSZPAIR {
|
198
|
+
HSZ hszSvc;
|
199
|
+
HSZ hszTopic;
|
200
|
+
}
|
201
|
+
alias HSZPAIR* PHSZPAIR;
|
202
|
+
|
203
|
+
struct CONVCONTEXT {
|
204
|
+
UINT cb = CONVCONTEXT.sizeof;
|
205
|
+
UINT wFlags;
|
206
|
+
UINT wCountryID;
|
207
|
+
int iCodePage;
|
208
|
+
DWORD dwLangID;
|
209
|
+
DWORD dwSecurity;
|
210
|
+
SECURITY_QUALITY_OF_SERVICE qos;
|
211
|
+
}
|
212
|
+
alias CONVCONTEXT* PCONVCONTEXT;
|
213
|
+
|
214
|
+
struct CONVINFO {
|
215
|
+
DWORD cb = CONVINFO.sizeof;
|
216
|
+
DWORD hUser;
|
217
|
+
HCONV hConvPartner;
|
218
|
+
HSZ hszSvcPartner;
|
219
|
+
HSZ hszServiceReq;
|
220
|
+
HSZ hszTopic;
|
221
|
+
HSZ hszItem;
|
222
|
+
UINT wFmt;
|
223
|
+
UINT wType;
|
224
|
+
UINT wStatus;
|
225
|
+
UINT wConvst;
|
226
|
+
UINT wLastError;
|
227
|
+
HCONVLIST hConvList;
|
228
|
+
CONVCONTEXT ConvCtxt;
|
229
|
+
HWND hwnd;
|
230
|
+
HWND hwndPartner;
|
231
|
+
}
|
232
|
+
alias CONVINFO* PCONVINFO;
|
233
|
+
|
234
|
+
struct DDEML_MSG_HOOK_DATA {
|
235
|
+
UINT uiLo;
|
236
|
+
UINT uiHi;
|
237
|
+
DWORD cbData;
|
238
|
+
DWORD[8] Data;
|
239
|
+
}
|
240
|
+
|
241
|
+
struct MONHSZSTRUCT {
|
242
|
+
UINT cb = MONHSZSTRUCT.sizeof;
|
243
|
+
int fsAction;
|
244
|
+
DWORD dwTime;
|
245
|
+
HSZ hsz;
|
246
|
+
HANDLE hTask;
|
247
|
+
TCHAR[1] _str;
|
248
|
+
|
249
|
+
TCHAR* str() { return _str.ptr; }
|
250
|
+
}
|
251
|
+
alias MONHSZSTRUCT* PMONHSZSTRUCT;
|
252
|
+
|
253
|
+
struct MONLINKSTRUCT {
|
254
|
+
UINT cb = MONLINKSTRUCT.sizeof;
|
255
|
+
DWORD dwTime;
|
256
|
+
HANDLE hTask;
|
257
|
+
BOOL fEstablished;
|
258
|
+
BOOL fNoData;
|
259
|
+
HSZ hszSvc;
|
260
|
+
HSZ hszTopic;
|
261
|
+
HSZ hszItem;
|
262
|
+
UINT wFmt;
|
263
|
+
BOOL fServer;
|
264
|
+
HCONV hConvServer;
|
265
|
+
HCONV hConvClient;
|
266
|
+
}
|
267
|
+
alias MONLINKSTRUCT* PMONLINKSTRUCT;
|
268
|
+
|
269
|
+
struct MONCONVSTRUCT {
|
270
|
+
UINT cb = MONCONVSTRUCT.sizeof;
|
271
|
+
BOOL fConnect;
|
272
|
+
DWORD dwTime;
|
273
|
+
HANDLE hTask;
|
274
|
+
HSZ hszSvc;
|
275
|
+
HSZ hszTopic;
|
276
|
+
HCONV hConvClient;
|
277
|
+
HCONV hConvServer;
|
278
|
+
}
|
279
|
+
alias MONCONVSTRUCT* PMONCONVSTRUCT;
|
280
|
+
|
281
|
+
struct MONCBSTRUCT {
|
282
|
+
UINT cb = MONCBSTRUCT.sizeof;
|
283
|
+
DWORD dwTime;
|
284
|
+
HANDLE hTask;
|
285
|
+
DWORD dwRet;
|
286
|
+
UINT wType;
|
287
|
+
UINT wFmt;
|
288
|
+
HCONV hConv;
|
289
|
+
HSZ hsz1;
|
290
|
+
HSZ hsz2;
|
291
|
+
HDDEDATA hData;
|
292
|
+
ULONG_PTR dwData1;
|
293
|
+
ULONG_PTR dwData2;
|
294
|
+
CONVCONTEXT cc;
|
295
|
+
DWORD cbData;
|
296
|
+
DWORD[8] Data;
|
297
|
+
}
|
298
|
+
alias MONCBSTRUCT* PMONCBSTRUCT;
|
299
|
+
|
300
|
+
struct MONERRSTRUCT {
|
301
|
+
UINT cb = MONERRSTRUCT.sizeof;
|
302
|
+
UINT wLastError;
|
303
|
+
DWORD dwTime;
|
304
|
+
HANDLE hTask;
|
305
|
+
}
|
306
|
+
alias MONERRSTRUCT* PMONERRSTRUCT;
|
307
|
+
|
308
|
+
struct MONMSGSTRUCT {
|
309
|
+
UINT cb = MONMSGSTRUCT.sizeof;
|
310
|
+
HWND hwndTo;
|
311
|
+
DWORD dwTime;
|
312
|
+
HANDLE hTask;
|
313
|
+
UINT wMsg;
|
314
|
+
WPARAM wParam;
|
315
|
+
LPARAM lParam;
|
316
|
+
DDEML_MSG_HOOK_DATA dmhd;
|
317
|
+
}
|
318
|
+
alias MONMSGSTRUCT* PMONMSGSTRUCT;
|
319
|
+
|
320
|
+
extern (Windows) {
|
321
|
+
BOOL DdeAbandonTransaction(DWORD, HCONV, DWORD);
|
322
|
+
PBYTE DdeAccessData(HDDEDATA, PDWORD);
|
323
|
+
HDdeDATA DdeAddData(HDdeDATA, PBYTE, DWORD, DWORD);
|
324
|
+
HDdeDATA DdeClientTransaction(PBYTE, DWORD, HCONV, HSZ, UINT, UINT,
|
325
|
+
DWORD, PDWORD);
|
326
|
+
int DdeCmpStringHandles(HSZ, HSZ);
|
327
|
+
HCONV DdeConnect(DWORD, HSZ, HSZ, PCONVCONTEXT);
|
328
|
+
HCONVLIST DdeConnectList(DWORD, HSZ, HSZ, HCONVLIST, PCONVCONTEXT);
|
329
|
+
HDdeDATA DdeCreateDataHandle(DWORD, PBYTE, DWORD, DWORD, HSZ, UINT,
|
330
|
+
UINT);
|
331
|
+
HSZ DdeCreateStringHandleA(DWORD, LPSTR, int);
|
332
|
+
HSZ DdeCreateStringHandleW(DWORD, LPWSTR, int);
|
333
|
+
BOOL DdeDisconnect(HCONV);
|
334
|
+
BOOL DdeDisconnectList(HCONVLIST);
|
335
|
+
BOOL DdeEnableCallback(DWORD, HCONV, UINT);
|
336
|
+
BOOL DdeFreeDataHandle(HDdeDATA);
|
337
|
+
BOOL DdeFreeStringHandle(DWORD, HSZ);
|
338
|
+
DWORD DdeGetData(HDdeDATA, PBYTE, DWORD, DWORD);
|
339
|
+
UINT DdeGetLastError(DWORD);
|
340
|
+
BOOL DdeImpersonateClient(HCONV);
|
341
|
+
UINT DdeInitializeA(PDWORD, PFNCALLBACK, DWORD, DWORD);
|
342
|
+
UINT DdeInitializeW(PDWORD, PFNCALLBACK, DWORD, DWORD);
|
343
|
+
BOOL DdeKeepStringHandle(DWORD, HSZ);
|
344
|
+
HDdeDATA DdeNameService(DWORD, HSZ, HSZ, UINT);
|
345
|
+
BOOL DdePostAdvise(DWORD, HSZ, HSZ);
|
346
|
+
UINT DdeQueryConvInfo(HCONV, DWORD, PCONVINFO);
|
347
|
+
HCONV DdeQueryNextServer(HCONVLIST, HCONV);
|
348
|
+
DWORD DdeQueryStringA(DWORD, HSZ, LPSTR, DWORD, int);
|
349
|
+
DWORD DdeQueryStringW(DWORD, HSZ, LPWSTR, DWORD, int);
|
350
|
+
HCONV DdeReconnect(HCONV);
|
351
|
+
BOOL DdeSetUserHandle(HCONV, DWORD, DWORD);
|
352
|
+
BOOL DdeUnaccessData(HDdeDATA);
|
353
|
+
BOOL DdeUninitialize(DWORD);
|
354
|
+
}
|
355
|
+
|
356
|
+
const TCHAR[]
|
357
|
+
SZDdeSYS_TOPIC = "System",
|
358
|
+
SZDdeSYS_ITEM_TOPICS = "Topics",
|
359
|
+
SZDdeSYS_ITEM_SYSITEMS = "SysItems",
|
360
|
+
SZDdeSYS_ITEM_RTNMSG = "ReturnMessage",
|
361
|
+
SZDdeSYS_ITEM_STATUS = "Status",
|
362
|
+
SZDdeSYS_ITEM_FORMATS = "Formats",
|
363
|
+
SZDdeSYS_ITEM_HELP = "Help",
|
364
|
+
SZDde_ITEM_ITEMLIST = "TopicItemList";
|
365
|
+
|
366
|
+
version (Unicode) {
|
367
|
+
alias DdeCreateStringHandleW DdeCreateStringHandle;
|
368
|
+
alias DdeInitializeW DdeInitialize;
|
369
|
+
alias DdeQueryStringW DdeQueryString;
|
370
|
+
} else {
|
371
|
+
alias DdeCreateStringHandleA DdeCreateStringHandle;
|
372
|
+
alias DdeInitializeA DdeInitialize;
|
373
|
+
alias DdeQueryStringA DdeQueryString;
|
374
|
+
}
|