[REACTOS] Standardize <imm.h> and <immdev.h> (#6493)

Improve header compatibility and
code quality.
JIRA issue: CORE-19268
- Improve <imm.h> and <immdev.h>
  compatibility by correctly choosing
  the items.
- Use <immdev.h> instead of
  <ddk/immdev.h>.
- Move INPUTCONTEXTDX, IMEINFOEX,
  IMEDPI, and CLIENTIMC into
  <imm32_undoc.h>.
- Adapt to these changes.
This commit is contained in:
Katayama Hirofumi MZ 2024-02-13 20:33:14 +09:00 committed by GitHub
parent bdcfc6bc8e
commit 8ea93d2ab2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 783 additions and 730 deletions

View File

@ -15,7 +15,8 @@
#include <windows.h>
#include <imm.h>
#include <ddk/immdev.h>
#include <immdev.h>
#include <imm32_undoc.h>
#include <cguid.h>
#include <tchar.h>
#include <msctf.h>
@ -34,6 +35,4 @@
#include "resource.h"
#define IS_IME_HKL(hKL) ((((ULONG_PTR)(hKL)) & 0xF0000000) == 0xE0000000)
extern HINSTANCE g_hInst;

View File

@ -47,6 +47,7 @@
#include "imm.h"
#ifdef __REACTOS__
#include <immdev.h>
#include <imm32_undoc.h>
#endif
#include "usp10.h"
#include "commctrl.h"

View File

@ -27,7 +27,8 @@
#include <winver.h>
#include <imm.h>
#include <ddk/immdev.h>
#include <immdev.h>
#include <imm32_undoc.h>
#define NTOS_MODE_USER
#include <ndk/umtypes.h>
@ -40,7 +41,6 @@
/* Undocumented user definitions */
#include <undocuser.h>
#include <imm32_undoc.h>
#include <strsafe.h>

View File

@ -16,7 +16,6 @@
#include <windows.h>
#include <sddl.h>
#include <imm.h>
#include <ddk/immdev.h>
#include <cguid.h>
#include <tchar.h>
#include <msctf.h>

View File

@ -16,7 +16,6 @@
#include <windows.h>
#include <oleacc.h>
#include <imm.h>
#include <ddk/immdev.h>
#include <undocuser.h>
#include <cguid.h>
#include <msctf.h>

View File

@ -234,7 +234,8 @@
#include "rtf.h"
#include "imm.h"
#ifdef __REACTOS__
#include "immdev.h"
#include <immdev.h>
#include <imm32_undoc.h>
#endif
#include "res.h"

View File

@ -4,13 +4,13 @@
#define WIN32_NO_STATUS
#include <windows.h>
#include <imm.h>
#include <ddk/immdev.h>
#include <immdev.h>
#include <imm32_undoc.h>
#include <pseh/pseh2.h>
#include <ndk/umtypes.h>
#include <ndk/pstypes.h>
#include "../../../win32ss/include/ntuser.h"
#include <undocuser.h>
#include <imm32_undoc.h>
#include <ndk/rtlfuncs.h>
#include <wine/test.h>
#include <stdio.h>

View File

@ -14,6 +14,8 @@
#include <wingdi.h>
#include <objbase.h>
#include <imm.h>
#include <immdev.h>
#include <imm32_undoc.h>
#include <winddi.h>
#include <prntfont.h>

View File

@ -2,7 +2,7 @@
* PROJECT: ReactOS headers
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: Providing DDK-compatible <immdev.h> and IME/IMM development helper
* COPYRIGHT: Copyright 2021-2022 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
* COPYRIGHT: Copyright 2021-2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#ifndef _IMMDEV_
@ -17,14 +17,70 @@
extern "C" {
#endif
BOOL WINAPI ImmDisableTextFrameService(_In_ DWORD dwThreadId);
BOOL WINAPI CtfImmIsCiceroStartedInThread(VOID);
typedef struct _tagIMEINFO {
DWORD dwPrivateDataSize;
DWORD fdwProperty;
DWORD fdwConversionCaps;
DWORD fdwSentenceCaps;
DWORD fdwUICaps;
DWORD fdwSCSCaps;
DWORD fdwSelectCaps;
} IMEINFO, *PIMEINFO, NEAR *NPIMEINFO, FAR *LPIMEINFO;
typedef struct tagSOFTKBDDATA
{
typedef struct tagCANDIDATEINFO {
DWORD dwSize;
DWORD dwCount;
DWORD dwOffset[32];
DWORD dwPrivateSize;
DWORD dwPrivateOffset;
} CANDIDATEINFO, *PCANDIDATEINFO, NEAR *NPCANDIDATEINFO, FAR *LPCANDIDATEINFO;
#if (WINVER >= 0x040A)
BOOL WINAPI ImmDisableTextFrameService(_In_ DWORD dwThreadId);
#endif
typedef struct tagSOFTKBDDATA {
UINT uCount;
WORD wCode[1][256];
} SOFTKBDDATA, *PSOFTKBDDATA, *LPSOFTKBDDATA;
WORD wCode[ANYSIZE_ARRAY][256];
} SOFTKBDDATA, *PSOFTKBDDATA, NEAR *NPSOFTKBDDATA, FAR *LPSOFTKBDDATA;
typedef struct tagCOMPOSITIONSTRING {
DWORD dwSize;
DWORD dwCompReadAttrLen;
DWORD dwCompReadAttrOffset;
DWORD dwCompReadClauseLen;
DWORD dwCompReadClauseOffset;
DWORD dwCompReadStrLen;
DWORD dwCompReadStrOffset;
DWORD dwCompAttrLen;
DWORD dwCompAttrOffset;
DWORD dwCompClauseLen;
DWORD dwCompClauseOffset;
DWORD dwCompStrLen;
DWORD dwCompStrOffset;
DWORD dwCursorPos;
DWORD dwDeltaStart;
DWORD dwResultReadClauseLen;
DWORD dwResultReadClauseOffset;
DWORD dwResultReadStrLen;
DWORD dwResultReadStrOffset;
DWORD dwResultClauseLen;
DWORD dwResultClauseOffset;
DWORD dwResultStrLen;
DWORD dwResultStrOffset;
DWORD dwPrivateSize;
DWORD dwPrivateOffset;
} COMPOSITIONSTRING, *PCOMPOSITIONSTRING, NEAR *NPCOMPOSITIONSTRING, FAR *LPCOMPOSITIONSTRING;
typedef struct tagGUIDELINE {
DWORD dwSize;
DWORD dwLevel;
DWORD dwIndex;
DWORD dwStrLen;
DWORD dwStrOffset;
DWORD dwPrivateSize;
DWORD dwPrivateOffset;
} GUIDELINE, *PGUIDELINE, NEAR *NPGUIDELINE, FAR *LPGUIDELINE;
/* wParam for WM_IME_CONTROL */
#define IMC_GETCONVERSIONMODE 0x0001
@ -90,70 +146,30 @@ typedef struct _tagINPUTCONTEXT {
HIMCC hMsgBuf;
DWORD fdwInit;
DWORD dwReserve[3];
} INPUTCONTEXT, *PINPUTCONTEXT, *LPINPUTCONTEXT;
} INPUTCONTEXT, *PINPUTCONTEXT, NEAR *NPINPUTCONTEXT, FAR *LPINPUTCONTEXT;
#ifdef _WIN64
C_ASSERT(offsetof(INPUTCONTEXT, hWnd) == 0x0);
C_ASSERT(offsetof(INPUTCONTEXT, fOpen) == 0x8);
C_ASSERT(offsetof(INPUTCONTEXT, ptStatusWndPos) == 0xc);
C_ASSERT(offsetof(INPUTCONTEXT, ptSoftKbdPos) == 0x14);
C_ASSERT(offsetof(INPUTCONTEXT, fdwConversion) == 0x1c);
C_ASSERT(offsetof(INPUTCONTEXT, fdwSentence) == 0x20);
C_ASSERT(offsetof(INPUTCONTEXT, lfFont) == 0x24);
C_ASSERT(offsetof(INPUTCONTEXT, cfCompForm) == 0x80);
C_ASSERT(offsetof(INPUTCONTEXT, cfCandForm) == 0x9c);
C_ASSERT(offsetof(INPUTCONTEXT, hCompStr) == 0x120);
C_ASSERT(offsetof(INPUTCONTEXT, hCandInfo) == 0x128);
C_ASSERT(offsetof(INPUTCONTEXT, hGuideLine) == 0x130);
C_ASSERT(offsetof(INPUTCONTEXT, hPrivate) == 0x138);
C_ASSERT(offsetof(INPUTCONTEXT, dwNumMsgBuf) == 0x140);
C_ASSERT(offsetof(INPUTCONTEXT, hMsgBuf) == 0x148);
C_ASSERT(offsetof(INPUTCONTEXT, fdwInit) == 0x150);
C_ASSERT(offsetof(INPUTCONTEXT, dwReserve) == 0x154);
C_ASSERT(sizeof(INPUTCONTEXT) == 0x160);
#else
#ifndef _WIN64
C_ASSERT(offsetof(INPUTCONTEXT, hWnd) == 0x0);
C_ASSERT(offsetof(INPUTCONTEXT, fOpen) == 0x4);
C_ASSERT(offsetof(INPUTCONTEXT, ptStatusWndPos) == 0x8);
C_ASSERT(offsetof(INPUTCONTEXT, ptSoftKbdPos) == 0x10);
C_ASSERT(offsetof(INPUTCONTEXT, fdwConversion) == 0x18);
C_ASSERT(offsetof(INPUTCONTEXT, fdwSentence) == 0x1c);
C_ASSERT(offsetof(INPUTCONTEXT, fdwSentence) == 0x1C);
C_ASSERT(offsetof(INPUTCONTEXT, lfFont) == 0x20);
C_ASSERT(offsetof(INPUTCONTEXT, cfCompForm) == 0x7c);
C_ASSERT(offsetof(INPUTCONTEXT, cfCompForm) == 0x7C);
C_ASSERT(offsetof(INPUTCONTEXT, cfCandForm) == 0x98);
C_ASSERT(offsetof(INPUTCONTEXT, hCompStr) == 0x118);
C_ASSERT(offsetof(INPUTCONTEXT, hCandInfo) == 0x11c);
C_ASSERT(offsetof(INPUTCONTEXT, hCandInfo) == 0x11C);
C_ASSERT(offsetof(INPUTCONTEXT, hGuideLine) == 0x120);
C_ASSERT(offsetof(INPUTCONTEXT, hPrivate) == 0x124);
C_ASSERT(offsetof(INPUTCONTEXT, dwNumMsgBuf) == 0x128);
C_ASSERT(offsetof(INPUTCONTEXT, hMsgBuf) == 0x12c);
C_ASSERT(offsetof(INPUTCONTEXT, hMsgBuf) == 0x12C);
C_ASSERT(offsetof(INPUTCONTEXT, fdwInit) == 0x130);
C_ASSERT(offsetof(INPUTCONTEXT, dwReserve) == 0x134);
C_ASSERT(sizeof(INPUTCONTEXT) == 0x140);
#endif
struct IME_STATE;
/* unconfirmed */
#ifdef __cplusplus
typedef struct INPUTCONTEXTDX : INPUTCONTEXT
{
#else
typedef struct INPUTCONTEXTDX
{
INPUTCONTEXT;
#endif
UINT nVKey; // +0x140
BOOL bNeedsTrans; // +0x144
DWORD dwUnknown1;
DWORD dwUIFlags; // +0x14c
DWORD dwUnknown2;
struct IME_STATE *pState; // +0x154
DWORD dwChange; // +0x158
HIMCC hCtfImeContext;
} INPUTCONTEXTDX, *PINPUTCONTEXTDX, *LPINPUTCONTEXTDX;
// bits of fdwInit of INPUTCONTEXT
/* bits of fdwInit of INPUTCONTEXT */
#define INIT_STATUSWNDPOS 0x00000001
#define INIT_CONVERSION 0x00000002
#define INIT_SENTENCE 0x00000004
@ -162,7 +178,7 @@ typedef struct INPUTCONTEXTDX
#define INIT_SOFTKBDPOS 0x00000020
#define INIT_GUIDMAP 0x00000040
// bits for INPUTCONTEXTDX.dwChange
/* bits for INPUTCONTEXTDX.dwChange */
#define INPUTCONTEXTDX_CHANGE_OPEN 0x1
#define INPUTCONTEXTDX_CHANGE_CONVERSION 0x2
#define INPUTCONTEXTDX_CHANGE_SENTENCE 0x4
@ -172,7 +188,7 @@ typedef struct INPUTCONTEXTDX
#define WM_IME_REPORT 0x280
#endif
// WM_IME_REPORT wParam
/* WM_IME_REPORT wParam */
#define IR_STRINGSTART 0x100
#define IR_STRINGEND 0x101
#define IR_OPENCONVERT 0x120
@ -186,193 +202,110 @@ typedef struct INPUTCONTEXTDX
#define IR_STRINGEX 0x180
#define IR_MODEINFO 0x190
// for IR_UNDETERMINE
typedef struct tagUNDETERMINESTRUCT
{
DWORD dwSize;
UINT uDefIMESize;
UINT uDefIMEPos;
UINT uUndetTextLen;
UINT uUndetTextPos;
UINT uUndetAttrPos;
UINT uCursorPos;
UINT uDeltaStart;
UINT uDetermineTextLen;
UINT uDetermineTextPos;
UINT uDetermineDelimPos;
UINT uYomiTextLen;
UINT uYomiTextPos;
UINT uYomiDelimPos;
} UNDETERMINESTRUCT, *PUNDETERMINESTRUCT, *LPUNDETERMINESTRUCT;
/* IMC */
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC);
LPINPUTCONTEXT WINAPI ImmLockIMC(_In_ HIMC hIMC);
BOOL WINAPI ImmUnlockIMC(_In_ HIMC hIMC);
DWORD WINAPI ImmGetIMCLockCount(_In_ HIMC hIMC);
typedef struct IME_SUBSTATE
{
struct IME_SUBSTATE *pNext;
HKL hKL;
DWORD dwValue;
} IME_SUBSTATE, *PIME_SUBSTATE;
/* IMCC */
#ifndef _WIN64
C_ASSERT(sizeof(IME_SUBSTATE) == 0xc);
HIMCC WINAPI ImmCreateIMCC(_In_ DWORD size);
HIMCC WINAPI ImmDestroyIMCC(_In_ HIMCC block);
LPVOID WINAPI ImmLockIMCC(_In_ HIMCC imcc);
BOOL WINAPI ImmUnlockIMCC(_In_ HIMCC imcc);
DWORD WINAPI ImmGetIMCCLockCount(_In_ HIMCC imcc);
HIMCC WINAPI ImmReSizeIMCC(_In_ HIMCC imcc, _In_ DWORD size);
DWORD WINAPI ImmGetIMCCSize(_In_ HIMCC imcc);
/* Messaging */
BOOL WINAPI ImmGenerateMessage(_In_ HIMC hIMC);
BOOL WINAPI
ImmTranslateMessage(
_In_ HWND hwnd,
_In_ UINT msg,
_In_ WPARAM wParam,
_In_ LPARAM lKeyData);
LRESULT WINAPI ImmRequestMessageA(_In_ HIMC hIMC, _In_ WPARAM wParam, _In_ LPARAM lParam);
LRESULT WINAPI ImmRequestMessageW(_In_ HIMC hIMC, _In_ WPARAM wParam, _In_ LPARAM lParam);
#ifdef UNICODE
#define ImmRequestMessage ImmRequestMessageW
#else
#define ImmRequestMessage ImmRequestMessageA
#endif
typedef struct IME_STATE
{
struct IME_STATE *pNext;
WORD wLang;
WORD fOpen;
DWORD dwConversion;
DWORD dwSentence;
DWORD dwInit;
PIME_SUBSTATE pSubState;
} IME_STATE, *PIME_STATE;
#ifndef _WIN64
C_ASSERT(sizeof(IME_STATE) == 0x18);
#endif
typedef struct _tagTRANSMSG
{
typedef struct _tagTRANSMSG {
UINT message;
WPARAM wParam;
LPARAM lParam;
} TRANSMSG, *PTRANSMSG, *LPTRANSMSG;
} TRANSMSG, *PTRANSMSG, NEAR *NPTRANSMSG, FAR *LPTRANSMSG;
typedef struct _tagTRANSMSGLIST
{
typedef struct _tagTRANSMSGLIST {
UINT uMsgCount;
TRANSMSG TransMsg[ANYSIZE_ARRAY];
} TRANSMSGLIST, *PTRANSMSGLIST, *LPTRANSMSGLIST;
} TRANSMSGLIST, *PTRANSMSGLIST, NEAR *NPTRANSMSGLIST, FAR *LPTRANSMSGLIST;
#define DEFINE_IME_ENTRY(type, name, params, extended) typedef type (WINAPI *FN_##name) params;
#include <imetable.h>
#undef DEFINE_IME_ENTRY
/* Soft keyboard */
typedef struct IMEDPI
{
struct IMEDPI *pNext;
HINSTANCE hInst;
HKL hKL;
IMEINFO ImeInfo;
UINT uCodePage;
WCHAR szUIClass[16];
DWORD cLockObj;
DWORD dwFlags;
#define DEFINE_IME_ENTRY(type, name, params, extended) FN_##name name;
#include <imetable.h>
#undef DEFINE_IME_ENTRY
} IMEDPI, *PIMEDPI;
HWND WINAPI
ImmCreateSoftKeyboard(
_In_ UINT uType,
_In_ HWND hwndParent,
_In_ INT x,
_In_ INT y);
#ifndef _WIN64
C_ASSERT(offsetof(IMEDPI, pNext) == 0x0);
C_ASSERT(offsetof(IMEDPI, hInst) == 0x4);
C_ASSERT(offsetof(IMEDPI, hKL) == 0x8);
C_ASSERT(offsetof(IMEDPI, ImeInfo) == 0xc);
C_ASSERT(offsetof(IMEDPI, uCodePage) == 0x28);
C_ASSERT(offsetof(IMEDPI, szUIClass) == 0x2c);
C_ASSERT(offsetof(IMEDPI, cLockObj) == 0x4c);
C_ASSERT(offsetof(IMEDPI, dwFlags) == 0x50);
C_ASSERT(offsetof(IMEDPI, ImeInquire) == 0x54);
C_ASSERT(offsetof(IMEDPI, ImeConversionList) == 0x58);
C_ASSERT(offsetof(IMEDPI, ImeRegisterWord) == 0x5c);
C_ASSERT(offsetof(IMEDPI, ImeUnregisterWord) == 0x60);
C_ASSERT(offsetof(IMEDPI, ImeGetRegisterWordStyle) == 0x64);
C_ASSERT(offsetof(IMEDPI, ImeEnumRegisterWord) == 0x68);
C_ASSERT(offsetof(IMEDPI, ImeConfigure) == 0x6c);
C_ASSERT(offsetof(IMEDPI, ImeDestroy) == 0x70);
C_ASSERT(offsetof(IMEDPI, ImeEscape) == 0x74);
C_ASSERT(offsetof(IMEDPI, ImeProcessKey) == 0x78);
C_ASSERT(offsetof(IMEDPI, ImeSelect) == 0x7c);
C_ASSERT(offsetof(IMEDPI, ImeSetActiveContext) == 0x80);
C_ASSERT(offsetof(IMEDPI, ImeToAsciiEx) == 0x84);
C_ASSERT(offsetof(IMEDPI, NotifyIME) == 0x88);
C_ASSERT(offsetof(IMEDPI, ImeSetCompositionString) == 0x8c);
C_ASSERT(offsetof(IMEDPI, ImeGetImeMenuItems) == 0x90);
C_ASSERT(offsetof(IMEDPI, CtfImeInquireExW) == 0x94);
C_ASSERT(offsetof(IMEDPI, CtfImeSelectEx) == 0x98);
C_ASSERT(offsetof(IMEDPI, CtfImeEscapeEx) == 0x9c);
C_ASSERT(offsetof(IMEDPI, CtfImeGetGuidAtom) == 0xa0);
C_ASSERT(offsetof(IMEDPI, CtfImeIsGuidMapEnable) == 0xa4);
C_ASSERT(sizeof(IMEDPI) == 0xa8);
#endif
BOOL WINAPI
ImmShowSoftKeyboard(
_In_ HWND hwndSoftKBD,
_In_ INT nCmdShow);
/* flags for IMEDPI.dwFlags */
#define IMEDPI_FLAG_UNLOADED 0x1
#define IMEDPI_FLAG_LOCKED 0x2
/* unconfirmed */
typedef struct tagCLIENTIMC
{
HANDLE hInputContext; /* LocalAlloc'ed LHND */
LONG cLockObj;
DWORD dwFlags;
DWORD dwCompatFlags;
RTL_CRITICAL_SECTION cs;
UINT uCodePage;
HKL hKL;
BOOL bCtfIme;
} CLIENTIMC, *PCLIENTIMC;
#ifndef _WIN64
C_ASSERT(offsetof(CLIENTIMC, hInputContext) == 0x0);
C_ASSERT(offsetof(CLIENTIMC, cLockObj) == 0x4);
C_ASSERT(offsetof(CLIENTIMC, dwFlags) == 0x8);
C_ASSERT(offsetof(CLIENTIMC, dwCompatFlags) == 0xc);
C_ASSERT(offsetof(CLIENTIMC, cs) == 0x10);
C_ASSERT(offsetof(CLIENTIMC, uCodePage) == 0x28);
C_ASSERT(offsetof(CLIENTIMC, hKL) == 0x2c);
C_ASSERT(sizeof(CLIENTIMC) == 0x34);
#endif
/* flags for CLIENTIMC */
#define CLIENTIMC_WIDE 0x1
#define CLIENTIMC_ACTIVE 0x2
#define CLIENTIMC_UNKNOWN4 0x20
#define CLIENTIMC_DESTROY 0x40
#define CLIENTIMC_DISABLEIME 0x80
#define CLIENTIMC_UNKNOWN2 0x100
BOOL WINAPI
ImmDestroySoftKeyboard(
_In_ HWND hwndSoftKBD);
/* IME file interface */
BOOL WINAPI
ImeInquire(
_Out_ LPIMEINFO lpIMEInfo,
_Out_ LPWSTR lpszWndClass,
_Out_ LPTSTR lpszWndClass,
_In_ DWORD dwSystemInfoFlags);
DWORD WINAPI
ImeConversionList(
_In_ HIMC hIMC,
_In_ LPCWSTR lpSrc,
_In_ LPCTSTR lpSrc,
_Out_ LPCANDIDATELIST lpDst,
_In_ DWORD dwBufLen,
_In_ UINT uFlag);
BOOL WINAPI
ImeRegisterWord(
_In_ LPCWSTR lpszReading,
_In_ LPCTSTR lpszReading,
_In_ DWORD dwStyle,
_In_ LPCWSTR lpszString);
_In_ LPCTSTR lpszString);
BOOL WINAPI
ImeUnregisterWord(
_In_ LPCWSTR lpszReading,
_In_ LPCTSTR lpszReading,
_In_ DWORD dwStyle,
_In_ LPCWSTR lpszString);
_In_ LPCTSTR lpszString);
UINT WINAPI
ImeGetRegisterWordStyle(
_In_ UINT nItem,
_Out_ LPSTYLEBUFW lpStyleBuf);
_Out_ LPSTYLEBUF lpStyleBuf);
UINT WINAPI
ImeEnumRegisterWord(
_In_ REGISTERWORDENUMPROCW lpfnEnumProc,
_In_opt_ LPCWSTR lpszReading,
_In_ REGISTERWORDENUMPROC lpfnEnumProc,
_In_opt_ LPCTSTR lpszReading,
_In_ DWORD dwStyle,
_In_opt_ LPCWSTR lpszString,
_In_opt_ LPCTSTR lpszString,
_In_opt_ LPVOID lpData);
BOOL WINAPI
@ -439,12 +372,41 @@ ImeGetImeMenuItems(
_In_ HIMC hIMC,
_In_ DWORD dwFlags,
_In_ DWORD dwType,
_Inout_opt_ LPIMEMENUITEMINFOW lpImeParentMenu,
_Inout_opt_ LPIMEMENUITEMINFOW lpImeMenu,
_Inout_opt_ LPIMEMENUITEMINFO lpImeParentMenu,
_Inout_opt_ LPIMEMENUITEMINFO lpImeMenu,
_In_ DWORD dwSize);
#ifdef __cplusplus
} // extern "C"
} /* extern "C" */
#endif
/* IME Property bits */
#define IME_PROP_END_UNLOAD 0x0001
#define IME_PROP_KBD_CHAR_FIRST 0x0002
#define IME_PROP_IGNORE_UPKEYS 0x0004
#define IME_PROP_NEED_ALTKEY 0x0008
#define IME_PROP_NO_KEYS_ON_CLOSE 0x0010
#define IME_PROP_ACCEPT_WIDE_VKEY 0x0020
/* for NI_CONTEXTUPDATED */
#define IMC_SETCONVERSIONMODE 0x0002
#define IMC_SETSENTENCEMODE 0x0004
#define IMC_SETOPENSTATUS 0x0006
/* dwAction for ImmNotifyIME */
#define NI_CONTEXTUPDATED 0x0003
#define NI_OPENCANDIDATE 0x0010
#define NI_CLOSECANDIDATE 0x0011
#define NI_SELECTCANDIDATESTR 0x0012
#define NI_CHANGECANDIDATELIST 0x0013
#define NI_FINALIZECONVERSIONRESULT 0x0014
#define NI_COMPOSITIONSTR 0x0015
#define NI_SETCANDIDATE_PAGESTART 0x0016
#define NI_SETCANDIDATE_PAGESIZE 0x0017
#define NI_IMEMENUSELECTED 0x0018
/* dwSystemInfoFlags bits */
#define IME_SYSINFO_WINLOGON 0x0001
#define IME_SYSINFO_WOW16 0x0002
#endif /* ndef _IMMDEV_ */

