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.

101 lines
2.4 KiB

  1. //
  2. // funcprv.cpp
  3. //
  4. #include "private.h"
  5. #include "globals.h"
  6. #include "funcprv.h"
  7. #include "fnrecon.h"
  8. #include "helpers.h"
  9. #include "immxutil.h"
  10. #include "ic.h"
  11. DBG_ID_INSTANCE(CFunctionProvider);
  12. //////////////////////////////////////////////////////////////////////////////
  13. //
  14. // CFunctionProvider
  15. //
  16. //////////////////////////////////////////////////////////////////////////////
  17. //+---------------------------------------------------------------------------
  18. //
  19. // ctor
  20. //
  21. //----------------------------------------------------------------------------
  22. CFunctionProvider::CFunctionProvider()
  23. {
  24. Dbg_MemSetThisNameID(TEXT("CFunctionProvider"));
  25. _cRef = 1;
  26. }
  27. //+---------------------------------------------------------------------------
  28. //
  29. // dtor
  30. //
  31. //----------------------------------------------------------------------------
  32. CFunctionProvider::~CFunctionProvider()
  33. {
  34. }
  35. //+---------------------------------------------------------------------------
  36. //
  37. // GetType
  38. //
  39. //----------------------------------------------------------------------------
  40. STDAPI CFunctionProvider::GetType(GUID *pguid)
  41. {
  42. *pguid = GUID_SYSTEM_FUNCTIONPROVIDER;
  43. return S_OK;
  44. }
  45. //+---------------------------------------------------------------------------
  46. //
  47. // GetDescription
  48. //
  49. //----------------------------------------------------------------------------
  50. STDAPI CFunctionProvider::GetDescription(BSTR *pbstrDesc)
  51. {
  52. *pbstrDesc = SysAllocString(L"System Function Provider");
  53. return *pbstrDesc != NULL ? S_OK : E_OUTOFMEMORY;
  54. }
  55. //+---------------------------------------------------------------------------
  56. //
  57. // GetFunction
  58. //
  59. //----------------------------------------------------------------------------
  60. STDAPI CFunctionProvider::GetFunction(REFGUID rguid, REFIID riid, IUnknown **ppunk)
  61. {
  62. if (!ppunk)
  63. return E_INVALIDARG;
  64. *ppunk = NULL;
  65. if (!IsEqualIID(rguid, GUID_NULL))
  66. return E_UNEXPECTED;
  67. if (IsEqualIID(riid, IID_ITfFnReconversion))
  68. {
  69. CFnReconversion *pReconv = new CFnReconversion(this);
  70. pReconv->QueryInterface(IID_IUnknown, (void **)ppunk);
  71. pReconv->Release();
  72. }
  73. else if (IsEqualIID(riid, IID_ITfFnAbort))
  74. {
  75. *ppunk = new CFnAbort(this);
  76. }
  77. if (*ppunk)
  78. return S_OK;
  79. return E_NOINTERFACE;
  80. }