forked from m417z/RAEditC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDragDrop.c
880 lines (768 loc) · 17.4 KB
/
DragDrop.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
#include "DragDrop.h"
#include "ClipBoard.h"
#include "Memory.h"
#include "Position.h"
// IDropTarget
static const IDropTargetVtbl vtIDropTarget = {
IDropTarget_QueryInterface,
IDropTarget_AddRef,
IDropTarget_Release,
IDropTarget_DragEnter,
IDropTarget_DragOver,
IDropTarget_DragLeave,
IDropTarget_Drop
};
IDropTargetImpl DropTarget = { &vtIDropTarget, 0, 0, 0, 0 };
// IDropSource
static const IDropSourceVtbl vtIDropSource = {
IDropSource_QueryInterface,
IDropSource_AddRef,
IDropSource_Release,
IDropSource_QueryContinueDrag,
IDropSource_GiveFeedback
};
IDropSourceImpl DropSource = { &vtIDropSource, 0 };
// IDataObject
static const IDataObjectVtbl vtIDataObject = {
IDO_QueryInterface,
IDO_AddRef,
IDO_Release,
IDO_GetData,
IDO_GetDataHere,
IDO_QueryGetData,
IDO_GetCanonicalFormatEtc,
IDO_SetData,
IDO_EnumFormatEtc,
IDO_DAdvise,
IDO_DUnadvise,
IDO_EnumDAdvise
};
IDataObjectImpl DataObject = { &vtIDataObject, 0 };
// IEnumFORMATETC
static const IEnumFORMATETCVtbl vtIEnumFORMATETCVtbl = {
IEnumFORMATETC_QueryInterface,
IEnumFORMATETC_AddRef,
IEnumFORMATETC_Release,
IEnumFORMATETC_Next,
IEnumFORMATETC_Skip,
IEnumFORMATETC_Reset,
IEnumFORMATETC_Clone
};
typedef struct
{
const IEnumFORMATETCVtbl *lpVtbl;
DWORD refcount;
DWORD ifmt;
DWORD ifmtmax;
} IEnumFORMATETCImpl;
static IEnumFORMATETCImpl EnumFORMATETC = { &vtIEnumFORMATETCVtbl, 0, 0, 1 };
/*
REG_T IsEqualGUID(REG_T rguid1, REG_T rguid2)
{
REG_T eax = 0, ecx, ecx, esi, edi;
eax = 0;
esi = rguid1;
edi = rguid2;
ecx = sizeof(GUID)/4;
eax = memcmp(esi, edi, ecx*4) == 0;
return eax;
} // IsEqualGUID
*/
// IDropTarget methods
REG_T WINAPI IDropTarget_QueryInterface(REG_T pthis, REG_T iid, REG_T ppvObject)
{
REG_T eax = 0, edx;
// PrintText 'IDropTarget_QueryInterface'
eax = IsEqualGUID(iid, &IID_IDropTarget);
if(!eax)
{
eax = IsEqualGUID(iid, &IID_IUnknown);
} // endif
edx = ppvObject;
if(eax)
{
eax = pthis;
*(REG_T *)edx = eax;
edx = eax;
eax = ((IDropTargetImpl *)edx)->lpVtbl->AddRef(eax);
eax = S_OK;
}
else
{
*(REG_T *)edx = 0;
eax = E_NOINTERFACE;
} // endif
return eax;
} // IDropTarget_QueryInterface
REG_T WINAPI IDropTarget_AddRef(REG_T pthis)
{
REG_T eax = 0, edx;
// PrintText 'IDropTarget_AddRef'
eax = pthis;
edx = eax;
((IDropTargetImpl *)edx)->refcount++;
eax = ((IDropTargetImpl *)edx)->refcount;
return eax;
} // IDropTarget_AddRef
REG_T WINAPI IDropTarget_Release(REG_T pthis)
{
REG_T eax = 0, edx;
// PrintText 'IDropTarget_Release'
eax = pthis;
edx = eax;
if(((IDropTargetImpl *)edx)->refcount)
{
((IDropTargetImpl *)edx)->refcount--;
} // endif
eax = ((IDropTargetImpl *)edx)->refcount;
return eax;
} // IDropTarget_Release
REG_T WINAPI IDropTarget_DragEnter(REG_T pthis, REG_T lpDataObject, DWORD grfKeyState, POINT pt, REG_T lpdwEffect)
{
REG_T eax = 0, edx, ebx, esi, edi;
REG_T temp1;
STGMEDIUM medium;
FORMATETC fmte;
EDIT *pMem;
// PrintText 'IDropTarget_DragEnter'
esi = lpDataObject;
ebx = lpdwEffect;
edi = pthis;
*(DWORD *)ebx = DROPEFFECT_NONE;
((IDropTargetImpl *)edi)->valid = FALSE;
eax = E_INVALIDARG;
if(esi)
{
eax = WindowFromPoint(pt);
temp1 = eax;
edx = eax;
eax = ScreenToClient(edx, &pt);
eax = temp1;
eax = ChildWindowFromPoint(eax, pt);
ebx = eax;
eax = GetWindowLongPtr(ebx, 0);
if(eax)
{
((IDropTargetImpl *)edi)->hwnd = ebx;
pMem = eax;
if(!(pMem->fstyle & STYLE_READONLY))
{
fmte.cfFormat = CF_TEXT;
fmte.ptd = NULL;
fmte.dwAspect = DVASPECT_CONTENT;
fmte.lindex = -1;
fmte.tymed = TYMED_HGLOBAL;
edx = esi;
eax = ((IDataObjectImpl *)edx)->lpVtbl->GetData(esi, &fmte, &medium);
if(eax==S_OK)
{
ebx = lpdwEffect;
if(grfKeyState & MK_CONTROL)
{
*(DWORD *)ebx = DROPEFFECT_COPY;
}
else
{
*(DWORD *)ebx = DROPEFFECT_MOVE;
} // endif
((IDropTargetImpl *)edi)->valid = TRUE;
eax = medium.pUnkForRelease;
if(eax)
{
edx = eax;
eax = ((IDataObjectImpl *)edx)->lpVtbl->Release(eax);
}
else
{
eax = GlobalFree(medium.hGlobal);
} // endif
} // endif
} // endif
} // endif
eax = S_OK;
} // endif
return eax;
} // IDropTarget_DragEnter
REG_T WINAPI IDropTarget_DragOver(REG_T pthis, DWORD grfKeyState, POINT pt, REG_T lpdwEffect)
{
REG_T eax = 0, ecx, edx, ebx, esi, edi;
REG_T temp1;
RECT rect;
EDIT *pMem;
// PrintText 'IDropTarget_DragOver'
edi = pthis;
edx = lpdwEffect;
*(DWORD *)edx = DROPEFFECT_NONE;
if(((IDropTargetImpl *)edi)->valid)
{
eax = WindowFromPoint(pt);
temp1 = eax;
edx = eax;
eax = ScreenToClient(edx, &pt);
eax = temp1;
eax = ChildWindowFromPoint(eax, pt);
ebx = eax;
eax = GetWindowLongPtr(ebx, 0);
if(eax)
{
((IDropTargetImpl *)edi)->hwnd = ebx;
pMem = eax;
eax = SetFocus(((IDropTargetImpl *)edi)->hwnd);
eax = ((IDropTargetImpl *)edi)->hwnd;
if(eax==pMem->edta.hwnd)
{
esi = &pMem->edta;
}
else
{
esi = &pMem->edtb;
} // endif
eax = GetClientRect(((IDropTargetImpl *)edi)->hwnd, &rect);
ecx = pMem->fntinfo.fntht;
ecx /= 2;
eax = pt.y;
edx = eax+ecx;
if(eax<ecx)
{
eax = SendMessage(((IDropTargetImpl *)edi)->hwnd, WM_VSCROLL, SB_LINEUP, ((RAEDT *)esi)->hvscroll);
}
else if(edx>rect.bottom)
{
eax = SendMessage(((IDropTargetImpl *)edi)->hwnd, WM_VSCROLL, SB_LINEDOWN, ((RAEDT *)esi)->hvscroll);
}
else
{
eax = pt.x;
edx = eax+32;
ecx = pMem->selbarwt;
ecx += pMem->linenrwt;
if(eax<ecx)
{
eax = SendMessage(((IDropTargetImpl *)edi)->hwnd, WM_HSCROLL, SB_LINEUP, pMem->hhscroll);
}
else if(edx>rect.right)
{
eax = SendMessage(((IDropTargetImpl *)edi)->hwnd, WM_HSCROLL, SB_LINEDOWN, pMem->hhscroll);
} // endif
} // endif
eax = GetCharFromPos(pMem, ((RAEDT *)esi)->cpy, pt.x, pt.y);
edx = eax;
((IDropTargetImpl *)edi)->cp = eax;
eax = GetPosFromChar(pMem, edx, &pt);
eax = pt.x;
eax -= pMem->cpx;
edx = pt.y;
edx -= ((RAEDT *)esi)->cpy;
eax = SetCaretPos(eax, edx);
eax = ShowCaret(((IDropTargetImpl *)edi)->hwnd);
pMem->fCaretHide = FALSE;
edx = lpdwEffect;
if(grfKeyState & MK_CONTROL)
{
*(DWORD *)edx = DROPEFFECT_COPY;
}
else
{
*(DWORD *)edx = DROPEFFECT_MOVE;
} // endif
} // endif
} // endif
eax = S_OK;
return eax;
} // IDropTarget_DragOver
REG_T WINAPI IDropTarget_DragLeave(REG_T pthis)
{
REG_T eax = 0, edi;
EDIT *pMem;
// PrintText 'IDropTarget_DragLeave'
edi = pthis;
if(((IDropTargetImpl *)edi)->hwnd)
{
eax = GetWindowLongPtr(((IDropTargetImpl *)edi)->hwnd, 0);
if(eax)
{
pMem = eax;
if(!pMem->fCaretHide)
{
eax = HideCaret(((IDropTargetImpl *)edi)->hwnd);
pMem->fCaretHide = TRUE;
} // endif
} // endif
((IDropTargetImpl *)edi)->hwnd = 0;
} // endif
eax = S_OK;
return eax;
} // IDropTarget_DragLeave
REG_T WINAPI IDropTarget_Drop(REG_T pthis, REG_T lpDataObject, DWORD grfKeyState, POINT pt, REG_T lpdwEffect)
{
REG_T eax = 0, ecx, edx, ebx, esi, edi;
STGMEDIUM medium;
FORMATETC fmte;
EDIT *pMem;
// PrintText 'IDropTarget_Drop'
esi = lpDataObject;
ebx = lpdwEffect;
edi = pthis;
eax = E_INVALIDARG;
*(DWORD *)ebx = DROPEFFECT_NONE;
((IDropTargetImpl *)edi)->valid = FALSE;
if(esi && ((IDropTargetImpl *)edi)->hwnd)
{
eax = GetWindowLongPtr(((IDropTargetImpl *)edi)->hwnd, 0);
if(eax)
{
pMem = eax;
fmte.cfFormat = CF_TEXT;
fmte.ptd = NULL;
fmte.dwAspect = DVASPECT_CONTENT;
fmte.lindex = -1;
fmte.tymed = TYMED_HGLOBAL;
edx = esi;
eax = ((IDataObjectImpl *)edx)->lpVtbl->GetData(esi, &fmte, &medium);
if(eax==S_OK)
{
eax = ((IDropTargetImpl *)edi)->cp;
edx = ((IDropTargetImpl *)edi)->hwnd;
edx = hDragWin;
// Test if Drop is on top of Drag
if((edx!=pMem->edta.hwnd && edx!=pMem->edtb.hwnd) || eax<=cpDragSource.cpMin || eax>=cpDragSource.cpMax)
{
pMem->cpMin = eax;
pMem->cpMax = eax;
if(eax<=cpDragSource.cpMin && (edx==pMem->edta.hwnd || edx==pMem->edtb.hwnd))
{
ecx = cpDragSource.cpMax;
ecx -= cpDragSource.cpMin;
cpDragSource.cpMin += ecx;
cpDragSource.cpMax += ecx;
} // endif
eax = Paste(pMem, ((IDropTargetImpl *)edi)->hwnd, medium.hGlobal);
edx = lpdwEffect;
if(grfKeyState & MK_CONTROL)
{
*(DWORD *)edx = DROPEFFECT_COPY;
}
else
{
*(DWORD *)edx = DROPEFFECT_MOVE;
} // endif
} // endif
((IDropTargetImpl *)edi)->valid = TRUE;
eax = medium.pUnkForRelease;
if(eax)
{
edx = eax;
eax = ((IDataObjectImpl *)edx)->lpVtbl->Release(eax);
}
else
{
eax = GlobalFree(medium.hGlobal);
} // endif
eax = ((IDropTargetImpl *)edi)->lpVtbl->DragLeave(pthis);
eax = S_OK;
} // endif
}
else
{
eax = E_INVALIDARG;
} // endif
} // endif
return eax;
} // IDropTarget_Drop
// IDropSource methods
REG_T WINAPI IDropSource_QueryInterface(REG_T pthis, REG_T iid, REG_T ppvObject)
{
REG_T eax = 0, edx;
// PrintText 'IDropSource_QueryInterface'
eax = IsEqualGUID(iid, &IID_IDropSource);
if(!eax)
{
eax = IsEqualGUID(iid, &IID_IUnknown);
} // endif
edx = ppvObject;
if(eax)
{
eax = pthis;
*(REG_T *)edx = eax;
edx = eax;
eax = ((IDropSourceImpl *)edx)->lpVtbl->AddRef(eax);
eax = S_OK;
}
else
{
*(REG_T *)edx = 0;
eax = E_NOINTERFACE;
} // endif
return eax;
} // IDropSource_QueryInterface
REG_T WINAPI IDropSource_AddRef(REG_T pthis)
{
REG_T eax = 0, edx;
// PrintText 'IDropSource_AddRef'
eax = pthis;
edx = eax;
((IDropSourceImpl *)edx)->refcount++;
eax = ((IDropSourceImpl *)edx)->refcount;
return eax;
} // IDropSource_AddRef
REG_T WINAPI IDropSource_Release(REG_T pthis)
{
REG_T eax = 0, edx;
// PrintText 'IDropSource_Release'
eax = pthis;
edx = eax;
if(((IDropTargetImpl *)edx)->refcount)
{
((IDropTargetImpl *)edx)->refcount--;
} // endif
eax = ((IDropTargetImpl *)edx)->refcount;
return eax;
} // IDropSource_Release
REG_T WINAPI IDropSource_QueryContinueDrag(REG_T pthis, DWORD fEscapePressed, DWORD grfKeyState)
{
REG_T eax = 0;
// PrintText 'IDropSource_QueryContinueDrag'
if(fEscapePressed)
{
eax = DRAGDROP_S_CANCEL;
}
else if(!(grfKeyState & MK_LBUTTON))
{
eax = DRAGDROP_S_DROP;
}
else
{
eax = S_OK;
} // endif
return eax;
} // IDropSource_QueryContinueDrag
REG_T WINAPI IDropSource_GiveFeedback(REG_T pthis, DWORD dwEffect)
{
REG_T eax = 0;
// PrintText 'IDropSource_GiveFeedback'
eax = DRAGDROP_S_USEDEFAULTCURSORS;
return eax;
} // IDropSource_GiveFeedback
// IDataObject methods
REG_T WINAPI IDO_QueryInterface(REG_T pthis, REG_T iid, REG_T ppvObject)
{
REG_T eax = 0, edx;
// PrintText 'IDataObject_QueryInterface'
eax = IsEqualGUID(iid, &IID_IDataObject);
if(!eax)
{
eax = IsEqualGUID(iid, &IID_IUnknown);
} // endif
edx = ppvObject;
if(eax)
{
eax = pthis;
*(REG_T *)edx = eax;
edx = eax;
eax = ((IDataObjectImpl *)edx)->lpVtbl->AddRef(eax);
eax = S_OK;
}
else
{
*(REG_T *)edx = 0;
eax = E_NOINTERFACE;
} // endif
return eax;
} // IDO_QueryInterface
REG_T WINAPI IDO_AddRef(REG_T pthis)
{
REG_T eax = 0, edx;
// PrintText 'IDataObject_AddRef'
eax = pthis;
edx = eax;
((IDataObjectImpl *)edx)->refcount++;
eax = ((IDataObjectImpl *)edx)->refcount;
return eax;
} // IDO_AddRef
REG_T WINAPI IDO_Release(REG_T pthis)
{
REG_T eax = 0, edx;
// PrintText 'IDataObject_Release'
eax = pthis;
edx = eax;
if(((IDataObjectImpl *)edx)->refcount)
{
((IDataObjectImpl *)edx)->refcount--;
} // endif
eax = ((IDataObjectImpl *)edx)->refcount;
return eax;
} // IDO_Release
REG_T WINAPI IDO_GetData(REG_T pthis, REG_T pFormatetc, REG_T pmedium)
{
REG_T eax = 0, edx, esi;
REG_T hCMem;
EDIT *pMem;
// PrintText 'IDataObject_GetData'
esi = pFormatetc;
if(((FORMATETC *)esi)->cfFormat==CF_TEXT)
{
if(((FORMATETC *)esi)->dwAspect==DVASPECT_CONTENT)
{
if(((FORMATETC *)esi)->lindex==-1)
{
if(((FORMATETC *)esi)->tymed==TYMED_HGLOBAL)
{
pMem = hDragSourceMem;
eax = pMem->cpMin;
eax -= pMem->cpMax;
if(R_SIGNED(eax) < 0)
{
eax = -eax;
} // endif
eax *= 2;
eax++;
eax = xGlobalAlloc(GMEM_SHARE | GMEM_MOVEABLE | GMEM_ZEROINIT, eax);
hCMem = eax;
eax = GlobalLock(hCMem);
eax = EditCopy(pMem, eax);
eax = GlobalUnlock(hCMem);
edx = pmedium;
((STGMEDIUM *)edx)->tymed = TYMED_HGLOBAL;
eax = hCMem;
((STGMEDIUM *)edx)->hGlobal = eax;
((STGMEDIUM *)edx)->pUnkForRelease = NULL;
eax = S_OK;
}
else
{
eax = DV_E_TYMED;
} // endif
}
else
{
eax = DV_E_LINDEX;
} // endif
}
else
{
eax = DV_E_DVASPECT;
} // endif
}
else
{
eax = DV_E_CLIPFORMAT;
} // endif
return eax;
} // IDO_GetData
REG_T WINAPI IDO_GetDataHere(REG_T pthis, REG_T pFormatetc, REG_T pmedium)
{
REG_T eax = 0;
// PrintText 'IDataObject_GetDataHere'
eax = E_NOTIMPL;
return eax;
} // IDO_GetDataHere
REG_T WINAPI IDO_QueryGetData(REG_T pthis, REG_T pFormatetc)
{
REG_T eax = 0, ebx;
// PrintText 'IDataObject_QueryGetData'
ebx = pFormatetc;
if(((FORMATETC *)ebx)->cfFormat==CF_TEXT)
{
if(((FORMATETC *)ebx)->dwAspect==DVASPECT_CONTENT)
{
if(((FORMATETC *)ebx)->lindex==-1)
{
if(((FORMATETC *)ebx)->tymed==TYMED_HGLOBAL)
{
eax = S_OK;
}
else
{
eax = DV_E_TYMED;
} // endif
}
else
{
eax = DV_E_LINDEX;
} // endif
}
else
{
eax = DV_E_DVASPECT;
} // endif
}
else
{
eax = DV_E_CLIPFORMAT;
} // endif
return eax;
} // IDO_QueryGetData
REG_T WINAPI IDO_GetCanonicalFormatEtc(REG_T pthis, REG_T pFormatetcIn, REG_T pFormatetcOut)
{
REG_T eax = 0, ecx, esi, edi;
// PrintText 'IDataObject_GetCanonicalFormatEtc'
esi = pFormatetcIn;
edi = pFormatetcOut;
ecx = sizeof(FORMATETC);
while(ecx > 0)
{
*(BYTE *)edi = *(BYTE *)esi;
edi++;
esi++;
ecx--;
}
((FORMATETC *)edi)->ptd = NULL;
eax = DATA_S_SAMEFORMATETC;
return eax;
} // IDO_GetCanonicalFormatEtc
REG_T WINAPI IDO_SetData(REG_T pthis, REG_T pFormatetc, REG_T pmedium, DWORD fRelease)
{
REG_T eax = 0;
// PrintText 'IDataObject_SetData'
eax = E_NOTIMPL;
return eax;
} // IDO_SetData
REG_T WINAPI IDO_EnumFormatEtc(REG_T pthis, DWORD dwDirection, REG_T ppenumFormatetc)
{
REG_T eax = 0, edx;
// PrintText 'IDataObject_EnumFormatEtc'
if(dwDirection==DATADIR_GET)
{
eax = &EnumFORMATETC;
edx = ppenumFormatetc;
*(REG_T *)edx = eax;
eax = S_OK;
}
else
{
eax = E_NOTIMPL;
} // endif
return eax;
} // IDO_EnumFormatEtc
REG_T WINAPI IDO_DAdvise(REG_T pthis, REG_T pFormatetc, DWORD advf, REG_T pAdvSink, REG_T pdwConnection)
{
REG_T eax = 0;
// PrintText 'IDataObject_DAdvise'
eax = E_NOTIMPL;
return eax;
} // IDO_DAdvise
REG_T WINAPI IDO_DUnadvise(REG_T pthis, DWORD dwConnection)
{
REG_T eax = 0;
// PrintText 'IDataObject_DUnadvise'
eax = E_NOTIMPL;
return eax;
} // IDO_DUnadvise
REG_T WINAPI IDO_EnumDAdvise(REG_T pthis, REG_T ppenumAdvise)
{
REG_T eax = 0;
// PrintText 'IDataObject_EnumDAdvise'
eax = E_NOTIMPL;
return eax;
} // IDO_EnumDAdvise
// IEnumFORMATETC methods
REG_T WINAPI IEnumFORMATETC_QueryInterface(REG_T pthis, REG_T iid, REG_T ppvObject)
{
REG_T eax = 0, edx;
// PrintText 'IEnumFORMATETC_QueryInterface'
eax = IsEqualGUID(iid, &IID_IEnumFORMATETC);
if(!eax)
{
eax = IsEqualGUID(iid, &IID_IUnknown);
} // endif
edx = ppvObject;
if(eax)
{
eax = pthis;
*(REG_T *)edx = eax;
edx = eax;
eax = ((IEnumFORMATETCImpl *)edx)->lpVtbl->AddRef(eax);
eax = S_OK;
}
else
{
*(REG_T *)edx = 0;
eax = E_NOINTERFACE;
} // endif
return eax;
} // IEnumFORMATETC_QueryInterface
REG_T WINAPI IEnumFORMATETC_AddRef(REG_T pthis)
{
REG_T eax = 0, edx;
// PrintText 'IEnumFORMATETC_AddRef'
eax = pthis;
edx = eax;
((IEnumFORMATETCImpl *)edx)->refcount++;
eax = ((IEnumFORMATETCImpl *)edx)->refcount;
return eax;
} // IEnumFORMATETC_AddRef
REG_T WINAPI IEnumFORMATETC_Release(REG_T pthis)
{
REG_T eax = 0, edx;
// PrintText 'IEnumFORMATETC_Release'
eax = pthis;
edx = eax;
if(((IEnumFORMATETCImpl *)edx)->refcount)
{
((IEnumFORMATETCImpl *)edx)->refcount--;
} // endif
if(!((IEnumFORMATETCImpl *)edx)->refcount)
{
((IEnumFORMATETCImpl *)edx)->ifmt = 0;
} // endif
eax = ((IEnumFORMATETCImpl *)edx)->refcount;
return eax;
} // IEnumFORMATETC_Release
REG_T WINAPI IEnumFORMATETC_Next(REG_T pthis, DWORD celt, REG_T rgelt, REG_T pceltFetched)
{
REG_T eax = 0, ecx, edx;
// PrintText 'IEnumFORMATETC_Next'
edx = 0;
eax = pthis;
ecx = ((IEnumFORMATETCImpl *)eax)->ifmt;
if(ecx<((IEnumFORMATETCImpl *)eax)->ifmtmax)
{
edx++;
ecx++;
((IEnumFORMATETCImpl *)eax)->ifmt = ecx;
eax = rgelt;
((FORMATETC *)eax)->cfFormat = CF_TEXT;
((FORMATETC *)eax)->ptd = NULL;
((FORMATETC *)eax)->dwAspect = DVASPECT_CONTENT;
((FORMATETC *)eax)->lindex = -1;
((FORMATETC *)eax)->tymed = TYMED_HGLOBAL;
} // endif
eax = pceltFetched;
if(eax)
{
*(DWORD *)eax = edx;
} // endif
if(edx==celt)
{
eax = S_OK;
}
else
{
eax = S_FALSE;
} // endif
return eax;
} // IEnumFORMATETC_Next
REG_T WINAPI IEnumFORMATETC_Skip(REG_T pthis, DWORD celt)
{
REG_T eax = 0;
// PrintText 'IEnumFORMATETC_Skip'
eax = E_NOTIMPL;
return eax;
} // IEnumFORMATETC_Skip
REG_T WINAPI IEnumFORMATETC_Reset(REG_T pthis)
{
REG_T eax = 0, edx;
// PrintText 'IEnumFORMATETC_Reset'
eax = pthis;
edx = eax;
((IEnumFORMATETCImpl *)edx)->ifmt = 0;
eax = S_OK;
return eax;
} // IEnumFORMATETC_Reset
REG_T WINAPI IEnumFORMATETC_Clone(REG_T pthis, REG_T ppenum)
{
REG_T eax = 0;
// PrintText 'IEnumFORMATETC_Clone'
eax = E_NOTIMPL;
return eax;
} // IEnumFORMATETC_Clone