Skip to content

Commit 5c6fcfb

Browse files
authored
[WIN32SS][SDK] ImmGetHotKey's 4th parameter is optional (reactos#8557)
Fix SAL2 annotations of the IME hot-key functions. JIRA issue: N/A - Add ImmGetHotKey and ImmSetHotKey prototypes into <imm32_undoc.h>. - Fix CliImmSetHotKey annotation in user32 and <undocuser.h>. - Also fixes ImmSetHotKey, NtUserGetImeHotKey and NtUserSetImeHotKey annotations.
1 parent aab65cb commit 5c6fcfb

6 files changed

Lines changed: 42 additions & 13 deletions

File tree

‎sdk/include/reactos/imm32_undoc.h‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,22 @@ BOOL WINAPI ImmSetActiveContextConsoleIME(_In_ HWND hwnd, _In_ BOOL fFlag);
261261
BOOL WINAPI ImmActivateLayout(_In_ HKL hKL);
262262
BOOL WINAPI ImmFreeLayout(_In_ HKL hKL);
263263

264+
BOOL WINAPI
265+
ImmGetHotKey(
266+
_In_ DWORD dwHotKey,
267+
_Out_ LPUINT lpuModifiers,
268+
_Out_ LPUINT lpuVKey,
269+
_Out_opt_ LPHKL lphKL);
270+
271+
BOOL WINAPI
272+
ImmSetHotKey(
273+
_In_ DWORD dwID,
274+
_In_ UINT uModifiers,
275+
_In_ UINT uVirtualKey,
276+
_In_opt_ _When_((dwAction == SETIMEHOTKEY_ADD) &&
277+
!(IME_HOTKEY_DSWITCH_FIRST <= dwHotKeyId &&
278+
dwHotKeyId <= IME_HOTKEY_DSWITCH_LAST), _Null_) HKL hKL);
279+
264280
BOOL WINAPI
265281
ImmWINNLSEnableIME(
266282
_In_opt_ HWND hWnd,

‎sdk/include/reactos/undocuser.h‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,16 @@ LONG WINAPI CsrBroadcastSystemMessageExW(DWORD dwflags,
202202
WPARAM wParam,
203203
LPARAM lParam,
204204
PBSMINFO pBSMInfo);
205-
BOOL WINAPI CliImmSetHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKl);
205+
206+
BOOL WINAPI
207+
CliImmSetHotKey(
208+
_In_ DWORD dwID,
209+
_In_ UINT uModifiers,
210+
_In_ UINT uVirtualKey,
211+
_In_opt_ _When_((dwAction == SETIMEHOTKEY_ADD) &&
212+
!(IME_HOTKEY_DSWITCH_FIRST <= dwHotKeyId &&
213+
dwHotKeyId <= IME_HOTKEY_DSWITCH_LAST), _Null_) HKL hKL);
214+
206215
HWND WINAPI SetTaskmanWindow(HWND);
207216
HWND WINAPI GetTaskmanWindow(VOID);
208217
HWND WINAPI GetProgmanWindow(VOID);

‎win32ss/include/ntuser.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,7 @@ NtUserGetImeHotKey(
23272327
_In_ DWORD dwHotKeyId,
23282328
_Out_ PUINT lpuModifiers,
23292329
_Out_ PUINT lpuVirtualKey,
2330-
_Out_ LPHKL lphKL);
2330+
_Out_opt_ LPHKL lphKL);
23312331

23322332
BOOL
23332333
NTAPI
@@ -3138,7 +3138,7 @@ NtUserSetImeHotKey(
31383138
_In_ DWORD dwHotKeyId,
31393139
_In_ UINT uModifiers,
31403140
_In_ UINT uVirtualKey,
3141-
_In_ HKL hKL,
3141+
_In_opt_ HKL hKL,
31423142
_In_ DWORD dwAction);
31433143

31443144
BOOL

‎win32ss/user/imm32/keymsg.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ ImmGetHotKey(
649649
_In_ DWORD dwHotKey,
650650
_Out_ LPUINT lpuModifiers,
651651
_Out_ LPUINT lpuVKey,
652-
_Out_ LPHKL lphKL)
652+
_Out_opt_ LPHKL lphKL)
653653
{
654654
TRACE("(0x%lX, %p, %p, %p)\n", dwHotKey, lpuModifiers, lpuVKey, lphKL);
655655
if (lpuModifiers && lpuVKey)

‎win32ss/user/ntuser/ime.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ IntSetImeHotKey(
363363
_In_ DWORD dwHotKeyId,
364364
_In_ UINT uModifiers,
365365
_In_ UINT uVirtualKey,
366-
_In_ HKL hKL,
366+
_In_opt_ HKL hKL,
367367
_In_ DWORD dwAction)
368368
{
369369
PIMEHOTKEY pNode;
@@ -435,7 +435,7 @@ NtUserGetImeHotKey(
435435
_In_ DWORD dwHotKeyId,
436436
_Out_ PUINT lpuModifiers,
437437
_Out_ PUINT lpuVirtualKey,
438-
_Out_ LPHKL lphKL)
438+
_Out_opt_ LPHKL lphKL)
439439
{
440440
PIMEHOTKEY pNode = NULL;
441441

@@ -484,7 +484,7 @@ NtUserSetImeHotKey(
484484
_In_ DWORD dwHotKeyId,
485485
_In_ UINT uModifiers,
486486
_In_ UINT uVirtualKey,
487-
_In_ HKL hKL,
487+
_In_opt_ HKL hKL,
488488
_In_ DWORD dwAction)
489489
{
490490
BOOL ret;

‎win32ss/user/user32/windows/input.c‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ IMEHOTKEYENTRY DefaultHotKeyTableC[] =
6666
#define FE_KOREAN (1 << 3)
6767

6868
// Sets the far-east flags
69-
// Win: SetFeKeyboardFlags
7069
VOID FASTCALL IntSetFeKeyboardFlags(LANGID LangID, PBYTE pbFlags)
7170
{
7271
switch (LangID)
@@ -143,8 +142,6 @@ CliImmSetHotKeyWorker(DWORD dwHotKeyId, UINT uModifiers, UINT uVirtualKey, HKL h
143142
return FALSE;
144143
}
145144

146-
147-
/* Win: LoadPreloadKeyboardLayouts */
148145
VOID IntLoadPreloadKeyboardLayouts(VOID)
149146
{
150147
UINT nNumber, uFlags;
@@ -258,11 +255,18 @@ CliSaveImeHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKL, BOOL bD
258255
return ret;
259256
}
260257

261-
/*
258+
/**
262259
* @implemented
263-
* Same as imm32!ImmSetHotKey.
260+
* @note Same as imm32!ImmSetHotKey.
264261
*/
265-
BOOL WINAPI CliImmSetHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKL)
262+
BOOL WINAPI
263+
CliImmSetHotKey(
264+
_In_ DWORD dwID,
265+
_In_ UINT uModifiers,
266+
_In_ UINT uVirtualKey,
267+
_In_opt_ _When_((dwAction == SETIMEHOTKEY_ADD) &&
268+
!(IME_HOTKEY_DSWITCH_FIRST <= dwHotKeyId &&
269+
dwHotKeyId <= IME_HOTKEY_DSWITCH_LAST), _Null_) HKL hKL)
266270
{
267271
BOOL ret;
268272

0 commit comments

Comments
 (0)