Commit 319097f5 authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

dinput: Move get_config_key to a common place.

parent bb3275ce
......@@ -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;
......
......@@ -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);
......
......@@ -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.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment