-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support calling conventions other than the default: Windows 32 bits, some calls fail #17
Comments
Hello there, Unfortunately that's expected. fastcall currently doesn't support setting calling conventions, just uses the default C call of the actual platform. It happens that Win64 uses that too, but Win32 uses its own stdcall conventionwhich is different than standard C. I'm planning to implement calling convention support, but it won't magically fixes active-win because it have to decalre its calling conventions based on the actual node runtime. |
OK, get it (kind of, I'm not a C guy). Thanks for the explanation. So, for now, for that specific use case, I'm stuck with |
I'm considering this issue as a feature request to support calling conventions other than the default. |
OK, cool. I'll update the title so you can refer to it later more easily. |
Unfortunatelly I need more time to get back to this project. This request hasn't forgotten, but real life issues burn up my whole spare time recently. |
Description
I'm trying to use active-win that uses fastcall as a dependency.
I'm being able to "build" / install it run it.
When I use it in a Windows 7 with a
x64
architecture it all works fine.But when I try to use it in a Windows 7 with a
ia32
architecture, it fails. I'm trying to run it in a node interactive session / terminal. But when I call the library it just exits without even thowing an exception or showing any error.Steps to reproduce
ia32
(x86
) free virtual machine from: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/, for example:IE8 on Win7 (x86)
.package.json
in that directory withnpm init
(without it,cmake-js
compilation would fail).active-win
:npm install --save active-win
.DEBUG
env var:$env:DEBUG="*"
node
.active-win
:const activeWin = require('active-win');
.activeWin()
.Promise
, but instead, Node just closes, without showing any error.Details
The code in
active-win
that usesfastcall
is here: https://github.com/sindresorhus/active-win/blob/master/windows.jsIt's possible to do all the same steps above, but instead of installing
active-win
as a dependency, installingfastcall
andref-wchar
.Then, running an interactive Node session, it's possible to run all the code in that file, line by line, up until: https://github.com/sindresorhus/active-win/blob/master/windows.js#L42, in that line is that it "explodes".
I did all the same experiment, in the same VM, but instead of using
fastcall
, replacing everything withnode-ffi
and it worked as expected. So it seems that it's not a problem with the names of the symbols or something similar.I'm unable to see any error, I don't really know how to try to find the problem. Do you have any suggestion on how to debug it?
The text was updated successfully, but these errors were encountered: