about summary refs log tree commit diff
path: root/library/std/src/sys/windows
AgeCommit message (Collapse)AuthorLines
2023-08-28Remove old bindings that have been movedChris Denton-7/+1
2023-08-28Add GetActiveProcessorCount and process attributesChris Denton-0/+7
2023-08-28Abstract over internal `SOCKET` typeChris Denton-16/+22
This allows `SOCKET` to be `usize` internally
2023-08-28Update windows ffi bindingsChris Denton-98/+82
2023-08-28Auto merge of #114848 - michaelvanstraten:spawn_with_attributes, r=ChrisDentonbors-2/+152
Add ability to spawn Windows process with Proc Thread Attributes | Take 2 This is the second attempt to merge pull request #88193 into the standard library. This PR implements the ability to add arbitrary attributes to a command on Windows targets using a new `raw_attribute` method on the [`CommandExt`](https://doc.rust-lang.org/stable/std/os/windows/process/trait.CommandExt.html) trait. `@TyPR124` and my main motivation behind adding this feature is to enable the support of pseudo terminals in the std library, but there are many more applications. A good starting point to get into this topic is to head over to the [`Win32 API documentation`](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-updateprocthreadattribute).
2023-08-25Add a new helper to avoid calling io::Error::kindBen Kimock-0/+5
2023-08-25Added option to set ProcThreadAttributes for Windows processesMichael van Straten-2/+152
This implements the ability to add arbitrary attributes to a command on Windows targets using a new `raw_attribute` method on the [`CommandExt`](https://doc.rust-lang.org/stable/std/os/windows/process/trait.CommandExt.html) trait. Setting these attributes provides extended configuration options for Windows processes. Co-authored-by: Tyler Ruckinger <t.ruckinger@gmail.com>
2023-08-19Usage zero as language id for FormatMessageW()Charles Lew-6/+2
2023-08-12Rollup merge of #114132 - tamird:better-env-debug-impls, r=AmanieuMatthias Krüger-5/+49
Better Debug for Vars and VarsOs Display actual vars instead of two dots. The same was done for Args and ArgsOs in 275f9a04af6191e3aee3852a5a1713.
2023-08-09Auto merge of #99747 - ankane:float_gamma, r=workingjubileebors-1/+5
Add gamma function to f32 and f64 Adds the [gamma function](https://en.wikipedia.org/wiki/Gamma_function) to `f32` and `f64` (`tgamma` and `tgammaf` from C). Refs: - https://github.com/rust-lang/rfcs/issues/864 - https://github.com/rust-lang/rust/issues/18271
2023-08-08Rollup merge of #106425 - ijackson:exit-status-default, r=dtolnayMatthias Krüger-1/+1
Make ExitStatus implement Default And, necessarily, make it inhabited even on platforms without processes. I noticed while preparing https://github.com/rust-lang/rfcs/pull/3362 that there was no way for anyone to construct an `ExitStatus`. This would be insta-stable so needs an FCP.
2023-08-07Better Debug for Vars and VarsOsTamir Duberstein-5/+49
Display actual vars instead of two dots. The same was done for Args and ArgsOs in 275f9a04af6191e3aee3852a5a1713.
2023-08-07impl Default for ExitStatusIan Jackson-1/+1
2023-08-07std::process (windows): Implement From<io::Stdout> etc. for imp::StdioIan Jackson-0/+14
This involves a new variant `imp;::Stdio::InheritSpecific`. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2023-08-07std::process (windows): refactor Stdio::to_handle slightlyIan Jackson-10/+11
We're going to want to reuse this bit of code.
2023-07-31Add gamma and ln_gamma functions to f32 and f64Andrew Kane-1/+5
2023-07-24remove additional [allow(unused_unsafe)]James Dietz-4/+1
2023-07-22Rollup merge of #113442 - epage:osstring, r=cuviperMatthias Krüger-0/+10
Allow limited access to `OsString` bytes This extends #109698 to allow no-cost conversion between `Vec<u8>` and `OsString` as suggested in feedback from `os_str_bytes` crate in #111544.
2023-07-20Minor improvements to Windows TLS dtorsChris Denton-28/+49
2023-07-07Allow limited access to `OsString` bytesEd Page-0/+10
This extends #109698 to allow no-cost conversion between `Vec<u8>` and `OsString` as suggested in feedback from `os_str_bytes` crate in #111544.
2023-07-06Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errorsfee1-dead-7/+7
Revert the lexing of `c"…"` string literals Fixes \[after beta-backport\] #113235. Further progress is tracked in #113333. This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy) and git-reverts #111647. CC `@fee1-dead` (#108801) `@klensy` (#111647) r? `@compiler-errors` `@rustbot` label F-c_str_literals beta-nominated
2023-07-05Revert "use c literals in library"León Orell Valerian Liehr-7/+7
This reverts commit f212ba6d6d60963c8101bb24fc3e53fca80c046f.
2023-07-05Auto merge of #112594 - ChrisDenton:process=-kill, r=Amanieubors-1/+10
Return `Ok` on kill if process has already exited This will require an FCP from `@rust-lang/libs-api.` Fixes #112423. See that issue for more details.
2023-07-01Return `Ok` on kill if process has already exitedChris Denton-1/+10
2023-06-25Auto merge of #113001 - ChrisDenton:win-arm32-shim, r=thomccbors-49/+44
Move windows-sys arm32 shim to c.rs This moves the arm32 shim in to c.rs instead of appending to the generated file itself. This makes it simpler to change these workarounds if/when needed. The downside is we need to exclude a couple of functions from being generated (see the comment). A metadata solution could help here but they'll be easy enough to add back if that happens.
2023-06-24Remove unnecessary `path` attributeChris Denton-1/+0
2023-06-24Move arm32 shim to c.rsChris Denton-49/+44
2023-06-18Fix windows `Socket::connect_timeout` overflowEval EXEC-1/+1
Signed-off-by: Eval EXEC <execvy@gmail.com>
2023-06-14Rollup merge of #98202 - aticu:impl_tryfrom_osstr_for_str, r=AmanieuMatthias Krüger-1/+1
Implement `TryFrom<&OsStr>` for `&str` Recently when trying to work with `&OsStr` I was surprised to find this `impl` missing. Since the `to_str` method already existed the actual implementation is fairly non-controversial, except for maybe the choice of the error type. I chose an opaque error here instead of something like `std::str::Utf8Error`, since that would already make a number of assumption about the underlying implementation of `OsStr`. As this is a trait implementation, it is insta-stable, if I'm not mistaken? Either way this will need an FCP. I chose "1.64.0" as the version, since this is unlikely to land before the beta cut-off. `@rustbot` modify labels: +T-libs-api API Change Proposal: rust-lang/rust#99031 (accepted)
2023-06-12Add comment for arm_shim in generate-windows-sysbdbai-0/+3
2023-06-12Add windows_sys typedef for Win ARM32bdbai-0/+17
2023-06-12Implement `TryFrom<&OsStr>` for `&str`aticu-1/+1
2023-06-10Keep uwp specific code in sync with windows-sysbdbai-5/+4
2023-06-10Lazy load ntdll functions on UWPbdbai-2/+61
2023-06-02Rollup merge of #111647 - klensy:cstr, r=oli-obkMatthias Krüger-7/+7
use c literals in compiler and library Use c literals #108801 in compiler and library currently blocked on: * <strike>rustfmt: don't know how to format c literals</strike> nope, nightly one works. * <strike>bootstrap</strike> r? `@ghost` `@rustbot` blocked
2023-05-31Fix bug in utf16_to_utf8 for zero length stringsShane Murphy-0/+13
This fixes the behavior of sending EOF by pressing Ctrl+Z => Enter in a windows console. Previously, that would trip the unpaired surrogate error, whereas now we correctly detect EOF.
2023-05-31use c literals in libraryklensy-7/+7
2023-05-30add FromOwnedFd/FromOwnedHandle for ChildStdin/out/errVincent Thiberville-1/+7
2023-05-15Add creation time support to `FileTimes` on apple and windowsbeetrees-4/+18
2023-05-13refactor: Remove bespoke from_os_str_bytes_uncheckedEd Page-13/+7
2023-05-13refactor: Remove redundant, private OsStr::bytesEd Page-16/+18
2023-05-05Sort windows_sys.lst alphabeticallyChris Denton-614/+617
2023-05-05Use new bindingsChris Denton-52/+69
2023-05-05Generate windows-sys bindingsChris Denton-3045/+7016
2023-05-03Use `from_wide_to_user_path` in `read_link`Chris Denton-4/+7
2023-05-03Correctly convert an NT path to a Win32 pathChris Denton-11/+16
This can be done by simply changing the `\??\` prefix to `\\?\` and then attempting to convert to a user path. Currently it simply strips off the prefix which could lead to the wrong path being returned (e.g. if it's not a drive path or if the path contains trailing spaces, etc).
2023-05-01Inline AsInner implementationsKonrad Borowski-0/+4
2023-04-28remove_dir_all: delete directory with fewer permsChris Denton-19/+22
If opening a directory with `FILE_LIST_DIRECTORY` access fails then we should try opening without requesting that access. We may still be able to delete it if it's empty or a link.
2023-04-16Windows: map a few more error codes to ErrorKindChris Denton-3/+6
NotFound errors: * `ERROR_INVALID_DRIVE`: The system cannot find the drive specified * `ERROR_BAD_NETPATH`: The network path was not found * `ERROR_BAD_NET_NAME`: The network name cannot be found. InvalidFilename: * `ERROR_BAD_PATHNAME`: The specified path is invalid.
2023-04-10Fix typos in libraryDaniPopes-1/+1