Commit Graph

527 Commits

Author SHA1 Message Date
Rémi Verschelde 2c8ab6e7eb
Merge pull request #94839 from alvinhochun/win-set-console-mode
Combine existing modes when calling SetConsoleMode
2024-09-18 11:15:22 +02:00
bruvzg 2c991a727b [Windows] Only use long executable path when necessary, fix broken apksigner detection. 2024-09-10 10:34:44 +03:00
bruvzg 10f3c1f587
Add support for non-blocking IO mode to `OS.execute_with_pipe`. 2024-09-06 14:16:39 +03:00
bruvzg 319bfa9965
[Windows] Use the same API for all `OS_Windows::*_environment` functions. 2024-09-03 16:02:35 +03:00
bruvzg d528f28275 [Windows] Fix OS.open_dynamic_library 2024-08-28 20:12:09 +03:00
bruvzg ae334e069c
[Windows] Always use absolute UNC paths and long path aware APIs, add "long path aware" flag to the application manifest. 2024-08-28 11:15:57 +03:00
Rémi Verschelde 96159ebc5d
Merge pull request #96192 from dsnopek/windows-gdext-adddlldirectory
Windows: Call `AddDllDirectory()` with an absolute path
2024-08-28 09:45:35 +02:00
David Snopek e8bd385f53 Windows: Call `AddDllDirectory()` with an absolute path 2024-08-27 17:38:30 -05:00
Rémi Verschelde 330fca1ffd
Merge pull request #93985 from alvinhochun/windows-gpu-pref
Respect integrated GPU preference in Windows Settings
2024-08-28 00:11:45 +02:00
Sébastien Dunne Fulmer c3ed8a842c
Remove confusing USER prefix from script-logged errors 2024-08-27 15:00:48 +01:00
Joel Croteau f44d6a235f Fix reload of GDExtension libraries in framework package on macos
`GDExtension::open_library` has a check in it to see if the library was loaded
from a temp file, and if it was to restore the original name as that is the one
we actually care about. This check is breaking extension reloading on Mac when
the library path is to a framework folder, as the file inside the framework
will not generally be the same name as the folder.

This check also shouldn't be necessary even on Windows, which is the only
platform that uses `generate_temp_files`, since disposal of the created temp
file is handled within `OS_Windows::open_dynamic_library`, and
`GDExtension::open_library` (which is the only function to call
`open_dynamic_library` with a `p_data` argument) only cares about the original
library file path and has to do extra work to remove the name of the temp file.
Instead, I have removed that check and set `OS_Windows::open_dynamic_library`
to return the name of the original file and not the name of the copy.

