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

x/sys/windows: add NtSetInformationFile #48933

Closed
mou-hao opened this issue Oct 13, 2021 · 2 comments
Closed

x/sys/windows: add NtSetInformationFile #48933

mou-hao opened this issue Oct 13, 2021 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mou-hao
Copy link

mou-hao commented Oct 13, 2021

Hi! When I was trying to implement a windows file handle based filesystem abstraction, I find NtSetInformationFile to be very useful used in conjunction with NtCreateFile. NtSetInformationFile supports file information classes not supported by SetFileInformationByHandle, for example FileDispositionInformationEx where you can use the FILE_DISPOSITION_POSIX_SEMANTICS flag to get posix stype delete.

The Microsoft doc for NtSetInformationFile can be found here: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntsetinformationfile

This should be a small change, as we already load ntdll.dll for NtCreateFile and more. I have already implemented it in another project. Use cases can be found here.

Thanks.

@gopherbot gopherbot added this to the Proposal milestone Oct 13, 2021
mou-hao added a commit to mou-hao/bb-storage that referenced this issue Oct 13, 2021
local_directory_windows.go makes use of consts and syscalls not present
in x/sys/windows. I have moved them out into a separate pkg and plan to
create a PR to x/sys/windows to add them there (where they should be).

See:
 - https://go-review.googlesource.com/c/sys/+/355350
 - golang/go#48933
mou-hao added a commit to mou-hao/bb-storage that referenced this issue Oct 13, 2021
local_directory_windows.go makes use of consts and syscalls not present
in x/sys/windows. I have moved them out into a separate pkg and plan to
create a PR to x/sys/windows to add them there (where they should be).

See:
 - https://go-review.googlesource.com/c/sys/+/355350
 - golang/go#48933
@ianlancetaylor ianlancetaylor changed the title proposal: x/sys/windows: add NtSetInformationFile x/sys/windows: add NtSetInformationFile Oct 13, 2021
@ianlancetaylor
Copy link
Contributor

Thanks. It's not necessary to make a proposal to add an existing Windows function to x/sys/windows. You can just send the CL.

@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. and removed Proposal labels Oct 13, 2021
@ianlancetaylor ianlancetaylor modified the milestones: Proposal, Unreleased Oct 13, 2021
@gopherbot
Copy link

Change https://golang.org/cl/355495 mentions this issue: windows: add NtSetInformationFile

EdSchouten pushed a commit to buildbarn/bb-storage that referenced this issue Oct 13, 2021
* local_directory_windows passing all tests

windows handle based impl to mimic as much as possible the behavior of
local_directory_unix

* move extension to x/sys/windows to separate pkg

local_directory_windows.go makes use of consts and syscalls not present
in x/sys/windows. I have moved them out into a separate pkg and plan to
create a PR to x/sys/windows to add them there (where they should be).

See:
 - https://go-review.googlesource.com/c/sys/+/355350
 - golang/go#48933
@golang golang locked and limited conversation to collaborators Oct 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants