Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
passing a variable as a pointer to a windows DLL method
Citizen Snips
10/23/2007 12:27:00 PM
hi guys,
i'm having a problem with a DLL method call which requires a few
pointers.
the code is seg faulting (on the openPort call), so any advice is
appreciated.
i've been able to call other methods from the same dll, so it's possible
i'm passing the variables incorrectly to this method.
require 'dl'
$my_dll = DL.dlopen('some.dll')
handle = " " * 4
p_mask = " " * 8
$my_dll['openPort', 'HicIiIII'].call(handle, "demo", a_mask, p_mask,
1024, 3, 2)
Note, a_mask is initialised elsewhere.
The openPort method has the following signature:
openPort (
long *pHandle,
char *userName,
unsigned __int64 accessMask,
unsigned __int64 *pPermissionMask,
unsigned int queueSize,
unsigned int version,
unsigned int type)
);
I've also tried using the Win32API library, with the same result:
require "Win32API"
mydll = "some.dll"
openport =
Win32API.new(mydll,"openPort",['P','P','I','P','I','I','I'],'I')
openport.call(handle, "demo", a_mask, p_mask, 1024, 3, 2)
thanks in advance....
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
passing a variable as a pointer to a windows DLL method
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password