Source code of Windows XP (NT5)
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.

42 lines
1.2 KiB

  1. #ifndef _REGISTRY_H
  2. #define _REGISTRY_H
  3. #define REGPATH_SNMPTRAPS "SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\TrapConfiguration"
  4. #define REGPATH_EVNTAGENT "Software\\Microsoft\\SNMP_EVENTS\\EventLog\\Sources"
  5. #define REG_SRC_ENTOID "EnterpriseOID"
  6. #define REG_SRC_APPEND "Append"
  7. #define REG_EVNT_COUNT "Count"
  8. #define REG_EVNT_ID "FullID"
  9. #define REG_EVNT_TIME "Time"
  10. #define REG_FLG_NEEDRESTART 1
  11. class CRegistry
  12. {
  13. HKEY m_hRegRoot;
  14. HKEY m_hRegSnmpTraps;
  15. HKEY m_hRegEvntSources;
  16. DWORD ConfigureRegSource(HKEY hRegSource, char *szEventSource);
  17. DWORD ConfigureRegEvent(HKEY hRegEvent, DWORD dwEventID, DWORD dwCount, DWORD dwTime);
  18. DWORD ScanForTrap(HKEY hRegCommunity, char *szAddress, char *szName, DWORD & nNameLen);
  19. public:
  20. DWORD m_dwFlags;
  21. CRegistry();
  22. ~CRegistry();
  23. DWORD Connect();
  24. DWORD AddEvent(char *szEventSource, DWORD dwEventID, DWORD dwCount, DWORD dwTime);
  25. DWORD DelEvent(char *szEventSource, DWORD dwEventID);
  26. DWORD AddTrap(char *szCommunity, char *szAddress);
  27. DWORD DelTrap(char *szCommunity, char *szAddress);
  28. };
  29. extern CRegistry gRegistry;
  30. #endif