This fixes GDExtension reloading on macOS. I do not have a Windows machine
available to test that it still works properly on Windows, so someone should
check that before merging this.
2024-08-08 08:31:49 -06:00
Alvin Wong 28c60a5ff9 Combine existing modes when calling SetConsoleMode
Otherwise the default modes will be cleared, which causes long lines to
be truncated in some terminals (e.g. Windows Terminal).
2024-07-28 00:32:40 +08:00
Alvin Wong 88581a7705 Support GPU preference for MS Store packaged apps 2024-07-16 23:46:37 +08:00
Alvin Wong 4091abd727 Respect integrated GPU preference in Windows Settings 2024-07-16 23:46:37 +08:00
Rémi Verschelde c349f0d6a7
Remove unused `is_wow64` method in `OS_Windows`
It was added in b4d369c88 for `get_processor_count`, but this was later
changed to rely on `std::thread` in 6bf02c016.
2024-07-11 23:16:12 +02:00
bruvzg 874814794b [Windows] Improve console IO redirection. 2024-04-27 00:40:17 +03:00
Fredia Huya-Kouadio 764de7fe31 Collapse the gdextension arguments into the `GDExtensionData` struct
This is used to reduce the number of arguments to `OS::open_dynamic_library(...)`.
2024-04-19 07:56:02 -07:00
Fredia Huya-Kouadio ede88cf59d Fix loading GDExtension dependencies on Android 2024-04-19 07:55:08 -07:00
kobewi dce4a3e4c2 Add get_process_exit_code() method 2024-04-16 12:46:15 +02:00
DmitriySalnikov b73e740786 Add renaming of PDB files to avoid blocking them 2024-04-05 00:14:23 +03:00
bruvzg 082b420c0a
Implement `OS.execute_with_pipe` method to run process with redirected stdio.
Implement `pipe://*` path handling for creation of named pipes.
2024-03-27 11:41:16 +02:00
Thaddeus Crews 3b3e2374c9
clang-tidy: Enforce `modernize-use-nullptr` 2024-03-12 10:59:53 -05:00
Muller-Castro a8bc9f3e78 Add const lvalue ref to core/* container parameters 2024-02-14 11:20:36 -03:00
Rémi Verschelde 37df2ff387
Merge pull request #86682 from Daylily-Zeleen/daylily-zeleen/distinguish_between_dynamic_libaray_not_found_and_can't_open
Distinguish between dynamic library not found and can't be opened.
2024-01-02 18:06:17 +01:00
Daylily-Zeleen fe6b073811 Distinguishs between dynamic library not found and can't be opened. 2024-01-01 20:01:57 +08:00
Septian 475c2fa1e7 Fix `OS.get_system_font_path` and `OS.get_system_font_path_for_text` to return correct value 2023-12-27 23:19:43 +07:00
A Thousand Ships 3565d1bf7e [Drivers,Platform] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-09-12 20:13:32 +02:00
Brecht Kuppens 5608b1d411
Windows: Always double-quote path when launching explorer.exe to browse
Code now always double quotes the filename to use as command line
argument when calling explorer.exe. In particular, commas in a filename
would be interpreted by explorer.exe as separators for commands.

Similarly a trim_suffix for "file://" is assumed to be a mistake, this
could potentially be a PREfix that we want to strip, but never a suffix.
Since it didn't seem needed in the end, we removed it.
2023-08-28 12:46:50 +02:00
bruvzg 4bfb820d32 [Windows] Initialize COM as apartment-threaded. 2023-07-20 12:14:16 +03:00
Kamil Brzoskowski 3cd865dbe8
Fix formatting of dlopen error message on Windows
And harmonize the format for all platforms.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2023-07-09 23:39:45 +02:00
Rémi Verschelde 9e4315bb50
Style: Harmonize header includes in platform ports
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module should be included with relative
paths (relative to the root folder of the modular component, e.g.
`platform/linuxbsd/`), in their own section before Godot's "core" includes.

The `api` and `export` subfolders also need to be handled as self-contained
(and thus use relative paths for their "local" includes) as they are all
compiled for each editor platform, without necessarily having the api/export
matching platform folder in the include path.
E.g. the Linux editor build will compile `platform/android/{api,export}/*.cpp`
and those need to use relative includes for it to work.
2023-06-08 15:19:19 +02:00
MJacred 2c5e2196bd Replace get_rendering_device() call to prevent crashes on OpenGL.
And make OpenGL video adapter info align with Vulkan.
2023-06-06 23:29:36 +02:00
MJacred 9e5bf3d589 Copy system info to clipboard + Update bug_report.yml
plus minor static-related fixes
* linuxbsd: get_systemd_os_release_info_value() -> static breaks usage if used multiple times
* windows/linuxbsd: get_video_adapter_driver_info() writes info into static
* linuxbsd: get_distribution_name() + get_version() -> write bsd fallback into static variable
* windows/uwp/android: remove unnecessary use of static
2023-05-27 18:21:23 +02:00
Fabio Alessandrelli 58c6f88802 [TLS/Windows] Skip disallowed certs in the trusted CA list.
Turns out the list of trusted root certificates contains disallowed
certificates (i.e. certificates which are no longer trusted or have been
revoked).

We need to check for the property `CERT_DISALLOWED_FILETIME_PROP_ID` to
check if and when the certificates should be distrusted.
2023-05-14 14:44:14 +02:00
Rémi Verschelde 258fabdbb3
Merge pull request #76836 from Faless/tls/system_certs
[TLS] Add support for platform-specific CA bundles.
2023-05-12 11:17:31 +02:00
Fabio Alessandrelli 6fd9982358 [TLS] Add support for platform-specific CA bundles.
Adds a new OS::get_system_ca_certs method which can be implemented by
platforms to retrieve the list of trusted CA certificates using OS
specific APIs.

The function should return the certificates in PEM format, and is
currently implemented for Windows/macOS/LinuxBSD(*)/Android.

mbedTLS will fall back to bundled certificates when the OS returns no
certificates.

(*) LinuxBSD does not have a standardized certificates store location.
    The current implementation will test for common locations and may
    return an empty string on some distributions (falling back to the
    bundled certificates).
2023-05-12 09:58:23 +02:00
Ninni Pipping 71ee65dc57 Enable shadow warnings and fix raised errors 2023-05-11 16:00:59 +02:00
Davi 65236fe2d5 Fix building the Windows x86_32 target
In x86_32, `ULONG_PTR` and `SIZE_T` are defined as `unsigned long`, which is not a type supported by Variant without the `NEED_LONG_INT` define.
2023-05-07 11:01:20 -03:00
Rémi Verschelde 76d33d187f
Merge pull request #69698 from Daylily-Zeleen/daylily-zeleen/show_in_explorer
Implement and expose OS::shell_show_in_file_manager()
2023-04-25 09:57:27 +02:00
Daylily-Zeleen b12ced0a26 Implement and expose OS::shell_show_in_file_manager() 2023-04-25 11:29:32 +08:00
bruvzg 628f3b2f79
[OS] Implement and expose to scripting APIs `get_memory_info` method instead of old `get_free_static_memory`. 2023-04-24 14:08:55 +03:00
Rémi Verschelde c2edf14faf
Merge pull request #75881 from bruvzg/win_coinit
[Windows] Cleanup COM library initialization/uninitialization.
2023-04-18 23:40:06 +02:00
bruvzg 83dc545ea2 [Windows] Cleanup COM library initialization/uninitialization. 2023-04-10 10:38:25 +03:00
bruvzg 68163f5643 [Windows] Detect missing DLL dependencies and list them in the open_dynamic_library error message. 2023-03-27 12:18:15 +03:00
Rémi Verschelde b7ecb9584a
Windows: Workaround missing DWRITE_FONT_WEIGHT value in old MinGW
Fixes #74339.
2023-03-05 18:18:04 +01:00
bruvzg 94355249c3 Fix Windows to Windows SSH remote deploy. Fix Windows `execute` exit code. 2023-02-27 09:54:49 +02:00
K. S. Ernest (iFire) Lee f8be889133 Fixed a few godot engine 4 warnings on clang with Opengl and Windows apis. 2023-01-30 17:00:02 -08:00
Rémi Verschelde a58f6a9dd6
Merge pull request #71220 from reduz/prevent-opening-windows-console-files
Prevent opening Windows console files
2023-01-21 11:28:31 +01:00
Rémi Verschelde 818a9e99a4
OS: Add `unset_environment`, better validate input
Instead of returning an undocumented boolean error code, we do the
validation checks that should ensure a successful result.

Based on:
- https://linux.die.net/man/3/setenv
- https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setenvironmentvariable
2023-01-16 16:39:44 +01:00
bruvzg 01adf738fa [Windows] Allow OS::kill method to terminate non-child processes. 2023-01-12 14:41:57 +02:00