Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / setup_native / source / win32 / customactions / reg4msdoc / windowsregistry.cxx
blobe06f1e51bd5164b306d92183daa98371d40b7681
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 // WindowsRegistry.cpp: Implementierung der Klasse WindowsRegistry.
3 //
4 //////////////////////////////////////////////////////////////////////
6 #include "windowsregistry.hxx"
7 #include "registrywnt.hxx"
8 #include "registryw9x.hxx"
10 #ifdef _MSC_VER
11 #pragma warning(disable : 4350)
12 #endif
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
46 RegistryKey regkey;
48 if (m_IsWinNT)
49 regkey = RegistryKey(new RegistryKeyImplWinNT(RootKey));
50 else
51 regkey = RegistryKey(new RegistryKeyImplWin9x(RootKey));
53 regkey->Open(Writeable);
55 return regkey;
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */