WSABTableView.cpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #include <kopano/platform.h>
  18. #include <mutex>
  19. #include "kcore.hpp"
  20. #include <kopano/kcodes.h>
  21. #include <mapi.h>
  22. #include <mapispi.h>
  23. #include "WSABTableView.h"
  24. #include "Mem.h"
  25. #include <kopano/ECGuid.h>
  26. // Utils
  27. #include "SOAPUtils.h"
  28. #include "WSUtil.h"
  29. WSABTableView::WSABTableView(ULONG ulType, ULONG ulFlags, KCmd *lpCmd,
  30. std::recursive_mutex &lpDataLock, ECSESSIONID ecSessionId, ULONG cbEntryId,
  31. LPENTRYID lpEntryId, ECABLogon* lpABLogon, WSTransport *lpTransport) :
  32. WSTableView(ulType, ulFlags, lpCmd, lpDataLock, ecSessionId, cbEntryId,
  33. lpEntryId, lpTransport, "WSABTableView")
  34. {
  35. m_lpProvider = lpABLogon;
  36. m_ulTableType = TABLETYPE_AB;
  37. }
  38. HRESULT WSABTableView::Create(ULONG ulType, ULONG ulFlags, KCmd *lpCmd,
  39. std::recursive_mutex &lpDataLock, ECSESSIONID ecSessionId, ULONG cbEntryId,
  40. LPENTRYID lpEntryId, ECABLogon* lpABLogon, WSTransport *lpTransport,
  41. WSTableView **lppTableView)
  42. {
  43. HRESULT hr = hrSuccess;
  44. WSABTableView *lpTableView = NULL;
  45. lpTableView = new WSABTableView(ulType, ulFlags, lpCmd, lpDataLock, ecSessionId, cbEntryId, lpEntryId, lpABLogon, lpTransport);
  46. hr = lpTableView->QueryInterface(IID_ECTableView, (void **) lppTableView);
  47. if(hr != hrSuccess)
  48. delete lpTableView;
  49. return hr;
  50. }
  51. HRESULT WSABTableView::QueryInterface(REFIID refiid, void **lppInterface)
  52. {
  53. REGISTER_INTERFACE3(ECTableView, WSTableView, this);
  54. return MAPI_E_INTERFACE_NOT_SUPPORTED;
  55. }