Hello, i was compiling various kernel32 headers fo...
# kotlin-native
e
Hello, i was compiling various kernel32 headers for use in a scoreboard memory-reading application in kotlin/native, and only one of them successfully made it into a klib. I've tried all the others out individually and it still doesn't seem to work for any of them. Here's my .def file:
Copy code
headers = memoryapi.h processthreadsapi.h winnt.h tlhelp32.h handleapi.h
compilerOpts.win32 = "-IC:/Program Files (x86)/Windows Kits/8.1/Include/um/" "-IC:/Program Files (x86)/Windows Kits/8.1/Include/shared/"
linkerOpts.win32 = "-LC:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86/kernel32.lib"
Only tlhelp32.h makes it through. Am I doing something wrong or should i just wait it out for a newer version?
o
at the moment space-separated names in .def are not supported, we will try to fix it, in the meantime - rename
e
what are the separators, then?
o
your filenames have spaces in them, space separation between files names works
e
let me move the headers and see what happens
nope, same skipping of functions, only tlhelp32.h makes the cut 😞
o
But why you need to use cinterop tool, aren’t required headers in platform libs? Which function you are looking for?
e
openprocess, readprocessmemory, virtualqueryex are the big 3 in memoryapi.h
i first discovered this when CloseHandle didn't exist, that's a part of processthreadsapi.h
o
all those APIs are available in
platform.windows
package
do you use IDE? it would help to discover that fact
e
all of them? and no i don't, as much as i'd like to support cilon costs money 😕
let me try and refactor it slightly
🤦‍♂️ CloseHandle was in platform.windows all along... I bet everything else is too, like you say. Thank you for the help!
o
IDEA CE is free and it will give you autocompletion on Windows