ReactOS  0.4.15-dev-3295-gaa8fc87
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
23 extern "C" {
24 #endif /* defined(__cplusplus) */
25 
26 inline ULONG
27 Win32DbgPrint(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 
72 inline 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
92 template <typename T>
93 class CComCreatorCentralInstance
94 {
95 private:
96  static IUnknown *s_pInstance;
97 
98 public:
99  static HRESULT WINAPI CreateInstance(void *pv, REFIID riid, LPVOID *ppv)
100  {
101  *ppv = NULL;
102  if (pv != NULL)
103  return CLASS_E_NOAGGREGATION;
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 
126 template <typename T>
127 IUnknown *CComCreatorCentralInstance<T>::s_pInstance = NULL;
128 
129 #define DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(x) \
130 public: \
131  typedef CComCreatorCentralInstance< ATL::CComObject<x> > _CreatorClass;
132 #endif
133 
134 #ifdef __cplusplus
135 template <class Base>
136 class CComDebugObject : public Base
137 {
138 public:
139  CComDebugObject(void * = NULL)
140  {
141 #if DEBUG_CCOMOBJECT_CREATION
142  DbgPrint("%S, this=%08p\n", __FUNCTION__, static_cast<Base*>(this));
143 #endif
144  _pAtlModule->Lock();
145  }
146 
147  virtual ~CComDebugObject()
148  {
149  this->FinalRelease();
150  _pAtlModule->Unlock();
151  }
152 
154  {
155  int rc = this->InternalAddRef();
156 #if DEBUG_CCOMOBJECT_REFCOUNTING
157  DbgPrint("%s, RefCount is now %d(--)!\n", __FUNCTION__, rc);
158 #endif
159  return rc;
160  }
161 
163  {
164  int rc = this->InternalRelease();
165 
166 #if DEBUG_CCOMOBJECT_REFCOUNTING
167  DbgPrint("%s, RefCount is now %d(--)!\n", __FUNCTION__, rc);
168 #endif
169 
170  if (rc == 0)
171  {
172 #if DEBUG_CCOMOBJECT_DESTRUCTION
173  DbgPrint("%s, RefCount reached 0 Deleting!\n", __FUNCTION__);
174 #endif
175  delete this;
176  }
177  return rc;
178  }
179 
181  {
182  return this->_InternalQueryInterface(iid, ppvObject);
183  }
184 
185  static HRESULT WINAPI CreateInstance(CComDebugObject<Base> **pp)
186  {
187  CComDebugObject<Base> *newInstance;
188  HRESULT hResult;
189 
190  ATLASSERT(pp != NULL);
191  if (pp == NULL)
192  return E_POINTER;
193 
194  hResult = E_OUTOFMEMORY;
195  newInstance = NULL;
196  ATLTRY(newInstance = new CComDebugObject<Base>());
197  if (newInstance != NULL)
198  {
199  newInstance->SetVoid(NULL);
200  newInstance->InternalFinalConstructAddRef();
201  hResult = newInstance->_AtlInitialConstruct();
202  if (SUCCEEDED(hResult))
203  hResult = newInstance->FinalConstruct();
204  if (SUCCEEDED(hResult))
205  hResult = newInstance->_AtlFinalConstruct();
206  newInstance->InternalFinalConstructRelease();
207  if (hResult != S_OK)
208  {
209  delete newInstance;
210  newInstance = NULL;
211  }
212  }
213  *pp = newInstance;
214  return hResult;
215  }
216 };
217 
218 #ifdef DEBUG_CCOMOBJECT
219 # define _CComObject CComDebugObject
220 #else
221 # define _CComObject CComObject
222 #endif
223 
224 template<class T>
225 void ReleaseCComPtrExpectZero(CComPtr<T>& cptr, BOOL forceRelease = FALSE)
226 {
227  if (cptr.p != NULL)
228  {
229  int nrc = cptr->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 = cptr->Release();
238  }
239  }
240  }
241  cptr.Detach();
242  }
243 }
244 
245 template<class T, class R>
246 HRESULT inline ShellDebugObjectCreator(REFIID riid, R ** ppv)
247 {
248  CComPtr<T> obj;
249  HRESULT hResult;
250 
251  if (ppv == NULL)
252  return E_POINTER;
253  *ppv = NULL;
254  ATLTRY(obj = new CComDebugObject<T>);
255  if (obj.p == NULL)
256  return E_OUTOFMEMORY;
257  hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
258  if (FAILED(hResult))
259  return hResult;
260  return S_OK;
261 }
262 
263 template<class T>
264 HRESULT inline ShellObjectCreator(REFIID riid, void ** ppv)
265 {
266  _CComObject<T> *pobj;
267  HRESULT hResult;
268 
269  hResult = _CComObject<T>::CreateInstance(&pobj);
270  if (FAILED(hResult))
271  return hResult;
272 
273  pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
274 
275  hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
276 
277  pobj->Release(); /* In case of failure the object will be released */
278 
279  return hResult;
280 }
281 
282 template<class T>
283 HRESULT inline ShellObjectCreatorInit(REFIID riid, void ** ppv)
284 {
285  _CComObject<T> *pobj;
286  HRESULT hResult;
287 
288  hResult = _CComObject<T>::CreateInstance(&pobj);
289  if (FAILED(hResult))
290  return hResult;
291 
292  pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
293 
294  hResult = pobj->Initialize();
295 
296  if (SUCCEEDED(hResult))
297  hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
298 
299  pobj->Release(); /* In case of failure the object will be released */
300 
301  return hResult;
302 }
303 
304 template<class T, class T1>
305 HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, void ** ppv)
306 {
307  _CComObject<T> *pobj;
308  HRESULT hResult;
309 
310  hResult = _CComObject<T>::CreateInstance(&pobj);
311  if (FAILED(hResult))
312  return hResult;
313 
314  pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
315 
316  hResult = pobj->Initialize(initArg1);
317 
318  if (SUCCEEDED(hResult))
319  hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
320 
321  pobj->Release(); /* In case of failure the object will be released */
322 
323  return hResult;
324 }
325 
326 template<class T, class T1, class T2>
327 HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, void ** ppv)
328 {
329  _CComObject<T> *pobj;
330  HRESULT hResult;
331 
332  hResult = _CComObject<T>::CreateInstance(&pobj);
333  if (FAILED(hResult))
334  return hResult;
335 
336  pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
337 
338  hResult = pobj->Initialize(initArg1, initArg2);
339 
340  if (SUCCEEDED(hResult))
341  hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
342 
343  pobj->Release(); /* In case of failure the object will be released */
344 
345  return hResult;
346 }
347 
348 template<class T, class T1, class T2, class T3>
349 HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, REFIID riid, void ** ppv)
350 {
351  _CComObject<T> *pobj;
352  HRESULT hResult;
353 
354  hResult = _CComObject<T>::CreateInstance(&pobj);
355  if (FAILED(hResult))
356  return hResult;
357 
358  pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
359 
360  hResult = pobj->Initialize(initArg1, initArg2, initArg3);
361 
362  if (SUCCEEDED(hResult))
363  hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
364 
365  pobj->Release(); /* In case of failure the object will be released */
366 
367  return hResult;
368 }
369 
370 template<class T, class T1, class T2, class T3, class T4>
371 HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, REFIID riid, void ** ppv)
372 {
373  _CComObject<T> *pobj;
374  HRESULT hResult;
375 
376  hResult = _CComObject<T>::CreateInstance(&pobj);
377  if (FAILED(hResult))
378  return hResult;
379 
380  pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
381 
382  hResult = pobj->Initialize(initArg1, initArg2, initArg3, initArg4);
383 
384  if (SUCCEEDED(hResult))
385  hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
386 
387  pobj->Release(); /* In case of failure the object will be released */
388 
389  return hResult;
390 }
391 
392 template<class T, class T1, class T2, class T3, class T4, class T5>
393 HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, T5 initArg5, REFIID riid, void ** ppv)
394 {
395  _CComObject<T> *pobj;
396  HRESULT hResult;
397 
398  hResult = _CComObject<T>::CreateInstance(&pobj);
399  if (FAILED(hResult))
400  return hResult;
401 
402  pobj->AddRef(); /* CreateInstance returns object with 0 ref count */
403 
404  hResult = pobj->Initialize(initArg1, initArg2, initArg3, initArg4, initArg5);
405 
406  if (SUCCEEDED(hResult))
407  hResult = pobj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
408 
409  pobj->Release(); /* In case of failure the object will be released */
410 
411  return hResult;
412 }
413 
414 HRESULT inline SHSetStrRet(LPSTRRET pStrRet, LPCSTR pstrValue)
415 {
416  pStrRet->uType = STRRET_CSTR;
417  strcpy(pStrRet->cStr, pstrValue);
418  return S_OK;
419 }
420 
421 HRESULT inline SHSetStrRet(LPSTRRET pStrRet, LPCWSTR pwstrValue)
422 {
423  SIZE_T cchr = wcslen(pwstrValue);
424  LPWSTR buffer = static_cast<LPWSTR>(CoTaskMemAlloc((cchr + 1) * sizeof(WCHAR)));
425  if (buffer == NULL)
426  return E_OUTOFMEMORY;
427 
428  pStrRet->uType = STRRET_WSTR;
429  pStrRet->pOleStr = buffer;
430  wcscpy(buffer, pwstrValue);
431  return S_OK;
432 }
433 
434 HRESULT inline SHSetStrRet(LPSTRRET pStrRet, HINSTANCE hInstance, DWORD resId)
435 {
437 
438  if (!LoadStringW(hInstance, resId, Buffer, MAX_PATH))
439  return E_FAIL;
440 
441  return SHSetStrRet(pStrRet, Buffer);
442 }
443 
444 static inline void DbgDumpMenuInternal(HMENU hmenu, char* padding, int padlevel)
445 {
446  WCHAR label[128];
447  int i;
449 
450  padding[padlevel] = '.';
451  padding[padlevel + 1] = '.';
452  padding[padlevel + 2] = 0;
453 
454  for (i = 0; i < count; i++)
455  {
456  MENUITEMINFOW mii = { 0 };
457 
458  mii.cbSize = sizeof(mii);
460  mii.dwTypeData = label;
461  mii.cch = _countof(label);
462 
463  GetMenuItemInfoW(hmenu, i, TRUE, &mii);
464 
465  if (mii.fType & MFT_BITMAP)
466  DbgPrint("%s%2d - %08x: BITMAP %08p (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.hbmpItem, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
467  else if (mii.fType & MFT_SEPARATOR)
468  DbgPrint("%s%2d - %08x ---SEPARATOR---\n", padding, i, mii.wID);
469  else
470  DbgPrint("%s%2d - %08x: %S (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.dwTypeData, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
471 
472  if (mii.hSubMenu)
473  DbgDumpMenuInternal(mii.hSubMenu, padding, padlevel + 2);
474 
475  }
476 
477  padding[padlevel] = 0;
478 }
479 
480 static __inline void DbgDumpMenu(HMENU hmenu)
481 {
482  char padding[128];
483  DbgDumpMenuInternal(hmenu, padding, 0);
484 }
485 
486 
487 static inline
488 void DumpIdList(LPCITEMIDLIST pcidl)
489 {
490  DbgPrint("Begin IDList Dump\n");
491 
492  for (; pcidl != NULL; pcidl = ILGetNext(pcidl))
493  {
494  int i;
495  int cb = pcidl->mkid.cb;
496  BYTE * sh = (BYTE*) &(pcidl->mkid);
497  if (cb == 0) // ITEMIDLISTs are terminatedwith a null SHITEMID.
498  break;
499  DbgPrint("Begin SHITEMID (cb=%d)\n", cb);
500  if ((cb & 3) != 0)
501  DbgPrint(" - WARNING: cb is not a multiple of 4\n");
502  for (i = 0; (i + 4) <= cb; i += 4)
503  {
504  DbgPrint(" - abID[%08x]: %02x %02x %02x %02x\n",
505  i,
506  sh[i + 0],
507  sh[i + 1],
508  sh[i + 2],
509  sh[i + 3]);
510  }
511  if (i < cb)
512  {
513  cb -= i;
514  if (cb == 3)
515  {
516  DbgPrint(" - abID[%08x]: %02x %02x %02x --\n",
517  i,
518  sh[i + 0],
519  sh[i + 1],
520  sh[i + 2]);
521  }
522  else if (cb == 2)
523  {
524  DbgPrint(" - abID[%08x]: %02x %02x -- --\n",
525  i,
526  sh[i + 0],
527  sh[i + 1]);
528  }
529  else if (cb == 1)
530  {
531  DbgPrint(" - abID[%08x]: %02x -- -- --\n",
532  i,
533  sh[i + 0]);
534  }
535  }
536  DbgPrint("End SHITEMID\n");
537  }
538  DbgPrint("End IDList Dump.\n");
539 }
540 
541 #endif /* __cplusplus */
542 
543 #define S_LESSTHAN 0xffff
544 #define S_EQUAL S_OK
545 #define S_GREATERTHAN S_FALSE
546 #define MAKE_COMPARE_HRESULT(x) ((x)>0 ? S_GREATERTHAN : ((x)<0 ? S_LESSTHAN : S_EQUAL))
547 
548 
549 static inline PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const* pida)
550 {
551  return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]);
552 }
553 
554 static inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i)
555 {
556  return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]);
557 }
558 
559 
560 #ifdef __cplusplus
561 
562 inline
563 HRESULT DataObject_GetData(IDataObject* pDataObject, CLIPFORMAT clipformat, PVOID pBuffer, SIZE_T dwBufferSize)
564 {
565  FORMATETC fmt = { clipformat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
566  STGMEDIUM medium = { TYMED_NULL };
567 
568  HRESULT hr = pDataObject->GetData(&fmt, &medium);
569  if (SUCCEEDED(hr))
570  {
571  LPVOID blob = GlobalLock(medium.hGlobal);
572  if (blob)
573  {
574  SIZE_T size = GlobalSize(medium.hGlobal);
575  if (size <= dwBufferSize)
576  {
578  hr = S_OK;
579  }
580  else
581  {
582  hr = E_OUTOFMEMORY;
583  }
584  GlobalUnlock(medium.hGlobal);
585  }
586  else
587  {
589  }
590 
591  ReleaseStgMedium(&medium);
592  }
593  return hr;
594 }
595 
596 inline
597 HRESULT DataObject_SetData(IDataObject* pDataObject, CLIPFORMAT clipformat, PVOID pBuffer, SIZE_T dwBufferSize)
598 {
599  STGMEDIUM medium = { TYMED_HGLOBAL };
600 
601  medium.hGlobal = GlobalAlloc(GHND, dwBufferSize);
602  if (!medium.hGlobal)
603  return E_OUTOFMEMORY;
604 
606  LPVOID blob = GlobalLock(medium.hGlobal);
607  if (blob)
608  {
609  CopyMemory(blob, pBuffer, dwBufferSize);
610  GlobalUnlock(medium.hGlobal);
611 
612  FORMATETC etc = { clipformat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
613  hr = pDataObject->SetData(&etc, &medium, TRUE);
614  }
615 
616  if (FAILED(hr))
617  GlobalFree(medium.hGlobal);
618 
619  return hr;
620 }
621 
622 #endif
623 
624 
625 #endif /* __ROS_SHELL_UTILS_H */
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define R(b, x)
Definition: sha2.c:134
#define MIIM_FTYPE
Definition: winuser.h:724
#define REFIID
Definition: guiddef.h:118
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
HRESULT hr
Definition: shlfolder.c:183
static HMENU hmenu
Definition: win.c:66
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
Definition: image.c:133
static HRESULT WINAPI CreateInstance(void *pv, REFIID riid, LPVOID *ppv)
Definition: atlcom.h:419
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define DbgPrint(fmt,...)
Definition: shellutils.h:59
#define TRUE
Definition: types.h:120
REFIID riid
Definition: precomp.h:44
GLuint GLuint GLsizei count
Definition: gl.h:1545
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2386
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:554
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
REFIID LPVOID * ppv
Definition: atlbase.h:39
LPWSTR pOleStr
Definition: shtypes.idl:96
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
GLuint buffer
Definition: glext.h:5915
LPWSTR dwTypeData
Definition: winuser.h:3245
#define MFT_BITMAP
Definition: winuser.h:733
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
const char * filename
Definition: ioapi.h:135
#define STG_E_INVALIDHANDLE
Definition: winerror.h:2569
#define E_FAIL
Definition: ddrawi.h:102
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
Definition: query.h:86
#define STDMETHOD(m)
Definition: basetyps.h:62
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
#define sprintf(buf, format,...)
Definition: sprintf.c:55
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
#define GHND
Definition: winbase.h:294
char cStr[MAX_PATH]
Definition: shtypes.idl:98
HINSTANCE hInstance
Definition: charmap.c:20
#define MIIM_SUBMENU
Definition: winuser.h:718
unsigned char * LPBYTE
Definition: typedefs.h:53
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define va_end(ap)
Definition: acmsvcex.h:90
#define FALSE
Definition: types.h:117
#define MIIM_STATE
Definition: winuser.h:716
unsigned int BOOL
Definition: ntddk_ex.h:94
if SUCCEEDED(hr)
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
ULONG Release()
PVOID pBuffer
Definition: parser.c:48
HRESULT SetData([in, unique] FORMATETC *pformatetc, [in, unique] STGMEDIUM *pmedium, [in] BOOL fRelease)
char * va_list
Definition: acmsvcex.h:78
Definition: bufpool.h:45
const char * LPCSTR
Definition: xmlstorage.h:183
#define MIIM_ID
Definition: winuser.h:717
BOOL _ROS_FAILED_HELPER(HRESULT hr, const char *expr, const char *filename, int line)
Definition: shellutils.h:72
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
Definition: view.c:203
unsigned int padding
Definition: isohybrid.c:50
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define _countof(array)
Definition: sndvol32.h:68
const GUID IID_IUnknown
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
#define CopyMemory
Definition: winbase.h:1662
unsigned long DWORD
Definition: ntddk_ex.h:95
va_start(ap, x)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
Definition: view.c:175
#define MFT_SEPARATOR
Definition: winuser.h:739
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
REFIID LPVOID * ppvObject
Definition: precomp.h:44
LPCWSTR lpFormat
Definition: trayclock.cpp:32
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:549
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
uint8_t label[11]
Definition: fsck.fat.h:65
unsigned char BYTE
Definition: xxhash.c:193
short sh
Definition: format.c:272
#define MIIM_STRING
Definition: winuser.h:722
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define S_OK
Definition: intsafe.h:52
_In_ BOOLEAN Release
Definition: cdrom.h:920
ULONG Win32DbgPrint(const char *filename, int line, const char *lpFormat,...)
Definition: shellutils.h:27
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
Definition: shtypes.idl:63
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
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
#define NULL
Definition: types.h:112
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define E_UNEXPECTED
Definition: winerror.h:2456
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
UINT uType
Definition: shtypes.idl:93
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
#define E_POINTER
Definition: winerror.h:2365
#define __FUNCTION__
Definition: types.h:112
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
Definition: dsound.c:943
void WINAPI SHIM_OBJ_NAME() OutputDebugStringA(LPCSTR lpOutputString)
Definition: ignoredbgout.c:18
Definition: shlobj.h:498