vb.net - Will FreeLibrary (or any other WINAPI) work if I declare it as a sub? -


this how should declared:

<dllimport("kernel32.dll", setlasterror:=true)> private function freelibrary(byval hmodule intptr) boolean end function 

will work if declare this?

<dllimport("kernel32.dll", setlasterror:=true)> private sub freelibrary(byval hmodule intptr) end sub 

i have no idea how can test this. telling me way test fine. thanks.

under x86 fine function. return value passed in eax volatile register under x86 abi.

under x64 fine. again return value passed in eax volatile under x64 abi.

i don't think questions asking can readily tested. need understand calling convention able answer such questions. static analysis is, in general, necessary.

frankly though attempting foolish in view. cannot see why possibly want ignore win32 api return values.


Comments