ReactOS 0.4.15-dev-6067-g0b695a6
shellutils.h
Go to the documentation of this file.
1/*
2 * Copyright 1999, 2000 Juergen Schmied
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef __ROS_SHELL_UTILS_H
20#define __ROS_SHELL_UTILS_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* defined(__cplusplus) */
25
26inline ULONG
27Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
28{
29 char szMsg[512];
30 char *szMsgStart;
31 const char *fname;
32 va_list vl;
33
34 fname = strrchr(filename, '\\');
35 if (fname == NULL)
36 {
37 fname = strrchr(filename, '/');
38 if (fname != NULL)
39 fname++;
40 }
41 else
42 fname++;
43
44 if (fname == NULL)
45 fname = filename;
46
47 szMsgStart = szMsg + sprintf(szMsg, "%s:%d: ", fname, line);
48
49 va_start(vl, lpFormat);
50 vsprintf(szMsgStart, lpFormat, vl);
51 va_end(vl);
52
53 OutputDebugStringA(szMsg);
54
55 /* Return STATUS_SUCCESS, since we are supposed to mimic DbgPrint */
56 return 0;
57}
58
59#define DbgPrint(fmt, ...) \
60 Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
61
62#ifdef __cplusplus
63# define IID_PPV_ARG(Itype, ppType) IID_##Itype, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
64# define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
65#else
66# define IID_PPV_ARG(Itype, ppType) IID_##Itype, (void**)(ppType)
67# define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, (void**)(ppType)
68#endif
69
70#if 1
71
72inline BOOL _ROS_FAILED_HELPER(HRESULT hr, const char* expr, const char* filename, int line)
73{
74 if (FAILED(hr))
75 {
76 Win32DbgPrint(filename, line, "Unexpected failure (%s)=%08x.\n", expr, hr);
77 return TRUE;
78 }
79 return FALSE;
80}
81
82#define FAILED_UNEXPECTEDLY(hr) _ROS_FAILED_HELPER((hr), #hr, __FILE__, __LINE__)
83#else
84#define FAILED_UNEXPECTEDLY(hr) FAILED(hr)
85#endif
86
87#ifdef __cplusplus
88} /* extern "C" */
89#endif /* defined(__cplusplus) */
90
91#ifdef __cplusplus
92template <typename T>
93class CComCreatorCentralInstance
94{
95private:
96 static IUnknown *s_pInstance;
97
98public:
99 static HRESULT WINAPI CreateInstance(void *pv, REFIID riid, LPVOID *ppv)
100 {
101 *ppv = NULL;
102 if (pv != NULL)
104 if (!s_pInstance)
105 {
106 PVOID pObj;
107 HRESULT hr;
109 if (FAILED(hr))
110 return hr;
111 if (InterlockedCompareExchangePointer((PVOID *)&s_pInstance, pObj, NULL))
112 static_cast<IUnknown *>(pObj)->Release();
113 }
114 return s_pInstance->QueryInterface(riid, ppv);
115 }
116 static void Term()
117 {
118 if (s_pInstance)
119 {
120 s_pInstance->Release();
121 s_pInstance = NULL;
122 }
123 }
124};
125
126template <typename T>
127IUnknown *CComCreatorCentralInstance<T>::s_pInstance = NULL;
128
129#define DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(x) \
130public: \
131 typedef CComCreatorCentralInstance< ATL::CComObject<x> > _CreatorClass;
132
133
134template <class Base>
135class CComDebugObject : public Base
136{
137public:
138 CComDebugObject(void * = NULL)
139 {
140#if DEBUG_CCOMOBJECT_CREATION
141 DbgPrint("%S, this=%08p\n", __FUNCTION__, static_cast<Base*>(this));
142#endif
143 _pAtlModule->Lock();
144 }
145
146 virtual ~CComDebugObject()
147 {
148 this->FinalRelease();
149 _pAtlModule->Unlock();
150 }
151
153 {
154 int rc = this->InternalAddRef();
155#if DEBUG_CCOMOBJECT_REFCOUNTING
156 DbgPrint("%s, RefCount is now %d(--)!\n", __FUNCTION__, rc);
157#endif
158 return rc;
159 }
160
162 {
163 int rc = this->InternalRelease();
164
165#if DEBUG_CCOMOBJECT_REFCOUNTING
166 DbgPrint("%s, RefCount is now %d(--)!\n", __FUNCTION__, rc);
167#endif
168
169 if (rc == 0)
170 {
171#if DEBUG_CCOMOBJECT_DESTRUCTION
172 DbgPrint("%s, RefCount reached 0 Deleting!\n", __FUNCTION__);
173#endif
174 delete this;
175 }
176 return rc;
177 }
178
180 {
181 return this->_InternalQueryInterface(iid, ppvObject);
182 }
183
184 static HRESULT WINAPI CreateInstance(CComDebugObject<Base> **pp)
185 {
186 CComDebugObject<Base> *newInstance;
187 HRESULT hResult;
188
189 ATLASSERT(pp != NULL);
190 if (pp == NULL)
191 return E_POINTER;
192
193 hResult = E_OUTOFMEMORY;
194 newInstance = NULL;
195 ATLTRY(newInstance = new CComDebugObject<Base>());
196 if (newInstance != NULL)
197 {
198 newInstance->SetVoid(NULL);
199 newInstance->InternalFinalConstructAddRef();
200 hResult = newInstance->_AtlInitialConstruct();
201 if (SUCCEEDED(hResult))
202 hResult = newInstance->FinalConstruct();
203 if (SUCCEEDED(hResult))
204 hResult = newInstance->_AtlFinalConstruct();
205 newInstance->InternalFinalConstructRelease();
206 if (hResult != S_OK)
207 {
208 delete newInstance;
209 newInstance = NULL;
210 }
211 }
212 *pp = newInstance;
213 return hResult;
214 }
215};
216
217#ifdef DEBUG_CCOMOBJECT
218# define _CComObject CComDebugObject
219#else
220# define _CComObject CComObject
221#endif
222
223template<class T>
224void ReleaseCComPtrExpectZero(CComPtr<T>& cptr, BOOL forceRelease = FALSE)
225{
226 if (cptr.p != NULL)
227 {
228 T *raw = cptr.Detach();
229 int nrc = raw->Release();
230 if (nrc > 0)
231 {
232 DbgPrint("WARNING: Unexpected RefCount > 0 (%d)!\n", nrc);
233 if (forceRelease)
234 {
235 while (nrc > 0)
236 {
237 nrc = raw->Release();
238 }
239 }
240 }
241 }
242}
243
244template<class T, class R>
245HRESULT inline ShellDebugObjectCreator(REFIID riid, R ** ppv)
246{
247 CComPtr<T> obj;
248 HRESULT hResult;
249
250 if (ppv == NULL)
251 return E_POINTER;
252 *ppv = NULL;
253 ATLTRY(obj = new CComDebugObject<T>);
254 if (obj.p == NULL)
255 return E_OUTOFMEMORY;
256 hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
257 if (FAILED(hResult))
258 return hResult;
259 return S_OK;
260}
261
262template<class T>
263HRESULT inline ShellObjectCreator(REFIID riid, void ** ppv)
264{
265 _CComObject<T> *pobj;
266 HRESULT hResult;
267
268 hResult = _CComObject<T>::CreateInstance(&pobj);
269 if (FAILED(hResult))
270 return hResult;
271
272 pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
273
274 hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
275
276 pobj->Release(); /* In case of failure the object will be released */
277
278 return hResult;
279}
280
281template<class T>
282HRESULT inline ShellObjectCreatorInit(REFIID riid, void ** ppv)
283{
284 _CComObject<T> *pobj;
285 HRESULT hResult;
286
287 hResult = _CComObject<T>::CreateInstance(&pobj);
288 if (FAILED(hResult))
289 return hResult;
290
291 pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
292
293 hResult = pobj->Initialize();
294
295 if (SUCCEEDED(hResult))
296 hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
297
298 pobj->Release(); /* In case of failure the object will be released */
299
300 return hResult;
301}
302
303template<class T, class T1>
304HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, void ** ppv)
305{
306 _CComObject<T> *pobj;
307 HRESULT hResult;
308
309 hResult = _CComObject<T>::CreateInstance(&pobj);
310 if (FAILED(hResult))
311 return hResult;
312
313 pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
314
315 hResult = pobj->Initialize(initArg1);
316
317 if (SUCCEEDED(hResult))
318 hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
319
320 pobj->Release(); /* In case of failure the object will be released */
321
322 return hResult;
323}
324
325template<class T, class T1, class T2>
326HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, void ** ppv)
327{
328 _CComObject<T> *pobj;
329 HRESULT hResult;
330
331 hResult = _CComObject<T>::CreateInstance(&pobj);
332 if (FAILED(hResult))
333 return hResult;
334
335 pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
336
337 hResult = pobj->Initialize(initArg1, initArg2);
338
339 if (SUCCEEDED(hResult))
340 hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
341
342 pobj->Release(); /* In case of failure the object will be released */
343
344 return hResult;
345}
346
347template<class T, class T1, class T2, class T3>
348HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, REFIID riid, void ** ppv)
349{
350 _CComObject<T> *pobj;
351 HRESULT hResult;
352
353 hResult = _CComObject<T>::CreateInstance(&pobj);
354 if (FAILED(hResult))
355 return hResult;
356
357 pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
358
359 hResult = pobj->Initialize(initArg1, initArg2, initArg3);
360
361 if (SUCCEEDED(hResult))
362 hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
363
364 pobj->Release(); /* In case of failure the object will be released */
365
366 return hResult;
367}
368
369template<class T, class T1, class T2, class T3, class T4>
370HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, REFIID riid, void ** ppv)
371{
372 _CComObject<T> *pobj;
373 HRESULT hResult;
374
375 hResult = _CComObject<T>::CreateInstance(&pobj);
376 if (FAILED(hResult))
377 return hResult;
378
379 pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
380
381 hResult = pobj->Initialize(initArg1, initArg2, initArg3, initArg4);
382
383 if (SUCCEEDED(hResult))
384 hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
385
386 pobj->Release(); /* In case of failure the object will be released */
387
388 return hResult;
389}
390
391template<class T, class T1, class T2, class T3, class T4, class T5>
392HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, T5 initArg5, REFIID riid, void ** ppv)
393{
394 _CComObject<T> *pobj;
395 HRESULT hResult;
396
397 hResult = _CComObject<T>::CreateInstance(&pobj);
398 if (FAILED(hResult))
399 return hResult;
400
401 pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
402
403 hResult = pobj->Initialize(initArg1, initArg2, initArg3, initArg4, initArg5);
404
405 if (SUCCEEDED(hResult))
406 hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
407
408 pobj->Release(); /* In case of failure the object will be released */
409
410 return hResult;
411}
412
413HRESULT inline SHSetStrRet(LPSTRRET pStrRet, LPCSTR pstrValue)
414{
415 pStrRet->uType = STRRET_CSTR;
416 strcpy(pStrRet->cStr, pstrValue);
417 return S_OK;
418}
419
420HRESULT inline SHSetStrRet(LPSTRRET pStrRet, LPCWSTR pwstrValue)
421{
422 SIZE_T cchr = wcslen(pwstrValue);
423 LPWSTR buffer = static_cast<LPWSTR>(CoTaskMemAlloc((cchr + 1) * sizeof(WCHAR)));
424 if (buffer == NULL)
425 return E_OUTOFMEMORY;
426
427 pStrRet->uType = STRRET_WSTR;
428 pStrRet->pOleStr = buffer;
429 wcscpy(buffer, pwstrValue);
430 return S_OK;
431}
432
433HRESULT inline SHSetStrRet(LPSTRRET pStrRet, HINSTANCE hInstance, DWORD resId)
434{
436
437 if (!LoadStringW(hInstance, resId, Buffer, MAX_PATH))
438 return E_FAIL;
439
440 return SHSetStrRet(pStrRet, Buffer);
441}
442
443static inline void DbgDumpMenuInternal(HMENU hmenu, char* padding, int padlevel)
444{
445 WCHAR label[128];
446 int i;
448
449 padding[padlevel] = '.';
450 padding[padlevel + 1] = '.';
451 padding[padlevel + 2] = 0;
452
453 for (i = 0; i < count; i++)
454 {
455 MENUITEMINFOW mii = { 0 };
456
457 mii.cbSize = sizeof(mii);
459 mii.dwTypeData = label;
460 mii.cch = _countof(label);
461
462 GetMenuItemInfoW(hmenu, i, TRUE, &mii);
463
464 if (mii.fType & MFT_BITMAP)
465 DbgPrint("%s%2d - %08x: BITMAP %08p (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.hbmpItem, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
466 else if (mii.fType & MFT_SEPARATOR)
467 DbgPrint("%s%2d - %08x ---SEPARATOR---\n", padding, i, mii.wID);
468 else
469 DbgPrint("%s%2d - %08x: %S (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.dwTypeData, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
470
471 if (mii.hSubMenu)
472 DbgDumpMenuInternal(mii.hSubMenu, padding, padlevel + 2);
473
474 }
475
476 padding[padlevel] = 0;
477}
478
479static __inline void DbgDumpMenu(HMENU hmenu)
480{
481 char padding[128];
482 DbgDumpMenuInternal(hmenu, padding, 0);
483}
484
485
486static inline
487void DumpIdList(LPCITEMIDLIST pcidl)
488{
489 DbgPrint("Begin IDList Dump\n");
490
491 for (; pcidl != NULL; pcidl = ILGetNext(pcidl))
492 {
493 int i;
494 int cb = pcidl->mkid.cb;
495 BYTE * sh = (BYTE*) &(pcidl->mkid);
496 if (cb == 0) // ITEMIDLISTs are terminatedwith a null SHITEMID.
497 break;
498 DbgPrint("Begin SHITEMID (cb=%d)\n", cb);
499 if ((cb & 3) != 0)
500 DbgPrint(" - WARNING: cb is not a multiple of 4\n");
501 for (i = 0; (i + 4) <= cb; i += 4)
502 {
503 DbgPrint(" - abID[%08x]: %02x %02x %02x %02x\n",
504 i,
505 sh[i + 0],
506 sh[i + 1],
507 sh[i + 2],
508 sh[i + 3]);
509 }
510 if (i < cb)
511 {
512 cb -= i;
513 if (cb == 3)
514 {
515 DbgPrint(" - abID[%08x]: %02x %02x %02x --\n",
516 i,
517 sh[i + 0],
518 sh[i + 1],
519 sh[i + 2]);
520 }
521 else if (cb == 2)
522 {
523 DbgPrint(" - abID[%08x]: %02x %02x -- --\n",
524 i,
525 sh[i + 0],
526 sh[i + 1]);
527 }
528 else if (cb == 1)
529 {
530 DbgPrint(" - abID[%08x]: %02x -- -- --\n",
531 i,
532 sh[i + 0]);
533 }
534 }
535 DbgPrint("End SHITEMID\n");
536 }
537 DbgPrint("End IDList Dump.\n");
538}
539
540struct CCoInit
541{
542 CCoInit()
543 {
545 }
546 ~CCoInit()
547 {
548 if (SUCCEEDED(hr))
549 {
551 }
552 }
553 HRESULT hr;
554};
555
556#endif /* __cplusplus */
557
558#define S_LESSTHAN 0xffff
559#define S_EQUAL S_OK
560#define S_GREATERTHAN S_FALSE
561#define MAKE_COMPARE_HRESULT(x) ((x)>0 ? S_GREATERTHAN : ((x)<0 ? S_LESSTHAN : S_EQUAL))
562
563
565{
566 return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]);
567}
568
570{
571 return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]);
572}
573
574
575#ifdef __cplusplus
576
577DECLSPEC_SELECTANY CLIPFORMAT g_cfHIDA = NULL;
578DECLSPEC_SELECTANY CLIPFORMAT g_cfShellIdListOffsets = NULL;
579
580// Allow to use the HIDA from an IDataObject without copying it
581struct CDataObjectHIDA
582{
583private:
584 STGMEDIUM m_medium;
585 CIDA* m_cida;
586 HRESULT m_hr;
587
588public:
589 explicit CDataObjectHIDA(IDataObject* pDataObject)
590 : m_cida(nullptr)
591 {
592 m_medium.tymed = TYMED_NULL;
593
594 if (g_cfHIDA == NULL)
595 {
596 g_cfHIDA = (CLIPFORMAT)RegisterClipboardFormatW(CFSTR_SHELLIDLISTW);
597 }
598 FORMATETC fmt = { g_cfHIDA, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
599
600 m_hr = pDataObject->GetData(&fmt, &m_medium);
601 if (FAILED(m_hr))
602 {
603 m_medium.tymed = TYMED_NULL;
604 return;
605 }
606
607 m_cida = (CIDA*)::GlobalLock(m_medium.hGlobal);
608 if (m_cida == nullptr)
609 {
610 m_hr = E_UNEXPECTED;
611 }
612 }
613
614 ~CDataObjectHIDA()
615 {
616 if (m_cida)
617 ::GlobalUnlock(m_cida);
618
619 ReleaseStgMedium(&m_medium);
620 }
621
622 HRESULT hr() const
623 {
624 return m_hr;
625 }
626
627 operator bool() const
628 {
629 return m_cida != nullptr;
630 }
631
632 operator const CIDA* () const
633 {
634 return m_cida;
635 }
636
637 const CIDA* operator->() const
638 {
639 return m_cida;
640 }
641};
642
643inline
644HRESULT DataObject_GetData(IDataObject* pDataObject, CLIPFORMAT clipformat, PVOID pBuffer, SIZE_T dwBufferSize)
645{
646 FORMATETC fmt = { clipformat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
647 STGMEDIUM medium = { TYMED_NULL };
648
649 HRESULT hr = pDataObject->GetData(&fmt, &medium);
650 if (SUCCEEDED(hr))
651 {
652 LPVOID blob = GlobalLock(medium.hGlobal);
653 if (blob)
654 {
655 SIZE_T size = GlobalSize(medium.hGlobal);
656 if (size <= dwBufferSize)
657 {
659 hr = S_OK;
660 }
661 else
662 {
664 }
665 GlobalUnlock(medium.hGlobal);
666 }
667 else
668 {
670 }
671
672 ReleaseStgMedium(&medium);
673 }
674 return hr;
675}
676
677inline
678HRESULT DataObject_SetData(IDataObject* pDataObject, CLIPFORMAT clipformat, PVOID pBuffer, SIZE_T dwBufferSize)
679{
680 STGMEDIUM medium = { TYMED_HGLOBAL };
681
682 medium.hGlobal = GlobalAlloc(GHND, dwBufferSize);
683 if (!medium.hGlobal)
684 return E_OUTOFMEMORY;
685
687 LPVOID blob = GlobalLock(medium.hGlobal);
688 if (blob)
689 {
690 CopyMemory(blob, pBuffer, dwBufferSize);
691 GlobalUnlock(medium.hGlobal);
692
693 FORMATETC etc = { clipformat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
694 hr = pDataObject->SetData(&etc, &medium, TRUE);
695 }
696
697 if (FAILED(hr))
698 GlobalFree(medium.hGlobal);
699
700 return hr;
701}
702
703
704inline HRESULT
705DataObject_GetOffset(IDataObject *pDataObject, POINT *point)
706{
707 if (g_cfShellIdListOffsets == NULL)
708 {
709 g_cfShellIdListOffsets = (CLIPFORMAT)RegisterClipboardFormatW(CFSTR_SHELLIDLISTOFFSETW);
710 }
711
712 point->x = point->y = 0;
713
714 return DataObject_GetData(pDataObject, g_cfShellIdListOffsets, point, sizeof(point[0]));
715}
716
717inline HRESULT
718DataObject_SetOffset(IDataObject* pDataObject, POINT* point)
719{
720 if (g_cfShellIdListOffsets == NULL)
721 {
722 g_cfShellIdListOffsets = (CLIPFORMAT)RegisterClipboardFormatW(CFSTR_SHELLIDLISTOFFSETW);
723 }
724
725 return DataObject_SetData(pDataObject, g_cfShellIdListOffsets, point, sizeof(point[0]));
726}
727
728#endif
729
730
731#endif /* __ROS_SHELL_UTILS_H */
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
#define STDMETHOD(m)
Definition: basetyps.h:62
const GUID IID_IUnknown
_In_ BOOLEAN Release
Definition: cdrom.h:920
HINSTANCE hInstance
Definition: charmap.c:19
static HRESULT WINAPI CreateInstance(void *pv, REFIID riid, LPVOID *ppv)
Definition: atlcom.h:424
Definition: bufpool.h:45
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
Definition: view.c:175
static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
Definition: view.c:203
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
#define __FUNCTION__
Definition: types.h:116
POINTL point
Definition: edittest.c:50
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
GLuint buffer
Definition: glext.h:5915
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
#define DbgPrint
Definition: hal.h:12
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
void WINAPI SHIM_OBJ_NAME() OutputDebugStringA(LPCSTR lpOutputString)
Definition: ignoredbgout.c:18
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT SetData([in, unique] FORMATETC *pformatetc, [in, unique] STGMEDIUM *pmedium, [in] BOOL fRelease)
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
ULONG AddRef()
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
const char * filename
Definition: ioapi.h:137
#define T
Definition: mbstring.h:31
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static const WCHAR label[]
Definition: itemdlg.c:1546
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
static const DWORD padding[]
Definition: mciwnd.c:89
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2427
#define bool
Definition: nsiface.idl:72
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:855
#define DECLSPEC_SELECTANY
Definition: guiddef.h:40
#define REFIID
Definition: guiddef.h:118
PVOID pBuffer
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
short sh
Definition: format.c:272
#define R(b, x)
Definition: sha2.c:134
ULONG Win32DbgPrint(const char *filename, int line, const char *lpFormat,...)
Definition: shellutils.h:27
#define DbgPrint(fmt,...)
Definition: shellutils.h:59
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:569
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:564
BOOL _ROS_FAILED_HELPER(HRESULT hr, const char *expr, const char *filename, int line)
Definition: shellutils.h:72
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR CFSTR_SHELLIDLISTOFFSETW[]
Definition: shlobj.h:435
static const WCHAR CFSTR_SHELLIDLISTW[]
Definition: shlobj.h:433
@ STRRET_CSTR
Definition: shtypes.idl:87
@ STRRET_WSTR
Definition: shtypes.idl:85
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
Definition: shtypes.idl:63
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:68
Definition: shlobj.h:499
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
char cStr[MAX_PATH]
Definition: shtypes.idl:98
UINT uType
Definition: shtypes.idl:93
LPWSTR pOleStr
Definition: shtypes.idl:96
Definition: image.c:134
Definition: query.h:87
Definition: dsound.c:943
Definition: parser.c:49
LPWSTR dwTypeData
Definition: winuser.h:3259
LPCWSTR lpFormat
Definition: trayclock.cpp:32
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59
static HMENU hmenu
Definition: win.c:66
#define CopyMemory
Definition: winbase.h:1668
#define GHND
Definition: winbase.h:297
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define WINAPI
Definition: msvc.h:6
#define STG_E_INVALIDHANDLE
Definition: winerror.h:2569
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define E_UNEXPECTED
Definition: winerror.h:2456
#define E_POINTER
Definition: winerror.h:2365
#define MIIM_STRING
Definition: winuser.h:722
#define MIIM_ID
Definition: winuser.h:717
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MIIM_FTYPE
Definition: winuser.h:724
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
#define MFT_SEPARATOR
Definition: winuser.h:739
#define MIIM_STATE
Definition: winuser.h:716
#define MIIM_SUBMENU
Definition: winuser.h:718
#define MFT_BITMAP
Definition: winuser.h:733
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193