Wednesday, November 16, 2005

MAPISpy updated

Hi, See for updated MAPISpy utility. Hook engine stability improved. Improved Outlook 2003 compatibility. Added IStream logging. Added IMDCvt_iCal interface hooking (via CoCreateInstance function). IMDCvt_iCal is interface to convert Outlook Appointment to iCal format. It is located in MIMEDIR.DLL. Started making GUI configuration tool. Update 17.11.2005 Release version of hooksrv.exe included enabled debug logging in release version of hooktool.dll

Updated MSLMS sample (Unicode build)

Hi, I've updated MSLMS sample. Most changes are Outlook XP related. Now Unicode build seems to work under Outlook XP. I haven't tested that thoroughly just created service, configured it and created some test messages. Previous post updated too. Download updated project

Friday, September 23, 2005

MSLMS Unicode

Recently i've tried to discover why MSLMS sample does not work when built as unicode. Anyway I know that only Outlook 2003 has full support of UNICODE but after adding service to the profile client can't open store. Call to IMAPISession::OpenMsgStore always fails returning MAPI_E_NOT_FOUND. I started digging. Checked every line of configuration code. Everything seemed to be fine. After I'd read thoroughly the error message Outlook gave me after trying to open store I noticed that message service name was truncated to only symbol 'M'. So I decided that somewhere UNICODE string was being passed instead of ANSI. Rechecking code I found that call to WrapStoreEntryID was being passed UNICODE string while flags report that string is ANSI. After fixing that and readding store to the profile solved the problem. So it seems that MAPI uses somehow dll name that passed to WrapStoreEntryID. That dll name present inside wrapped EntryID. Testing UNICODE build i've dicovered another memory corruption bug and fixed it. Anyway there are still problems with file database. In particular when store works as default store. There are several instances of provider are loaded and several threads use these instances. And sometimes cached binary tree nodes are being freed while some streams are still opened and have references to freed nodes. When streams are being released memory corruption occurs. I've uploaded the whole updated MSLMS sample to rapidshare. I haven't tested this build with Outlook XP. Since Outlook XP not fully supports UNICODE there still some places to be fixed. All places where format of passes or requested strings is determined via passes flags. F.e. IMAPIProp::GetLastError and IMsgStore::GetReceiveFolder. 16.11.2005 Changes: Fixed some store configuration issues for unicode build (Outlook XP and Outlook 2003) Fixed bug in store file storage (small memory corruption)

Wednesday, September 14, 2005

Outlooks Internal iCal <=> MAPI convertor

Just working on investigation on this convertor.
Added initial spying of this convertion to MAPISpy.
Also fixed some issues with named properties.
Started creating GUI interface for Settings of MAPISpy.

So in some time this should be available.

Also i'm going to create another article about chaining FreeBusy providers and using them by clients (including build-in providers for Exchange and Internet FreeBusy(SMTP)).

Thursday, July 21, 2005

MAPI Spy

That small utility i've written while developing own store provider. That is utility is written to investigate Outlook behaviour with MAPI subsystem. It does not have some GUI interface so far but we have what we have. I think some useful log files can do some good :) It's not so stable as I want but it is usable. I noticed that it is rather stable if you run investigated process under VC6 debugger. How to use

  1. Copy content of archive to c:\hook
  2. Copy hookstub.dll to %SYSTEM32% directory or to any directory in %PATH%.
  3. Edit HookTool.ini [Scope] Hook= sets processes names (without .exe extension) to be hooked [MAPI] Functions= determines functions of MAPI subsystem to be hooked. There is some set of functions already but commented out. Each function has it's description in it's own section
  4. Run HookSrv.exe.
  5. Start investigated process.
  6. Look C:\ for log files.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

IMPORTANT

To use this tool under VS.NET Debugger you need to set variable

in HookTool.ini

[Trace]

;...

CreateRemoteThread = No

;...

Without this setting started process will hang

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

There is the possibility to spy MAPI providers without hooktool engine. See the following how to spy without hooktool. Sample uses Exchange provider to demonstrate how to do that. Copy mapispy32.dll and hooktool.ini to the C:\Program Files\Common Files\System\Mapi\1033\. It is for Outlook XP english default installation. Other versions of Outlook can use slightly differ path. Modify mapisvc.ini in this directory: change section [EMS_MDB_private] like this [EMS_MDB_private] 3dfd001e=EMSMDB32.DLL ;PR_PROVIDER_DLL_NAME=EMSMDB.DLL PR_PROVIDER_DLL_NAME=MAPISpy.DLL PR_SERVICE_INSTALL_ID={6485D26A-C2AC-11D1-AD3E-10A0C911C9C0}

PR_RESOURCE_TYPE=MAPI_STORE_PROVIDER PR_RESOURCE_FLAGS=STATUS_PRIMARY_IDENTITYSTATUS_DEFAULT_STORESTATUS_PRIMARY_STORE 66090003=0C000000 660A0003=01000000 34140102=5494A1C0297F101BA58708002B2A2517 PR_DISPLAY_NAME=Private Folders PR_PROVIDER_DISPLAY=Microsoft Exchange Message Store To make it work you need to create new profile because this information is populated while adding provider to the profile. Previously created profiles won't be hooked. After that you can revert changes and you will have only hooked profile. :) That way you can spy only providers and not only Outlook working with these providers. But client spying is impossible. Any way that should do the trick for you.

Download Last Updated 08.08.2008