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
bc1e27d9
Commit
bc1e27d9
authored
Feb 13, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
Feb 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Add Enable key and User key for language profile.
parent
e93d3481
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
7 deletions
+44
-7
inputprocessor.c
dlls/msctf/inputprocessor.c
+44
-7
No files found.
dlls/msctf/inputprocessor.c
View file @
bc1e27d9
...
...
@@ -40,6 +40,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
msctf
);
static
const
WCHAR
szwLngp
[]
=
{
'L'
,
'a'
,
'n'
,
'g'
,
'u'
,
'a'
,
'g'
,
'e'
,
'P'
,
'r'
,
'o'
,
'f'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
szwEnabled
[]
=
{
'E'
,
'n'
,
'a'
,
'b'
,
'l'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
szwTipfmt
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
szwFullLangfmt
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
'\\'
,
'0'
,
'x'
,
'%'
,
'0'
,
'8'
,
'x'
,
'\\'
,
'%'
,
's'
,
0
};
typedef
struct
tagInputProcessorProfiles
{
const
ITfInputProcessorProfilesVtbl
*
InputProcessorProfilesVtbl
;
LONG
refCount
;
...
...
@@ -53,6 +58,35 @@ static void InputProcessorProfiles_Destructor(InputProcessorProfiles *This)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
void
add_userkey
(
REFCLSID
rclsid
,
LANGID
langid
,
REFGUID
guidProfile
)
{
HKEY
key
;
WCHAR
buf
[
39
];
WCHAR
buf2
[
39
];
WCHAR
fullkey
[
168
];
DWORD
disposition
=
0
;
ULONG
res
;
TRACE
(
"
\n
"
);
StringFromGUID2
(
rclsid
,
buf
,
39
);
StringFromGUID2
(
guidProfile
,
buf2
,
39
);
sprintfW
(
fullkey
,
szwFullLangfmt
,
szwSystemTIPKey
,
buf
,
szwLngp
,
langid
,
buf2
);
res
=
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
fullkey
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
key
,
&
disposition
);
if
(
!
res
&&
disposition
==
REG_CREATED_NEW_KEY
)
{
DWORD
zero
=
0x0
;
RegSetValueExW
(
key
,
szwEnabled
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
zero
,
sizeof
(
DWORD
));
}
if
(
!
res
)
RegCloseKey
(
key
);
}
static
HRESULT
WINAPI
InputProcessorProfiles_QueryInterface
(
ITfInputProcessorProfiles
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
{
InputProcessorProfiles
*
This
=
(
InputProcessorProfiles
*
)
iface
;
...
...
@@ -99,13 +133,12 @@ static HRESULT WINAPI InputProcessorProfiles_Register(
InputProcessorProfiles
*
This
=
(
InputProcessorProfiles
*
)
iface
;
HKEY
tipkey
;
WCHAR
buf
[
39
];
static
const
WCHAR
fmt
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
WCHAR
fullkey
[
68
];
TRACE
(
"(%p) %s
\n
"
,
This
,
debugstr_guid
(
rclsid
));
StringFromGUID2
(
rclsid
,
buf
,
39
);
sprintfW
(
fullkey
,
fmt
,
szwSystemTIPKey
,
buf
);
sprintfW
(
fullkey
,
szwTip
fmt
,
szwSystemTIPKey
,
buf
);
if
(
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
fullkey
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
tipkey
,
NULL
)
!=
ERROR_SUCCESS
)
...
...
@@ -134,10 +167,9 @@ static HRESULT WINAPI InputProcessorProfiles_AddLanguageProfile(
WCHAR
buf
[
39
];
WCHAR
fullkey
[
100
];
ULONG
res
;
DWORD
disposition
=
0
;
static
const
WCHAR
fmt
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
fmt2
[]
=
{
'%'
,
's'
,
'\\'
,
'0'
,
'x'
,
'%'
,
'0'
,
'8'
,
'x'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
lngp
[]
=
{
'L'
,
'a'
,
'n'
,
'g'
,
'u'
,
'a'
,
'g'
,
'e'
,
'P'
,
'r'
,
'o'
,
'f'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
desc
[]
=
{
'D'
,
'e'
,
's'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
icnf
[]
=
{
'I'
,
'c'
,
'o'
,
'n'
,
'F'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
icni
[]
=
{
'I'
,
'c'
,
'o'
,
'n'
,
'I'
,
'n'
,
'd'
,
'e'
,
'x'
,
0
};
...
...
@@ -149,24 +181,29 @@ static HRESULT WINAPI InputProcessorProfiles_AddLanguageProfile(
debugstr_wn
(
pchIconFile
,
cchFile
),
uIconIndex
);
StringFromGUID2
(
rclsid
,
buf
,
39
);
sprintfW
(
fullkey
,
fmt
,
szwSystemTIPKey
,
buf
);
sprintfW
(
fullkey
,
szwTip
fmt
,
szwSystemTIPKey
,
buf
);
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
fullkey
,
0
,
KEY_READ
|
KEY_WRITE
,
&
tipkey
)
!=
ERROR_SUCCESS
)
return
E_FAIL
;
StringFromGUID2
(
guidProfile
,
buf
,
39
);
sprintfW
(
fullkey
,
fmt2
,
l
ngp
,
langid
,
buf
);
sprintfW
(
fullkey
,
fmt2
,
szwL
ngp
,
langid
,
buf
);
res
=
RegCreateKeyExW
(
tipkey
,
fullkey
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
fmtkey
,
NULL
);
NULL
,
&
fmtkey
,
&
disposition
);
if
(
!
res
)
{
DWORD
zero
=
0x0
;
RegSetValueExW
(
fmtkey
,
desc
,
0
,
REG_SZ
,
(
LPBYTE
)
pchDesc
,
cchDesc
*
sizeof
(
WCHAR
));
RegSetValueExW
(
fmtkey
,
icnf
,
0
,
REG_SZ
,
(
LPBYTE
)
pchIconFile
,
cchFile
*
sizeof
(
WCHAR
));
RegSetValueExW
(
fmtkey
,
icni
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
uIconIndex
,
sizeof
(
DWORD
));
if
(
disposition
==
REG_CREATED_NEW_KEY
)
RegSetValueExW
(
fmtkey
,
szwEnabled
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
zero
,
sizeof
(
DWORD
));
RegCloseKey
(
fmtkey
);
add_userkey
(
rclsid
,
langid
,
guidProfile
);
}
RegCloseKey
(
tipkey
);
...
...
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