Chromium Code Reviews| Index: test/win/enable-winrt/dllmain.cc |
| diff --git a/test/win/enable-winrt/dllmain.cc b/test/win/enable-winrt/dllmain.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c42c6bd5a4e368757a112e7810827aaa80199ee6 |
| --- /dev/null |
| +++ b/test/win/enable-winrt/dllmain.cc |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2013 Google Inc. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include <windows.h> |
| +#include <wrl.h> |
| +#include <wrl/wrappers/corewrappers.h> |
| +#include <windows.graphics.display.h> |
| + |
| +using namespace Microsoft::WRL; |
| +using namespace Microsoft::WRL::Wrappers; |
| +using namespace ABI::Windows::Foundation; |
| +using namespace ABI::Windows::Graphics::Display; |
| + |
| +bool TryToUseSomeWinRT() |
|
scottmg
2014/09/23 00:01:13
nit; please reformat this to the standard style (p
|
| +{ |
| + ComPtr<IDisplayPropertiesStatics> dp; |
|
scottmg
2014/09/23 00:01:13
This code isn't being run in the test, afaict. Doe
|
| + HStringReference s(RuntimeClass_Windows_Graphics_Display_DisplayProperties); |
| + HRESULT hr = GetActivationFactory(s.Get(), dp.GetAddressOf()); |
| + if (SUCCEEDED(hr)) |
| + { |
| + float dpi = 96.0f; |
| + if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) |
| + { |
| + return true; |
| + } |
| + } |
| + return false; |
| +} |
| + |
| +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { |
| + return TRUE; |
| +} |