wintab32: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6e8af61f10
commit
783d71366a
|
@ -34,8 +34,6 @@
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(wintab32);
|
WINE_DEFAULT_DEBUG_CHANNEL(wintab32);
|
||||||
|
|
||||||
HWND hwndDefault = NULL;
|
HWND hwndDefault = NULL;
|
||||||
static const WCHAR
|
|
||||||
WC_TABLETCLASSNAME[] = {'W','i','n','e','T','a','b','l','e','t','C','l','a','s','s',0};
|
|
||||||
static CRITICAL_SECTION_DEBUG csTablet_debug =
|
static CRITICAL_SECTION_DEBUG csTablet_debug =
|
||||||
{
|
{
|
||||||
0, 0, &csTablet,
|
0, 0, &csTablet,
|
||||||
|
@ -62,34 +60,26 @@ static VOID TABLET_Register(void)
|
||||||
wndClass.cbWndExtra = 0;
|
wndClass.cbWndExtra = 0;
|
||||||
wndClass.hCursor = NULL;
|
wndClass.hCursor = NULL;
|
||||||
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW +1);
|
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW +1);
|
||||||
wndClass.lpszClassName = WC_TABLETCLASSNAME;
|
wndClass.lpszClassName = L"WineTabletClass";
|
||||||
RegisterClassW(&wndClass);
|
RegisterClassW(&wndClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID TABLET_Unregister(void)
|
static VOID TABLET_Unregister(void)
|
||||||
{
|
{
|
||||||
UnregisterClassW(WC_TABLETCLASSNAME, NULL);
|
UnregisterClassW(L"WineTabletClass", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HMODULE load_graphics_driver(void)
|
static HMODULE load_graphics_driver(void)
|
||||||
{
|
{
|
||||||
static const WCHAR display_device_guid_propW[] = {
|
static const WCHAR key_pathW[] = L"System\\CurrentControlSet\\Control\\Video\\{";
|
||||||
'_','_','w','i','n','e','_','d','i','s','p','l','a','y','_',
|
static const WCHAR displayW[] = L"}\\0000";
|
||||||
'd','e','v','i','c','e','_','g','u','i','d',0 };
|
|
||||||
static const WCHAR key_pathW[] = {
|
|
||||||
'S','y','s','t','e','m','\\',
|
|
||||||
'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
|
|
||||||
'C','o','n','t','r','o','l','\\',
|
|
||||||
'V','i','d','e','o','\\','{',0};
|
|
||||||
static const WCHAR displayW[] = {'}','\\','0','0','0','0',0};
|
|
||||||
static const WCHAR driverW[] = {'G','r','a','p','h','i','c','s','D','r','i','v','e','r',0};
|
|
||||||
|
|
||||||
HMODULE ret = 0;
|
HMODULE ret = 0;
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
DWORD size;
|
DWORD size;
|
||||||
WCHAR path[MAX_PATH];
|
WCHAR path[MAX_PATH];
|
||||||
WCHAR key[ARRAY_SIZE(key_pathW) + ARRAY_SIZE(displayW) + 40];
|
WCHAR key[ARRAY_SIZE(key_pathW) + ARRAY_SIZE(displayW) + 40];
|
||||||
UINT guid_atom = HandleToULong( GetPropW( GetDesktopWindow(), display_device_guid_propW ));
|
UINT guid_atom = HandleToULong( GetPropW( GetDesktopWindow(), L"__wine_display_device_guid" ));
|
||||||
|
|
||||||
if (!guid_atom) return 0;
|
if (!guid_atom) return 0;
|
||||||
memcpy( key, key_pathW, sizeof(key_pathW) );
|
memcpy( key, key_pathW, sizeof(key_pathW) );
|
||||||
|
@ -97,7 +87,7 @@ static HMODULE load_graphics_driver(void)
|
||||||
lstrcatW( key, displayW );
|
lstrcatW( key, displayW );
|
||||||
if (RegOpenKeyW( HKEY_LOCAL_MACHINE, key, &hkey )) return 0;
|
if (RegOpenKeyW( HKEY_LOCAL_MACHINE, key, &hkey )) return 0;
|
||||||
size = sizeof(path);
|
size = sizeof(path);
|
||||||
if (!RegQueryValueExW( hkey, driverW, NULL, NULL, (BYTE *)path, &size )) ret = LoadLibraryW( path );
|
if (!RegQueryValueExW( hkey, L"GraphicsDriver", NULL, NULL, (BYTE *)path, &size )) ret = LoadLibraryW( path );
|
||||||
RegCloseKey( hkey );
|
RegCloseKey( hkey );
|
||||||
TRACE( "%s %p\n", debugstr_w(path), ret );
|
TRACE( "%s %p\n", debugstr_w(path), ret );
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -105,8 +95,6 @@ static HMODULE load_graphics_driver(void)
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
|
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
static const WCHAR name[] = {'T','a','b','l','e','t',0};
|
|
||||||
|
|
||||||
TRACE("%p, %x, %p\n",hInstDLL,fdwReason,lpReserved);
|
TRACE("%p, %x, %p\n",hInstDLL,fdwReason,lpReserved);
|
||||||
switch (fdwReason)
|
switch (fdwReason)
|
||||||
{
|
{
|
||||||
|
@ -114,7 +102,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
|
||||||
TRACE("Initialization\n");
|
TRACE("Initialization\n");
|
||||||
DisableThreadLibraryCalls(hInstDLL);
|
DisableThreadLibraryCalls(hInstDLL);
|
||||||
TABLET_Register();
|
TABLET_Register();
|
||||||
hwndDefault = CreateWindowW(WC_TABLETCLASSNAME, name,
|
hwndDefault = CreateWindowW(L"WineTabletClass", L"Tablet",
|
||||||
WS_POPUPWINDOW,0,0,0,0,0,0,hInstDLL,0);
|
WS_POPUPWINDOW,0,0,0,0,0,0,hInstDLL,0);
|
||||||
if (hwndDefault)
|
if (hwndDefault)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue