WM6

The day I failed at googling

I've accidentally created one small piece of WTF! code yesterday, while hacking some c++ / windows mobile mail checker utility.

I wanted to synchronize mailbox in pocket outlook, but for some unknown reason I missed one simple and elegant solution...

Just compare:
tmail.exe -service "netvor.sk" -sync

with my original CEMAPI solution...

HRESULT hr;
HINSTANCE hMailTrns;
ICEMAPISession *pSession = NULL;
IMAPITable * pTable = NULL;
IMAPITable * pMsgStoresTable = NULL;
IMsgStore *pStore = NULL;
SRowSet *pSRowSet = NULL;
SPropValue *pPropValue = NULL;
ULONG lCount = -1;
SizedSPropTagArray(2, PropTagArray) = { 2, PR_DISPLAY_NAME, PR_EMAIL_ADDRESS };
IMailSyncHandler * pIMailSyncHandler = NULL;
CMailSyncCallBack MailSyncCallBack;
ONESTOPFACTORYFUNC pOneStopFactoryFunc = NULL;
SYNCCREDENTIALS sc;
MAILSYNCREQUEST msr;

hMailTrns = LoadLibrary(_T("MailTrns.dll"));
if (hMailTrns == NULL)
  return false;
}

pOneStopFactoryFunc = (ONESTOPFACTORYFUNC)GetProcAddress(hMailTrns, _T("OneStopFactory"));
if (pOneStopFactoryFunc == NULL)
  return false;
}
if (FAILED((*pOneStopFactoryFunc)(L"IMAP4", &pIMailSyncHandler))) {
  return false;
}

MAPIInitialize(NULL);
MAPILogonEx(0, NULL, NULL, 0, (LPMAPISESSION*)&pSession);
hr = pSession->GetMsgStoresTable(0, &pTable);

while (!FAILED(hr)) {
  if (FAILED(hr = pTable->QueryRows(1, 0, &pSRowSet)))
    break;
  if (pSRowSet->cRows != 1)
    break;

  pSession->OpenMsgStore(NULL,
                         pSRowSet->aRow[0].lpProps[0].Value.bin.cb,
                         (ENTRYID*)pSRowSet->aRow[0].lpProps[0].Value.bin.lpb,
                         NULL, 0, &pStore);
  if (SUCCEEDED(pStore->GetProps((SPropTagArray*)&PropTagArray, 0, &lCount, &pPropValue))) {
    if (wcscmp(sName,pPropValue[0].Value.lpszW) == 0) {
      // match
      if (FAILED(pIMailSyncHandler->Initialize(&MailSyncCallBack,
                          pPropValue[0].Value.lpszW,pStore))) {
        return false;
      }

      ZeroMemory(&sc, sizeof(SYNCCREDENTIALS));
      sc.cbSize = sizeof(SYNCCREDENTIALS);
      sc.pszUsername = _T("username");
      sc.pszPassword = _T("password");
      sc.pszDomain = _T("domain");

      if (FAILED(pIMailSyncHandler->Connect(0, &sc))) {
        return false;
      }

      ZeroMemory(&msr, sizeof(MAILSYNCREQUEST));
      msr.cbSize = sizeof(MAILSYNCREQUEST);
      msr.ffFlags = SYNC_NORMAL;
     
      if (FAILED(pIMailSyncHandler->Synchronize(&msr))) {
        return false;
      }

      pIMailSyncHandler->Disconnect(0);
      pIMailSyncHandler->ShutDown(0);
    }
    // cleanup
    MAPIFreeBuffer(pPropValue);
  }
  //cleanup
  FreeProws(pSRowSet);
}
 johnny's blog   Add new comment    
Tags:  c++   hacks   PDA   pissed   WM6   wtf

Ruby everywhere

\^^/ and productivity goes down...

Life without mobile data connection is painful, so I've googled out Ruby 1.8.6 for Windows Mobile just to have some fun on those offline/afk times ^^.

It's running great on my brick (HTC TyTN), but still one missing thing for perfection... vim ^_^

(google to get it running... or shortly: PocketConsole, PocketCMD and play!)

 johnny's blog   Add new comment    
Tags:  geek   life   PDA   ruby   WM6

Windows Mobile 6.0 and my SPV M3100

\^^/

I've just finished my daily plan for 2007-05-21, and updated my Orange SPV M3100 (HTC TyTN)

I can enjoy SIM-unlocked/CID-unlocked phone with some improvements and lots and lots of undocumented features (aka bugs).
For now it seems that despite the lost guarantee it was worth it! (I'll probably change my mind tomorrow morning... whatever :])



There were just a hell to much reason for upgrade, like:

  • all those small bugs in wm5 aku2.3 (ie. wildcard ssl certificates in mobileie)
  • orange.sk announced that there will be no official wm6 update for slovak users
  • SIM lock, as I am planning to use this device on my next term mobility stay in Innsbruck



This is the list of things I've done to my SPV M3100 from Slovak orange (ORANG006):

  1. replaced SPL with Hard-SPL-2.10.Olipro [link]
    (it already saved my butt from bricking my device today :])


  2. updated radio to 1.51.0.10 [link]
    You don't have to update your radio, but it's recommended if you're running some older version like i did (1.06.00.00). It seems it has improved my GSM signal and maybe other pros I'm going to mention one day.


  3. flashed my own re-cooked wm6 rom based on LVSW
    Basically, you could use some out-of-box solution with user sw and tweaks in place. It's faster and 'cheaper', but I like to do things on my own ;p.

    For cooked ROMS, google search: tnt2 wm6 or black wm6 or sleuth wm6 or ... i could continue but you're smart reader capable of doing some research on his own. (just look at xda-devs forum)




And thats all. just download archives few pages, click on all checkboxes and next buttons and you're done. :]

I've continued by modifying some themes to 'my look', tuning system and installing some useful sw (pocketputty) and OS hacks :].

Entire flashing process was pretty simple except fact that auto-detection of SPL version in CustormRUU (flashing utility) failed and I had to manually select 'new SPL (2.10)' and 'Hard SPL'.
(imo orange.sk/itsutils.dll execution problem)



That's all for now..

Sum up of all wm6 PROs and CONs gonna have to wait as I am still not decided if to love it or hate it!

 johnny's blog   Add new comment    
Tags:  geek   HOWTO   PDA   SPV M3100   WM6   \^^/

Syndicate content
Π