File diff suppressed because it is too large Load Diff

View File

@ -11,18 +11,210 @@
extern "C" {
#endif
#include <immdev.h>
#define IS_IME_HKL(hkl) ((((ULONG_PTR)(hkl)) & 0xF0000000) == 0xE0000000)
typedef struct tagIMEINFOEX
{
HKL hkl;
IMEINFO ImeInfo;
WCHAR wszUIClass[16];
ULONG fdwInitConvMode;
INT fInitOpen;
INT fLoadFlag;
DWORD dwProdVersion;
DWORD dwImeWinVersion;
WCHAR wszImeDescription[50];
WCHAR wszImeFile[80];
struct
{
INT fSysWow64Only:1;
INT fCUASLayer:1;
};
} IMEINFOEX, *PIMEINFOEX, NEAR *NPIMEINFOEX, FAR *LPIMEINFOEX;
typedef enum IMEINFOEXCLASS
{
ImeInfoExKeyboardLayout,
ImeInfoExKeyboardLayoutTFS,
ImeInfoExImeWindow,
ImeInfoExImeFileName
} IMEINFOEXCLASS;
#define DEFINE_IME_ENTRY(type, name, params, extended) typedef type (WINAPI *FN_##name) params;
#include <imetable.h>
#undef DEFINE_IME_ENTRY
typedef struct IMEDPI
{
struct IMEDPI *pNext;
HINSTANCE hInst;
HKL hKL;
IMEINFO ImeInfo;
UINT uCodePage;
WCHAR szUIClass[16];
DWORD cLockObj;
DWORD dwFlags;
#define DEFINE_IME_ENTRY(type, name, params, extended) FN_##name name;
#include <imetable.h>
#undef DEFINE_IME_ENTRY
} IMEDPI, *PIMEDPI, NEAR *NPIMEDPI, FAR *LPIMEDPI;
#ifndef _WIN64
C_ASSERT(offsetof(IMEDPI, pNext) == 0x0);
C_ASSERT(offsetof(IMEDPI, hInst) == 0x4);
C_ASSERT(offsetof(IMEDPI, hKL) == 0x8);
C_ASSERT(offsetof(IMEDPI, ImeInfo) == 0xc);
C_ASSERT(offsetof(IMEDPI, uCodePage) == 0x28);
C_ASSERT(offsetof(IMEDPI, szUIClass) == 0x2c);
C_ASSERT(offsetof(IMEDPI, cLockObj) == 0x4c);
C_ASSERT(offsetof(IMEDPI, dwFlags) == 0x50);
C_ASSERT(offsetof(IMEDPI, ImeInquire) == 0x54);
C_ASSERT(offsetof(IMEDPI, ImeConversionList) == 0x58);
C_ASSERT(offsetof(IMEDPI, ImeRegisterWord) == 0x5c);
C_ASSERT(offsetof(IMEDPI, ImeUnregisterWord) == 0x60);
C_ASSERT(offsetof(IMEDPI, ImeGetRegisterWordStyle) == 0x64);
C_ASSERT(offsetof(IMEDPI, ImeEnumRegisterWord) == 0x68);
C_ASSERT(offsetof(IMEDPI, ImeConfigure) == 0x6c);
C_ASSERT(offsetof(IMEDPI, ImeDestroy) == 0x70);
C_ASSERT(offsetof(IMEDPI, ImeEscape) == 0x74);
C_ASSERT(offsetof(IMEDPI, ImeProcessKey) == 0x78);
C_ASSERT(offsetof(IMEDPI, ImeSelect) == 0x7c);
C_ASSERT(offsetof(IMEDPI, ImeSetActiveContext) == 0x80);
C_ASSERT(offsetof(IMEDPI, ImeToAsciiEx) == 0x84);
C_ASSERT(offsetof(IMEDPI, NotifyIME) == 0x88);
C_ASSERT(offsetof(IMEDPI, ImeSetCompositionString) == 0x8c);
C_ASSERT(offsetof(IMEDPI, ImeGetImeMenuItems) == 0x90);
C_ASSERT(offsetof(IMEDPI, CtfImeInquireExW) == 0x94);
C_ASSERT(offsetof(IMEDPI, CtfImeSelectEx) == 0x98);
C_ASSERT(offsetof(IMEDPI, CtfImeEscapeEx) == 0x9c);
C_ASSERT(offsetof(IMEDPI, CtfImeGetGuidAtom) == 0xa0);
C_ASSERT(offsetof(IMEDPI, CtfImeIsGuidMapEnable) == 0xa4);
C_ASSERT(sizeof(IMEDPI) == 0xa8);
#endif
/* flags for IMEDPI.dwFlags */
#define IMEDPI_FLAG_UNLOADED 0x1
#define IMEDPI_FLAG_LOCKED 0x2
PIMEDPI WINAPI ImmLockImeDpi(_In_ HKL hKL);
VOID WINAPI ImmUnlockImeDpi(_Inout_ PIMEDPI pImeDpi);
/* unconfirmed */
typedef struct tagCLIENTIMC
{
HANDLE hInputContext; /* LocalAlloc'ed LHND */
LONG cLockObj;
DWORD dwFlags;
DWORD dwCompatFlags;
RTL_CRITICAL_SECTION cs;
UINT uCodePage;
HKL hKL;
BOOL bCtfIme;
} CLIENTIMC, *PCLIENTIMC, NEAR *NPCLIENTIMC, FAR *LPCLIENTIMC;
#ifndef _WIN64
C_ASSERT(offsetof(CLIENTIMC, hInputContext) == 0x0);
C_ASSERT(offsetof(CLIENTIMC, cLockObj) == 0x4);
C_ASSERT(offsetof(CLIENTIMC, dwFlags) == 0x8);
C_ASSERT(offsetof(CLIENTIMC, dwCompatFlags) == 0xc);
C_ASSERT(offsetof(CLIENTIMC, cs) == 0x10);
C_ASSERT(offsetof(CLIENTIMC, uCodePage) == 0x28);
C_ASSERT(offsetof(CLIENTIMC, hKL) == 0x2c);
C_ASSERT(sizeof(CLIENTIMC) == 0x34);
#endif
/* flags for CLIENTIMC */
#define CLIENTIMC_WIDE 0x1
#define CLIENTIMC_ACTIVE 0x2
#define CLIENTIMC_UNKNOWN4 0x20
#define CLIENTIMC_DESTROY 0x40
#define CLIENTIMC_DISABLEIME 0x80
#define CLIENTIMC_UNKNOWN2 0x100
PCLIENTIMC WINAPI ImmLockClientImc(_In_ HIMC hImc);
VOID WINAPI ImmUnlockClientImc(_Inout_ PCLIENTIMC pClientImc);
struct IME_STATE;
/* unconfirmed */
#ifdef __cplusplus
typedef struct INPUTCONTEXTDX : INPUTCONTEXT
{
#else
typedef struct INPUTCONTEXTDX
{
INPUTCONTEXT;
#endif
UINT nVKey; // +0x140
BOOL bNeedsTrans; // +0x144
DWORD dwUnknown1;
DWORD dwUIFlags; // +0x14c
DWORD dwUnknown2;
struct IME_STATE *pState; // +0x154
DWORD dwChange; // +0x158
HIMCC hCtfImeContext;
} INPUTCONTEXTDX, *PINPUTCONTEXTDX, NEAR *NPINPUTCONTEXTDX, FAR *LPINPUTCONTEXTDX;
typedef struct IME_SUBSTATE
{
struct IME_SUBSTATE *pNext;
HKL hKL;
DWORD dwValue;
} IME_SUBSTATE, *PIME_SUBSTATE, NEAR *NPIME_SUBSTATE, FAR *PIME_SUBSTATE;
#ifndef _WIN64
C_ASSERT(sizeof(IME_SUBSTATE) == 0xc);
#endif
typedef struct IME_STATE
{
struct IME_STATE *pNext;
WORD wLang;
WORD fOpen;
DWORD dwConversion;
DWORD dwSentence;
DWORD dwInit;
PIME_SUBSTATE pSubState;
} IME_STATE, *PIME_STATE, NEAR *NPIME_STATE, FAR *LPIME_STATE;
#ifndef _WIN64
C_ASSERT(sizeof(IME_STATE) == 0x18);
#endif
/* for WM_IME_REPORT IR_UNDETERMINE */
typedef struct tagUNDETERMINESTRUCT
{
DWORD dwSize;
UINT uDefIMESize;
UINT uDefIMEPos;
UINT uUndetTextLen;
UINT uUndetTextPos;
UINT uUndetAttrPos;
UINT uCursorPos;
UINT uDeltaStart;
UINT uDetermineTextLen;
UINT uDetermineTextPos;
UINT uDetermineDelimPos;
UINT uYomiTextLen;
UINT uYomiTextPos;
UINT uYomiDelimPos;
} UNDETERMINESTRUCT, *PUNDETERMINESTRUCT, *LPUNDETERMINESTRUCT;
UINT WINAPI GetKeyboardLayoutCP(_In_ LANGID wLangId);
BOOL WINAPI
ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey);
ImmGetImeInfoEx(
_Out_ PIMEINFOEX pImeInfoEx,
_In_ IMEINFOEXCLASS SearchType,
_In_ PVOID pvSearchKey);
BOOL WINAPI ImmLoadLayout(HKL hKL, PIMEINFOEX pImeInfoEx);
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc);
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc);
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL);
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi);
HRESULT WINAPI CtfImmTIMActivate(HKL hKL);
DWORD WINAPI ImmGetAppCompatFlags(HIMC hIMC);
BOOL WINAPI ImmLoadLayout(_In_ HKL hKL, _Inout_ PIMEINFOEX pImeInfoEx);
DWORD WINAPI ImmGetAppCompatFlags(_In_ HIMC hIMC);
BOOL WINAPI ImmSetActiveContext(_In_ HWND hwnd, _In_ HIMC hIMC, _In_ BOOL fFlag);
BOOL WINAPI ImmLoadIME(_In_ HKL hKL);
DWORD WINAPI ImmProcessKey(_In_ HWND, _In_ HKL, _In_ UINT, _In_ LPARAM, _In_ DWORD);
HRESULT WINAPI CtfAImmActivate(_Out_opt_ HINSTANCE *phinstCtfIme);
HRESULT WINAPI CtfAImmDeactivate(_In_ BOOL bDestroy);
@ -37,6 +229,9 @@ VOID WINAPI CtfImmCoUninitialize(VOID);
VOID WINAPI CtfImmEnterCoInitCountSkipMode(VOID);
BOOL WINAPI CtfImmLeaveCoInitCountSkipMode(VOID);
HRESULT WINAPI CtfImmLastEnabledWndDestroy(_In_ BOOL bCreate);
BOOL WINAPI CtfImmIsCiceroStartedInThread(VOID);
HRESULT WINAPI CtfImmTIMActivate(_In_ HKL hKL);
BOOL WINAPI CtfImmIsTextFrameServiceDisabled(VOID);
LRESULT WINAPI
CtfImmDispatchDefImeMessage(

View File

@ -1206,34 +1206,6 @@ typedef struct tagCURSORDATA
#define CURSORF_LINKED 0x0100
#define CURSORF_CURRENT 0x0200
typedef struct tagIMEINFOEX
{
HKL hkl;
IMEINFO ImeInfo;
WCHAR wszUIClass[16];
ULONG fdwInitConvMode;
INT fInitOpen;
INT fLoadFlag;
DWORD dwProdVersion;
DWORD dwImeWinVersion;
WCHAR wszImeDescription[50];
WCHAR wszImeFile[80];
struct
{
INT fSysWow64Only:1;
INT fCUASLayer:1;
};
} IMEINFOEX, *PIMEINFOEX;
typedef enum IMEINFOEXCLASS
{
ImeInfoExKeyboardLayout,
ImeInfoExKeyboardLayoutTFS,
ImeInfoExImeWindow,
ImeInfoExImeFileName
} IMEINFOEXCLASS;
#define IS_IME_HKL(hkl) ((((ULONG_PTR)(hkl)) & 0xF0000000) == 0xE0000000)
#define IS_IMM_MODE() (gpsi && (gpsi->dwSRVIFlags & SRVINFO_IMM32))
#define IS_CICERO_MODE() (gpsi && (gpsi->dwSRVIFlags & SRVINFO_CICERO_ENABLED))
#define IS_16BIT_MODE() (GetWin32ClientInfo()->dwTIFlags & TIF_16BIT)

View File

@ -59,10 +59,13 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
#include <winddi.h>
#define OEMRESOURCE
#include <winuser.h>
#include <ndk/rtltypes.h>
#include <prntfont.h>
#define _NOCSECT_TYPE
#include <ddrawi.h>
#include <imm.h>
#include <immdev.h>
#include <imm32_undoc.h>
#include <dbt.h>
/* NDK headers */

View File

@ -7,7 +7,7 @@
*/
#include <win32k.h>
#include <ddk/immdev.h>
#include <immdev.h>
DBG_DEFAULT_CHANNEL(UserFocus);
PUSER_MESSAGE_QUEUE gpqForeground = NULL;

View File

@ -10,7 +10,7 @@
*/
#include <win32k.h>
#include <ddk/immdev.h>
#include <immdev.h>
// Was included only because of CP_ACP and required the
// definition of SYSTEMTIME in ndk\rtltypes.h

View File

@ -8,7 +8,7 @@
*/
#include <win32k.h>
#include <ddk/immdev.h>
#include <immdev.h>
DBG_DEFAULT_CHANNEL(UserWnd);
INT gNestedWindowLimit = 50;

View File

@ -7,7 +7,7 @@
*/
#include <win32k.h>
#include <ddk/immdev.h>
#include <immdev.h>
DBG_DEFAULT_CHANNEL(UserWinpos);
/* GLOBALS *******************************************************************/

View File

@ -28,6 +28,8 @@
#include <winreg.h>
#include <winuser.h>
#include <imm.h>
#include <immdev.h>
#include <imm32_undoc.h>
#include <ddeml.h>
#include <dde.h>
#include <windowsx.h>

View File

@ -9,7 +9,7 @@
#include <user32.h>
#include <strsafe.h>
#include <ddk/immdev.h>
#include <immdev.h>
WINE_DEFAULT_DEBUG_CHANNEL(user32);

View File

@ -10,7 +10,7 @@
*/
#include <user32.h>
#include <ddk/immdev.h>
#include <immdev.h>
WINE_DEFAULT_DEBUG_CHANNEL(user32);

View File

@ -23,6 +23,8 @@
#include <winreg.h>
#include <winuser.h>
#include <imm.h>
#include <immdev.h>
#include <imm32_undoc.h>
/* Undocumented user definitions */
#include <undocuser.h>