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.

54 lines
1.4 KiB

  1. // PPServerClass.h : Declaration of the CPPServerClass
  2. #ifndef __PPSERVERCLASS_H_
  3. #define __PPSERVERCLASS_H_
  4. #include "resource.h" // main symbols
  5. #include <atlctl.h>
  6. #include <vector>
  7. using namespace std;
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CPPServerClass
  10. class ATL_NO_VTABLE CPPServerClass :
  11. public CComObjectRootEx<CComSingleThreadModel>,
  12. public CComCoClass<CPPServerClass, &CLSID_PPServerClass>,
  13. public IDispatchImpl<IPPServerClass, &IID_IPPServerClass, &LIBID_PPSERVERLib>,
  14. public IObjectSafetyImpl<CPPServerClass, INTERFACESAFE_FOR_UNTRUSTED_CALLER>
  15. {
  16. public:
  17. CPPServerClass()
  18. {
  19. }
  20. DECLARE_REGISTRY_RESOURCEID(IDR_PPSERVERCLASS)
  21. DECLARE_PROTECT_FINAL_CONSTRUCT()
  22. BEGIN_COM_MAP(CPPServerClass)
  23. COM_INTERFACE_ENTRY(IPPServerClass)
  24. COM_INTERFACE_ENTRY(IDispatch)
  25. COM_INTERFACE_ENTRY(IObjectSafety)
  26. END_COM_MAP()
  27. // IPPServerClass
  28. public:
  29. STDMETHOD(AllowAutomaticSniffing)(/*[out, retval]*/ VARIANT * pvarShow);
  30. protected:
  31. bool Create(HKEY hKeyParent, LPCTSTR strKeyName, bool* bCreatedNew, REGSAM access =KEY_ALL_ACCESS);
  32. bool SetNumericValue(LPCTSTR strValueName, DWORD dwValue);
  33. bool GetNumericValue(LPCTSTR strValueName, DWORD& dwValue);
  34. void Close();
  35. private:
  36. // Data
  37. HKEY m_hKey; // current key handle
  38. vector<HKEY> m_arrKeysToClose; // array of keys(subkeys) opened by the object
  39. };
  40. #endif //__PPSERVERCLASS_H_