-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: mkwinsyscall: support syscalls with more than 15 params #57914
Comments
Thanks. I don't think this has to be a proposal. It's just a bug fix. |
For the record: as of today (go1.20), syscall.SyscallN is internally limited to 42 arguments, even though it accepts a variadic input. go/src/runtime/syscall_windows.go Lines 528 to 533 in 9894ded
|
Thank you @dagood for creating this issue. I agree with Ian. It is just a bug in Perhaps we could even change Alex |
I could give this a shot @alexbrainman, would this fix just involve changing the number of params ? |
Sure. Go ahead. Unless @dagood or others already started working on this change.
Current version uses Syscall/Syscall6/Syscall9/Syscall12/Syscall15 syscalls. You can add Syscall18 support, that will take care of https://learn.microsoft.com/en-us/windows/win32/api/fontsub/nf-fontsub-createfontpackage with 17 parameters that is listed above. Or you could replace all Syscall/Syscall6/Syscall9/Syscall12/Syscall15 syscalls with new SyscallN. That will cover every call that Go syscall package supports. If you do that, you would have to regenerate all code that uses mkwinsyscall program in golang.org/x/sys/windows/... and in the standard library, so people who use mkwinsyscall next time are not surprised by large diffs that new version of mkwinsyscall will generate. Alex |
I'm not currently working on this. Thanks @sladyn98 for giving it a try. 🙂 |
The mkwinsyscall command has a hard limit of 15 on the number of syscall arguments. Windows has several system calls with more than 15 arguments, for example CreateFontPackage has 18 arguments. Another limiting factor is that mkwinsyscall uses the various SyscallX functions, that generates extra complexity that can be avoided by relying on SyscallN. Updates golang/go#57914
Change https://go.dev/cl/518995 mentions this issue: |
This is a follow up for CL 518995 that regenerates the windows zsyscalls to use SyscallN instead of the various SyscallX functions. Fixes golang#57914
Change https://go.dev/cl/518857 mentions this issue: |
The mkwinsyscall command has a hard limit of 15 on the number of syscall arguments. Windows has several system calls with more than 15 arguments, for example CreateFontPackage has 18 arguments. If the number of arguments is higher than 15 we use SyscallN. Updates golang/go#57914
The mkwinsyscall command has a hard limit of 15 on the number of syscall arguments. Windows has several system calls with more than 15 arguments, for example CreateFontPackage has 18 arguments. If the number of arguments is higher than 15 we use SyscallN. Updates golang/go#57914
The mkwinsyscall command has a hard limit of 15 on the number of syscall arguments. Windows has several system calls with more than 15 arguments, for example CreateFontPackage has 18 arguments. If the number of arguments is higher than 15 we use SyscallN. Updates golang/go#57914
The mkwinsyscall command has a hard limit of 15 on the number of syscall arguments. Windows has several system calls with more than 15 arguments, for example CreateFontPackage has 18 arguments. If the number of arguments is higher than 15 we use SyscallN. Updates golang/go#57914
The mkwinsyscall command has a hard limit of 15 on the number of syscall arguments. Windows has several system calls with more than 15 arguments, for example CreateFontPackage has 18 arguments. If the number of arguments is higher than 15 we use SyscallN. Updates golang/go#57914
Currently
mkwinsyscall
includes a 15 arg limit with apanic
: https://github.com/golang/sys/blob/6e4d1c53cf3b2c1c6d104466749f76cc7a5c9ed8/windows/mkwinsyscall/mkwinsyscall.go#L554-L558The limit was committed Oct 3, 2019, and since then, Go 1.18 deprecated the individual
Syscall
,Syscall6
, etc. methods in favor ofSyscallN
.Changing
mkwinsyscall
to useSyscallN
simplifies the code as well as widening support, unless I'm not aware of some caveat. 😄Here's an example API with 17 params: https://learn.microsoft.com/en-us/windows/win32/api/fontsub/nf-fontsub-createfontpackage
Background
I'm trying to use
mkwinsyscall
for x/sys/windows: use win32metadata? #43838 by having a generator create//sys
comments. When I generated//sys
lines for all the API methods forWindows.Win32.winmd
, I found a handful of methods with a few more params than the current limit:-
and.
in DLL name #57913, I'm not sure if it makes sense to usemkwinsyscall
to generate a broad list of APIs like these, but I figure it's worth making room for the possibility by proposing this change.The text was updated successfully, but these errors were encountered: