1 // WindowsRegistry.cpp: Implementierung der Klasse WindowsRegistry.
3 //////////////////////////////////////////////////////////////////////
5 #include "windowsregistry.hxx"
6 #include "registrywnt.hxx"
7 #include "registryw9x.hxx"
10 #pragma warning(disable : 4350)
13 //------------------------------
15 //------------------------------
17 WindowsRegistry::WindowsRegistry()
19 OSVERSIONINFOA osverinfo
;
20 ZeroMemory(&osverinfo
, sizeof(osverinfo
));
21 osverinfo
.dwOSVersionInfoSize
= sizeof(osverinfo
);
22 GetVersionExA(&osverinfo
);
24 m_IsWinNT
= (osverinfo
.dwPlatformId
== VER_PLATFORM_WIN32_NT
);
27 //------------------------------
29 //------------------------------
31 RegistryKey
WindowsRegistry::GetClassesRootKey(bool Writeable
) const
33 return GetRegistryKey(HKEY_CLASSES_ROOT
, Writeable
);
36 //------------------------------
38 //------------------------------
40 RegistryKey
WindowsRegistry::GetCurrentUserKey(bool Writeable
) const
42 return GetRegistryKey(HKEY_CURRENT_USER
, Writeable
);
45 //------------------------------
47 //------------------------------
49 RegistryKey
WindowsRegistry::GetLocalMachineKey(bool Writeable
) const
51 return GetRegistryKey(HKEY_LOCAL_MACHINE
, Writeable
);
54 //------------------------------
56 //------------------------------
58 RegistryKey
WindowsRegistry::GetUserKey(bool Writeable
) const
60 return GetRegistryKey(HKEY_USERS
, Writeable
);
63 //------------------------------
65 //------------------------------
67 RegistryKey
WindowsRegistry::GetRegistryKey(HKEY RootKey
, bool Writeable
) const
72 regkey
= RegistryKey(new RegistryKeyImplWinNT(RootKey
));
74 regkey
= RegistryKey(new RegistryKeyImplWin9x(RootKey
));
76 regkey
->Open(Writeable
);