Edited because I had the DLL built wrong:
I have built a DLL, and if I do a dumpbin /exports
command on the DLL I see the following:
Dump of file stun_driver.dll
File Type: DLL
Section contains the following exports for stun_driver.dll
00000000 characteristics
546E6C63 time date stamp Thu Nov 20 17:34:11 2014
0.00 version
1 ordinal base
4 number of functions
4 number of names
ordinal hint RVA name
1 0 00001005 OPENSSL_Applink = @ILT+0(_OPENSSL_Applink)
2 1 00001320 launch_stun = @ILT+795(_launch_stun)
3 2 000011D6 stop_stun = @ILT+465(_stop_stun)
4 3 00001078 test_print = @ILT+115(_test_print)
Summary
1A000 .data
2000 .idata
46000 .rdata
F000 .reloc
135000 .text
My code for executing the "test_print" function, is as follows:
/* import js-ctypes */
Cu.import("resource://gre/modules/ctypes.jsm")
var stun_driver = ctypes.open("C:\\stun_driver.dll");
const test_print = stun_driver.declare("test_print", ctypes.default_abi, ctypes.int32_t);
.
.
.//in a button
test_print();
So my question is, if my test_print()
is doing a printf("Hello World")
, where does that text go? It doesn't seem to be getting logged to my browser console, or to the dos console i am running "cfx run" from.
If you start Firefox from a terminal window, you should see the output there.