[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

@ -722,19 +722,12 @@ static void GetEnvStatus()
trace("Show hidden folders: %s\n", g_ShowHidden ? "yes" : "no");
}
struct CCoInit
{
CCoInit() { hres = CoInitialize(NULL); }
~CCoInit() { if (SUCCEEDED(hres)) { CoUninitialize(); } }
HRESULT hres;
};
START_TEST(ACListISF)
{
GetEnvStatus();
CCoInit init;
ok_hr(init.hres, S_OK);
if (!SUCCEEDED(init.hres))
ok_hr(init.hr, S_OK);
if (!SUCCEEDED(init.hr))
{
skip("CoInitialize failed\n");
return;

View file

@ -32,13 +32,6 @@ ULONG DbgPrint(PCH Format,...);
#define ok_wstri(x, y) \
ok(lstrcmpiW(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)
struct CCoInit
{
CCoInit() { hres = CoInitialize(NULL); }
~CCoInit() { if (SUCCEEDED(hres)) { CoUninitialize(); } }
HRESULT hres;
};
DEFINE_GUID(IID_IACLCustomMRU, 0xf729fc5e, 0x8769, 0x4f3e, 0xbd, 0xb2, 0xd7, 0xb5, 0x0f, 0xd2, 0x27, 0x5b);
static const WCHAR szTestPath[] = L"TESTPATH_BROWSEUI_APITEST";
@ -551,8 +544,8 @@ test_IACLCustomMRU_TypedURLs() // TypedURLs is special case
START_TEST(IACLCustomMRU)
{
CCoInit init;
ok_hex(init.hres, S_OK);
if (!SUCCEEDED(init.hres))
ok_hex(init.hr, S_OK);
if (!SUCCEEDED(init.hr))
return;
test_IACLCustomMRU_Basics();

View file

@ -14,20 +14,13 @@
#include <stdio.h>
#include <shellutils.h>
struct CCoInit
{
CCoInit() { hres = CoInitialize(NULL); }
~CCoInit() { if (SUCCEEDED(hres)) { CoUninitialize(); } }
HRESULT hres;
};
START_TEST(IACLHistory)
{
CCoInit init;
ok_hex(init.hres, S_OK);
if (FAILED(init.hres))
ok_hex(init.hr, S_OK);
if (FAILED(init.hr))
{
skip("CoInitialize failed with 0x%08lX\n", init.hres);
skip("CoInitialize failed with 0x%08lX\n", init.hr);
return;
}

View file

@ -16,6 +16,7 @@
#include <atlsimpcoll.h>
#include <shlwapi.h>
#include <strsafe.h>
#include <shellutils.h>
//#define MANUAL_DEBUGGING
@ -23,13 +24,6 @@
#define ok_wstri(x, y) \
ok(lstrcmpiW(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)
struct CCoInit
{
CCoInit() { hr = CoInitialize(NULL); }
~CCoInit() { if (SUCCEEDED(hr)) { CoUninitialize(); } }
HRESULT hr;
};
// create an EDIT control
static HWND MyCreateEditCtrl(INT x, INT y, INT cx, INT cy)
{