From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../python/gyp/test/win/enable-winrt/dllmain.cc | 30 +++++++++++++++++ .../gyp/test/win/enable-winrt/enable-winrt.gyp | 39 ++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 third_party/python/gyp/test/win/enable-winrt/dllmain.cc create mode 100644 third_party/python/gyp/test/win/enable-winrt/enable-winrt.gyp (limited to 'third_party/python/gyp/test/win/enable-winrt') diff --git a/third_party/python/gyp/test/win/enable-winrt/dllmain.cc b/third_party/python/gyp/test/win/enable-winrt/dllmain.cc new file mode 100644 index 0000000000..dedd83c3f6 --- /dev/null +++ b/third_party/python/gyp/test/win/enable-winrt/dllmain.cc @@ -0,0 +1,30 @@ +// 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 +#include +#include +#include + +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +using namespace ABI::Windows::Foundation; +using namespace ABI::Windows::Graphics::Display; + +bool TryToUseSomeWinRT() { + ComPtr dp; + 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; +} diff --git a/third_party/python/gyp/test/win/enable-winrt/enable-winrt.gyp b/third_party/python/gyp/test/win/enable-winrt/enable-winrt.gyp new file mode 100644 index 0000000000..69f70189db --- /dev/null +++ b/third_party/python/gyp/test/win/enable-winrt/enable-winrt.gyp @@ -0,0 +1,39 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'enable_winrt_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_missing_dll', + 'type': 'shared_library', + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_winphone_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_enable_winphone': 1, + 'sources': [ + 'dllmain.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + '%(AdditionalDependencies)', + ], + }, + }, + }, + ] +} -- cgit v1.2.3