Has anybody succesfully initialized RIL under C# using the ril.dll
interface? I'm trying to use the following commands but never managed to
receive a callback after invoking the proper methods.
public delegate void RILRESULTCALLBACK(int dwCode, void* hrCmdID,
void* lpData, int cbData, int dwParam);
public delegate void RILNOTIFYCALLBACK(int dwCode, void* lpData, int
cbData, int dwParam);
public static readonly int RIL_NCLASS_ALL = 0x0fffffff;
[DllImport("ril.dll")]
public static extern int RIL_Initialize(int dwIndex,
[MarshalAs(UnmanagedType.FunctionPtr)]RILRESULTCALLBACK pfnResult,
[MarshalAs(UnmanagedType.FunctionPtr)]RILNOTIFYCALLBACK pfnNotify, int
dwNotificationClasses, int dwParam, out void* lphRil);
And then I try:
RILRESULTCALLBACK resultCallback = new RILRESULTCALLBACK(f_result);
RILNOTIFYCALLBACK notifyCallback = new RILNOTIFYCALLBACK(f_notify);
where the receivers are:
private void f_notify(int dwCode, void* lpData, int cbData, int dwParam)
{...}
private void f_result(int dwCode, void* hrCmdID, void* lpData, int
cbData, int dwParam) {...}
My question is am a using correct argument types for the methods. Has
anyone done it, had it working and would share the solution with me?