Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 2001, Microsoft Corporation
  3. Module Name:
  4. reconvps.cpp
  5. Abstract:
  6. This file implements the CReconvertPropStore Class.
  7. Author:
  8. Revision History:
  9. Notes:
  10. --*/
  11. #include "private.h"
  12. #include "reconvps.h"
  13. //+---------------------------------------------------------------------------
  14. //
  15. // CReconvertPropStore::IUnknown::QueryInterface
  16. // CReconvertPropStore::IUnknown::AddRef
  17. // CReconvertPropStore::IUnknown::Release
  18. //
  19. //----------------------------------------------------------------------------
  20. HRESULT
  21. CReconvertPropStore::QueryInterface(
  22. REFIID riid,
  23. void** ppvObj)
  24. {
  25. *ppvObj = NULL;
  26. if (IsEqualIID(riid, IID_ITfPropertyStore))
  27. {
  28. *ppvObj = static_cast<ITfPropertyStore*>(this);
  29. }
  30. else if (IsEqualGUID(riid, IID_IUnknown))
  31. {
  32. *ppvObj = this;
  33. }
  34. if (*ppvObj) {
  35. AddRef();
  36. return S_OK;
  37. }
  38. return E_NOINTERFACE;
  39. }
  40. ULONG
  41. CReconvertPropStore::AddRef(
  42. )
  43. {
  44. return InterlockedIncrement(&m_ref);
  45. }
  46. ULONG
  47. CReconvertPropStore::Release(
  48. )
  49. {
  50. ULONG cr = InterlockedDecrement(&m_ref);
  51. if (cr == 0) {
  52. delete this;
  53. }
  54. return cr;
  55. }
  56. //+---------------------------------------------------------------------------
  57. //
  58. // CReconvertPropStore::ITfPropertyStore::GetType
  59. //
  60. //----------------------------------------------------------------------------
  61. HRESULT
  62. CReconvertPropStore::GetType(GUID *pguid)
  63. {
  64. *pguid = m_guid;
  65. return S_OK;
  66. }
  67. //+---------------------------------------------------------------------------
  68. //
  69. // CReconvertPropStore::ITfPropertyStore::GetDataType
  70. //
  71. //----------------------------------------------------------------------------
  72. HRESULT
  73. CReconvertPropStore::GetDataType(DWORD *pdwReserved)
  74. {
  75. if (pdwReserved == NULL)
  76. return E_INVALIDARG;
  77. *pdwReserved = 0;
  78. return S_OK;
  79. }
  80. //+---------------------------------------------------------------------------
  81. //
  82. // CReconvertPropStore::ITfPropertyStore::GetData
  83. //
  84. //----------------------------------------------------------------------------
  85. HRESULT
  86. CReconvertPropStore::GetData(VARIANT *pvarValue)
  87. {
  88. if (pvarValue == NULL)
  89. return E_INVALIDARG;
  90. *pvarValue = m_var;
  91. return S_OK;
  92. }