https://git.reactos.org/?p=reactos.git;a=commitdiff;h=52bd0c0c18298fe68971a…
commit 52bd0c0c18298fe68971a301bae58ba28c72e396
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Dec 19 15:46:13 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Dec 19 15:46:13 2023 +0900
[MSCTFIME][SDK] Implement CtfImeGuidAtom (#6196)
- Add CTFIMECONTEXT structure.
- Add CicInputContext class.
- Rename INPUTCONTEXTDX.dwUnknown5 as
hCtfImeContext and retype it as HIMCC.
- Implement CtfImeGetGuidAtom by using them.
CORE-19360
---
dll/ime/msctfime/msctfime.cpp | 61 +++++++++++++++++++++++++++++++++++++++++--
dll/ime/msctfime/msctfime.h | 8 ++++++
sdk/include/ddk/immdev.h | 2 +-
3 files changed, 68 insertions(+), 3 deletions(-)
diff --git a/dll/ime/msctfime/msctfime.cpp b/dll/ime/msctfime/msctfime.cpp
index 2b6404f4819..f6830f9dc62 100644
--- a/dll/ime/msctfime/msctfime.cpp
+++ b/dll/ime/msctfime/msctfime.cpp
@@ -82,6 +82,38 @@ IsInteractiveUserLogon(VOID)
return bOK && IsMember;
}
+class CicInputContext
+{
+public:
+ HRESULT
+ GetGuidAtom(
+ _Inout_ IMCLock& imcLock,
+ _In_ DWORD dwUnknown,
+ _Out_opt_ LPDWORD pdwGuidAtom);
+};
+
+/**
+ * @unimplemented
+ */
+HRESULT
+CicInputContext::GetGuidAtom(
+ _Inout_ IMCLock& imcLock,
+ _In_ DWORD dwUnknown,
+ _Out_opt_ LPDWORD pdwGuidAtom)
+{
+ InternalIMCCLock<CTFIMECONTEXT> imeContext(imcLock.m_pIC->hCompStr);
+
+ HRESULT hr = imeContext.m_hr;
+ if (!imeContext)
+ hr = E_FAIL;
+
+ if (FAILED(hr))
+ return hr;
+
+ // FIXME
+ return hr;
+}
+
/**
* @implemented
*/
@@ -756,14 +788,39 @@ CtfImeEscapeEx(
return 0;
}
+/***********************************************************************
+ * CtfImeGetGuidAtom (MSCTFIME.@)
+ *
+ * @implemented
+ */
EXTERN_C HRESULT WINAPI
CtfImeGetGuidAtom(
_In_ HIMC hIMC,
_In_ DWORD dwUnknown,
_Out_opt_ LPDWORD pdwGuidAtom)
{
- FIXME("stub:(%p, 0x%lX, %p)\n", hIMC, dwUnknown, pdwGuidAtom);
- return E_FAIL;
+ TRACE("(%p, 0x%lX, %p)\n", hIMC, dwUnknown, pdwGuidAtom);
+
+ IMCLock imcLock(hIMC);
+
+ HRESULT hr = imcLock.m_hr;
+ if (!imcLock)
+ hr = E_FAIL;
+ if (FAILED(hr))
+ return hr;
+
+ InternalIMCCLock<CTFIMECONTEXT> imccLock(imcLock.m_pIC->hCtfImeContext);
+ hr = imccLock.m_hr;
+ if (!imccLock)
+ hr = E_FAIL;
+ if (FAILED(hr))
+ return hr;
+
+ if (!imccLock.m_pIMCC->m_pCicIC)
+ return E_OUTOFMEMORY;
+
+ hr = imccLock.m_pIMCC->m_pCicIC->GetGuidAtom(imcLock, dwUnknown, pdwGuidAtom);
+ return hr;
}
/***********************************************************************
diff --git a/dll/ime/msctfime/msctfime.h b/dll/ime/msctfime/msctfime.h
index 987ccf46d76..9b962285029 100644
--- a/dll/ime/msctfime/msctfime.h
+++ b/dll/ime/msctfime/msctfime.h
@@ -25,6 +25,14 @@
#include <cicero/CModulePath.h>
#include <cicero/imclock.h>
+class CicInputContext;
+
+typedef struct tagCTFIMECONTEXT
+{
+ CicInputContext *m_pCicIC;
+ DWORD m_dwCicFlags;
+} CTFIMECONTEXT, *PCTFIMECONTEXT;
+
#include <wine/debug.h>
#include "resource.h"
diff --git a/sdk/include/ddk/immdev.h b/sdk/include/ddk/immdev.h
index 5dfb82f3763..2d955dd81c6 100644
--- a/sdk/include/ddk/immdev.h
+++ b/sdk/include/ddk/immdev.h
@@ -149,7 +149,7 @@ typedef struct INPUTCONTEXTDX
DWORD dwUnknown2;
struct IME_STATE *pState; // +0x154
DWORD dwChange; // +0x158
- DWORD dwUnknown5;
+ HIMCC hCtfImeContext;
} INPUTCONTEXTDX, *PINPUTCONTEXTDX, *LPINPUTCONTEXTDX;
// bits of fdwInit of INPUTCONTEXT