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
5035a855
Commit
5035a855
authored
Mar 25, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Mar 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm: Implement ImmGetIMEFileNameW and ImmGetIMEFileNameA.
parent
a71998d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
11 deletions
+72
-11
Makefile.in
dlls/imm32/Makefile.in
+1
-1
imm.c
dlls/imm32/imm.c
+71
-10
No files found.
dlls/imm32/Makefile.in
View file @
5035a855
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
imm32.dll
IMPORTLIB
=
imm32
IMPORTS
=
user32 gdi32 kernel32
IMPORTS
=
user32 gdi32
advapi32
kernel32
C_SRCS
=
\
imm.c
...
...
dlls/imm32/imm.c
View file @
5035a855
...
...
@@ -30,6 +30,7 @@
#include "imm.h"
#include "ddk/imm.h"
#include "winnls.h"
#include "winreg.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
imm
);
...
...
@@ -1178,23 +1179,83 @@ DWORD WINAPI ImmGetGuideLineW(HIMC hIMC, DWORD dwIndex, LPWSTR lpBuf, DWORD dwBu
/***********************************************************************
* ImmGetIMEFileNameA (IMM32.@)
*/
UINT
WINAPI
ImmGetIMEFileNameA
(
HKL
hKL
,
LPSTR
lpszFileName
,
UINT
uBufLen
)
UINT
WINAPI
ImmGetIMEFileNameA
(
HKL
hKL
,
LPSTR
lpszFileName
,
UINT
uBufLen
)
{
FIXME
(
"(%p, %p, %d): stub
\n
"
,
hKL
,
lpszFileName
,
uBufLen
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
0
;
LPWSTR
bufW
=
NULL
;
UINT
wBufLen
=
uBufLen
;
UINT
rc
;
if
(
uBufLen
&&
lpszFileName
)
bufW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
uBufLen
*
sizeof
(
WCHAR
));
else
/* We need this to get the number of byte required */
{
bufW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAX_PATH
*
sizeof
(
WCHAR
));
wBufLen
=
MAX_PATH
;
}
rc
=
ImmGetIMEFileNameW
(
hKL
,
bufW
,
wBufLen
);
if
(
rc
>
0
)
{
if
(
uBufLen
&&
lpszFileName
)
rc
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufW
,
-
1
,
lpszFileName
,
uBufLen
,
NULL
,
NULL
);
else
/* get the length */
rc
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
}
HeapFree
(
GetProcessHeap
(),
0
,
bufW
);
return
rc
;
}
/***********************************************************************
* ImmGetIMEFileNameW (IMM32.@)
*/
UINT
WINAPI
ImmGetIMEFileNameW
(
HKL
hKL
,
LPWSTR
lpszFileName
,
UINT
uBufLen
)
UINT
WINAPI
ImmGetIMEFileNameW
(
HKL
hKL
,
LPWSTR
lpszFileName
,
UINT
uBufLen
)
{
FIXME
(
"(%p, %p, %d): stub
\n
"
,
hKL
,
lpszFileName
,
uBufLen
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
0
;
static
const
WCHAR
szImeFileW
[]
=
{
'I'
,
'm'
,
'e'
,
' '
,
'F'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
fmt
[]
=
{
'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'
,
'x'
,
0
};
HKEY
hkey
;
DWORD
length
;
DWORD
rc
;
WCHAR
regKey
[
sizeof
(
fmt
)
/
sizeof
(
WCHAR
)
+
8
];
wsprintfW
(
regKey
,
fmt
,
(
unsigned
)
hKL
);
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
regKey
,
&
hkey
);
if
(
rc
!=
ERROR_SUCCESS
)
{
SetLastError
(
rc
);
return
0
;
}
length
=
0
;
rc
=
RegGetValueW
(
hkey
,
NULL
,
szImeFileW
,
RRF_RT_REG_SZ
,
NULL
,
NULL
,
&
length
);
if
(
rc
!=
ERROR_SUCCESS
)
{
RegCloseKey
(
hkey
);
SetLastError
(
rc
);
return
0
;
}
if
(
length
>
uBufLen
*
sizeof
(
WCHAR
)
||
!
lpszFileName
)
{
RegCloseKey
(
hkey
);
if
(
lpszFileName
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
0
;
}
else
return
length
/
sizeof
(
WCHAR
);
}
RegGetValueW
(
hkey
,
NULL
,
szImeFileW
,
RRF_RT_REG_SZ
,
NULL
,
lpszFileName
,
&
length
);
RegCloseKey
(
hkey
);
return
length
/
sizeof
(
WCHAR
);
}
/***********************************************************************
...
...
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