ReactOS 0.4.15-dev-7098-ge0c17c3
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
413template<class P, class R> static HRESULT SHILClone(P pidl, R *ppOut)
414{
415 R r = *ppOut = (R)ILClone((PIDLIST_RELATIVE)pidl);
416 return r ? S_OK : E_OUTOFMEMORY;
417}
418
419template<class B, class R> static HRESULT SHILCombine(B base, PCUIDLIST_RELATIVE sub, R *ppOut)
420{
421 R r = *ppOut = (R)ILCombine((PCIDLIST_ABSOLUTE)base, sub);
422 return r ? S_OK : E_OUTOFMEMORY;
423}
424
425HRESULT inline SHSetStrRet(LPSTRRET pStrRet, LPCSTR pstrValue)
426{
427 pStrRet->uType = STRRET_CSTR;
428 strcpy(pStrRet->cStr, pstrValue);
429 return S_OK;
430}
431
432HRESULT inline SHSetStrRet(LPSTRRET pStrRet, LPCWSTR pwstrValue)
433{
434 SIZE_T cchr = wcslen(pwstrValue);
435 LPWSTR buffer = static_cast<LPWSTR>(CoTaskMemAlloc((cchr + 1) * sizeof(WCHAR)));
436 if (buffer == NULL)
437 return E_OUTOFMEMORY;
438
439 pStrRet->uType = STRRET_WSTR;
440 pStrRet->pOleStr = buffer;
441 wcscpy(buffer, pwstrValue);
442 return S_OK;
443}
444
445HRESULT inline SHSetStrRet(LPSTRRET pStrRet, HINSTANCE hInstance, DWORD resId)
446{
448
449 if (!LoadStringW(hInstance, resId, Buffer, MAX_PATH))
450 return E_FAIL;
451
452 return SHSetStrRet(pStrRet, Buffer);
453}
454
455static inline void DbgDumpMenuInternal(HMENU hmenu, char* padding, int padlevel)
456{
457 WCHAR label[128];
458 int i;
460
461 padding[padlevel] = '.';
462 padding[padlevel + 1] = '.';
463 padding[padlevel + 2] = 0;
464
465 for (i = 0; i < count; i++)
466 {
467 MENUITEMINFOW mii = { 0 };
468
469 mii.cbSize = sizeof(mii);
471 mii.dwTypeData = label;
472 mii.cch = _countof(label);
473
474 GetMenuItemInfoW(hmenu, i, TRUE, &mii);
475
476 if (mii.fType & MFT_BITMAP)
477 DbgPrint("%s%2d - %08x: BITMAP %08p (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.hbmpItem, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
478 else if (mii.fType & MFT_SEPARATOR)
479 DbgPrint("%s%2d - %08x ---SEPARATOR---\n", padding, i, mii.wID);
480 else
481 DbgPrint("%s%2d - %08x: %S (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.dwTypeData, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
482
483 if (mii.hSubMenu)
484 DbgDumpMenuInternal(mii.hSubMenu, padding, padlevel + 2);
485
486 }
487
488 padding[padlevel] = 0;
489}
490
491static __inline void DbgDumpMenu(HMENU hmenu)
492{
493 char padding[128];
494 DbgDumpMenuInternal(hmenu, padding, 0);
495}
496
497
498static inline
499void DumpIdList(LPCITEMIDLIST pcidl)
500{
501 DbgPrint("Begin IDList Dump\n");
502
503 for (; pcidl != NULL; pcidl = ILGetNext(pcidl))
504 {
505 int i;
506 int cb = pcidl->mkid.cb;
507 BYTE * sh = (BYTE*) &(pcidl->mkid);
508 if (cb == 0) // ITEMIDLISTs are terminatedwith a null SHITEMID.
509 break;
510 DbgPrint("Begin SHITEMID (cb=%d)\n", cb);
511 if ((cb & 3) != 0)
512 DbgPrint(" - WARNING: cb is not a multiple of 4\n");
513 for (i = 0; (i + 4) <= cb; i += 4)
514 {
515 DbgPrint(" - abID[%08x]: %02x %02x %02x %02x\n",
516 i,
517 sh[i + 0],
518 sh[i + 1],
519 sh[i + 2],
520 sh[i + 3]);
521 }
522 if (i < cb)
523 {
524 cb -= i;
525 if (cb == 3)
526 {
527 DbgPrint(" - abID[%08x]: %02x %02x %02x --\n",
528 i,
529 sh[i + 0],
530 sh[i + 1],
531 sh[i + 2]);
532 }
533 else if (cb == 2)
534 {
535 DbgPrint(" - abID[%08x]: %02x %02x -- --\n",
536 i,
537 sh[i + 0],
538 sh[i + 1]);
539 }
540 else if (cb == 1)
541 {
542 DbgPrint(" - abID[%08x]: %02x -- -- --\n",
543 i,
544 sh[i + 0]);
545 }
546 }
547 DbgPrint("End SHITEMID\n");
548 }
549 DbgPrint("End IDList Dump.\n");
550}
551
552struct CCoInit
553{
554 CCoInit()
555 {
557 }
558 ~CCoInit()
559 {
560 if (SUCCEEDED(hr))
561 {
563 }
564 }
565 HRESULT hr;
566};
567
568#endif /* __cplusplus */
569
570#define S_LESSTHAN 0xffff
571#define S_EQUAL S_OK
572#define S_GREATERTHAN S_FALSE
573#define MAKE_COMPARE_HRESULT(x) ((x)>0 ? S_GREATERTHAN : ((x)<0 ? S_LESSTHAN : S_EQUAL))
574
575
577{
578 return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]);
579}
580
582{
583 return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]);
584}
585
586
587#ifdef __cplusplus
588
589DECLSPEC_SELECTANY CLIPFORMAT g_cfHIDA = NULL;
590DECLSPEC_SELECTANY CLIPFORMAT g_cfShellIdListOffsets = NULL;
591
592// Allow to use the HIDA from an IDataObject without copying it
593struct CDataObjectHIDA
594{
595private:
596 STGMEDIUM m_medium;
597 CIDA* m_cida;
598 HRESULT m_hr;
599
600public:
601 explicit CDataObjectHIDA(IDataObject* pDataObject)
602 : m_cida(nullptr)
603 {
604 m_medium.tymed = TYMED_NULL;
605
606 if (g_cfHIDA == NULL)
607 {
608 g_cfHIDA = (CLIPFORMAT)RegisterClipboardFormatW(CFSTR_SHELLIDLISTW);
609 }
610 FORMATETC fmt = { g_cfHIDA, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
611
612 m_hr = pDataObject->GetData(&fmt, &m_medium);
613 if (FAILED(m_hr))
614 {
615 m_medium.tymed = TYMED_NULL;
616 return;
617 }
618
619 m_cida = (CIDA*)::GlobalLock(m_medium.hGlobal);
620 if (m_cida == nullptr)
621 {
622 m_hr = E_UNEXPECTED;
623 }
624 }
625
626 ~CDataObjectHIDA()
627 {
628 if (m_cida)
629 ::GlobalUnlock(m_cida);
630
631 ReleaseStgMedium(&m_medium);
632 }
633
634 HRESULT hr() const
635 {
636 return m_hr;
637 }
638
639 operator bool() const
640 {
641 return m_cida != nullptr;
642 }
643
644 operator const CIDA* () const
645 {
646 return m_cida;
647 }
648
649 const CIDA* operator->() const
650 {
651 return m_cida;
652 }
653};
654
655inline
656HRESULT DataObject_GetData(IDataObject* pDataObject, CLIPFORMAT clipformat, PVOID pBuffer, SIZE_T dwBufferSize)
657{
658 FORMATETC fmt = { clipformat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
659 STGMEDIUM medium = { TYMED_NULL };
660
661 HRESULT hr = pDataObject->GetData(&fmt, &medium);
662 if (SUCCEEDED(hr))
663 {
664 LPVOID blob = GlobalLock(medium.hGlobal);
665 if (blob)
666 {
667 SIZE_T size = GlobalSize(medium.hGlobal);
668 if (size <= dwBufferSize)
669 {
671 hr = S_OK;
672 }
673 else
674 {
676 }
677 GlobalUnlock(medium.hGlobal);
678 }
679 else
680 {
682 }
683
684 ReleaseStgMedium(&medium);
685 }
686 return hr;
687}
688
689inline
690HRESULT DataObject_SetData(IDataObject* pDataObject, CLIPFORMAT clipformat, PVOID pBuffer, SIZE_T dwBufferSize)
691{
692 STGMEDIUM medium = { TYMED_HGLOBAL };
693
694 medium.hGlobal = GlobalAlloc(GHND, dwBufferSize);
695 if (!medium.hGlobal)
696 return E_OUTOFMEMORY;
697
699 LPVOID blob = GlobalLock(medium.hGlobal);
700 if (blob)
701 {
702 CopyMemory(blob, pBuffer, dwBufferSize);
703 GlobalUnlock(medium.hGlobal);
704
705 FORMATETC etc = { clipformat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
706 hr = pDataObject->SetData(&etc, &medium, TRUE);
707 }
708
709 if (FAILED(hr))
710 GlobalFree(medium.hGlobal);
711
712 return hr;
713}
714
715
716inline HRESULT
717DataObject_GetOffset(IDataObject *pDataObject, POINT *point)
718{
719 if (g_cfShellIdListOffsets == NULL)
720 {
721 g_cfShellIdListOffsets = (CLIPFORMAT)RegisterClipboardFormatW(CFSTR_SHELLIDLISTOFFSETW);
722 }
723
724 point->x = point->y = 0;
725
726 return DataObject_GetData(pDataObject, g_cfShellIdListOffsets, point, sizeof(point[0]));
727}
728
729inline HRESULT
730DataObject_SetOffset(IDataObject* pDataObject, POINT* point)
731{
732 if (g_cfShellIdListOffsets == NULL)
733 {
734 g_cfShellIdListOffsets = (CLIPFORMAT)RegisterClipboardFormatW(CFSTR_SHELLIDLISTOFFSETW);
735 }
736
737 return DataObject_SetData(pDataObject, g_cfShellIdListOffsets, point, sizeof(point[0]));
738}
739
740#endif
741
742
743#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: ehthrow.cxx:54
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 P(row, col)
#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
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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:63
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2439
#define bool
Definition: nsiface.idl:72
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:703
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:581
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:576
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:501
static const WCHAR CFSTR_SHELLIDLISTW[]
Definition: shlobj.h:499
@ 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:565
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:3268
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:1710
#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:727
#define MIIM_ID
Definition: winuser.h:722
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:729
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
#define MFT_SEPARATOR
Definition: winuser.h:744
#define MIIM_STATE
Definition: winuser.h:721
#define MIIM_SUBMENU
Definition: winuser.h:723
#define MFT_BITMAP
Definition: winuser.h:738
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