blob: 460606bb1d3a6cc08d64efbd21e082c710329b30 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
bungeman@google.com9df621d2011-06-23 21:43:52 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
bungeman@google.com9df621d2011-06-23 21:43:52 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
bungeman@google.com9df621d2011-06-23 21:43:52 +000010#define WIN32_LEAN_AND_MEAN
11#include <Windows.h>
12#include <ole2.h>
13#include "SkAutoCoInitialize.h"
14
15AutoCoInitialize::AutoCoInitialize() :
16 fHR(
17 CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)
18 )
19{ }
20
21AutoCoInitialize::~AutoCoInitialize() {
22 if (SUCCEEDED(this->fHR)) {
23 CoUninitialize();
24 }
25}
26
27HRESULT AutoCoInitialize::getHR() { return this->fHR; }