blob: dd6e9368d6354e3495f1bd74c59a372b1b28e9eb [file] [log] [blame]
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <ole2.h>
#include "SkAutoCoInitialize.h"
SkAutoCoInitialize::SkAutoCoInitialize() :
fHR(
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)
)
{ }
SkAutoCoInitialize::~SkAutoCoInitialize() {
if (SUCCEEDED(this->fHR)) {
CoUninitialize();
}
}
bool SkAutoCoInitialize::succeeded() {
return SUCCEEDED(this->fHR) || RPC_E_CHANGED_MODE == this->fHR;
}