Description
Currently mkwinsyscall
includes a 15 arg limit with a panic
: https://github.com/golang/sys/blob/6e4d1c53cf3b2c1c6d104466749f76cc7a5c9ed8/windows/mkwinsyscall/mkwinsyscall.go#L554-L558
The limit was committed Oct 3, 2019, and since then, Go 1.18 deprecated the individual Syscall
, Syscall6
, etc. methods in favor of SyscallN
.
Changing mkwinsyscall
to use SyscallN
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 for Windows.Win32.winmd
, I found a handful of methods with a few more params than the current limit:
CreateFontPackage
ICDrawBegin
DRMGetUsagePolicy
ScriptPlaceOpenType
D2D1GetGradientMeshInteriorPointsFromCoonsPatch
AccessCheckByTypeAndAuditAlarmW
AccessCheckByTypeResultListAndAuditAlarmW
AccessCheckByTypeResultListAndAuditAlarmByHandleW
AccessCheckByTypeAndAuditAlarmA
AccessCheckByTypeResultListAndAuditAlarmA
AccessCheckByTypeResultListAndAuditAlarmByHandleA
- Like I mentioned in x/sys/windows: mkwinsyscall: Support
-
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.