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 SEC_* constants #56053

Open
piotr-sneller opened this issue Oct 5, 2022 · 5 comments
Open

x/sys/windows: add SEC_* constants #56053

piotr-sneller opened this issue Oct 5, 2022 · 5 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@piotr-sneller
Copy link

What version of Go are you using (go version)?

1.19.2

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

windows/amd64

What did you expect to see?

Hi,

this is not a "notable change", so I am reporting it as a bug for the lack of a better idea.

CreateFileMapping() can take more protection flags than the windows package defines at the moment. I believe the file would be memory_windows.go; could you please add the following?

SEC_COMMIT           = 0x08000000
SEC_IMAGE            = 0x01000000
SEC_IMAGE_NO_EXECUTE = 0x11000000
SEC_LARGE_PAGES      = 0x80000000
SEC_NOCACHE          = 0x10000000
SEC_RESERVE          = 0x04000000
SEC_WRITECOMBINE     = 0x40000000
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Oct 5, 2022
@gopherbot gopherbot added this to the Unreleased milestone Oct 5, 2022
@prattmic
Copy link
Member

prattmic commented Oct 5, 2022

cc @golang/windows

@prattmic
Copy link
Member

prattmic commented Oct 5, 2022

The Windows folks can say more definitely, but this doesn't sound controversial to me, so I think you can just send a CL adding these.

@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 6, 2022
@alexbrainman
Copy link
Member

@piotr-sneller

If you want these flags added to memory_windows.go, you have to do it yourself. Here https://go.dev/doc/contribute is how to contribute. I will be happy to review your change.

But you can just add these consts to your own source files, and use them from there too.

Alex

@piotr-sneller
Copy link
Author

@alexbrainman I gladly would, but I got stuck with the legal part, so cannot contribute until it is all resolved. It's approved on my end, but I don't have the time to go through the paperwork ordeal just now. This is the root issue, I believe.

Certainly, I have the missing constants (and more) defined in my own files. But conceptually they don't belong there; it's pure WinAPI and should be provided by the WinAPI wrapper package (for any programming language). Another benefit would be allowing more people to use them straight out of the box.

@alexbrainman
Copy link
Member

@alexbrainman I gladly would, but I got stuck with the legal part, so cannot contribute until it is all resolved. It's approved on my end, but I don't have the time to go through the paperwork ordeal just now. This is the root issue, I believe.

No worries. When you are ready.

Certainly, I have the missing constants (and more) defined in my own files. But conceptually they don't belong there; it's pure WinAPI and should be provided by the WinAPI wrapper package (for any programming language). Another benefit would be allowing more people to use them straight out of the box.

Agree.

Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

5 participants