Unsafe DLL Loading
zx2c4 opened this issue · comments
You're using syscall, but you should be using x/sys/windows's lazy DLL struct instead:
damon/win32/base_types_win32.go
Lines 11 to 15 in f4a70e9
iphlpapi.dll and userenv.dll are not part of \KnownDlls.
Your blog post indicates you know about the right way to do it but for some reason didn't.
Thanks for the find @zx2c4. Do you have time to make the PR to fix it?
I have no idea what this project does or is used for, but I thought you had an interesting Windows library so I was poking around with it. You're probably a better person to fix this than me.
Sure, just wanted to give you first dibs on fixing it if you were interested. Thank you anyway for reporting, I'll take care of it.
By the way, there's an easier way of dealing with all this using //sys
. Check it out:
In this file (or in any file, really), I define a bunch of calls like this one:
And then in this file, I have a go generate directive:
Which winds up creating a file containing the fuction, like:
Neat, I'll take a look at this too. Thanks for the tip!