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
e7d088a6
Commit
e7d088a6
authored
Nov 19, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
68831826
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
37 deletions
+18
-37
imm.c
dlls/imm32/imm.c
+15
-30
imm32.c
dlls/imm32/tests/imm32.c
+3
-7
No files found.
dlls/imm32/imm.c
View file @
e7d088a6
...
@@ -99,14 +99,8 @@ typedef struct _tagIMMThreadData {
...
@@ -99,14 +99,8 @@ typedef struct _tagIMMThreadData {
static
struct
list
ImmHklList
=
LIST_INIT
(
ImmHklList
);
static
struct
list
ImmHklList
=
LIST_INIT
(
ImmHklList
);
static
struct
list
ImmThreadDataList
=
LIST_INIT
(
ImmThreadDataList
);
static
struct
list
ImmThreadDataList
=
LIST_INIT
(
ImmThreadDataList
);
static
const
WCHAR
szwWineIMCProperty
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'I'
,
'm'
,
'm'
,
'H'
,
'I'
,
'M'
,
'C'
,
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'y'
,
0
};
static
const
WCHAR
szwWineIMCProperty
[]
=
L"WineImmHIMCProperty"
;
static
const
WCHAR
szImeRegFmt
[]
=
L"System
\\
CurrentControlSet
\\
Control
\\
Keyboard Layouts
\\
%08lx"
;
static
const
WCHAR
szImeFileW
[]
=
{
'I'
,
'm'
,
'e'
,
' '
,
'F'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
szLayoutTextW
[]
=
{
'L'
,
'a'
,
'y'
,
'o'
,
'u'
,
't'
,
' '
,
'T'
,
'e'
,
'x'
,
't'
,
0
};
static
const
WCHAR
szImeRegFmt
[]
=
{
'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'
,
'\\'
,
'K'
,
'e'
,
'y'
,
'b'
,
'o'
,
'a'
,
'r'
,
'd'
,
' '
,
'L'
,
'a'
,
'y'
,
'o'
,
'u'
,
't'
,
's'
,
'\\'
,
'%'
,
'0'
,
'8'
,
'l'
,
'x'
,
0
};
static
const
WCHAR
szwIME
[]
=
{
'I'
,
'M'
,
'E'
,
0
};
static
const
WCHAR
szwDefaultIME
[]
=
{
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
' '
,
'I'
,
'M'
,
'E'
,
0
};
static
CRITICAL_SECTION
threaddata_cs
;
static
CRITICAL_SECTION
threaddata_cs
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
...
@@ -297,23 +291,15 @@ static void IMM_FreeThreadData(void)
...
@@ -297,23 +291,15 @@ static void IMM_FreeThreadData(void)
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
)
);
...
@@ -321,7 +307,8 @@ static HMODULE load_graphics_driver(void)
...
@@ -321,7 +307,8 @@ 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
;
...
@@ -1642,7 +1629,7 @@ static BOOL needs_ime_window(HWND hwnd)
...
@@ -1642,7 +1629,7 @@ static BOOL needs_ime_window(HWND hwnd)
{
{
WCHAR
classW
[
8
];
WCHAR
classW
[
8
];
if
(
GetClassNameW
(
hwnd
,
classW
,
ARRAY_SIZE
(
classW
))
&&
!
lstrcmpW
(
classW
,
szwIME
))
if
(
GetClassNameW
(
hwnd
,
classW
,
ARRAY_SIZE
(
classW
))
&&
!
lstrcmpW
(
classW
,
L"IME"
))
return
FALSE
;
return
FALSE
;
if
(
GetClassLongPtrW
(
hwnd
,
GCL_STYLE
)
&
CS_IME
)
return
FALSE
;
if
(
GetClassLongPtrW
(
hwnd
,
GCL_STYLE
)
&
CS_IME
)
return
FALSE
;
...
@@ -1680,7 +1667,7 @@ BOOL WINAPI __wine_register_window(HWND hwnd)
...
@@ -1680,7 +1667,7 @@ BOOL WINAPI __wine_register_window(HWND hwnd)
{
{
/* Do not create the window inside of a critical section */
/* Do not create the window inside of a critical section */
LeaveCriticalSection
(
&
threaddata_cs
);
LeaveCriticalSection
(
&
threaddata_cs
);
new
=
CreateWindowExW
(
0
,
szwIME
,
szwDefaultIME
,
new
=
CreateWindowExW
(
0
,
L"IME"
,
L"Default IME"
,
WS_POPUP
|
WS_DISABLED
|
WS_CLIPSIBLINGS
,
WS_POPUP
|
WS_DISABLED
|
WS_CLIPSIBLINGS
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
0
);
0
,
0
,
1
,
1
,
0
,
0
,
0
,
0
);
/* thread_data is in the current thread so we can assume it's still valid */
/* thread_data is in the current thread so we can assume it's still valid */
...
@@ -1785,13 +1772,11 @@ UINT WINAPI ImmGetDescriptionA(
...
@@ -1785,13 +1772,11 @@ UINT WINAPI ImmGetDescriptionA(
*/
*/
UINT
WINAPI
ImmGetDescriptionW
(
HKL
hKL
,
LPWSTR
lpszDescription
,
UINT
uBufLen
)
UINT
WINAPI
ImmGetDescriptionW
(
HKL
hKL
,
LPWSTR
lpszDescription
,
UINT
uBufLen
)
{
{
static
const
WCHAR
name
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'X'
,
'I'
,
'M'
,
0
};
FIXME
(
"(%p, %p, %d): semi stub
\n
"
,
hKL
,
lpszDescription
,
uBufLen
);
FIXME
(
"(%p, %p, %d): semi stub
\n
"
,
hKL
,
lpszDescription
,
uBufLen
);
if
(
!
hKL
)
return
0
;
if
(
!
hKL
)
return
0
;
if
(
!
uBufLen
)
return
lstrlenW
(
name
);
if
(
!
uBufLen
)
return
lstrlenW
(
L"Wine XIM"
);
lstrcpynW
(
lpszDescription
,
name
,
uBufLen
);
lstrcpynW
(
lpszDescription
,
L"Wine XIM"
,
uBufLen
);
return
lstrlenW
(
lpszDescription
);
return
lstrlenW
(
lpszDescription
);
}
}
...
@@ -1872,7 +1857,7 @@ UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
...
@@ -1872,7 +1857,7 @@ UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
}
}
length
=
0
;
length
=
0
;
rc
=
RegGetValueW
(
hkey
,
NULL
,
szImeFileW
,
RRF_RT_REG_SZ
,
NULL
,
NULL
,
&
length
);
rc
=
RegGetValueW
(
hkey
,
NULL
,
L"Ime File"
,
RRF_RT_REG_SZ
,
NULL
,
NULL
,
&
length
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
{
{
...
@@ -1892,7 +1877,7 @@ UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
...
@@ -1892,7 +1877,7 @@ UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
return
length
/
sizeof
(
WCHAR
);
return
length
/
sizeof
(
WCHAR
);
}
}
RegGetValueW
(
hkey
,
NULL
,
szImeFileW
,
RRF_RT_REG_SZ
,
NULL
,
lpszFileName
,
&
length
);
RegGetValueW
(
hkey
,
NULL
,
L"Ime File"
,
RRF_RT_REG_SZ
,
NULL
,
lpszFileName
,
&
length
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
...
@@ -2111,10 +2096,10 @@ HKL WINAPI ImmInstallIMEW(
...
@@ -2111,10 +2096,10 @@ HKL WINAPI ImmInstallIMEW(
if
(
rc
==
ERROR_SUCCESS
)
if
(
rc
==
ERROR_SUCCESS
)
{
{
rc
=
RegSetValueExW
(
hkey
,
szImeFileW
,
0
,
REG_SZ
,
(
const
BYTE
*
)
lpszIMEFileName
,
rc
=
RegSetValueExW
(
hkey
,
L"Ime File"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
lpszIMEFileName
,
(
lstrlenW
(
lpszIMEFileName
)
+
1
)
*
sizeof
(
WCHAR
));
(
lstrlenW
(
lpszIMEFileName
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
rc
==
ERROR_SUCCESS
)
if
(
rc
==
ERROR_SUCCESS
)
rc
=
RegSetValueExW
(
hkey
,
szLayoutTextW
,
0
,
REG_SZ
,
(
const
BYTE
*
)
lpszLayoutText
,
rc
=
RegSetValueExW
(
hkey
,
L"Layout Text"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
lpszLayoutText
,
(
lstrlenW
(
lpszLayoutText
)
+
1
)
*
sizeof
(
WCHAR
));
(
lstrlenW
(
lpszLayoutText
)
+
1
)
*
sizeof
(
WCHAR
));
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
return
hkl
;
return
hkl
;
...
...
dlls/imm32/tests/imm32.c
View file @
e7d088a6
...
@@ -1099,10 +1099,9 @@ static void test_ImmDefaultHwnd(void)
...
@@ -1099,10 +1099,9 @@ static void test_ImmDefaultHwnd(void)
static
BOOL
CALLBACK
is_ime_window_proc
(
HWND
hWnd
,
LPARAM
param
)
static
BOOL
CALLBACK
is_ime_window_proc
(
HWND
hWnd
,
LPARAM
param
)
{
{
static
const
WCHAR
imeW
[]
=
{
'I'
,
'M'
,
'E'
,
0
};
WCHAR
class_nameW
[
16
];
WCHAR
class_nameW
[
16
];
HWND
*
ime_window
=
(
HWND
*
)
param
;
HWND
*
ime_window
=
(
HWND
*
)
param
;
if
(
GetClassNameW
(
hWnd
,
class_nameW
,
ARRAY_SIZE
(
class_nameW
))
&&
!
lstrcmpW
(
class_nameW
,
imeW
))
if
(
GetClassNameW
(
hWnd
,
class_nameW
,
ARRAY_SIZE
(
class_nameW
))
&&
!
lstrcmpW
(
class_nameW
,
L"IME"
))
{
{
*
ime_window
=
hWnd
;
*
ime_window
=
hWnd
;
return
FALSE
;
return
FALSE
;
...
@@ -1562,9 +1561,6 @@ static LRESULT CALLBACK processkey_wnd_proc( HWND hWnd, UINT msg, WPARAM wParam,
...
@@ -1562,9 +1561,6 @@ static LRESULT CALLBACK processkey_wnd_proc( HWND hWnd, UINT msg, WPARAM wParam,
static
void
test_ime_processkey
(
void
)
static
void
test_ime_processkey
(
void
)
{
{
WCHAR
classNameW
[]
=
{
'P'
,
'r'
,
'o'
,
'c'
,
'e'
,
's'
,
's'
,
'K'
,
'e'
,
'y'
,
'T'
,
'e'
,
's'
,
't'
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
0
};
WCHAR
windowNameW
[]
=
{
'P'
,
'r'
,
'o'
,
'c'
,
'e'
,
's'
,
's'
,
'K'
,
'e'
,
'y'
,
0
};
MSG
msg
;
MSG
msg
;
WNDCLASSW
wclass
;
WNDCLASSW
wclass
;
HANDLE
hInstance
=
GetModuleHandleW
(
NULL
);
HANDLE
hInstance
=
GetModuleHandleW
(
NULL
);
...
@@ -1573,7 +1569,7 @@ static void test_ime_processkey(void)
...
@@ -1573,7 +1569,7 @@ static void test_ime_processkey(void)
INT
rc
;
INT
rc
;
HWND
hWndTest
;
HWND
hWndTest
;
wclass
.
lpszClassName
=
classNameW
;
wclass
.
lpszClassName
=
L"ProcessKeyTestClass"
;
wclass
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wclass
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wclass
.
lpfnWndProc
=
processkey_wnd_proc
;
wclass
.
lpfnWndProc
=
processkey_wnd_proc
;
wclass
.
hInstance
=
hInstance
;
wclass
.
hInstance
=
hInstance
;
...
@@ -1589,7 +1585,7 @@ static void test_ime_processkey(void)
...
@@ -1589,7 +1585,7 @@ static void test_ime_processkey(void)
}
}
/* create the test window that will receive the keystrokes */
/* create the test window that will receive the keystrokes */
hWndTest
=
CreateWindowW
(
wclass
.
lpszClassName
,
windowNameW
,
hWndTest
=
CreateWindowW
(
wclass
.
lpszClassName
,
L"ProcessKey"
,
WS_OVERLAPPEDWINDOW
,
CW_USEDEFAULT
,
0
,
100
,
100
,
WS_OVERLAPPEDWINDOW
,
CW_USEDEFAULT
,
0
,
100
,
100
,
NULL
,
NULL
,
hInstance
,
NULL
);
NULL
,
NULL
,
hInstance
,
NULL
);
...
...
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