Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows fill_utf16_buf: explain the expected return value #124282

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

RalfJung
Copy link
Member

The comment just says "return what the syscall returns", but that doesn't work for all syscalls as the Windows API is not consistent in how buffer size is negotiated. For instance, GetUserProfileDirectoryW works a bit differently, and so home_dir_crt has to translate this to the usual protocol itself. So it's worth describing that protocol.

r? @ChrisDenton

@rustbot rustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 23, 2024
@ChrisDenton
Copy link
Member

Makes sense to me.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 24, 2024

📌 Commit a21c2d8 has been approved by ChrisDenton

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 24, 2024
fmease added a commit to fmease/rust that referenced this pull request Apr 24, 2024
…nton

windows fill_utf16_buf: explain the expected return value

The comment just says "return what the syscall returns", but that doesn't work for all syscalls as the Windows API is not consistent in how buffer size is negotiated. For instance, GetUserProfileDirectoryW works a bit differently, and so home_dir_crt has to translate this to the usual protocol itself. So it's worth describing that protocol.

r? `@ChrisDenton`
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#122500 (delegation: Support renaming, and async, const, extern "ABI" and C-variadic functions)
 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#124136 (Provide more context and suggestions in borrowck errors involving closures)
 - rust-lang#124280 (Port repr128-dwarf run-make test to rmake)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

r? `@ghost`
`@rustbot` modify labels: rollup
fmease added a commit to fmease/rust that referenced this pull request Apr 24, 2024
…nton

windows fill_utf16_buf: explain the expected return value

The comment just says "return what the syscall returns", but that doesn't work for all syscalls as the Windows API is not consistent in how buffer size is negotiated. For instance, GetUserProfileDirectoryW works a bit differently, and so home_dir_crt has to translate this to the usual protocol itself. So it's worth describing that protocol.

r? `@ChrisDenton`
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 5 pull requests

Successful merges:

 - rust-lang#122500 (delegation: Support renaming, and async, const, extern "ABI" and C-variadic functions)
 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#123794 (More DefineOpaqueTypes::Yes)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

Failed merges:

 - rust-lang#124136 (Provide more context and suggestions in borrowck errors involving closures)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#123794 (More DefineOpaqueTypes::Yes)
 - rust-lang#123881 (Bump Fuchsia versions)
 - rust-lang#124281 (fix weak memory bug in TLS on Windows)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#123794 (More DefineOpaqueTypes::Yes)
 - rust-lang#123881 (Bump Fuchsia versions)
 - rust-lang#124281 (fix weak memory bug in TLS on Windows)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 388dc0d into rust-lang:master Apr 24, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 24, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup merge of rust-lang#124282 - RalfJung:fill_utf16_buf, r=ChrisDenton

windows fill_utf16_buf: explain the expected return value

The comment just says "return what the syscall returns", but that doesn't work for all syscalls as the Windows API is not consistent in how buffer size is negotiated. For instance, GetUserProfileDirectoryW works a bit differently, and so home_dir_crt has to translate this to the usual protocol itself. So it's worth describing that protocol.

r? ``@ChrisDenton``
@RalfJung RalfJung deleted the fill_utf16_buf branch April 25, 2024 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants