I noticed when I tried to set ACLs on a mispelled folder I got an error back which when printed said The operation completed successfully. (i.e. ERROR_SUCCESS)
The 3rd parameter of the syscall-type function should only be used for functions which return a TRUE/FALSE and vend their error through the GetLastError() mechanism. In the case of GetNamedSecurityInfoW the error code is what is returned. Therefore the code should look more like:
I haven't looked at the api package more exhaustively to see if this applies to other functions, but I expect it does. If I find time I will submit an MR with a small test and hopefully fixes for these (though as a larger fix it may be worth moving to the x/sys/windows/mkwinsyscall mechanism for generating these functions?)
I noticed when I tried to set ACLs on a mispelled folder I got an error back which when printed said
The operation completed successfully.
(i.e. ERROR_SUCCESS)Looking at the API package:
The 3rd parameter of the syscall-type function should only be used for functions which return a TRUE/FALSE and vend their error through the GetLastError() mechanism. In the case of GetNamedSecurityInfoW the error code is what is returned. Therefore the code should look more like:
I haven't looked at the api package more exhaustively to see if this applies to other functions, but I expect it does. If I find time I will submit an MR with a small test and hopefully fixes for these (though as a larger fix it may be worth moving to the x/sys/windows/mkwinsyscall mechanism for generating these functions?)