Error "800B0001" from the HrMAPIOpenFolderEx function (194435)



The information in this article applies to:

  • Microsoft Exchange Development Kit (EDK) 5.0
  • Microsoft Exchange Development Kit (EDK) 5.5
  • Microsoft Extended Messaging Application Programming Interface (MAPI)

This article was previously published under Q194435

SYMPTOMS

When you open a folder by using the HrMAPIOpenFolderEx function, you may receive the following error message:
800B0001- MAPI_E_PROVIDER_UNKNOWN

CAUSE

The cause of the error is an invalid folder path.

MORE INFORMATION

The following code demonstrates the problem. The first call to open a folder fails because the path of the folder is incorrect. The second call succeeds because the path has been corrected.

The following additional libraries are required to compile this code:
  • Msvcrt.lib
  • Edkguid.lib
  • Addrlkup.lib
  • Version.lib
  • Edkutils.lib
  • Edkdebug.lib
  • Edkmapi.lib
  • Mapi32.lib
  • Aclcls.lib

Sample code

   #include <edk.h>

    LPMAPISESSION         lpMapiSession = NULL;
    LPMDB                 lpPrivStore = NULL;
    LPMAPIFOLDER          lpFolder = NULL;
    LPMAPITABLE           lpContentTable = NULL;
    LPSRowSet             lpRows = NULL;
    ULONG                 rCount = 0, i = 0;
    HRESULT               hr;
    MAPIINIT_0            MapiInit;
    char                  lngName[100];

    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR pszCmd,
                       int nCmdShow)
    {
      MapiInit.ulVersion = 0;
      MapiInit.ulFlags = MAPI_NT_SERVICE;

      hr = MAPIInitialize( &MapiInit);
      if (!HR_SUCCEEDED(hr))
      {
        MessageBox(0L,"MAPIInitialize error","Error",MB_OK);
        return -1;
      }

      hr = MAPILogonEx( 0, (LPTSTR)NULL, (LPTSTR)"",
                        MAPI_NEW_SESSION | MAPI_EXTENDED | MAPI_LOGON_UI,
                        &lpMapiSession);
      if (!HR_SUCCEEDED(hr))
      {
        MessageBox(0L,"MAPILogonEx error","Error",MB_OK);
        return -1;
      }

      hr = HrOpenExchangePrivateStore( lpMapiSession, &lpPrivStore);
      if (!HR_SUCCEEDED(hr))
      {
        MessageBox(0L,"HrOpenExchangePrivateStore error","Error",MB_OK);
        return -1;
      }

      hr = HrMAPIOpenFolderEx(lpPrivStore,'\\',"\\Inbox",&lpFolder);
      if (!HR_SUCCEEDED(hr))
      {
        char szError[50];
        sprintf(szError, "HrMAPIOpenFolderEx error %x",hr);
        MessageBox(0L,szError,"Error",MB_OK);
      }

      hr = HrMAPIOpenFolderEx(lpPrivStore,'\\',
                        "Top of Information Store\\Inbox",&lpFolder);
      if (!HR_SUCCEEDED(hr))
      {
        MessageBox(0L,"HrMAPIOpenFolderEx error","Error",MB_OK);
        return -1;
      }
      else
        MessageBox(0L,"HrMAPIOpenFolderEx Successful","Error",MB_OK);

      if (lpMapiSession)
      {
        lpMapiSession->Logoff(0, 0, 0);
        ULRELEASE(lpMapiSession);
      }
      MAPIUninitialize();

      return 0 ;
    }
				

Modification Type:MinorLast Reviewed:1/13/2006
Keywords:kbprb KB194435