Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d61a7864
Commit
d61a7864
authored
May 10, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
May 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Get rid of the graphics driver loading mechanism.
parent
f7d4eec4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
35 deletions
+25
-35
imm.c
dlls/imm32/imm.c
+25
-35
No files found.
dlls/imm32/imm.c
View file @
d61a7864
...
@@ -429,31 +429,6 @@ static struct imc *query_imc_data( HIMC handle )
...
@@ -429,31 +429,6 @@ static struct imc *query_imc_data( HIMC handle )
return
ret
&&
ret
->
handle
==
handle
?
ret
:
NULL
;
return
ret
&&
ret
->
handle
==
handle
?
ret
:
NULL
;
}
}
static
HMODULE
load_graphics_driver
(
void
)
{
static
const
WCHAR
key_pathW
[]
=
L"System
\\
CurrentControlSet
\\
Control
\\
Video
\\
{"
;
static
const
WCHAR
displayW
[]
=
L"}
\\
0000"
;
HMODULE
ret
=
0
;
HKEY
hkey
;
DWORD
size
;
WCHAR
path
[
MAX_PATH
];
WCHAR
key
[
ARRAY_SIZE
(
key_pathW
)
+
ARRAY_SIZE
(
displayW
)
+
40
];
UINT
guid_atom
=
HandleToULong
(
GetPropW
(
GetDesktopWindow
(),
L"__wine_display_device_guid"
));
if
(
!
guid_atom
)
return
0
;
memcpy
(
key
,
key_pathW
,
sizeof
(
key_pathW
)
);
if
(
!
GlobalGetAtomNameW
(
guid_atom
,
key
+
lstrlenW
(
key
),
40
))
return
0
;
lstrcatW
(
key
,
displayW
);
if
(
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
key
,
&
hkey
))
return
0
;
size
=
sizeof
(
path
);
if
(
!
RegQueryValueExW
(
hkey
,
L"GraphicsDriver"
,
NULL
,
NULL
,
(
BYTE
*
)
path
,
&
size
))
ret
=
LoadLibraryW
(
path
);
RegCloseKey
(
hkey
);
TRACE
(
"%s %p
\n
"
,
debugstr_w
(
path
),
ret
);
return
ret
;
}
/* lookup an IME from a HKL, must hold ime_cs */
/* lookup an IME from a HKL, must hold ime_cs */
static
struct
ime
*
find_ime_from_hkl
(
HKL
hkl
)
static
struct
ime
*
find_ime_from_hkl
(
HKL
hkl
)
{
{
...
@@ -511,17 +486,33 @@ BOOL WINAPI ImmLoadIME( HKL hkl )
...
@@ -511,17 +486,33 @@ BOOL WINAPI ImmLoadIME( HKL hkl )
if
(
use_default_ime
)
if
(
use_default_ime
)
{
{
if
(
*
buffer
)
WARN
(
"Failed to load %s, falling back to default.
\n
"
,
debugstr_w
(
buffer
)
);
if
(
*
buffer
)
WARN
(
"Failed to load %s, falling back to default.
\n
"
,
debugstr_w
(
buffer
)
);
if
(
!
(
ime
->
module
=
load_graphics_driver
()))
ime
->
module
=
LoadLibraryW
(
L"imm32"
);
ime
->
module
=
LoadLibraryW
(
L"imm32"
);
ime
->
pImeInquire
=
(
void
*
)
ImeInquire
;
ime
->
pImeDestroy
=
ImeDestroy
;
ime
->
pImeSelect
=
ImeSelect
;
ime
->
pImeConfigure
=
ImeConfigure
;
ime
->
pImeEscape
=
ImeEscape
;
ime
->
pImeSetActiveContext
=
ImeSetActiveContext
;
ime
->
pImeToAsciiEx
=
(
void
*
)
ImeToAsciiEx
;
ime
->
pNotifyIME
=
NotifyIME
;
ime
->
pImeRegisterWord
=
(
void
*
)
ImeRegisterWord
;
ime
->
pImeUnregisterWord
=
(
void
*
)
ImeUnregisterWord
;
ime
->
pImeEnumRegisterWord
=
(
void
*
)
ImeEnumRegisterWord
;
ime
->
pImeSetCompositionString
=
ImeSetCompositionString
;
ime
->
pImeConversionList
=
(
void
*
)
ImeConversionList
;
ime
->
pImeProcessKey
=
(
void
*
)
ImeProcessKey
;
ime
->
pImeGetRegisterWordStyle
=
(
void
*
)
ImeGetRegisterWordStyle
;
ime
->
pImeGetImeMenuItems
=
(
void
*
)
ImeGetImeMenuItems
;
}
}
else
{
#define LOAD_FUNCPTR( f ) \
#define LOAD_FUNCPTR( f ) \
if (!(ime->p##f = (void *)GetProcAddress( ime->module, #f )) && \
if (!(ime->p##f = (void *)GetProcAddress( ime->module, #f ))) \
!(ime->p##f = use_default_ime ? (void *)f : NULL)) \
{ \
{ \
LeaveCriticalSection( &ime_cs ); \
WARN( "Can't find function %s in HKL %p IME\n", #f, hkl ); \
WARN( "Can't find function %s in HKL %p IME\n", #f, hkl ); \
goto failed; \
goto failed; \
}
}
LOAD_FUNCPTR
(
ImeInquire
);
LOAD_FUNCPTR
(
ImeInquire
);
LOAD_FUNCPTR
(
ImeDestroy
);
LOAD_FUNCPTR
(
ImeDestroy
);
LOAD_FUNCPTR
(
ImeSelect
);
LOAD_FUNCPTR
(
ImeSelect
);
...
@@ -539,13 +530,10 @@ BOOL WINAPI ImmLoadIME( HKL hkl )
...
@@ -539,13 +530,10 @@ BOOL WINAPI ImmLoadIME( HKL hkl )
LOAD_FUNCPTR
(
ImeGetRegisterWordStyle
);
LOAD_FUNCPTR
(
ImeGetRegisterWordStyle
);
LOAD_FUNCPTR
(
ImeGetImeMenuItems
);
LOAD_FUNCPTR
(
ImeGetImeMenuItems
);
#undef LOAD_FUNCPTR
#undef LOAD_FUNCPTR
}
ime
->
hkl
=
hkl
;
ime
->
hkl
=
hkl
;
if
(
!
ime
->
pImeInquire
(
&
ime
->
info
,
buffer
,
0
))
if
(
!
ime
->
pImeInquire
(
&
ime
->
info
,
buffer
,
0
))
goto
failed
;
{
LeaveCriticalSection
(
&
ime_cs
);
goto
failed
;
}
if
(
ime_is_unicode
(
ime
))
lstrcpynW
(
ime
->
ui_class
,
buffer
,
ARRAY_SIZE
(
ime
->
ui_class
)
);
if
(
ime_is_unicode
(
ime
))
lstrcpynW
(
ime
->
ui_class
,
buffer
,
ARRAY_SIZE
(
ime
->
ui_class
)
);
else
MultiByteToWideChar
(
CP_ACP
,
0
,
(
char
*
)
buffer
,
-
1
,
ime
->
ui_class
,
ARRAY_SIZE
(
ime
->
ui_class
)
);
else
MultiByteToWideChar
(
CP_ACP
,
0
,
(
char
*
)
buffer
,
-
1
,
ime
->
ui_class
,
ARRAY_SIZE
(
ime
->
ui_class
)
);
...
@@ -558,6 +546,8 @@ BOOL WINAPI ImmLoadIME( HKL hkl )
...
@@ -558,6 +546,8 @@ BOOL WINAPI ImmLoadIME( HKL hkl )
return
TRUE
;
return
TRUE
;
failed:
failed:
LeaveCriticalSection
(
&
ime_cs
);
if
(
ime
->
module
)
FreeLibrary
(
ime
->
module
);
if
(
ime
->
module
)
FreeLibrary
(
ime
->
module
);
free
(
ime
);
free
(
ime
);
return
FALSE
;
return
FALSE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment