ReactOS 0.4.17-dev-966-gf06eace
pastespl.c
Go to the documentation of this file.
1/*
2 * OleUIPasteSpecial implementation
3 *
4 * Copyright 2006 Huw Davies
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#define COBJMACROS
22
23#include <stdarg.h>
24
25#include "windef.h"
26#include "winbase.h"
27#include "winerror.h"
28#include "wingdi.h"
29#include "winuser.h"
30#include "winnls.h"
31#include "oledlg.h"
32
33#include "oledlg_private.h"
34#include "resource.h"
35
36#include "wine/debug.h"
37
39
40typedef struct
41{
48 LPOLESTR app_name;
50
51static const struct ps_flag
52{
54 const char *name;
55} ps_flags[] = {
56#define PS_FLAG_ENTRY(p) {p, #p}
65 {-1, NULL}
66#undef PS_FLAG_ENTRY
67};
68
70{
71 char flagstr[1000] = "";
72
73 const struct ps_flag *flag = ps_flags;
74 for( ; flag->name; flag++) {
75 if(flags & flag->flag) {
76 strcat(flagstr, flag->name);
77 strcat(flagstr, "|");
78 }
79 }
80 TRACE("flags %08lx %s\n", flags, flagstr);
81}
82
84{
85 INT i;
86 UINT j;
87
89 TRACE("hwnd %p caption %s hook %p custdata %Ix\n",
92 TRACE("hinst %p template %04x hresource %p\n", ps->hInstance, (WORD)(ULONG_PTR)ps->lpszTemplate, ps->hResource);
93 else
94 TRACE("hinst %p template %s hresource %p\n", ps->hInstance, debugstr_w(ps->lpszTemplate), ps->hResource);
95 TRACE("dataobj %p arrpasteent %p cpasteent %d arrlinktype %p clinktype %d\n",
97 ps->arrLinkTypes, ps->cLinkTypes);
98 TRACE("cclsidex %d lpclsidex %p nselect %d flink %d hmetapict %p size(%ld,%ld)\n",
100 ps->hMetaPict, ps->sizel.cx, ps->sizel.cy);
101 for(i = 0; i < ps->cPasteEntries; i++)
102 {
103 TRACE("arrPasteEntries[%d]: cFormat %08x pTargetDevice %p dwAspect %ld lindex %ld tymed %ld\n",
104 i, ps->arrPasteEntries[i].fmtetc.cfFormat, ps->arrPasteEntries[i].fmtetc.ptd,
105 ps->arrPasteEntries[i].fmtetc.dwAspect, ps->arrPasteEntries[i].fmtetc.lindex,
106 ps->arrPasteEntries[i].fmtetc.tymed);
107 TRACE("\tformat name %s result text %s flags %04lx\n", debugstr_w(ps->arrPasteEntries[i].lpstrFormatName),
109 }
110 for(i = 0; i < ps->cLinkTypes; i++)
111 TRACE("arrLinkTypes[%d] %08x\n", i, ps->arrLinkTypes[i]);
112 for(j = 0; j < ps->cClsidExclude; j++)
113 TRACE("lpClsidExclude[%u] %s\n", j, debugstr_guid(&ps->lpClsidExclude[j]));
114
115}
116
117static inline WCHAR *strdupAtoW(const char *str)
118{
119 DWORD len;
120 WCHAR *ret;
121 if(!str) return NULL;
122 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
123 ret = malloc(len * sizeof(WCHAR));
125 return ret;
126}
127
128static void get_descriptors(HWND hdlg, ps_struct_t *ps_struct)
129{
130 FORMATETC fmtetc;
131 STGMEDIUM stg;
132
133 fmtetc.tymed = TYMED_HGLOBAL;
134 fmtetc.dwAspect = DVASPECT_CONTENT;
135 fmtetc.ptd = NULL;
136 fmtetc.lindex = -1;
137
138 fmtetc.cfFormat = cf_object_descriptor;
139 if(IDataObject_GetData(ps_struct->ps->lpSrcDataObj, &fmtetc, &stg) == S_OK)
140 {
141 OBJECTDESCRIPTOR *obj_desc = GlobalLock(stg.hGlobal);
142 if(obj_desc->dwSrcOfCopy)
143 ps_struct->source_name = wcsdup((WCHAR*)((char*)obj_desc + obj_desc->dwSrcOfCopy));
144 if(obj_desc->dwFullUserTypeName)
145 ps_struct->type_name = wcsdup((WCHAR*)((char*)obj_desc + obj_desc->dwFullUserTypeName));
146 OleRegGetUserType(&obj_desc->clsid, USERCLASSTYPE_APPNAME, &ps_struct->app_name);
147 /* Get the icon here. If dwDrawAspect & DVASCPECT_ICON call GetData(CF_METAFILEPICT), otherwise
148 native calls OleGetIconFromClass(obj_desc->clsid) */
149 GlobalUnlock(stg.hGlobal);
150 GlobalFree(stg.hGlobal);
151 }
152 else
153 {
154 /* Try to get some data using some of the other clipboard formats */
155 }
156
157 fmtetc.cfFormat = cf_link_src_descriptor;
158 if(IDataObject_GetData(ps_struct->ps->lpSrcDataObj, &fmtetc, &stg) == S_OK)
159 {
160 OBJECTDESCRIPTOR *obj_desc = GlobalLock(stg.hGlobal);
161 if(obj_desc->dwSrcOfCopy)
162 ps_struct->link_source_name = wcsdup((WCHAR*)((char*)obj_desc + obj_desc->dwSrcOfCopy));
163 if(obj_desc->dwFullUserTypeName)
164 ps_struct->link_type_name = wcsdup((WCHAR*)((char*)obj_desc + obj_desc->dwFullUserTypeName));
165 GlobalUnlock(stg.hGlobal);
166 GlobalFree(stg.hGlobal);
167 }
168
169 if(ps_struct->source_name == NULL && ps_struct->link_source_name == NULL)
170 {
171 WCHAR buf[200];
173 ps_struct->source_name = wcsdup(buf);
174 }
175
176 if(ps_struct->type_name == NULL && ps_struct->link_type_name == NULL)
177 {
178 WCHAR buf[200];
180 ps_struct->type_name = wcsdup(buf);
181 }
182}
183
185{
186 HWND hwnd = GetDlgItem(hdlg, id);
187 BOOL ret = FALSE;
188
189 /* FIXME %s handling */
190
191 /* Note that this suffers from the same bug as native, in that if a new string
192 is a substring of an already added string, then the FINDSTRING will succeed
193 this is probably not what we want */
195 {
198 ret = TRUE;
199 }
200 return ret;
201}
202
204{
205 IEnumFORMATETC *penum;
206 HRESULT hr;
207 FORMATETC fmts[20];
208 DWORD fetched, items_added = 0;
209
210 hr = IDataObject_EnumFormatEtc(ps->lpSrcDataObj, DATADIR_GET, &penum);
211 if(FAILED(hr))
212 {
213 WARN("Unable to create IEnumFORMATETC\n");
214 return 0;
215 }
216
217 /* The native version grabs only the first 20 fmts and we do the same */
218 hr = IEnumFORMATETC_Next(penum, ARRAY_SIZE(fmts), fmts, &fetched);
219 TRACE("got %ld formats hr %08lx\n", fetched, hr);
220
221 if(SUCCEEDED(hr))
222 {
223 DWORD src_fmt, req_fmt;
224 for(req_fmt = 0; req_fmt < ps->cPasteEntries; req_fmt++)
225 {
226 /* This is used by update_structure() to set nSelectedIndex on exit */
227 ps->arrPasteEntries[req_fmt].dwScratchSpace = req_fmt;
228 TRACE("req_fmt %x\n", ps->arrPasteEntries[req_fmt].fmtetc.cfFormat);
229 for(src_fmt = 0; src_fmt < fetched; src_fmt++)
230 {
231 TRACE("\tenum'ed fmt %x\n", fmts[src_fmt].cfFormat);
232 if(ps->arrPasteEntries[req_fmt].fmtetc.cfFormat == fmts[src_fmt].cfFormat)
233 {
235 items_added++;
236 break;
237 }
238 }
239 }
240 }
241
242 IEnumFORMATETC_Release(penum);
243 EnableWindow(GetDlgItem(hdlg, IDC_PS_PASTE), items_added != 0);
244 return items_added;
245}
246
248{
249 HRESULT hr;
250 DWORD supported_mask = 0;
251 DWORD items_added = 0;
252 int link, req_fmt;
253 FORMATETC fmt = {0, NULL, DVASPECT_CONTENT, -1, -1};
254
255 for(link = 0; link < ps->cLinkTypes && link < PS_MAXLINKTYPES; link++)
256 {
257 fmt.cfFormat = ps->arrLinkTypes[link];
258 hr = IDataObject_QueryGetData(ps->lpSrcDataObj, &fmt);
259 if(hr == S_OK)
260 supported_mask |= 1 << link;
261 }
262 TRACE("supported_mask %02lx\n", supported_mask);
263 for(req_fmt = 0; req_fmt < ps->cPasteEntries; req_fmt++)
264 {
265 DWORD linktypes;
267 linktypes = 0xff;
268 else
269 linktypes = ps->arrPasteEntries[req_fmt].dwFlags & 0xff;
270
271 if(linktypes & supported_mask)
272 {
274 items_added++;
275 }
276 }
277
278 EnableWindow(GetDlgItem(hdlg, IDC_PS_PASTELINK), items_added != 0);
279 return items_added;
280}
281
282/* copies src_list_id into the display list */
283static void update_display_list(HWND hdlg, UINT src_list_id)
284{
285 LONG count, i, old_pos;
286 WCHAR txt[256];
287 LONG item_data;
288 HWND display_list = GetDlgItem(hdlg, IDC_PS_DISPLAYLIST);
289 HWND list = GetDlgItem(hdlg, src_list_id);
290
291 old_pos = SendMessageW(display_list, LB_GETCURSEL, 0, 0);
292 if(old_pos == -1) old_pos = 0;
293
294 SendMessageW(display_list, WM_SETREDRAW, 0, 0);
295 SendMessageW(display_list, LB_RESETCONTENT, 0, 0);
297 for(i = 0; i < count; i++)
298 {
300 item_data = SendMessageW(list, LB_GETITEMDATA, i, 0);
301 SendMessageW(display_list, LB_INSERTSTRING, i, (LPARAM)txt);
302 SendMessageW(display_list, LB_SETITEMDATA, i, item_data);
303 }
304 SendMessageW(display_list, LB_SETCURSEL, 0, 0);
305 SendMessageW(display_list, WM_SETREDRAW, 1, 0);
306 if(GetForegroundWindow() == hdlg)
307 SetFocus(display_list);
308}
309
310static void init_lists(HWND hdlg, ps_struct_t *ps_struct)
311{
312 DWORD pastes_added = init_pastelist(hdlg, ps_struct->ps);
313 DWORD links_added = init_linklist(hdlg, ps_struct->ps);
314 UINT check_id, list_id;
315
316 if((ps_struct->flags & (PSF_SELECTPASTE | PSF_SELECTPASTELINK)) == 0)
317 ps_struct->flags |= PSF_SELECTPASTE;
318
319 if(!pastes_added && !links_added)
320 ps_struct->flags &= ~(PSF_SELECTPASTE | PSF_SELECTPASTELINK);
321 else if(!pastes_added && (ps_struct->flags & PSF_SELECTPASTE))
322 {
323 ps_struct->flags &= ~PSF_SELECTPASTE;
324 ps_struct->flags |= PSF_SELECTPASTELINK;
325 }
326 else if(!links_added && (ps_struct->flags & PSF_SELECTPASTELINK))
327 {
328 ps_struct->flags &= ~PSF_SELECTPASTELINK;
329 ps_struct->flags |= PSF_SELECTPASTE;
330 }
331
332 check_id = 0;
333 list_id = 0;
334 if(ps_struct->flags & PSF_SELECTPASTE)
335 {
336 check_id = IDC_PS_PASTE;
337 list_id = IDC_PS_PASTELIST;
338 }
339 else if(ps_struct->flags & PSF_SELECTPASTELINK)
340 {
341 check_id = IDC_PS_PASTELINK;
342 list_id = IDC_PS_PASTELINKLIST;
343 }
344
346
347 if(list_id)
348 update_display_list(hdlg, list_id);
349 else
350 EnableWindow(GetDlgItem(hdlg, IDOK), 0);
351}
352
353static void update_src_text(HWND hdlg, const ps_struct_t *ps_struct)
354{
355 WCHAR *str;
356
357 if(ps_struct->flags & PSF_SELECTPASTE)
358 {
359 if(ps_struct->source_name)
360 str = ps_struct->source_name;
361 else
362 str = ps_struct->link_source_name;
363
364 }
365 else
366 {
367 if(ps_struct->link_source_name)
368 str = ps_struct->link_source_name;
369 else
370 str = ps_struct->source_name;
371
372 }
374}
375
376static void update_as_icon(HWND hdlg, ps_struct_t *ps_struct)
377{
378 HWND icon_display = GetDlgItem(hdlg, IDC_PS_ICONDISPLAY);
379 HWND display_as_icon = GetDlgItem(hdlg, IDC_PS_DISPLAYASICON);
380 HWND change_icon = GetDlgItem(hdlg, IDC_PS_CHANGEICON);
381
382 /* FIXME. No as icon handling */
383 ps_struct->flags &= ~PSF_CHECKDISPLAYASICON;
384
386 EnableWindow(display_as_icon, 0);
387 ShowWindow(icon_display, SW_HIDE);
388 EnableWindow(icon_display, 0);
389 ShowWindow(change_icon, SW_HIDE);
390 EnableWindow(change_icon, 0);
391}
392
393static void update_result_text(HWND hdlg, const ps_struct_t *ps_struct)
394{
395 WCHAR resource_txt[200];
396 UINT res_id;
397 OLEUIPASTEENTRYW *pent;
398 LONG cur_sel;
399 static const WCHAR percent_s[] = {'%','s',0};
400 WCHAR *result_txt, *ptr;
401
403 if(cur_sel == -1) return;
405
406 if(ps_struct->flags & PSF_SELECTPASTE)
407 {
408 if(ps_struct->flags & PSF_CHECKDISPLAYASICON)
410 else
411 res_id = IDS_PS_PASTE_DATA;
412 }
413 else
414 {
415 if(ps_struct->flags & PSF_CHECKDISPLAYASICON)
417 else
418 res_id = IDS_PS_PASTE_LINK_DATA;
419 }
420
421 LoadStringW(OLEDLG_hInstance, res_id, resource_txt, ARRAY_SIZE(resource_txt));
422 if((ptr = wcsstr(resource_txt, percent_s)))
423 {
424 /* FIXME handle %s in ResultText. Sub appname if IDS_PS_PASTE_OBJECT{_AS_ICON}. Else sub appropriate type name */
425 size_t result_txt_len = lstrlenW(pent->lpstrResultText);
426 ptrdiff_t offs = (char*)ptr - (char*)resource_txt;
427 result_txt = malloc((wcslen(resource_txt) + result_txt_len - 1) * sizeof(WCHAR));
428 memcpy(result_txt, resource_txt, offs);
429 memcpy((char*)result_txt + offs, pent->lpstrResultText, result_txt_len * sizeof(WCHAR));
430 memcpy((char*)result_txt + offs + result_txt_len * sizeof(WCHAR), ptr + 2, (lstrlenW(ptr + 2) + 1) * sizeof(WCHAR));
431 }
432 else
433 result_txt = resource_txt;
434
435 SetDlgItemTextW(hdlg, IDC_PS_RESULTTEXT, result_txt);
436
437 if(result_txt != resource_txt)
438 free(result_txt);
439
440}
441
442static void selection_change(HWND hdlg, ps_struct_t *ps_struct)
443{
444 update_as_icon(hdlg, ps_struct);
445 update_result_text(hdlg, ps_struct);
446}
447
448static void mode_change(HWND hdlg, ps_struct_t *ps_struct, UINT id)
449{
450 if(id == IDC_PS_PASTE)
451 {
452 ps_struct->flags &= ~PSF_SELECTPASTELINK;
453 ps_struct->flags |= PSF_SELECTPASTE;
454 }
455 else
456 {
457 ps_struct->flags &= ~PSF_SELECTPASTE;
458 ps_struct->flags |= PSF_SELECTPASTELINK;
459 }
460
461 update_src_text(hdlg, ps_struct);
463 selection_change(hdlg, ps_struct);
464}
465
466static void post_help_msg(HWND hdlg, ps_struct_t *ps_struct)
467{
469}
470
471static void send_end_dialog_msg(HWND hdlg, ps_struct_t *ps_struct, UINT id)
472{
473 SendMessageW(hdlg, oleui_msg_enddialog, id, 0);
474}
475
476static void update_structure(HWND hdlg, ps_struct_t *ps_struct)
477{
479 if(cur_sel != -1)
480 {
481 OLEUIPASTEENTRYW *pent;
483 ps_struct->ps->nSelectedIndex = pent->dwScratchSpace;
484 }
485 ps_struct->ps->dwFlags = ps_struct->flags;
486 ps_struct->ps->fLink = (ps_struct->flags & PSF_SELECTPASTELINK) != 0;
487}
488
489static void free_structure(ps_struct_t *ps_struct)
490{
491 free(ps_struct->type_name);
492 free(ps_struct->source_name);
493 free(ps_struct->link_type_name);
494 free(ps_struct->link_source_name);
495 CoTaskMemFree(ps_struct->app_name);
496 free(ps_struct);
497}
498
500{
501 /* native uses prop name "Structure", but we're not compatible
502 with that so we'll prepend "Wine_". */
503 static const WCHAR prop_name[] = {'W','i','n','e','_','S','t','r','u','c','t','u','r','e',0};
504 ps_struct_t *ps_struct;
505
506 TRACE("(%p, %04x, %08Ix, %08Ix)\n", hdlg, msg, wp, lp);
507
508 ps_struct = GetPropW(hdlg, prop_name);
509
510 if(msg != WM_INITDIALOG)
511 {
512 if(!ps_struct)
513 return 0;
514
515 if(ps_struct->ps->lpfnHook)
516 {
517 INT_PTR ret = ps_struct->ps->lpfnHook(hdlg, msg, wp, lp);
518 if(ret) return ret;
519 }
520 }
521
522 switch(msg)
523 {
524 case WM_INITDIALOG:
525 {
526 ps_struct = malloc(sizeof(*ps_struct));
527 ps_struct->ps = (OLEUIPASTESPECIALW*)lp;
528 ps_struct->type_name = NULL;
529 ps_struct->source_name = NULL;
530 ps_struct->link_type_name = NULL;
531 ps_struct->link_source_name = NULL;
532 ps_struct->app_name = NULL;
533 ps_struct->flags = ps_struct->ps->dwFlags;
534
535 SetPropW(hdlg, prop_name, ps_struct);
536
537 if(!(ps_struct->ps->dwFlags & PSF_SHOWHELP))
538 {
541 }
542
543 if(ps_struct->ps->lpszCaption)
544 SetWindowTextW(hdlg, ps_struct->ps->lpszCaption);
545
546 get_descriptors(hdlg, ps_struct);
547
548 init_lists(hdlg, ps_struct);
549
550 update_src_text(hdlg, ps_struct);
551
552 selection_change(hdlg, ps_struct);
553
555
556 if(ps_struct->ps->lpfnHook)
557 ps_struct->ps->lpfnHook(hdlg, msg, 0, 0);
558 return FALSE; /* use new focus */
559 }
560 case WM_COMMAND:
561 switch(LOWORD(wp))
562 {
564 switch(HIWORD(wp))
565 {
566 case LBN_SELCHANGE:
567 selection_change(hdlg, ps_struct);
568 return FALSE;
569 default:
570 return FALSE;
571 }
572 case IDC_PS_PASTE:
573 case IDC_PS_PASTELINK:
574 switch(HIWORD(wp))
575 {
576 case BN_CLICKED:
577 mode_change(hdlg, ps_struct, LOWORD(wp));
578 return FALSE;
579
580 default:
581 return FALSE;
582 }
583 case IDC_OLEUIHELP:
584 switch(HIWORD(wp))
585 {
586 case BN_CLICKED:
587 post_help_msg(hdlg, ps_struct);
588 return FALSE;
589 default:
590 return FALSE;
591 }
592 case IDOK:
593 case IDCANCEL:
594 switch(HIWORD(wp))
595 {
596 case BN_CLICKED:
597 send_end_dialog_msg(hdlg, ps_struct, LOWORD(wp));
598 return FALSE;
599 default:
600 return FALSE;
601 }
602 }
603 return FALSE;
604 default:
606 {
607 if(wp == IDOK)
608 update_structure(hdlg, ps_struct);
609 EndDialog(hdlg, wp);
610 /* native does its cleanup in WM_DESTROY */
611 RemovePropW(hdlg, prop_name);
612 free_structure(ps_struct);
613 return TRUE;
614 }
615 return FALSE;
616 }
617
618}
619
620/***********************************************************************
621 * OleUIPasteSpecialA (OLEDLG.4)
622 */
624{
626 UINT ret;
627 TRACE("(%p)\n", psA);
628
629 memcpy(&ps, psA, psA->cbStruct);
630
634
635 if(psA->cPasteEntries > 0)
636 {
637 DWORD size = psA->cPasteEntries * sizeof(ps.arrPasteEntries[0]);
638 INT i;
639
642 for(i = 0; i < psA->cPasteEntries; i++)
643 {
648 }
649 }
650
651 ret = OleUIPasteSpecialW(&ps);
652
653 if(psA->cPasteEntries > 0)
654 {
655 INT i;
656 for(i = 0; i < psA->cPasteEntries; i++)
657 {
660 }
662 }
664 free((WCHAR*)ps.lpszTemplate);
665 free((WCHAR*)ps.lpszCaption);
666
667 /* Copy back the output fields */
668 psA->dwFlags = ps.dwFlags;
669 psA->lpSrcDataObj = ps.lpSrcDataObj;
671 psA->fLink = ps.fLink;
672 psA->hMetaPict = ps.hMetaPict;
673 psA->sizel = ps.sizel;
674
675 return ret;
676}
677
678/***********************************************************************
679 * OleUIPasteSpecialW (OLEDLG.22)
680 */
682{
684 UINT ret;
685
686 TRACE("(%p)\n", ps);
687
688 if(TRACE_ON(ole)) dump_pastespecial(ps);
689
690 if(!ps->lpSrcDataObj)
692
693 if(ps->hInstance || !ps->hResource)
694 {
697 HRSRC hrsrc;
698
701 if(!hrsrc) return OLEUI_ERR_FINDTEMPLATEFAILURE;
702 dlg_templ = LoadResource(hInst, hrsrc);
703 if(!dlg_templ) return OLEUI_ERR_LOADTEMPLATEFAILURE;
704 }
705
707
708 return ret;
709}
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define WARN(fmt,...)
Definition: precomp.h:61
Definition: list.h:39
const WCHAR * link
Definition: db.cpp:998
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define CP_ACP
Definition: compat.h:109
#define TRACE_ON(x)
Definition: compat.h:75
#define CALLBACK
Definition: compat.h:35
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define IS_INTRESOURCE(x)
Definition: loader.c:613
int ptrdiff_t
Definition: corecrt.h:194
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP wchar_t *__cdecl wcsstr(const wchar_t *, const wchar_t *)
Definition: wcs.c:2998
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
HRESULT WINAPI OleGetClipboard(IDataObject **obj)
Definition: clipboard.c:2246
HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype)
Definition: ole2.c:668
#define IDS_PS_PASTE_DATA
Definition: resource.h:53
#define IDS_PS_UNKNOWN_SRC
Definition: resource.h:61
#define IDS_PS_PASTE_OBJECT_AS_ICON
Definition: resource.h:55
#define IDS_PS_PASTE_LINK_DATA
Definition: resource.h:56
#define IDS_PS_UNKNOWN_TYPE
Definition: resource.h:60
#define IDS_PS_PASTE_LINK_OBJECT_AS_ICON
Definition: resource.h:58
return ret
Definition: mutex.c:147
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int UINT
Definition: sysinfo.c:13
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HINSTANCE OLEDLG_hInstance
Definition: oledlg_main.c:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static ERESOURCE GlobalLock
Definition: sys_arch.c:8
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
static struct fmt fmts[]
#define IDC_PS_PASTELIST
Definition: oledlg.h:452
#define PSF_SELECTPASTE
Definition: oledlg.h:429
#define PSF_HIDECHANGEICON
Definition: oledlg.h:434
#define PSF_NOREFRESHDATAOBJECT
Definition: oledlg.h:436
#define IDC_PS_SOURCETEXT
Definition: oledlg.h:451
#define PSF_SHOWHELP
Definition: oledlg.h:428
#define IDD_PASTESPECIAL
Definition: oledlg.h:445
#define IDC_PS_DISPLAYLIST
Definition: oledlg.h:454
#define IDC_PS_PASTELINKLIST
Definition: oledlg.h:453
#define IDC_PS_ICONDISPLAY
Definition: oledlg.h:456
@ OLEUIPASTE_LINKANYTYPE
Definition: oledlg.h:341
#define OLEUI_ERR_FINDTEMPLATEFAILURE
Definition: oledlg.h:77
#define PSF_CHECKDISPLAYASICON
Definition: oledlg.h:432
#define IDC_OLEUIHELP
Definition: oledlg.h:51
#define PSF_STAYONCLIPBOARDCHANGE
Definition: oledlg.h:435
#define IDC_PS_DISPLAYASICON
Definition: oledlg.h:455
#define IDC_PS_RESULTTEXT
Definition: oledlg.h:459
#define OLEUI_ERR_LPSZTEMPLATEINVALID
Definition: oledlg.h:75
#define IDC_PS_PASTELINK
Definition: oledlg.h:450
#define IDC_PS_PASTE
Definition: oledlg.h:449
#define PSF_DISABLEDISPLAYASICON
Definition: oledlg.h:433
#define OLEUI_ERR_LOADTEMPLATEFAILURE
Definition: oledlg.h:78
#define PSF_SELECTPASTELINK
Definition: oledlg.h:430
#define PS_MAXLINKTYPES
Definition: oledlg.h:426
#define IDD_PASTESPECIAL4
Definition: oledlg.h:446
#define IDC_PS_CHANGEICON
Definition: oledlg.h:457
UINT oleui_msg_help
Definition: oledlg_main.c:50
UINT cf_link_src_descriptor
Definition: oledlg_main.c:45
UINT cf_object_descriptor
Definition: oledlg_main.c:44
UINT oleui_msg_enddialog
Definition: oledlg_main.c:51
static void get_descriptors(HWND hdlg, ps_struct_t *ps_struct)
Definition: pastespl.c:128
static void init_lists(HWND hdlg, ps_struct_t *ps_struct)
Definition: pastespl.c:310
static void update_structure(HWND hdlg, ps_struct_t *ps_struct)
Definition: pastespl.c:476
static DWORD init_linklist(HWND hdlg, OLEUIPASTESPECIALW *ps)
Definition: pastespl.c:247
static const struct ps_flag ps_flags[]
static void free_structure(ps_struct_t *ps_struct)
Definition: pastespl.c:489
static void mode_change(HWND hdlg, ps_struct_t *ps_struct, UINT id)
Definition: pastespl.c:448
static INT_PTR CALLBACK ps_dlg_proc(HWND hdlg, UINT msg, WPARAM wp, LPARAM lp)
Definition: pastespl.c:499
static void dump_pastespecial(const OLEUIPASTESPECIALW *ps)
Definition: pastespl.c:83
static void update_src_text(HWND hdlg, const ps_struct_t *ps_struct)
Definition: pastespl.c:353
UINT WINAPI OleUIPasteSpecialA(LPOLEUIPASTESPECIALA psA)
Definition: pastespl.c:623
static void update_as_icon(HWND hdlg, ps_struct_t *ps_struct)
Definition: pastespl.c:376
static void selection_change(HWND hdlg, ps_struct_t *ps_struct)
Definition: pastespl.c:442
static void dump_ps_flags(DWORD flags)
Definition: pastespl.c:69
static void update_display_list(HWND hdlg, UINT src_list_id)
Definition: pastespl.c:283
static BOOL add_entry_to_lb(HWND hdlg, UINT id, OLEUIPASTEENTRYW *pe)
Definition: pastespl.c:184
static void post_help_msg(HWND hdlg, ps_struct_t *ps_struct)
Definition: pastespl.c:466
static WCHAR * strdupAtoW(const char *str)
Definition: pastespl.c:117
static void send_end_dialog_msg(HWND hdlg, ps_struct_t *ps_struct, UINT id)
Definition: pastespl.c:471
UINT WINAPI OleUIPasteSpecialW(LPOLEUIPASTESPECIALW ps)
Definition: pastespl.c:681
static void update_result_text(HWND hdlg, const ps_struct_t *ps_struct)
Definition: pastespl.c:393
static DWORD init_pastelist(HWND hdlg, OLEUIPASTESPECIALW *ps)
Definition: pastespl.c:203
#define PS_FLAG_ENTRY(p)
#define LOWORD(l)
Definition: pedump.c:82
short WCHAR
Definition: pedump.c:58
#define RT_DIALOG
Definition: pedump.c:367
long LONG
Definition: pedump.c:60
const DLGTEMPLATE * LPCDLGTEMPLATEW
Definition: winuser.h:3177
#define LB_GETCOUNT
Definition: winuser.h:2067
#define SW_HIDE
Definition: winuser.h:779
#define LB_GETITEMDATA
Definition: winuser.h:2070
INT_PTR WINAPI DialogBoxIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
#define IDCANCEL
Definition: winuser.h:842
#define LB_GETTEXT
Definition: winuser.h:2085
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_COMMAND
Definition: winuser.h:1768
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define WM_INITDIALOG
Definition: winuser.h:1767
#define LB_ADDSTRING
Definition: winuser.h:2060
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define LB_RESETCONTENT
Definition: winuser.h:2091
HWND WINAPI SetFocus(_In_opt_ HWND)
#define LB_FINDSTRING
Definition: winuser.h:2063
#define LB_INSERTSTRING
Definition: winuser.h:2089
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define LB_SETITEMDATA
Definition: winuser.h:2101
#define LBN_SELCHANGE
Definition: winuser.h:2111
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define BN_CLICKED
Definition: winuser.h:1954
#define LB_SETCURSEL
Definition: winuser.h:2099
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define LB_GETCURSEL
Definition: winuser.h:2068
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define WM_SETREDRAW
Definition: winuser.h:1644
const WCHAR * str
strcat
Definition: string.h:92
#define LoadStringW
Definition: utils.h:64
#define TRACE(s)
Definition: solgame.cpp:4
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
Definition: dsound.c:943
Definition: name.c:39
const char * name
Definition: pastespl.c:54
DWORD flag
Definition: pastespl.c:53
OLEUIPASTESPECIALW * ps
Definition: pastespl.c:42
WCHAR * source_name
Definition: pastespl.c:44
DWORD flags
Definition: pastespl.c:43
LPOLESTR app_name
Definition: pastespl.c:48
WCHAR * link_type_name
Definition: pastespl.c:47
WCHAR * link_source_name
Definition: pastespl.c:45
WCHAR * type_name
Definition: pastespl.c:46
LPCSTR lpstrResultText
Definition: oledlg.h:356
LPCSTR lpstrFormatName
Definition: oledlg.h:355
FORMATETC fmtetc
Definition: oledlg.h:363
LPCWSTR lpstrFormatName
Definition: oledlg.h:364
LPCWSTR lpstrResultText
Definition: oledlg.h:365
DWORD dwScratchSpace
Definition: oledlg.h:367
LPOLEUIPASTEENTRYA arrPasteEntries
Definition: oledlg.h:386
LPDATAOBJECT lpSrcDataObj
Definition: oledlg.h:385
LPDATAOBJECT lpSrcDataObj
Definition: oledlg.h:409
HINSTANCE hInstance
Definition: oledlg.h:406
LPCWSTR lpszCaption
Definition: oledlg.h:403
LPCWSTR lpszTemplate
Definition: oledlg.h:407
LPCLSID lpClsidExclude
Definition: oledlg.h:415
LPFNOLEUIHOOK lpfnHook
Definition: oledlg.h:404
LPOLEUIPASTEENTRYW arrPasteEntries
Definition: oledlg.h:410
int32_t INT_PTR
Definition: typedefs.h:64
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define HIWORD(l)
Definition: typedefs.h:247
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6