diff options
author | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
commit | cfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch) | |
tree | 18d94153a302445196fc0c18586abf44a1ce4a38 /Swiften/Base/WindowsRegistry.h | |
parent | 1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff) | |
download | swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2 |
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines
in the process.
Changed CheckTabs.py tool to disallow hard tabs in source
files.
Test-Information:
Manually checked 30 random files that the conversion worked
as expected.
Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swiften/Base/WindowsRegistry.h')
-rw-r--r-- | Swiften/Base/WindowsRegistry.h | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/Swiften/Base/WindowsRegistry.h b/Swiften/Base/WindowsRegistry.h index 31ece7a..6243dd2 100644 --- a/Swiften/Base/WindowsRegistry.h +++ b/Swiften/Base/WindowsRegistry.h @@ -9,49 +9,49 @@ #include <windows.h> namespace Swift { - class WindowsRegistry { - public: - static bool isFIPSEnabled() { - char* pathForXP = "System\\CurrentControlSet\\Control\\Lsa"; - char* pathSinceVista = "System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy"; - char* keyForXP = "FIPSAlgorithmPolicy"; - char* keySinceVista = "Enabled"; - - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&osvi); - - char* keyForOS = osvi.dwMajorVersion < 6 ? keyForXP : keySinceVista; - char* pathForOS = osvi.dwMajorVersion < 6 ? pathForXP : pathSinceVista; - - /* http://support.microsoft.com/kb/811833 */ - /* http://msdn.microsoft.com/en-us/library/ms724911%28VS.85%29.aspx */ - HKEY key; - bool result = false; - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, - pathForOS, - 0, - KEY_READ, - &key) != ERROR_SUCCESS) { - /* If we can't find the key that says we're FIPS, we're not FIPS */ - return result; - } - DWORD keyType = REG_DWORD; - DWORD data; - DWORD length = sizeof(data); - - if (RegQueryValueEx(key, - keyForOS, - NULL, - &keyType, - (LPBYTE)&data, - &length) == ERROR_SUCCESS) { - result = data != 0; - } - - RegCloseKey(key); - return result; - } - }; + class WindowsRegistry { + public: + static bool isFIPSEnabled() { + char* pathForXP = "System\\CurrentControlSet\\Control\\Lsa"; + char* pathSinceVista = "System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy"; + char* keyForXP = "FIPSAlgorithmPolicy"; + char* keySinceVista = "Enabled"; + + OSVERSIONINFO osvi; + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + + char* keyForOS = osvi.dwMajorVersion < 6 ? keyForXP : keySinceVista; + char* pathForOS = osvi.dwMajorVersion < 6 ? pathForXP : pathSinceVista; + + /* http://support.microsoft.com/kb/811833 */ + /* http://msdn.microsoft.com/en-us/library/ms724911%28VS.85%29.aspx */ + HKEY key; + bool result = false; + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, + pathForOS, + 0, + KEY_READ, + &key) != ERROR_SUCCESS) { + /* If we can't find the key that says we're FIPS, we're not FIPS */ + return result; + } + DWORD keyType = REG_DWORD; + DWORD data; + DWORD length = sizeof(data); + + if (RegQueryValueEx(key, + keyForOS, + NULL, + &keyType, + (LPBYTE)&data, + &length) == ERROR_SUCCESS) { + result = data != 0; + } + + RegCloseKey(key); + return result; + } + }; } |