none
Log entries when address book is loaded. RRS feed

  • Question

  • I am getting these log entries when the address book loads :

    0x3f34 12:14:22.243AM  04-04-2016 AutoLoadMAPI - loading MAPI exports
    0x3f34 12:14:22.244AM  04-04-2016 LoadMAPIFuncs - loading from 0x55FC0000
    0x3f34 12:14:22.244AM  04-04-2016 Failed to load "MNLS_lstrlenW" from 0x55FC0000

    Is there any way to fix that?


    Regards, (Mr) Kim Groves

    Friday, April 15, 2016 9:25 AM

Answers

  • Hi Justin,

    I appreciate your feedback on this issue.

    I think I have found a resolution.

    This error may depend on which version of Outlook or MAPI is installed.

    My confusion has been due to believing that I was not calling this exported function in my project, 
    so why where there so many log entries saying that this function was missing?

    The answer is that I was calling this function but there was a #define statement involved so I didn't pick that up right away.
    ie
      #define lstrlenW MNLS_lstrlenW
      ..
      // from abdb.cpp
      ulLen = lstrlenW(pspvSrc->Value.lpszW) + 1;
      
    Now I was able to properly debug the project and step through the code. 
    This explained why I was getting unusual characters in the Address Book window of Outlook.
    If MNLS_lstrlenW is not connected to the MAPI library, it will return 0 by default. 
    This then allowed the rest of the code to load garbled data into the string in the Address Book window.
     
    So I definitely need that function to work, but how to find out the correct function in the DLL?
    I remembered that I can look that up for myself using Dependency Walker.

    Here is the function in the project source code where I found the issue of the unknown function :

    // Copied from Wrapped PST Sample Project https://ol2010mapisamples.codeplex.com/releases 
    void LoadMAPIFuncs(HMODULE hMod)
    {
    Log(true,_T("LoadMAPIFuncs - loading from 0x%08X\n"),hMod);
    if (!hMod) return;

    GETPROC(pfnLaunchWizard, LPLAUNCHWIZARDENTRY, LAUNCHWIZARDENTRYNAME)
    GETPROC(pfnMAPIAllocateBuffer, LPMAPIALLOCATEBUFFER, "MAPIAllocateBuffer")
    GETPROC(pfnMAPIAllocateMore, LPMAPIALLOCATEMORE, "MAPIAllocateMore")
    GETPROC(pfnMAPIFreeBuffer, LPMAPIFREEBUFFER, "MAPIFreeBuffer")
    GETPROC(pfnHrGetOneProp, LPHRGETONEPROP, "HrGetOneProp@12")
    GETPROC(pfnHrGetOneProp, LPHRGETONEPROP, "HrGetOneProp")
    GETPROC(pfnMAPIInitialize, LPMAPIINITIALIZE, "MAPIInitialize")
    GETPROC(pfnMAPIUninitialize, LPMAPIUNINITIALIZE, "MAPIUninitialize")
    GETPROC(pfnLPFreeProws, LPFREEPROWS, "FreeProws@4")
    GETPROC(pfnLPFreeProws, LPFREEPROWS, "FreeProws")
    GETPROC(pfnPpropFindProp, LPPPROPFINDPROP, "PpropFindProp@12")
    GETPROC(pfnPpropFindProp, LPPPROPFINDPROP, "PpropFindProp")
    GETPROC(pfnScDupPropset, LPSCDUPPROPSET, "ScDupPropset@16")
    GETPROC(pfnScDupPropset, LPSCDUPPROPSET, "ScDupPropset")
    GETPROC(pfnScCountProps, LPSCCOUNTPROPS, "ScCountProps@12")
    GETPROC(pfnScCountProps, LPSCCOUNTPROPS, "ScCountProps")
    GETPROC(pfnScCopyProps, LPSCCOPYPROPS, "ScCopyProps@16")
    GETPROC(pfnScCopyProps, LPSCCOPYPROPS, "ScCopyProps")
    GETPROC(pfnOpenIMsgOnIStg, LPOPENIMSGONISTG, "OpenIMsgOnIStg@44")
    GETPROC(pfnOpenIMsgOnIStg, LPOPENIMSGONISTG, "OpenIMsgOnIStg")
    GETPROC(pfnMAPIGetDefaultMalloc, LPMAPIGETDEFAULTMALLOC, "MAPIGetDefaultMalloc@0")
    GETPROC(pfnMAPIGetDefaultMalloc, LPMAPIGETDEFAULTMALLOC, "MAPIGetDefaultMalloc")
    GETPROC(pfnOpenTnefStreamEx, LPOPENTNEFSTREAMEX, "OpenTnefStreamEx")
    GETPROC(pfnOpenStreamOnFile, LPOPENSTREAMONFILE, "OpenStreamOnFile")
    GETPROC(pfnCloseIMsgSession, LPCLOSEIMSGSESSION, "CloseIMsgSession@4")
    GETPROC(pfnCloseIMsgSession, LPCLOSEIMSGSESSION, "CloseIMsgSession")
    GETPROC(pfnOpenIMsgSession, LPOPENIMSGSESSION, "OpenIMsgSession@12")
    GETPROC(pfnOpenIMsgSession, LPOPENIMSGSESSION, "OpenIMsgSession")
    GETPROC(pfnHrQueryAllRows, LPHRQUERYALLROWS, "HrQueryAllRows@24")
    GETPROC(pfnHrQueryAllRows, LPHRQUERYALLROWS, "HrQueryAllRows")
    GETPROC(pfnMAPIOpenFormMgr, LPMAPIOPENFORMMGR, "MAPIOpenFormMgr")
    GETPROC(pfnRTFSync, LPRTFSYNC, "RTFSync")
    GETPROC(pfnHrSetOneProp, LPHRSETONEPROP, "HrSetOneProp@8")
    GETPROC(pfnHrSetOneProp, LPHRSETONEPROP, "HrSetOneProp")
    GETPROC(pfnFreePadrlist, LPFREEPADRLIST, "FreePadrlist@4")
    GETPROC(pfnFreePadrlist, LPFREEPADRLIST, "FreePadrlist")
    GETPROC(pfnPropCopyMore, LPPROPCOPYMORE, "PropCopyMore@16")
    GETPROC(pfnPropCopyMore, LPPROPCOPYMORE, "PropCopyMore")
    GETPROC(pfnWrapCompressedRTFStream, LPWRAPCOMPRESSEDRTFSTREAM, "WrapCompressedRTFStream")
    GETPROC(pfnWrapStoreEntryID, LPWRAPSTOREENTRYID, "WrapStoreEntryID@24")
    GETPROC(pfnWrapStoreEntryID, LPWRAPSTOREENTRYID, "WrapStoreEntryID")
    GETPROC(pfnCreateIProp, LPCREATEIPROP, "CreateIProp@24")
    GETPROC(pfnCreateIProp, LPCREATEIPROP, "CreateIProp")
    GETPROC(pfnCreateTable, LPCREATETABLE, "CreateTable@36")
    GETPROC(pfnCreateTable, LPCREATETABLE, "CreateTable")
    GETPROC(pfnHrValidateParameters, LPHRVALIDATEPARAMETERS, "HrValidateParameters@8")
    GETPROC(pfnHrValidateParameters, LPHRVALIDATEPARAMETERS, "HrValidateParameters")
    GETPROC(pfnBuildDisplayTable, LPBUILDDISPLAYTABLE, "BuildDisplayTable@40")
    GETPROC(pfnBuildDisplayTable, LPBUILDDISPLAYTABLE, "BuildDisplayTable")
    GETPROC(pfnMNLS_lstrlenW, LPMNLS_LSTRLENW, "MNLS_lstrlenW")
    GETPROC(pfnMAPILogonEx, LPMAPILOGONEX, "MAPILogonEx")
    GETPROC(pfnMAPIAdminProfiles, LPMAPIADMINPROFILES, "MAPIAdminProfiles")
    GETPROC(pfnHrValidateIPMSubtree, LPHRVALIDATEIPMSUBTREE, "HrValidateIPMSubtree@20")
    GETPROC(pfnHrValidateIPMSubtree, LPHRVALIDATEIPMSUBTREE, "HrValidateIPMSubtree")
    GETPROC(pfnMAPIOpenLocalFormContainer, LPMAPIOPENLOCALFORMCONTAINER,"MAPIOpenLocalFormContainer")
    GETPROC(pfnHrDispatchNotifications, LPHRDISPATCHNOTIFICATIONS, "HrDispatchNotifications@4")
    GETPROC(pfnHrDispatchNotifications, LPHRDISPATCHNOTIFICATIONS, "HrDispatchNotifications")
    }

    When I loaded MAPI32.DLL in Dependency Walker, I saw all of these functions are in the DLL.
    So why is there an issue with MNLS_lstrlenW?
    I kept looking and realised that some functions are there more than once with different signatures.
    The source code allows for this by listing these functions multiple times, with the
    preferred signature first, followed by a fallback (if any).
    If the first signature is found, the function pointer is assigned and any more calls
    to GETPROC return without updating the pointer.

    In my case, actually there was no signature for "MNLS_lstrlenW", only "MNLS_lstrlenW@4".

    So I updated the code like so :

      // existing code..
    GETPROC(pfnBuildDisplayTable, LPBUILDDISPLAYTABLE, "BuildDisplayTable")
    // new code - function signature found using Dependency Walker !
    GETPROC(pfnMNLS_lstrlenW, LPMNLS_LSTRLENW, "MNLS_lstrlenW@4")
    // existing code..
    GETPROC(pfnMNLS_lstrlenW, LPMNLS_LSTRLENW, "MNLS_lstrlenW")

    Now I don't get the log entries about MNLS_lstrlenW being missing.
    I stepped through the project and confirmed that the code block in abdp.cpp will now
    get the length of the string and the rest of the logic is correct.
    The address book entries now load into the Address Book window in Outlook.

    Thanks again for your time.

    Please let me know if you find out any other changes that I should make to the project.


    Regards, (Mr) Kim Groves

    • Marked as answer by digicate Friday, April 22, 2016 12:53 PM
    Friday, April 22, 2016 12:53 PM

