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.

51 lines
1.1 KiB

  1. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  2. #ifndef __TRAP_SESSION__
  3. #define __TRAP_SESSION__
  4. #define TRAP_EVENT (WM_USER+1)
  5. class SnmpWinSnmpTrapSession : private Window
  6. {
  7. private:
  8. SnmpTrapManager* m_managerPtr;
  9. BOOL m_bValid;
  10. HSNMP_SESSION m_session_handle;
  11. BOOL m_bDestroy;
  12. LONG m_cRef;
  13. BOOL RegisterForAllTraps ();
  14. public:
  15. SnmpWinSnmpTrapSession (SnmpTrapManager* managerPtr);
  16. BOOL PostMessage (UINT user_msg_id, WPARAM wParam, LPARAM lParam);
  17. LONG_PTR HandleEvent (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  18. HWND GetWindowHandle() { return Window::GetWindowHandle(); }
  19. void* operator()() const { return ( m_bValid ? (void*)this : NULL ); }
  20. BOOL DestroySession();
  21. ~SnmpWinSnmpTrapSession ();
  22. };
  23. class SnmpTrapTaskObject : public SnmpTaskObject
  24. {
  25. private:
  26. SnmpTrapManager* m_mptr;
  27. SnmpWinSnmpTrapSession** m_pptrapsess;
  28. public:
  29. SnmpTrapTaskObject (SnmpTrapManager* managerPtr, SnmpWinSnmpTrapSession** pptrapsess);
  30. ~SnmpTrapTaskObject () {}
  31. void Process ();
  32. };
  33. #endif //__TRAP_SESSION__