x/sys/windows: mkwinsyscall: Add support for DLLs with extensions other than .dll
#58,337 opened on Feb 5, 2023
Repository metrics
- Stars
- (133,883 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
What version of Go are you using (go version)?
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env)?
What did you do?
Some of the Windows system dynamic link library (DLL) files have extensions other than .dll.
For example,
- ActiveX Controls files with
.ocxextension - Control Panel applets with
.cplextension - Device drivers with
.drvextension
mkwinsyscall does not support generating the syscall wrappers for these DLLs with different extensions.
The extension is always hard-coded to .dll in the generated code.
What did you expect to see?
What did you see instead?
Proposed solution
If the user specified the extension of the DLL in the //sys comment, use that extension instead of adding the .dll extension.
Going back to the previous example, the user can specify the extension as .drv in the //sys comment.
Then, the generated code will be,
The code changes are fairly straightforward. I have working code that I can submit as a pull request if the proposal makes sense.