Flutter Engine
The Flutter Engine
SkAutoCoInitialize.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9#if defined(SK_BUILD_FOR_WIN)
10
12
13#include <objbase.h>
14#include <winerror.h>
15
16SkAutoCoInitialize::SkAutoCoInitialize() :
17 fHR(
18 CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)
19 )
20{ }
21
22SkAutoCoInitialize::~SkAutoCoInitialize() {
23 if (SUCCEEDED(this->fHR)) {
24 CoUninitialize();
25 }
26}
27
28bool SkAutoCoInitialize::succeeded() {
29 return SUCCEEDED(this->fHR) || RPC_E_CHANGED_MODE == this->fHR;
30}
31
32#endif//defined(SK_BUILD_FOR_WIN)
#define SUCCEEDED(hr)