webrtc/rtc_base/win/hstring.h
Austin Orion 0bb354c540 Add and refactor functionality into rtc_base/win
This change moves ScopedComInitializer out of core_audio_utility and
into rtc_base/win so it can be reused elsewhere more easily.

It also adds HSTRING and GetActivationFactory functionality to
rtc_base/win. These two were heavily based on what is already present
base/win.

All of these are necessary for the new window capturer based on the
Windows.Graphics.Capture API. You can see how these APIs will be
used in this CL: 186603: Implement WgcCaptureSession |
https://webrtc-review.googlesource.com/c/src/+/186603

Bug: webrtc:9273
Change-Id: I0a36373aac98be779ccbabe1053bb8d6e234f6a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188523
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32522}
2020-10-29 20:39:10 +00:00

30 lines
887 B
C++

/*
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef RTC_BASE_WIN_HSTRING_H_
#define RTC_BASE_WIN_HSTRING_H_
#include <hstring.h>
#include <stdint.h>
#include <winerror.h>
namespace webrtc {
// Callers must check the return value of ResolveCoreWinRTStringDelayLoad()
// before using these functions.
bool ResolveCoreWinRTStringDelayload();
HRESULT CreateHstring(const wchar_t* src, uint32_t len, HSTRING* out_hstr);
HRESULT DeleteHstring(HSTRING hstr);
} // namespace webrtc
#endif // RTC_BASE_WIN_HSTRING_H_