dinput: Move get_config_key to a common place.
This commit is contained in:
parent
bb3275ce97
commit
319097f563
|
@ -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);
|
||||
|
|
|
@ -262,22 +262,6 @@ static BOOL joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue