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.

105 lines
2.2 KiB

  1. //////////////////////////////////////////////////////////////////////
  2. // ActiveSocket.h : Declaration of CActiveSocket class which implements
  3. // our WMI class SCW_ActiveSocket
  4. // Copyright (c)1997-2001 Microsoft Corporation
  5. //
  6. // Original Create Date: 5/15/2001
  7. // Original Author: shawnwu
  8. //////////////////////////////////////////////////////////////////////
  9. #pragma once
  10. #include "globals.h"
  11. #include "IPSecBase.h"
  12. //#include "IPUtil.h"
  13. /*
  14. Class description
  15. Naming:
  16. CActiveSocket stands for Active Socket.
  17. Base class:
  18. CIPSecBase, because it is a class representing a WMI object - its WMI
  19. class name is SCW_ActiveSocket
  20. Purpose of class:
  21. (1) SCW_ActiveSocket provides helper information for active sockets.
  22. Design:
  23. (1) it implements IIPSecObjectImpl.
  24. Use:
  25. (1) We probably will never directly use this class. All its use is driven by
  26. IIPSecObjectImpl.
  27. */
  28. class ATL_NO_VTABLE CActiveSocket :
  29. public CIPSecBase
  30. {
  31. protected:
  32. CActiveSocket(){}
  33. virtual ~CActiveSocket () {}
  34. public:
  35. //
  36. // IIPSecObjectImpl methods:
  37. //
  38. STDMETHOD(QueryInstance) (
  39. IN LPCWSTR pszQuery,
  40. IN IWbemContext * pCtx,
  41. IN IWbemObjectSink * pSink
  42. );
  43. STDMETHOD(DeleteInstance) (
  44. IN IWbemContext * pCtx,
  45. IN IWbemObjectSink * pSink
  46. );
  47. STDMETHOD(PutInstance) (
  48. IN IWbemClassObject * pInst,
  49. IN IWbemContext * pCtx,
  50. IN IWbemObjectSink * pSink
  51. );
  52. STDMETHOD(GetInstance) (
  53. IN IWbemContext * pCtx,
  54. IN IWbemObjectSink * pSink
  55. );
  56. private:
  57. typedef enum _SCW_Protocol
  58. {
  59. PROTO_NONE = 0,
  60. PROTO_TCP = 1,
  61. PROTO_UDP = 2,
  62. PROTO_IP = 4,
  63. PROTO_ICMP = 8,
  64. } SCW_Protocol, *PSCW_Protocol;
  65. HRESULT CreateWbemObjFromSocket (
  66. IN SCW_Protocol dwProtocol,
  67. IN DWORD dwPort,
  68. OUT IWbemClassObject ** ppObj
  69. );
  70. //
  71. // this is from netstat.c's same named function
  72. //
  73. HRESULT DoConnectionsWithOwner ();
  74. };