//1// Copyright 2014 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//56// com_utils.h: Utility functions for working with COM objects78#ifndef UTIL_COM_UTILS_H9#define UTIL_COM_UTILS_H1011template <typename outType>12inline outType *DynamicCastComObject(IUnknown *object)13{14outType *outObject = nullptr;15HRESULT result =16object->QueryInterface(__uuidof(outType), reinterpret_cast<void **>(&outObject));17if (SUCCEEDED(result))18{19return outObject;20}21else22{23SafeRelease(outObject);24return nullptr;25}26}2728#endif // UTIL_COM_UTILS_H293031