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.

59 lines
1.8 KiB

  1. //////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // RegistryKey.h
  4. //
  5. // Copyright (C) 1998, 1999 Microsoft Corporation. All rights reserved.
  6. //
  7. // Abstract :
  8. //
  9. // This is the definition of the CRegistryKey class. This class was created in order to
  10. // support automatic destruction of C++ object when an exception is thrown.
  11. //
  12. // History :
  13. //
  14. // 05/06/1999 luish Created
  15. //
  16. //////////////////////////////////////////////////////////////////////////////////////////////
  17. #if !defined(__REGISTRYKEY_)
  18. #define __REGISTRYKEY_
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #include <windows.h>
  23. #include <objbase.h>
  24. #include <stdio.h>
  25. class CRegistryKey
  26. {
  27. public :
  28. CRegistryKey(void);
  29. ~CRegistryKey(void);
  30. STDMETHOD (EnumKeys) (const DWORD dwIndex, LPSTR lpszSubKeyName, LPDWORD lpdwSubKeyNameLen);
  31. STDMETHOD (CheckForExistingKey) (HKEY hKey, LPCSTR lpszSubKeyName);
  32. STDMETHOD (CreateKey) (HKEY hKey, LPCSTR lpszSubKeyName, const DWORD dwOptions, const REGSAM samDesired, BOOL bSpecifySecurityAttributes, LPDWORD lpdwDisposition);
  33. STDMETHOD (OpenKey) (HKEY hKey, LPCSTR lpszSubKeyName, const REGSAM samDesired);
  34. STDMETHOD (CloseKey) (void);
  35. STDMETHOD (DeleteKey) (HKEY hKey, LPCSTR lpszSubKeyName);
  36. STDMETHOD (EnumValues) (const DWORD dwIndex, LPSTR lpszValueName, LPDWORD lpdwValueNameLen, LPDWORD lpdwType, LPBYTE lpData, LPDWORD lpdwDataLen);
  37. STDMETHOD (CheckForExistingValue) (LPCSTR lpszValueName);
  38. STDMETHOD (GetValue) (LPCSTR lpszValueName, LPDWORD lpdwType, LPBYTE lpData, LPDWORD lpdwDataLen);
  39. STDMETHOD (SetValue) (LPCSTR lpszValueName, const DWORD dwType, const BYTE * lpData, const DWORD dwDataLen);
  40. STDMETHOD (DeleteValue) (LPCSTR lpszValueName);
  41. private :
  42. BOOL m_fKeyOpen;
  43. HKEY m_hRegistryKey;
  44. };
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif // __REGISTRYKEY_