Open
Description
What version of Go are you using (go version
)?
$ go version go version go1.20 windows/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env : GOARCH=amd64 GOOS=windows :
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
.ocx
extension - Control Panel applets with
.cpl
extension - Device drivers with
.drv
extension
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.
//sys ClosePrinter(h syscall.Handle) (err error) = winspool.ClosePrinter
What did you expect to see?
var ( modwinspool = windows.NewLazySystemDLL("winspool.drv") procClosePrinter = modwinspool.NewProc("ClosePrinter") )
What did you see instead?
var ( modwinspool = windows.NewLazySystemDLL("winspool.dll") procClosePrinter = modwinspool.NewProc("ClosePrinter") )
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.
//sys ClosePrinter(h syscall.Handle) (err error) = winspool.drv.ClosePrinter
Then, the generated code will be,
var ( modwinspool = windows.NewLazySystemDLL("winspool.drv") procClosePrinter = modwinspool.NewProc("ClosePrinter") )
The code changes are fairly straightforward. I have working code that I can submit as a pull request if the proposal makes sense.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo