[PATCH v2] services: Allow reading binary registry values as DWORDs

Tim Schumacher timschumi at gmx.de
Sun May 12 16:12:41 CDT 2019


Some programs/services actually save those values as a registry
value of the type REG_BINARY. As long as the size matches, it
shouldn't be a problem to just interpret it as a DWORD type,
but warn anyways in case someone runs into issues.

Signed-off-by: Tim Schumacher <timschumi at gmx.de>
---
This fixes the following:
Bug 47178 - Grand Prix Legends: Service papycpu2 doesn't load

Differences in v2:
Added signoff
---
 programs/services/utils.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/programs/services/utils.c b/programs/services/utils.c
index c59b003e58..6f6ae42730 100644
--- a/programs/services/utils.c
+++ b/programs/services/utils.c
@@ -149,11 +149,15 @@ DWORD load_reg_dword(HKEY hKey, LPCWSTR szValue, DWORD *output)
             return ERROR_SUCCESS;
         goto failed;
     }
-    if (type != REG_DWORD || size != sizeof(DWORD))
+    if ((type != REG_DWORD && type != REG_BINARY) || size != sizeof(DWORD))
     {
         err = ERROR_INVALID_DATATYPE;
         goto failed;
     }
+
+    if (type == REG_BINARY)
+        WINE_WARN("Read binary value as a DWORD. szValue: %s, output: %d\n", wine_dbgstr_w(szValue), *output);
+
     return ERROR_SUCCESS;

 failed:
--
2.21.0




More information about the wine-devel mailing list