Module: wine Branch: master Commit: 319097f563bcb610c2eb8a1d1b0e4448fd07f92b URL: http://source.winehq.org/git/wine.git/?a=commit;h=319097f563bcb610c2eb8a1d1b...
Author: Vitaliy Margolen wine-patches@kievinfo.com Date: Mon Sep 24 19:34:27 2007 -0600
dinput: Move get_config_key to a common place.
---
dlls/dinput/device.c | 16 ++++++++++++++++ dlls/dinput/device_private.h | 2 ++ dlls/dinput/joystick_linux.c | 16 ---------------- 3 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 10e31cd..d1c94fc 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -32,6 +32,7 @@ #include "wine/unicode.h" #include "windef.h" #include "winbase.h" +#include "winreg.h" #include "winuser.h" #include "winerror.h" #include "dinput.h" @@ -216,6 +217,21 @@ void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) { } }
+/****************************************************************************** + * Get a config key from either the app-specific or the default config + */ +DWORD get_config_key( HKEY defkey, HKEY appkey, const char *name, + char *buffer, DWORD size ) +{ + if (appkey && !RegQueryValueExA( appkey, name, 0, NULL, (LPBYTE)buffer, &size )) + return 0; + + if (defkey && !RegQueryValueExA( defkey, name, 0, NULL, (LPBYTE)buffer, &size )) + return 0; + + return ERROR_FILE_NOT_FOUND; +} + /* Conversion between internal data buffer and external data buffer */ void fill_DataFormat(void *out, const void *in, const DataFormat *df) { int i; diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index 6686577..b855c1b 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -72,6 +72,8 @@ struct IDirectInputDevice2AImpl DataFormat data_format; /* user data format and wine to user format converter */ };
+extern DWORD get_config_key(HKEY, HKEY, const char*, char*, DWORD); + /* Routines to do DataFormat / WineFormat conversions */ extern void fill_DataFormat(void *out, const void *in, const DataFormat *df) ; extern HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *format); diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index e15e32e..0f821de 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -263,22 +263,6 @@ static BOOL joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN }
/* - * Get a config key from either the app-specific or the default config - */ - -static inline DWORD get_config_key( HKEY defkey, HKEY appkey, const char *name, - char *buffer, DWORD size ) -{ - if (appkey && !RegQueryValueExA( appkey, name, 0, NULL, (LPBYTE)buffer, &size )) - return 0; - - if (defkey && !RegQueryValueExA( defkey, name, 0, NULL, (LPBYTE)buffer, &size )) - return 0; - - return ERROR_FILE_NOT_FOUND; -} - -/* * Setup the dinput options. */