From 2f35275024c16c1f67cbeec1b2b5a2c85e333556 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 12 Oct 2020 17:50:23 +0100 Subject: [PATCH] config.py: Revert conditional orders for Windows Registry gets I failed to realise the values I'd moved earlier in the conditional were being passed by reference to the ctypes call. Thus they had initial values only upon test, rather than the 'returned' values as they should. This caused no values to be loaded from the Registry! --- config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index 2ebf8b34..72c92522 100644 --- a/config.py +++ b/config.py @@ -309,8 +309,7 @@ class Config(): key_size = DWORD() # Only strings are handled here. if ( - key_type.value not in [REG_SZ, REG_MULTI_SZ] - or RegQueryValueEx( + RegQueryValueEx( self.hkey, key, 0, @@ -318,6 +317,7 @@ class Config(): None, ctypes.byref(key_size) ) + or key_type.value not in [REG_SZ, REG_MULTI_SZ] ): return None @@ -337,8 +337,7 @@ class Config(): key_size = DWORD(4) key_val = DWORD() if ( - key_type.value != REG_DWORD - or RegQueryValueEx( + RegQueryValueEx( self.hkey, key, 0, @@ -346,6 +345,7 @@ class Config(): ctypes.byref(key_val), ctypes.byref(key_size) ) + or key_type.value != REG_DWORD ): return 0