[SDK] Define CCoInit in shellutils

This commit is contained in:
Mark Jansen 2022-10-23 21:16:56 +02:00
parent 8083ef9ad7
commit d82185f104
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
7 changed files with 30 additions and 59 deletions

View file

@ -129,9 +129,8 @@ IUnknown *CComCreatorCentralInstance<T>::s_pInstance = NULL;
#define DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(x) \
public: \
typedef CComCreatorCentralInstance< ATL::CComObject<x> > _CreatorClass;
#endif
#ifdef __cplusplus
template <class Base>
class CComDebugObject : public Base
{
@ -538,6 +537,22 @@ void DumpIdList(LPCITEMIDLIST pcidl)
DbgPrint("End IDList Dump.\n");
}
struct CCoInit
{
CCoInit()
{
hr = CoInitialize(NULL);
}
~CCoInit()
{
if (SUCCEEDED(hr))
{
CoUninitialize();
}
}
HRESULT hr;
};
#endif /* __cplusplus */
#define S_LESSTHAN 0xffff