All replies

  • The Log entries are coming from code copied from the Wrapped PST Sample downloaded from here :

    http://ol2010mapisamples.codeplex.com/

    Do I need this function if I don't call it from my code?


    Regards, (Mr) Kim Groves

    Friday, April 15, 2016 9:26 AM
  • >>>Do I need this function if I don't call it from my code?

    Sorry, I am not so clear about your issue, could you provide more information about it, that will help us reproduce and resolve it.

    In addition you could post your question with discussions to seek help through you provided link.

    Thanks for your understanding.
    Tuesday, April 19, 2016 9:17 AM
  • Hi Justin,

    (I had put more detail in my first post but the page did not save my typing.)

    What I need to know is how to stop this error message "Failed to load "MNLS_lstrlenW" from 0x55FC0000"

    This happens in the startup of the Address Book Provider.

    If I comment out references to the function MNLS_lstrlenW then the Address Book Provider will cause Outlook to crash when I try to open the Address Book in the Outlook Application.

    When I leave the references uncommented, the Outlook Application takes about 5-10 seconds longer to load (because the code which tries to access this function runs about 18,000 times during the Application Startup process (according to the log entries)).

    So if there is a typo in the function name or something I would like to fix that.

    Maybe there is a problem with my project settings.

    I notice that the function has W at the end, which indicates it is used to process Wide strings. My project is setup for UNICODE strings, is that correct?

    The code that generates these logs is in the ImportProcs.cpp file. The code is loading access to these functions from the MAPI Stub as far as I understand.  I have added this code to my project so that I can correctly load the provider into the MAPISVC.INF file. The location of this file moved between Outlook 2010 and Outlook 2013 and I read that the best thing is to use MAPI to determine where the file is loaded from as this will be compatible moving forward to future version.

    I have also tried posting to the Issues discussion on the Wrapped PST project website.

    Thanks

    Kim Groves


    Regards, (Mr) Kim Groves

    Thursday, April 21, 2016 7:23 AM
  • Hi, digicate

    Thanks very much for providing details about this issue. 
    Since this issue is so complex, I will still keep troubleshooting it and also involve some senior engineers to look into it, but it will take some time.

    Thanks for your understanding.
    Friday, April 22, 2016 7:10 AM
  • Hi Justin,

    I appreciate your feedback on this issue.

    I think I have found a resolution.

    This error may depend on which version of Outlook or MAPI is installed.

    My confusion has been due to believing that I was not calling this exported function in my project, 
    so why where there so many log entries saying that this function was missing?

    The answer is that I was calling this function but there was a #define statement involved so I didn't pick that up right away.
    ie
      #define lstrlenW MNLS_lstrlenW
      ..
      // from abdb.cpp
      ulLen = lstrlenW(pspvSrc->Value.lpszW) + 1;
      
    Now I was able to properly debug the project and step through the code. 
    This explained why I was getting unusual characters in the Address Book window of Outlook.
    If MNLS_lstrlenW is not connected to the MAPI library, it will return 0 by default. 
    This then allowed the rest of the code to load garbled data into the string in the Address Book window.
     
    So I definitely need that function to work, but how to find out the correct function in the DLL?
    I remembered that I can look that up for myself using Dependency Walker.

    Here is the function in the project source code where I found the issue of the unknown function :

    // Copied from Wrapped PST Sample Project https://ol2010mapisamples.codeplex.com/releases 
    void LoadMAPIFuncs(HMODULE hMod)
    {
    Log(true,_T("LoadMAPIFuncs - loading from 0x%08X\n"),hMod);
    if (!hMod) return;

    GETPROC(pfnLaunchWizard, LPLAUNCHWIZARDENTRY, LAUNCHWIZARDENTRYNAME)
    GETPROC(pfnMAPIAllocateBuffer, LPMAPIALLOCATEBUFFER, "MAPIAllocateBuffer")
    GETPROC(pfnMAPIAllocateMore, LPMAPIALLOCATEMORE, "MAPIAllocateMore")
    GETPROC(pfnMAPIFreeBuffer, LPMAPIFREEBUFFER, "MAPIFreeBuffer")
    GETPROC(pfnHrGetOneProp, LPHRGETONEPROP, "HrGetOneProp@12")
    GETPROC(pfnHrGetOneProp, LPHRGETONEPROP, "HrGetOneProp")
    GETPROC(pfnMAPIInitialize, LPMAPIINITIALIZE, "MAPIInitialize")
    GETPROC(pfnMAPIUninitialize, LPMAPIUNINITIALIZE, "MAPIUninitialize")
    GETPROC(pfnLPFreeProws, LPFREEPROWS, "FreeProws@4")
    GETPROC(pfnLPFreeProws, LPFREEPROWS, "FreeProws")
    GETPROC(pfnPpropFindProp, LPPPROPFINDPROP, "PpropFindProp@12")
    GETPROC(pfnPpropFindProp, LPPPROPFINDPROP, "PpropFindProp")
    GETPROC(pfnScDupPropset, LPSCDUPPROPSET, "ScDupPropset@16")
    GETPROC(pfnScDupPropset, LPSCDUPPROPSET, "ScDupPropset")
    GETPROC(pfnScCountProps, LPSCCOUNTPROPS, "ScCountProps@12")
    GETPROC(pfnScCountProps, LPSCCOUNTPROPS, "ScCountProps")
    GETPROC(pfnScCopyProps, LPSCCOPYPROPS, "ScCopyProps@16")
    GETPROC(pfnScCopyProps, LPSCCOPYPROPS, "ScCopyProps")
    GETPROC(pfnOpenIMsgOnIStg, LPOPENIMSGONISTG, "OpenIMsgOnIStg@44")
    GETPROC(pfnOpenIMsgOnIStg, LPOPENIMSGONISTG, "OpenIMsgOnIStg")
    GETPROC(pfnMAPIGetDefaultMalloc, LPMAPIGETDEFAULTMALLOC, "MAPIGetDefaultMalloc@0")
    GETPROC(pfnMAPIGetDefaultMalloc, LPMAPIGETDEFAULTMALLOC, "MAPIGetDefaultMalloc")
    GETPROC(pfnOpenTnefStreamEx, LPOPENTNEFSTREAMEX, "OpenTnefStreamEx")
    GETPROC(pfnOpenStreamOnFile, LPOPENSTREAMONFILE, "OpenStreamOnFile")
    GETPROC(pfnCloseIMsgSession, LPCLOSEIMSGSESSION, "CloseIMsgSession@4")
    GETPROC(pfnCloseIMsgSession, LPCLOSEIMSGSESSION, "CloseIMsgSession")
    GETPROC(pfnOpenIMsgSession, LPOPENIMSGSESSION, "OpenIMsgSession@12")
    GETPROC(pfnOpenIMsgSession, LPOPENIMSGSESSION, "OpenIMsgSession")
    GETPROC(pfnHrQueryAllRows, LPHRQUERYALLROWS, "HrQueryAllRows@24")
    GETPROC(pfnHrQueryAllRows, LPHRQUERYALLROWS, "HrQueryAllRows")
    GETPROC(pfnMAPIOpenFormMgr, LPMAPIOPENFORMMGR, "MAPIOpenFormMgr")
    GETPROC(pfnRTFSync, LPRTFSYNC, "RTFSync")
    GETPROC(pfnHrSetOneProp, LPHRSETONEPROP, "HrSetOneProp@8")
    GETPROC(pfnHrSetOneProp, LPHRSETONEPROP, "HrSetOneProp")
    GETPROC(pfnFreePadrlist, LPFREEPADRLIST, "FreePadrlist@4")
    GETPROC(pfnFreePadrlist, LPFREEPADRLIST, "FreePadrlist")
    GETPROC(pfnPropCopyMore, LPPROPCOPYMORE, "PropCopyMore@16")
    GETPROC(pfnPropCopyMore, LPPROPCOPYMORE, "PropCopyMore")
    GETPROC(pfnWrapCompressedRTFStream, LPWRAPCOMPRESSEDRTFSTREAM, "WrapCompressedRTFStream")
    GETPROC(pfnWrapStoreEntryID, LPWRAPSTOREENTRYID, "WrapStoreEntryID@24")
    GETPROC(pfnWrapStoreEntryID, LPWRAPSTOREENTRYID, "WrapStoreEntryID")
    GETPROC(pfnCreateIProp, LPCREATEIPROP, "CreateIProp@24")
    GETPROC(pfnCreateIProp, LPCREATEIPROP, "CreateIProp")
    GETPROC(pfnCreateTable, LPCREATETABLE, "CreateTable@36")
    GETPROC(pfnCreateTable, LPCREATETABLE, "CreateTable")
    GETPROC(pfnHrValidateParameters, LPHRVALIDATEPARAMETERS, "HrValidateParameters@8")
    GETPROC(pfnHrValidateParameters, LPHRVALIDATEPARAMETERS, "HrValidateParameters")
    GETPROC(pfnBuildDisplayTable, LPBUILDDISPLAYTABLE, "BuildDisplayTable@40")
    GETPROC(pfnBuildDisplayTable, LPBUILDDISPLAYTABLE, "BuildDisplayTable")
    GETPROC(pfnMNLS_lstrlenW, LPMNLS_LSTRLENW, "MNLS_lstrlenW")
    GETPROC(pfnMAPILogonEx, LPMAPILOGONEX, "MAPILogonEx")
    GETPROC(pfnMAPIAdminProfiles, LPMAPIADMINPROFILES, "MAPIAdminProfiles")
    GETPROC(pfnHrValidateIPMSubtree, LPHRVALIDATEIPMSUBTREE, "HrValidateIPMSubtree@20")
    GETPROC(pfnHrValidateIPMSubtree, LPHRVALIDATEIPMSUBTREE, "HrValidateIPMSubtree")
    GETPROC(pfnMAPIOpenLocalFormContainer, LPMAPIOPENLOCALFORMCONTAINER,"MAPIOpenLocalFormContainer")
    GETPROC(pfnHrDispatchNotifications, LPHRDISPATCHNOTIFICATIONS, "HrDispatchNotifications@4")
    GETPROC(pfnHrDispatchNotifications, LPHRDISPATCHNOTIFICATIONS, "HrDispatchNotifications")
    }

    When I loaded MAPI32.DLL in Dependency Walker, I saw all of these functions are in the DLL.
    So why is there an issue with MNLS_lstrlenW?
    I kept looking and realised that some functions are there more than once with different signatures.
    The source code allows for this by listing these functions multiple times, with the
    preferred signature first, followed by a fallback (if any).
    If the first signature is found, the function pointer is assigned and any more calls
    to GETPROC return without updating the pointer.

    In my case, actually there was no signature for "MNLS_lstrlenW", only "MNLS_lstrlenW@4".

    So I updated the code like so :

      // existing code..
    GETPROC(pfnBuildDisplayTable, LPBUILDDISPLAYTABLE, "BuildDisplayTable")
    // new code - function signature found using Dependency Walker !
    GETPROC(pfnMNLS_lstrlenW, LPMNLS_LSTRLENW, "MNLS_lstrlenW@4")
    // existing code..
    GETPROC(pfnMNLS_lstrlenW, LPMNLS_LSTRLENW, "MNLS_lstrlenW")

    Now I don't get the log entries about MNLS_lstrlenW being missing.
    I stepped through the project and confirmed that the code block in abdp.cpp will now
    get the length of the string and the rest of the logic is correct.
    The address book entries now load into the Address Book window in Outlook.

    Thanks again for your time.

    Please let me know if you find out any other changes that I should make to the project.


    Regards, (Mr) Kim Groves

    • Marked as answer by digicate Friday, April 22, 2016 12:53 PM
    Friday, April 22, 2016 12:53 PM
  • Hi, digicate

    Congratulation, I am glad to hear that you have resolved your issue. Thanks for your sharing your solution, that will help other community members when they have same issue.
    Tuesday, May 3, 2016 5:24 AM