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.

97 lines
2.1 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. COMTRANS.H
  5. Abstract:
  6. Declares the COM based transport class.
  7. History:
  8. a-davj 04-Mar-97 Created.
  9. --*/
  10. #ifndef _DCOMTran_H_
  11. #define _DCOMTran_H_
  12. typedef void ** PPVOID;
  13. //***************************************************************************
  14. //
  15. // CLASS NAME:
  16. //
  17. // CDCOMTran
  18. //
  19. // DESCRIPTION:
  20. //
  21. // Implements the DCOM version of CCOMTrans class.
  22. //
  23. //***************************************************************************
  24. class CDCOMTrans : IUnknown
  25. {
  26. protected:
  27. long m_cRef; //Object reference count
  28. IWbemLevel1Login * m_pLevel1;
  29. BOOL m_bInitialized;
  30. public:
  31. CDCOMTrans();
  32. ~CDCOMTrans();
  33. SCODE DoCCI (
  34. IN COSERVERINFO *psi ,
  35. IN BOOL a_Local,
  36. long lFlags);
  37. SCODE DoActualCCI (
  38. IN COSERVERINFO *psi ,
  39. IN BOOL a_Local,
  40. long lFlags);
  41. SCODE DoConnection(
  42. BSTR NetworkResource,
  43. BSTR User,
  44. BSTR Password,
  45. BSTR Locale,
  46. long lSecurityFlags,
  47. BSTR Authority,
  48. IWbemContext *pCtx,
  49. IWbemServices **pInterface);
  50. SCODE DoActualConnection(
  51. BSTR NetworkResource,
  52. BSTR User,
  53. BSTR Password,
  54. BSTR Locale,
  55. long lSecurityFlags,
  56. BSTR Authority,
  57. IWbemContext *pCtx,
  58. IWbemServices **pInterface);
  59. //Non-delegating object IUnknown
  60. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  61. STDMETHODIMP_(ULONG) AddRef(void)
  62. {
  63. InterlockedIncrement(&m_cRef);
  64. return m_cRef;
  65. }
  66. STDMETHODIMP_(ULONG) Release(void)
  67. {
  68. long lTemp = InterlockedDecrement(&m_cRef);
  69. if (0!= lTemp)
  70. return lTemp;
  71. delete this;
  72. return 0;
  73. }
  74. };
  75. #endif