diff options
| author | bors <bors@rust-lang.org> | 2025-05-16 05:45:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-05-16 05:45:37 +0000 |
| commit | c79bbfab78dcb0a72aa3b2bc35c00334b58bfe2e (patch) | |
| tree | d6f39db82b528e67936230e39ad6c460d8904977 /library/std/src/os/windows/process.rs | |
| parent | 7e19eef048ba58c28c70afbf5f95da4829c15796 (diff) | |
| parent | 5ce27f572ff4a5ba50146dc70aa5397b24a3f20a (diff) | |
| download | rust-c79bbfab78dcb0a72aa3b2bc35c00334b58bfe2e.tar.gz rust-c79bbfab78dcb0a72aa3b2bc35c00334b58bfe2e.zip | |
Auto merge of #141066 - matthiaskrgr:rollup-e7tyrj5, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #140791 (std: explain prefer `TryInto` over `TryFrom` when specifying traits bounds on generic function) - #140834 (move (or remove) some impl Trait tests) - #140910 (Remove `stable` attribute from wasi fs (read_exact|write_all)_at) - #140984 (fix doc for UnixStream) - #140997 (Add negative test coverage for `-Clink-self-contained` and `-Zlinker-features`) - #141003 (Improve ternary operator recovery) - #141009 (Migrate to modern datetime API) - #141013 (Implement methods to set STARTUPINFO flags for Command API on Windows) - #141026 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/os/windows/process.rs')
| -rw-r--r-- | library/std/src/os/windows/process.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/library/std/src/os/windows/process.rs b/library/std/src/os/windows/process.rs index a084f452e55..c223eee95b5 100644 --- a/library/std/src/os/windows/process.rs +++ b/library/std/src/os/windows/process.rs @@ -344,6 +344,27 @@ pub trait CommandExt: Sealed { &mut self, attribute_list: &ProcThreadAttributeList<'_>, ) -> io::Result<process::Child>; + + /// When true, sets the `STARTF_RUNFULLSCREEN` flag on the [STARTUPINFO][1] struct before passing it to `CreateProcess`. + /// + /// [1]: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa + #[unstable(feature = "windows_process_extensions_startupinfo", issue = "141010")] + fn startupinfo_fullscreen(&mut self, enabled: bool) -> &mut process::Command; + + /// When true, sets the `STARTF_UNTRUSTEDSOURCE` flag on the [STARTUPINFO][1] struct before passing it to `CreateProcess`. + /// + /// [1]: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa + #[unstable(feature = "windows_process_extensions_startupinfo", issue = "141010")] + fn startupinfo_untrusted_source(&mut self, enabled: bool) -> &mut process::Command; + + /// When specified, sets the following flags on the [STARTUPINFO][1] struct before passing it to `CreateProcess`: + /// - If `Some(true)`, sets `STARTF_FORCEONFEEDBACK` + /// - If `Some(false)`, sets `STARTF_FORCEOFFFEEDBACK` + /// - If `None`, does not set any flags + /// + /// [1]: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa + #[unstable(feature = "windows_process_extensions_startupinfo", issue = "141010")] + fn startupinfo_force_feedback(&mut self, enabled: Option<bool>) -> &mut process::Command; } #[stable(feature = "windows_process_extensions", since = "1.16.0")] @@ -385,6 +406,21 @@ impl CommandExt for process::Command { .spawn_with_attributes(sys::process::Stdio::Inherit, true, Some(attribute_list)) .map(process::Child::from_inner) } + + fn startupinfo_fullscreen(&mut self, enabled: bool) -> &mut process::Command { + self.as_inner_mut().startupinfo_fullscreen(enabled); + self + } + + fn startupinfo_untrusted_source(&mut self, enabled: bool) -> &mut process::Command { + self.as_inner_mut().startupinfo_untrusted_source(enabled); + self + } + + fn startupinfo_force_feedback(&mut self, enabled: Option<bool>) -> &mut process::Command { + self.as_inner_mut().startupinfo_force_feedback(enabled); + self + } } #[unstable(feature = "windows_process_extensions_main_thread_handle", issue = "96723")] |
