1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 // WindowsRegistry.cpp: Implementierung der Klasse WindowsRegistry.
4 //////////////////////////////////////////////////////////////////////
6 #include "windowsregistry.hxx"
7 #include "registrywnt.hxx"
8 #include "registryw9x.hxx"
11 #pragma warning(disable : 4350)
14 WindowsRegistry::WindowsRegistry()
16 OSVERSIONINFOA osverinfo
;
17 ZeroMemory(&osverinfo
, sizeof(osverinfo
));
18 osverinfo
.dwOSVersionInfoSize
= sizeof(osverinfo
);
19 GetVersionExA(&osverinfo
);
21 m_IsWinNT
= (osverinfo
.dwPlatformId
== VER_PLATFORM_WIN32_NT
);
24 RegistryKey
WindowsRegistry::GetClassesRootKey(bool Writeable
) const
26 return GetRegistryKey(HKEY_CLASSES_ROOT
, Writeable
);
29 RegistryKey
WindowsRegistry::GetCurrentUserKey(bool Writeable
) const
31 return GetRegistryKey(HKEY_CURRENT_USER
, Writeable
);
34 RegistryKey
WindowsRegistry::GetLocalMachineKey(bool Writeable
) const
36 return GetRegistryKey(HKEY_LOCAL_MACHINE
, Writeable
);
39 RegistryKey
WindowsRegistry::GetUserKey(bool Writeable
) const
41 return GetRegistryKey(HKEY_USERS
, Writeable
);
44 RegistryKey
WindowsRegistry::GetRegistryKey(HKEY RootKey
, bool Writeable
) const
49 regkey
= RegistryKey(new RegistryKeyImplWinNT(RootKey
));
51 regkey
= RegistryKey(new RegistryKeyImplWin9x(RootKey
));
53 regkey
->Open(Writeable
);
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */