8Bit - SMS - Windows Mobile Development and Hacking General

Hi, has someone of you experience with receiving and sending sms 8bit-coded? I think that RAW is a very important cue, but my c++-Application dont receive the RAW-SMS.
Using the MS-SMS.dll. To Receive RAW I tried:
Code:
HRESULT hr = SmsOpen (SMS_MSGTYPE_TEXT, SMS_MODE_RECEIVE,
&smshHandle, &hRead);
if (hr != ERROR_SUCCESS) return "Error: SmsOpen fehlgeschlagen";
rc = WaitForSingleObject (hRead, 15000); // 15 Sekunden Zeit dazu
...
hr = SmsReadMessage (smshHandle, &smsaServiceCenter, &smsaDestination, NULL, (PBYTE) pMessage, dwSize, // (PBYTE)pMessage, dwSize, (PBYTE)&tpsd, sizeof(RAW_PROVIDER_SPECIFIC_DATA),&dwRead);
if (hr == ERROR_SUCCESS) {...
Unfortunaly the application isn`t able to read and so get a timeout on WaitForSingleObject...
With normal Test-SMS the sample works without problems.

HAve u managed to intercept your incoming messages ?? And what is RAW exactly ??

Related

lineSetAppPriority doesn't seem to work...

For the program I posted here, I want to handle incoming calls before the default popup appears (to replace the ringtone).
Currently, my tool seems to be quick enough without lineSetAppPriority in most cases, but sadly not in all...
I was using the following code: (currently removed again, because it didn't work and even caused some troubles...)
Initialization:
Code:
if ( lineInitialize( &LineApp, theApp.m_hInstance, LineCallback,
theApp.m_pszAppName, &LineHandleCount ) == 0 )
{
LineHandles = new HLINE[LineHandleCount];
for(DWORD i = 0; i < LineHandleCount; i++)
{
if ( lineNegotiateAPIVersion( LineApp, i, 0x00010000, 0x00020000,
&ver, &extensionID ) == 0 )
{
rc = lineOpen( LineApp, i, &LineHandles[i], ver, 0, (DWORD)this,
LINECALLPRIVILEGE_MONITOR|LINECALLPRIVILEGE_OWNER,
LINEMEDIAMODE_INTERACTIVEVOICE, NULL );
if ( rc < 0 )
LineHandles[i] = NULL;
else
if ( LineHandleSignal == NULL )
LineHandleSignal = LineHandles[i];
}
}
HRESULT res = lineSetAppPriority( theApp.m_pszAppName,
LINEMEDIAMODE_INTERACTIVEVOICE,
NULL,
LINEREQUESTMODE_MAKECALL,
NULL, 1 );
}
Callback:
Code:
VOID FAR PASCAL LineCallback( DWORD hDevice,
DWORD dwMsg,
DWORD dwCallbackInstance,
DWORD dwParam1,
DWORD dwParam2,
DWORD dwParam3
)
{
if ( dwMsg == LINE_CALLSTATE )
{
LINECALLINFO *callInfo = (LINECALLINFO *)calloc(sizeof(LINECALLINFO)
+1024, 1);
callInfo->dwTotalSize = sizeof(LINECALLINFO)+1024;
lineGetCallInfo( (HCALL)hDevice, callInfo );
// different stuff...
HRESULT res;
// Remove from priority list, so lineHandoff will run the default
// call window
res = lineSetAppPriority( theApp.m_pszAppName,
LINEMEDIAMODE_INTERACTIVEVOICE, NULL,
LINEREQUESTMODE_MEDIACALL, NULL, 0 );
// Forward event to next instance (usually Windows' phone app)
lineHandoff( (HCALL)hDevice, NULL, callInfo->dwMediaMode );
// Set to top priority again
res = lineSetAppPriority( theApp.m_pszAppName,
LINEMEDIAMODE_INTERACTIVEVOICE, NULL,
LINEREQUESTMODE_MEDIACALL, NULL, 1 );
}
lineSetAppPriorty returns OK in all cases. But when a call comes in, the
default bubble applears simultaneously with the callback function. I
wanted it to be shown when I do the lineHandoff...
What am I doing wrong?
TIA,
Mirko
I used lineSetAppPriority too, with same result....
I think there is one way.....kill cprog

RIL message

Ok lets say i want to use this RIL function ... where would i get the data back from ??? Any help ?? I tried the CALL BACK functions but it does not seem to return much just some hexa stuff
Code:
HRESULT RIL_ReadMsg(
HRIL hRil, // @parm handle to RIL instance returned by <f RIL_Initialize>
DWORD dwIndex // @parm index of the message to be read
);

RIL

Hi there,
I begin to learn RIL functions (i work i-mate sp3i).
I'm stuck with RIL_Initialize returning a NULL handle .... ??? :?
Hvoid RilResultCallback(
DWORD dwCode, // @parm result code
HRESULT hrCmdID, // @parm ID returned by the command that originated>
const void* lpData, // @parm data associated with the notification
DWORD cbData, // @parm size of the strcuture pointed to lpData
DWORD dwParam // @parm parameter passed to <f RIL_Initialize>
)
{
}
void RilNotifyCallback(
DWORD dwCode, // @parm notification code
const void* lpData, // @parm data associated with the notification
DWORD cbData, // @parm size of the strcuture pointed to lpData
DWORD dwParam // @parm parameter passed to <f RIL_Initialize>
)
{
}
void fn()
{
HRIL hRil;
RIL_Initialize(1, RilResultCallback, RilNotifyCallback,
0, 0, &hRil);
if(hRil == NULL)
{
AfxMessageBox(L"hRil == NULL");
}else AfxMessageBox(L"hRil != NULL");
}
I don't understand what the problem is???
Thanks for any help.
what is the result code?
rc= RIL_Initialize( ... )
willem
if i understand you the question right, the result is:
rc=RIL_Initialize(1, RilResultCallback, RilNotifyCallback,
0, 0, &hRil);
hRil==0 , rc == 8........
tstril -- Answers too
8 is a very strange result value for RIL_Initialize.
the only possible answers i see are:
0x80070057 for invalid parameter
0x8007000E or 0x80004005 or 1
... ah, when you specify a notifyproc, you do have to specify some notificationclasses to go with it. .. the 4th param should not be 0 when notifyproc !=NULL
willem
I a beginner if am possible on more in detail,
and the full answer 0x80004005
thankful in advance
maybe your phone is in flightmode?
.. this error means ril did not initialize properly.
willem
Thanks all. I have understood. The certificate is necessary.

EDB notification

Hi All,
Is anyone familiar with the EDB notification mechanism? I have some code that has opened the appointments database to get change notifications, all well and good. The trouble is I am unable to delete the CENOTIFICATION structure, meaning I get a memory leak after every change.
if anyone has seen this or knows the solution, I'd be grateful.
Code:
CEOID apps_oid;
request= new CENOTIFYREQUEST; // or (CENOTIFYREQUEST *) LocalAlloc (LPTR,
// sizeof (CENOTIFYREQUEST));
if (request) {
request->dwSize = sizeof (CENOTIFYREQUEST);
request->hwnd = hwnd;
request->hHeap = NULL;
request->dwFlags = CEDB_EXNOTIFICATION;
request->dwParam = param;
database = CeOpenDatabaseInSession ( NULL,
&pim_guid,
&apps_oid,
L"Appointments Database",
0,
0, // or CEDB_AUTOINCREMENT,
request);
}
. . .
case WM_DBNOTIFICATION:
{
CENOTIFICATION * notification = (CENOTIFICATION *)lParam;
// Always returns FALSE
BOOL hr = CeFreeNotification(request, notification);
// Always returns 5 - access denied
DWORD dw = GetLastError();
}
break;

Initiate a VoIP call via RTC API on WM6

Hello everyone, it's my first post here.
Please help me with a small problem:
I have a WM6 device (Glofiish X800) with a VoIP enabled (WM6VoIP.cab). Built-in VoIP dialer works perfectly with my sipnet.ru profile.
Now I'm trying to initiate a VoIP call from my application. I use RTC API for this (rtcdll.dll etc.). I've got headers from the RTC Client API v.1.3 SDK for desktop.
Here are the examples I follow: http://msdn.microsoft.com/en-us/library/ms775274(VS.85).aspx
Everything compiles and runs ok, the objects get created, I even receive RTC events through IRTCEventNotification.
But when I try to enable and register my profile (exactly the same to which I provisioned and it worked), I receive RTCRS_ERROR state with the status 0x800703EB (ERROR_CAN_NOT_COMPLETE).
Code:
ThrowIfFailed(::CoCreateInstance(CLSID_RTCClient, NULL, CLSCTX_INPROC_SERVER, IID_IRTCClient, OUT (LPVOID*)(&client_))) ;
ThrowIfFailed(client_->Initialize()) ;
ThrowIfFailed(client_->QueryInterface(IID_IRTCClientProvisioning, OUT (LPVOID*) &prov_)) ;
ThrowIfFailed(client_->put_EventFilter(RTCRF_REGISTER_ALL)) ;
{
CComPtr<IConnectionPointContainer> connPtCont ;
ThrowIfFailed(client_->QueryInterface(IID_IConnectionPointContainer, OUT (void**)&connPtCont)) ;
ThrowIfFailed(connPtCont->FindConnectionPoint(IID_IRTCEventNotification, OUT &connPt_)) ;
CComPtr<IUnknown> myUnknown ;
ThrowIfFailed(QueryInterface(IID_IUnknown, OUT (void**)&myUnknown)) ;
ThrowIfFailed(connPt_->Advise(myUnknown, OUT &handlerConnectionCookie_)) ;
}
static const PCTSTR KProfileXml =
L"<provision key='1232ab01' name='SIPNET'>"
L" <provider name='SIPNET' />"
L" <user account='sim123456' password='s1i2m3'"
L" uri='sip:[email protected]'"
L" allowedauth='digest'/>"
L" <sipsrv addr='sipnet.ru:5060' protocol='UDP' role='proxy'>"
L" <session party='first' type='pc2pc' />"
L" <session party='first' type='pc2ph' />"
L" </sipsrv>"
L" <sipsrv addr='sipnet.ru:5060' protocol='UDP' role='registrar'/>"
L"</provision>"
;
CComBSTR profileXmlBstr(KProfileXml) ;
ThrowIfFailed(prov_->CreateProfile(profileXmlBstr, OUT &profile_)) ;
ThrowIfFailed(prov_->EnableProfile(profile_, RTCRF_REGISTER_ALL)) ;
I tried to pass 0 to EnableProfile() (to avoid registration) and then make a call.
I call CreateSession() and then AddParticipant(), then I receive RTCSS_INPROGRESS with status 0 and then RTCSS_DISCONNECTED with status 0x800703EB (ERROR_CAN_NOT_COMPLETE).
Code:
ThrowIfFailed(client_->CreateSession(RTCST_PC_TO_PHONE, 0, profile_, RTCCS_FORCE_PROFILE, OUT &session_)) ;
CComBSTR other(L"sip:[email protected]") ;
CComPtr<IRTCParticipant> participant ;
ThrowIfFailed(session_->AddParticipant(other, 0, OUT &participant)) ;
Please, anyone, if you've tried this at home, tell me what am I doing wrong?
The device is in flight mode, connected via ActiveSync USB, internet is accessible.
Here is the event handling code:
Code:
HRESULT CRtcDialog::Event( RTC_EVENT RTCEvent, IDispatch *pEvent )
{
PRINTF1(_CRtcDialog, "RTCEvent = %d", RTCEvent) ;
if (RTCEvent == RTCE_REGISTRATION_STATE_CHANGE)
return HandleRegistrationStateChange(pEvent) ;
if (RTCEvent == RTCE_SESSION_STATE_CHANGE)
return HandleSessionStateChange(pEvent) ;
return S_OK ;
}
HRESULT CRtcDialog::HandleRegistrationStateChange(IDispatch *pIDispatch)
{
ThrowIfNull(pIDispatch) ;
CComPtr<IRTCRegistrationStateChangeEvent> regChangeEvent ;
ThrowIfFailed(pIDispatch->QueryInterface(IID_IRTCRegistrationStateChangeEvent, OUT (void**)&regChangeEvent)) ;
HRESULT hr ;
RTC_REGISTRATION_STATE regState ;
hr = regChangeEvent->get_State(OUT &regState) ;
CComBSTR statusText ;
hr = regChangeEvent->get_StatusText(OUT &statusText) ;
long statusCode = 0 ;
hr = regChangeEvent->get_StatusCode(OUT &statusCode) ;
PRINTF3(_CRtcDialog, "regState = %d (0x%08X: %s)", regState, statusCode, statusText) ;
return S_OK ;
}
Thanks in advance.

Categories

Resources