ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2024
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
128 discussions
Start a n
N
ew thread
[reactos] 01/01: [MSCTFIME] Add UIComposition Part 2 (#6520)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=353edbd3f4aaefe56ecbe…
commit 353edbd3f4aaefe56ecbe0b8c0de7cf811186d31 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Feb 23 11:18:52 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Feb 23 11:18:52 2024 +0900 [MSCTFIME] Add UIComposition Part 2 (#6520) Supporting TIPs... JIRA issue: CORE-19360 - Add implementation to UIComposition class. --- dll/ime/msctfime/misc.cpp | 25 +++ dll/ime/msctfime/misc.h | 4 + dll/ime/msctfime/tls.cpp | 22 +++ dll/ime/msctfime/tls.h | 2 + dll/ime/msctfime/ui.cpp | 412 +++++++++++++++++++++++++++++++++++++++++++--- dll/ime/msctfime/ui.h | 71 +++++++- 6 files changed, 504 insertions(+), 32 deletions(-) diff --git a/dll/ime/msctfime/misc.cpp b/dll/ime/msctfime/misc.cpp index 18e01939ada..7cf38ad15b2 100644 --- a/dll/ime/msctfime/misc.cpp +++ b/dll/ime/msctfime/misc.cpp @@ -208,3 +208,28 @@ LONG CModeBias::ConvertModeBias(REFGUID guid) } return 0; } + +/***********************************************************************/ + +/// East-Asian language? +/// @implemented +BOOL IsEALang(VOID) +{ + TLS *pTLS = TLS::GetTLS(); + if (!pTLS || !pTLS->m_pProfile) + return FALSE; + + LANGID LangID; + pTLS->m_pProfile->GetLangId(&LangID); + + switch (PRIMARYLANGID(LangID)) + { + case LANG_CHINESE: + case LANG_JAPANESE: + case LANG_KOREAN: + return TRUE; + + default: + return FALSE; + } +} diff --git a/dll/ime/msctfime/misc.h b/dll/ime/msctfime/misc.h index ca96a227f54..f1f600b4671 100644 --- a/dll/ime/msctfime/misc.h +++ b/dll/ime/msctfime/misc.h @@ -54,3 +54,7 @@ public: LONG ConvertModeBias(REFGUID guid); void SetModeBias(REFGUID rguid); }; + +/***********************************************************************/ + +BOOL IsEALang(VOID); diff --git a/dll/ime/msctfime/tls.cpp b/dll/ime/msctfime/tls.cpp index efb6f9726f5..c6db21cc61e 100644 --- a/dll/ime/msctfime/tls.cpp +++ b/dll/ime/msctfime/tls.cpp @@ -54,3 +54,25 @@ BOOL TLS::InternalDestroyTLS() ::TlsSetValue(s_dwTlsIndex, NULL); return TRUE; } + +/// @implemented +BOOL TLS::NonEACompositionEnabled() +{ + if (!m_NonEAComposition) + { + DWORD dwValue = 1; + + CicRegKey regKey; + LSTATUS error = regKey.Open(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\CTF\\CUAS")); + if (error == ERROR_SUCCESS) + { + error = regKey.QueryDword(TEXT("NonEAComposition"), &dwValue); + if (error != ERROR_SUCCESS) + dwValue = 1; + } + + m_NonEAComposition = dwValue; + } + + return (m_NonEAComposition == 2); +} diff --git a/dll/ime/msctfime/tls.h b/dll/ime/msctfime/tls.h index ae1a6000e9c..2d2c882a67e 100644 --- a/dll/ime/msctfime/tls.h +++ b/dll/ime/msctfime/tls.h @@ -71,4 +71,6 @@ public: static TLS* InternalAllocateTLS(); static BOOL InternalDestroyTLS(); + + BOOL NonEACompositionEnabled(); }; diff --git a/dll/ime/msctfime/ui.cpp b/dll/ime/msctfime/ui.cpp index fb8ae4105a9..ed8455782c2 100644 --- a/dll/ime/msctfime/ui.cpp +++ b/dll/ime/msctfime/ui.cpp @@ -287,8 +287,8 @@ void CDefCompFrameWindow::SetCompStrRect(INT nWidth, INT nHeight, BOOL bShow) Show(bShow); - ::MoveWindow(m_hwndDefCompFrame, GripperWidth + 2, 7, nWidth, nHeight, TRUE); - ::ShowWindow(m_hwndDefCompFrame, (bShow ? SW_SHOWNOACTIVATE : SW_HIDE)); + ::MoveWindow(m_hwndCompStr, GripperWidth + 2, 7, nWidth, nHeight, TRUE); + ::ShowWindow(m_hwndCompStr, (bShow ? SW_SHOWNOACTIVATE : SW_HIDE)); } /// @implemented @@ -342,11 +342,11 @@ STDMETHODIMP_(void) CDefCompFrameWindow::OnCreate(HWND hWnd) /// @implemented STDMETHODIMP_(BOOL) CDefCompFrameWindow::OnSetCursor(UINT uMsg, LONG x, LONG y) { - if (!::IsWindow(m_hwndDefCompFrame)) + if (!::IsWindow(m_hwndCompStr)) return FALSE; RECT rc; - ::GetWindowRect(m_hwndDefCompFrame, &rc); + ::GetWindowRect(m_hwndCompStr, &rc); MyScreenToClient(NULL, &rc); POINT pt = { x, y }; return ::PtInRect(&rc, pt); @@ -365,15 +365,15 @@ CDefCompFrameWindow::OnWindowPosChanged(HWND hWnd, UINT uMsg, WPARAM wParam, LPA /// @implemented STDMETHODIMP_(void) CDefCompFrameWindow::HandleMouseMsg(UINT uMsg, LONG x, LONG y) { - if (::IsWindow(m_hwndDefCompFrame)) + if (::IsWindow(m_hwndCompStr)) { RECT rc; - ::GetWindowRect(m_hwndDefCompFrame, &rc); + ::GetWindowRect(m_hwndCompStr, &rc); MyScreenToClient(NULL, &rc); POINT pt = { x, y }; if (::PtInRect(&rc, pt)) - ::SendMessage(m_hwndDefCompFrame, 0x7E8, 0, 0); + ::SendMessage(m_hwndCompStr, 0x7E8, 0, 0); } CUIFWindow::HandleMouseMsg(uMsg, x, y); @@ -381,27 +381,380 @@ STDMETHODIMP_(void) CDefCompFrameWindow::HandleMouseMsg(UINT uMsg, LONG x, LONG /***********************************************************************/ +/// @implemented +POLYTEXTW *CPolyText::GetPolyAt(INT iItem) +{ + return &m_PolyTextArray[iItem]; +} + +/// @implemented +HRESULT CPolyText::ShiftPolyText(INT xDelta, INT yDelta) +{ + for (size_t iItem = 0; iItem < m_PolyTextArray.size(); ++iItem) + { + POLYTEXTW *pPolyText = &m_PolyTextArray[iItem]; + pPolyText->x += xDelta; + pPolyText->y += yDelta; + ::OffsetRect((LPRECT)&pPolyText->rcl, xDelta, yDelta); + } + return S_OK; +} + +/// @implemented +HRESULT CPolyText::RemoveLastLine(BOOL bHorizontal) +{ + size_t iItem, cItems = m_PolyTextArray.size(); + if (!cItems) + return E_FAIL; + + POLYTEXTW *pData1 = &m_PolyTextArray[cItems - 1]; + + for (iItem = 0; iItem < cItems; ++iItem) + { + POLYTEXTW *pData2 = &m_PolyTextArray[iItem]; + if (bHorizontal) + { + if (pData1->x == pData2->x) + break; + } + else + { + if (pData1->y == pData2->y) + break; + } + } + + if (iItem >= cItems) + return E_FAIL; + + m_PolyTextArray.Remove(iItem, cItems - iItem); + m_ValueArray.Remove(iItem, cItems - iItem); + return S_OK; +} + +/// @implemented +void CPolyText::RemoveAll() +{ + m_PolyTextArray.clear(); + m_ValueArray.clear(); +} + +/***********************************************************************/ + +/// @implemented +void COMPWND::_ClientToScreen(LPRECT prc) +{ + ::ClientToScreen(m_hWnd, (LPPOINT)prc); + ::ClientToScreen(m_hWnd, (LPPOINT)&prc->right); +} + +/***********************************************************************/ + // For GetWindowLongPtr/SetWindowLongPtr -#define UIGWLP_HIMC 0 -#define UIGWLP_UI sizeof(HIMC) -#define UIGWLP_SIZE (UIGWLP_UI + sizeof(UI*)) +#define UICOMP_GWLP_INDEX 0 +#define UICOMP_GWLP_SIZE (UICOMP_GWLP_INDEX + sizeof(INT)) /// @unimplemented -void UIComposition::OnImeStartComposition(CicIMCLock& imcLock, HWND hUIWnd) +UIComposition::UIComposition(HWND hwndParent) { - //FIXME +} + +/// @implemented +UIComposition::~UIComposition() +{ + DestroyCompositionWindow(); + + if (m_hFont1) + { + ::DeleteObject(m_hFont1); + m_hFont1 = NULL; + } + + if (m_hFont2) + { + ::DeleteObject(m_hFont2); + m_hFont2 = NULL; + } + + if (m_strCompStr) + { + cicMemFree(m_strCompStr); + m_strCompStr = NULL; + } + + m_cchCompStr = 0; +} + +// @implemented +BOOL UIComposition::SendMessageToUI(CicIMCLock& imcLock, WPARAM wParam, LPARAM lParam) +{ + HWND hImeWnd = ImmGetDefaultIMEWnd(0); + if (!::IsWindow(hImeWnd)) + return TRUE; + TLS *pTLS = TLS::GetTLS(); + LRESULT ret; + if (pTLS && pTLS->m_cWnds > 1) + ret = ::SendMessage(imcLock.get().hWnd, WM_IME_NOTIFY, wParam, lParam); + else + ret = ::SendMessage(hImeWnd, WM_IME_NOTIFY, wParam, lParam); + return !ret; +} + +/// @implemented +HRESULT UIComposition::CreateDefFrameWnd(HWND hwndParent, HIMC hIMC) +{ + if (!m_pDefCompFrameWindow) + { + m_pDefCompFrameWindow = new(cicNoThrow) CDefCompFrameWindow(hIMC, 0x800000A4); + if (!m_pDefCompFrameWindow) + return E_OUTOFMEMORY; + if (!m_pDefCompFrameWindow->Initialize()) + { + delete m_pDefCompFrameWindow; + m_pDefCompFrameWindow = NULL; + return E_FAIL; + } + + m_pDefCompFrameWindow->Init(); + } + + m_pDefCompFrameWindow->CreateWnd(hwndParent); + return S_OK; +} + +/// @implemented +HRESULT UIComposition::CreateCompButtonWnd(HWND hwndParent, HIMC hIMC) +{ + TLS *pTLS = TLS::GetTLS(); + if (!pTLS || !pTLS->NonEACompositionEnabled()) + return S_OK; + + if (IsEALang()) + { + if (m_pCompButtonFrameWindow) + { + delete m_pCompButtonFrameWindow; + m_pCompButtonFrameWindow = NULL; + } + return S_OK; + } + + if (!m_pCompButtonFrameWindow) + { + m_pCompButtonFrameWindow = new(cicNoThrow) CCompButtonFrameWindow(hIMC, 0x800000B4); + if (!m_pCompButtonFrameWindow) + return E_OUTOFMEMORY; + + if (!m_pCompButtonFrameWindow->Initialize()) + { + if (m_pCompButtonFrameWindow) + { + delete m_pCompButtonFrameWindow; + m_pCompButtonFrameWindow = NULL; + } + return E_FAIL; + } + + m_pCompButtonFrameWindow->Init(); + } + + m_pCompButtonFrameWindow->CreateWnd(hwndParent); + return S_OK; +} + +/// @implemented +HRESULT UIComposition::CreateCompositionWindow(CicIMCLock& imcLock, HWND hwndParent) +{ + if (FAILED(imcLock.m_hr)) + return imcLock.m_hr; + + if (!::IsWindow(hwndParent) || m_bHasCompWnd) + return E_FAIL; + + for (INT iCompStr = 0; iCompStr < 3; ++iCompStr) + { + DWORD style = WS_POPUP | WS_DISABLED; + HWND hwndCompStr = ::CreateWindowExW(0, L"MSCTFIME Composition", NULL, style, + 0, 0, 0, 0, hwndParent, NULL, g_hInst, NULL); + m_CompStrs[iCompStr].m_hWnd = hwndCompStr; + ::SetWindowLongPtrW(hwndCompStr, GWLP_USERDATA, (LONG_PTR)this); + ::SetWindowLongPtrW(hwndCompStr, UICOMP_GWLP_INDEX, iCompStr); + m_CompStrs[iCompStr].m_Caret.CreateCaret(hwndCompStr, m_CaretSize); + } + + HRESULT hr = CreateCompButtonWnd(hwndParent, imcLock.m_hIMC); + if (FAILED(hr)) + { + DestroyCompositionWindow(); + return E_OUTOFMEMORY; + } + + hr = CreateDefFrameWnd(hwndParent, imcLock.m_hIMC); + if (FAILED(hr)) + { + DestroyCompositionWindow(); + return E_OUTOFMEMORY; + } + + DWORD style = WS_CHILD | WS_DISABLED; + HWND hwndCompStr = ::CreateWindowExW(WS_EX_CLIENTEDGE, L"MSCTFIME Composition", NULL, style, + 0, 0, 0, 0, *m_pDefCompFrameWindow, NULL, g_hInst, NULL); + if (!hwndCompStr) + { + DestroyCompositionWindow(); + return E_OUTOFMEMORY; + } + + m_CompStrs[3].m_hWnd = hwndCompStr; + m_pDefCompFrameWindow->m_hwndCompStr = hwndCompStr; + ::SetWindowLongPtrW(hwndCompStr, GWLP_USERDATA, (LONG_PTR)this); + ::SetWindowLongPtrW(hwndCompStr, UICOMP_GWLP_INDEX, -1); + m_CompStrs[3].m_Caret.CreateCaret(hwndCompStr, m_CaretSize); + m_bHasCompWnd = TRUE; + + return S_OK; +} + +/// @implemented +HRESULT UIComposition::DestroyCompositionWindow() +{ + for (INT i = 0; i < 4; ++i) + { + COMPWND *pCompStr = &m_CompStrs[i]; + pCompStr->m_Caret.DestroyCaret(); + if (::IsWindow(pCompStr->m_hWnd)) + { + DestroyWindow(pCompStr->m_hWnd); + pCompStr->m_PolyText.RemoveAll(); + } + pCompStr->m_hWnd = NULL; + } + + if (m_pCompButtonFrameWindow) + { + ::DestroyWindow(*m_pCompButtonFrameWindow); + delete m_pCompButtonFrameWindow; + m_pCompButtonFrameWindow = NULL; + } + + if (m_pDefCompFrameWindow) + { + ::DestroyWindow(*m_pDefCompFrameWindow); + delete m_pDefCompFrameWindow; + m_pDefCompFrameWindow = NULL; + } + + return 0; +} + +// @implemented +BOOL UIComposition::InquireImeUIWndState(CicIMCLock& imcLock) +{ + BOOL bValue = FALSE; + UIComposition::SendMessageToUI(imcLock, 0x11u, (LPARAM)&bValue); + return bValue; +} + +/// @implemented +HRESULT UIComposition::UpdateShowCompWndFlag(CicIMCLock& imcLock, DWORD *pdwCompStrLen) +{ + if (FAILED(imcLock.m_hr)) + return imcLock.m_hr; + if (!::IsWindow(imcLock.get().hWnd)) + return E_FAIL; + + CicIMCCLock<COMPOSITIONSTRING> compStr(imcLock.get().hCompStr); + if (FAILED(compStr.m_hr)) + return compStr.m_hr; + + if ((m_dwUnknown56[0] & 0x80000000) && compStr.get().dwCompStrLen) + m_bHasCompStr = TRUE; + else + m_bHasCompStr = FALSE; + + if (pdwCompStrLen) + *pdwCompStrLen = compStr.get().dwCompStrLen; + + return S_OK; +} + +/// @implemented +HRESULT UIComposition::UpdateFont(CicIMCLock& imcLock) +{ + if (FAILED(imcLock.m_hr)) + return imcLock.m_hr; + + if (m_hFont1) + ::DeleteObject(m_hFont1); + if (m_hFont2) + ::DeleteObject(m_hFont2); + + LOGFONTW lf = imcLock.get().lfFont.W; + m_hFont2 = ::CreateFontIndirectW(&lf); + + lf.lfEscapement = 0; + lf.lfOrientation = 0; + BOOL bVertical = (lf.lfFaceName[0] == L'@'); + if (bVertical) + { + MoveMemory(lf.lfFaceName, &lf.lfFaceName[1], sizeof(lf.lfFaceName) - sizeof(WCHAR)); + lf.lfFaceName[_countof(lf.lfFaceName) - 1] = UNICODE_NULL; + } + m_hFont1 = ::CreateFontIndirectW(&lf); + + return S_OK; +} + +// @implemented +void UIComposition::OnTimer(HWND hWnd) +{ + INT iCompStr = (INT)::GetWindowLongPtrW(hWnd, UICOMP_GWLP_INDEX); + if (iCompStr == -1) + m_CompStrs[3].m_Caret.OnTimer(); + else + m_CompStrs[iCompStr].m_Caret.OnTimer(); +} + +/// @implemented +BOOL UIComposition::GetImeUIWndTextExtent(CicIMCLock& imcLock, LPARAM lParam) +{ + return !UIComposition::SendMessageToUI(imcLock, 0x14, lParam); +} + +/// @implemented +LPWSTR UIComposition::GetCompStrBuffer(INT cchStr) +{ + if (!m_strCompStr) + { + m_strCompStr = (LPWSTR)cicMemAllocClear((cchStr + 1) * sizeof(WCHAR)); + m_cchCompStr = cchStr; + } + if (m_cchCompStr < cchStr) + { + m_strCompStr = (LPWSTR)cicMemReAlloc(m_strCompStr, (cchStr + 1) * sizeof(WCHAR)); + m_cchCompStr = cchStr; + } + return m_strCompStr; } /// @unimplemented -void UIComposition::OnImeCompositionUpdate(CicIMCLock& imcLock) +void UIComposition::OnImeStartComposition(CicIMCLock& imcLock, HWND hUIWnd) { //FIXME } +/// @implemented +HRESULT UIComposition::OnImeCompositionUpdate(CicIMCLock& imcLock) +{ + m_dwUnknown56[0] |= 0x8000; + return UIComposition::UpdateShowCompWndFlag(imcLock, NULL); +} + /// @unimplemented -void UIComposition::OnImeEndComposition() +HRESULT UIComposition::OnImeEndComposition() { - //FIXME + m_dwUnknown56[0] = 0; + return DestroyCompositionWindow(); } /// @unimplemented @@ -416,10 +769,10 @@ void UIComposition::OnPaintTheme(WPARAM wParam) //FIXME } -/// @unimplemented -void UIComposition::OnDestroy() +/// @implemented +HRESULT UIComposition::OnDestroy() { - //FIXME + return DestroyCompositionWindow(); } /// @unimplemented @@ -433,6 +786,11 @@ UIComposition::CompWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /***********************************************************************/ +// For GetWindowLongPtr/SetWindowLongPtr +#define UI_GWLP_HIMC 0 +#define UI_GWLP_UI sizeof(HIMC) +#define UI_GWLP_SIZE (UI_GWLP_UI + sizeof(UI*)) + /// @implemented UI::UI(HWND hWnd) : m_hWnd(hWnd) { @@ -447,11 +805,11 @@ UI::~UI() /// @implemented HRESULT UI::_Create() { - m_pComp = new(cicNoThrow) UIComposition(); + m_pComp = new(cicNoThrow) UIComposition(m_hWnd); if (!m_pComp) return E_OUTOFMEMORY; - ::SetWindowLongPtrW(m_hWnd, UIGWLP_UI, (LONG_PTR)this); + ::SetWindowLongPtrW(m_hWnd, UI_GWLP_UI, (LONG_PTR)this); return S_OK; } @@ -459,13 +817,13 @@ HRESULT UI::_Create() void UI::_Destroy() { m_pComp->OnDestroy(); - ::SetWindowLongPtrW(m_hWnd, UIGWLP_UI, 0); + ::SetWindowLongPtrW(m_hWnd, UI_GWLP_UI, 0); } /// @implemented void UI::OnCreate(HWND hWnd) { - UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UIGWLP_UI); + UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UI_GWLP_UI); if (pUI) return; pUI = new(cicNoThrow) UI(hWnd); @@ -476,7 +834,7 @@ void UI::OnCreate(HWND hWnd) /// @implemented void UI::OnDestroy(HWND hWnd) { - UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UIGWLP_UI); + UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UI_GWLP_UI); if (!pUI) return; @@ -580,8 +938,8 @@ CIMEUIWindowHandler::ImeUIWndProcWorker(HWND hWnd, UINT uMsg, WPARAM wParam, LPA case WM_IME_SELECT: case WM_TIMER: { - HIMC hIMC = (HIMC)GetWindowLongPtrW(hWnd, UIGWLP_HIMC); - UI* pUI = (UI*)GetWindowLongPtrW(hWnd, UIGWLP_UI); + HIMC hIMC = (HIMC)GetWindowLongPtrW(hWnd, UI_GWLP_HIMC); + UI* pUI = (UI*)GetWindowLongPtrW(hWnd, UI_GWLP_UI); CicIMCLock imcLock(hIMC); switch (uMsg) { @@ -664,7 +1022,7 @@ BOOL RegisterImeClass(VOID) { ZeroMemory(&wcx, sizeof(wcx)); wcx.cbSize = sizeof(WNDCLASSEXW); - wcx.cbWndExtra = UIGWLP_SIZE; + wcx.cbWndExtra = UI_GWLP_SIZE; wcx.hIcon = LoadIconW(0, (LPCWSTR)IDC_ARROW); wcx.hInstance = g_hInst; wcx.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); @@ -680,7 +1038,7 @@ BOOL RegisterImeClass(VOID) { ZeroMemory(&wcx, sizeof(wcx)); wcx.cbSize = sizeof(WNDCLASSEXW); - wcx.cbWndExtra = sizeof(DWORD); + wcx.cbWndExtra = UICOMP_GWLP_SIZE; wcx.hIcon = NULL; wcx.hInstance = g_hInst; wcx.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_IBEAM); diff --git a/dll/ime/msctfime/ui.h b/dll/ime/msctfime/ui.h index 71b32ebb40d..8d416312a72 100644 --- a/dll/ime/msctfime/ui.h +++ b/dll/ime/msctfime/ui.h @@ -94,7 +94,7 @@ public: class CDefCompFrameWindow : public CCompFrameWindow { public: - HWND m_hwndDefCompFrame; + HWND m_hwndCompStr; CDefCompFrameGripper *m_pGripper; CCompFinalizeButton *m_pFinalizeButton; MARGINS m_Margins; @@ -120,14 +120,74 @@ public: /***********************************************************************/ -struct UIComposition +struct CPolyText { + CicArray<POLYTEXTW> m_PolyTextArray; + CicArray<DWORD> m_ValueArray; + + HRESULT ShiftPolyText(INT xDelta, INT yDelta); + POLYTEXTW *GetPolyAt(INT iItem); + HRESULT RemoveLastLine(BOOL bHorizontal); + void RemoveAll(); +}; + +/***********************************************************************/ + +struct COMPWND +{ + HWND m_hWnd; + CPolyText m_PolyText; + CicCaret m_Caret; + DWORD m_dwUnknown57[3]; + + void _ClientToScreen(LPRECT prc); +}; + +/***********************************************************************/ + +class UIComposition +{ +public: + HWND m_hwndParent; + BOOL m_bHasCompWnd; + COMPWND m_CompStrs[4]; + HFONT m_hFont1; + DWORD m_dwUnknown54; + HFONT m_hFont2; + DWORD m_dwUnknown55; + SIZE m_CaretSize; + DWORD m_dwUnknown56[2]; + LPWSTR m_strCompStr; + INT m_cchCompStr; + BOOL m_bInComposition; + BOOL m_bHasCompStr; + CDefCompFrameWindow *m_pDefCompFrameWindow; + CCompButtonFrameWindow *m_pCompButtonFrameWindow; + +public: + UIComposition(HWND hwndParent); + virtual ~UIComposition(); + + HRESULT CreateDefFrameWnd(HWND hwndParent, HIMC hIMC); + HRESULT CreateCompButtonWnd(HWND hwndParent, HIMC hIMC); + HRESULT CreateCompositionWindow(CicIMCLock& imcLock, HWND hwndParent); + HRESULT DestroyCompositionWindow(); + + HRESULT UpdateShowCompWndFlag(CicIMCLock& imcLock, DWORD *pdwCompStrLen); + HRESULT UpdateFont(CicIMCLock& imcLock); + LPWSTR GetCompStrBuffer(INT cchStr); + void OnImeStartComposition(CicIMCLock& imcLock, HWND hUIWnd); - void OnImeCompositionUpdate(CicIMCLock& imcLock); - void OnImeEndComposition(); + HRESULT OnImeCompositionUpdate(CicIMCLock& imcLock); + HRESULT OnImeEndComposition(); void OnImeSetContext(CicIMCLock& imcLock, HWND hUIWnd, WPARAM wParam, LPARAM lParam); void OnPaintTheme(WPARAM wParam); - void OnDestroy(); + void OnTimer(HWND hWnd); + HRESULT OnDestroy(); + + static BOOL SendMessageToUI(CicIMCLock& imcLock, WPARAM wParam, LPARAM lParam); + static BOOL InquireImeUIWndState(CicIMCLock& imcLock); + static BOOL GetImeUIWndTextExtent(CicIMCLock& imcLock, LPARAM lParam); static LRESULT CALLBACK CompWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); }; @@ -147,6 +207,7 @@ struct UI static void OnCreate(HWND hWnd); static void OnDestroy(HWND hWnd); + void OnImeSetContext(CicIMCLock& imcLock, WPARAM wParam, LPARAM lParam); };
10 months
1
0
0
0
[reactos] 01/01: [NTFS] Typo fix: "Steam" -> "Stream"
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=14d3b53cc6199d7117320…
commit 14d3b53cc6199d71173208987f3e82dd98c1e05a Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Feb 22 20:33:34 2024 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Feb 22 22:43:40 2024 +0100 [NTFS] Typo fix: "Steam" -> "Stream" --- drivers/filesystems/ntfs/finfo.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/filesystems/ntfs/finfo.c b/drivers/filesystems/ntfs/finfo.c index b8c039a5d15..f6cfdce68ed 100644 --- a/drivers/filesystems/ntfs/finfo.c +++ b/drivers/filesystems/ntfs/finfo.c @@ -223,10 +223,10 @@ NtfsGetNetworkOpenInformation(PNTFS_FCB Fcb, static NTSTATUS -NtfsGetSteamInformation(PNTFS_FCB Fcb, - PDEVICE_EXTENSION DeviceExt, - PFILE_STREAM_INFORMATION StreamInfo, - PULONG BufferLength) +NtfsGetStreamInformation(PNTFS_FCB Fcb, + PDEVICE_EXTENSION DeviceExt, + PFILE_STREAM_INFORMATION StreamInfo, + PULONG BufferLength) { ULONG CurrentSize; FIND_ATTR_CONTXT Context; @@ -492,10 +492,10 @@ NtfsQueryInformation(PNTFS_IRP_CONTEXT IrpContext) break; case FileStreamInformation: - Status = NtfsGetSteamInformation(Fcb, - DeviceObject->DeviceExtension, - SystemBuffer, - &BufferLength); + Status = NtfsGetStreamInformation(Fcb, + DeviceObject->DeviceExtension, + SystemBuffer, + &BufferLength); break; case FileAlternateNameInformation:
10 months
1
0
0
0
[reactos] 04/04: [WINSRV] Delay-load psapi.dll
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=59f8611321c676050a413…
commit 59f8611321c676050a41315c660f93f7d6b9143c Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Feb 22 14:05:04 2024 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Feb 22 22:41:06 2024 +0100 [WINSRV] Delay-load psapi.dll Note that it is used only in debug builds in order to display the list of processes being terminated in the debug log. --- win32ss/user/winsrv/CMakeLists.txt | 2 +- win32ss/user/winsrv/consrv.cmake | 4 ++-- win32ss/user/winsrv/usersrv.cmake | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/win32ss/user/winsrv/CMakeLists.txt b/win32ss/user/winsrv/CMakeLists.txt index a04ad47fabd..c0cc6d68164 100644 --- a/win32ss/user/winsrv/CMakeLists.txt +++ b/win32ss/user/winsrv/CMakeLists.txt @@ -29,7 +29,7 @@ target_link_libraries(winsrv consrv usersrv) # Add win32ksys because of NtUser...() target_link_libraries(winsrv ${CONSRV_TARGET_LINK_LIBS} win32ksys libcntpr ${PSEH_LIB}) -add_delay_importlibs(winsrv ${CONSRV_DELAY_IMPORT_LIBS} advapi32) +add_delay_importlibs(winsrv ${CONSRV_DELAY_IMPORT_LIBS} ${USERSRV_DELAY_IMPORT_LIBS} advapi32) add_importlibs(winsrv ${CONSRV_IMPORT_LIBS} ${USERSRV_IMPORT_LIBS} csrsrv gdi32 user32 kernel32 ntdll) add_dependencies(winsrv bugcodes xdk) add_cd_file(TARGET winsrv DESTINATION reactos/system32 FOR all) diff --git a/win32ss/user/winsrv/consrv.cmake b/win32ss/user/winsrv/consrv.cmake index d2ef3a2b5ec..dd4b6da03c2 100644 --- a/win32ss/user/winsrv/consrv.cmake +++ b/win32ss/user/winsrv/consrv.cmake @@ -57,7 +57,7 @@ target_link_libraries(consrv pseh) add_dependencies(consrv psdk) add_pch(consrv consrv/consrv.h CONSRV_SOURCE) #add_object_library(consrv ${CONSRV_SOURCE}) -list(APPEND CONSRV_IMPORT_LIBS psapi) -list(APPEND CONSRV_DELAY_IMPORT_LIBS shell32 ole32) +#list(APPEND CONSRV_IMPORT_LIBS) +list(APPEND CONSRV_DELAY_IMPORT_LIBS shell32 ole32 psapi) list(APPEND CONSRV_TARGET_LINK_LIBS concfg uuid) set_module_type(consrv module UNICODE) diff --git a/win32ss/user/winsrv/usersrv.cmake b/win32ss/user/winsrv/usersrv.cmake index 8db138e5a27..ebdd72ca597 100644 --- a/win32ss/user/winsrv/usersrv.cmake +++ b/win32ss/user/winsrv/usersrv.cmake @@ -14,5 +14,6 @@ target_link_libraries(usersrv pseh) add_dependencies(usersrv xdk) add_pch(usersrv usersrv/usersrv.h USERSRV_SOURCE) #add_object_library(usersrv ${USERSRV_SOURCE}) -list(APPEND USERSRV_IMPORT_LIBS basesrv psapi) +list(APPEND USERSRV_IMPORT_LIBS basesrv) +list(APPEND USERSRV_DELAY_IMPORT_LIBS psapi) set_module_type(usersrv module UNICODE)
10 months
1
0
0
0
[reactos] 03/04: [WINSRV] Use ARRAYSIZE() instead of hardcoding buffer size in GetProcessImageFileNameW call
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c0af91ba198b3114db0f…
commit 2c0af91ba198b3114db0f9ad8973a345431b9d28 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Feb 22 14:03:33 2024 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Feb 22 22:41:05 2024 +0100 [WINSRV] Use ARRAYSIZE() instead of hardcoding buffer size in GetProcessImageFileNameW call --- win32ss/user/winsrv/consrv/shutdown.c | 3 +-- win32ss/user/winsrv/usersrv/shutdown.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/win32ss/user/winsrv/consrv/shutdown.c b/win32ss/user/winsrv/consrv/shutdown.c index 91e43993ba8..aec89dfb8e6 100644 --- a/win32ss/user/winsrv/consrv/shutdown.c +++ b/win32ss/user/winsrv/consrv/shutdown.c @@ -49,7 +49,7 @@ NonConsoleProcessShutdown(IN PCSR_PROCESS Process, /* Terminate this process */ #if DBG WCHAR buffer[MAX_PATH]; - if (!GetProcessImageFileNameW(Process->ProcessHandle, buffer, MAX_PATH)) + if (!GetProcessImageFileNameW(Process->ProcessHandle, buffer, ARRAYSIZE(buffer))) { DPRINT1("Terminating process %x\n", Process->ClientId.UniqueProcess); } @@ -58,7 +58,6 @@ NonConsoleProcessShutdown(IN PCSR_PROCESS Process, DPRINT1("Terminating process %x (%S)\n", Process->ClientId.UniqueProcess, buffer); } #endif - NtTerminateProcess(Process->ProcessHandle, 0); WaitForSingleObject(Process->ProcessHandle, ShutdownSettings.ProcessTerminateTimeout); } diff --git a/win32ss/user/winsrv/usersrv/shutdown.c b/win32ss/user/winsrv/usersrv/shutdown.c index 42973b4cfc6..ce9d4f97e1e 100644 --- a/win32ss/user/winsrv/usersrv/shutdown.c +++ b/win32ss/user/winsrv/usersrv/shutdown.c @@ -777,7 +777,7 @@ UserClientShutdown(IN PCSR_PROCESS CsrProcess, #if DBG { WCHAR buffer[MAX_PATH]; - if (!GetProcessImageFileNameW(CsrProcess->ProcessHandle, buffer, MAX_PATH)) + if (!GetProcessImageFileNameW(CsrProcess->ProcessHandle, buffer, ARRAYSIZE(buffer))) { DPRINT1("Terminating process %x\n", CsrProcess->ClientId.UniqueProcess); } @@ -788,7 +788,6 @@ UserClientShutdown(IN PCSR_PROCESS CsrProcess, } #endif NtTerminateProcess(CsrProcess->ProcessHandle, 0); - WaitForSingleObject(CsrProcess->ProcessHandle, ShutdownSettings.ProcessTerminateTimeout); /* We are done */
10 months
1
0
0
0
[reactos] 02/04: [PSAPI] Don't make the dll depend on MSVCRT
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e5db85276e31e3b914575…
commit e5db85276e31e3b9145755b9129a5b727701817e Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Feb 22 13:37:36 2024 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Feb 22 22:41:04 2024 +0100 [PSAPI] Don't make the dll depend on MSVCRT psapi.dll can also used by low-level DLLs, such as winsrv.dll, therefore it is better to reduce its dependencies. --- dll/win32/psapi/CMakeLists.txt | 4 ++-- dll/win32/psapi/psapi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dll/win32/psapi/CMakeLists.txt b/dll/win32/psapi/CMakeLists.txt index d92b5d415ff..60c1398b70e 100644 --- a/dll/win32/psapi/CMakeLists.txt +++ b/dll/win32/psapi/CMakeLists.txt @@ -7,7 +7,7 @@ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/psapi.def) add_library(psapi MODULE ${SOURCE}) -set_module_type(psapi win32dll) +set_module_type(psapi win32dll ENTRYPOINT DllMain 12) target_link_libraries(psapi ${PSEH_LIB}) -add_importlibs(psapi msvcrt kernel32 ntdll) +add_importlibs(psapi kernel32 ntdll) add_cd_file(TARGET psapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/psapi/psapi.c b/dll/win32/psapi/psapi.c index 8194571624d..c73f3176d3b 100644 --- a/dll/win32/psapi/psapi.c +++ b/dll/win32/psapi/psapi.c @@ -299,9 +299,9 @@ DllMain(HINSTANCE hDllHandle, PsStopAndAnalyzeProfile(); } break; - } + } - return TRUE; + return TRUE; }
10 months
1
0
0
0
[reactos] 01/04: [USETUP] Exchange SetupStartPage and LanguagePage
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=047f1c3d551ee404b83d6…
commit 047f1c3d551ee404b83d63918b86baea21c3e670 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Feb 22 12:05:56 2024 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Feb 22 22:41:03 2024 +0100 [USETUP] Exchange SetupStartPage and LanguagePage --- base/setup/usetup/usetup.c | 206 ++++++++++++++++++++++----------------------- 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c index 59593f38b59..9dbba31f27c 100644 --- a/base/setup/usetup/usetup.c +++ b/base/setup/usetup/usetup.c @@ -536,6 +536,109 @@ GetNTOSInstallationName( } +/* + * Start page + * + * Next pages: + * LanguagePage (at once, default) + * InstallIntroPage (at once, if unattended) + * QuitPage + * + * SIDEEFFECTS + * Init Sdi + * Init USetupData.SourcePath + * Init USetupData.SourceRootPath + * Init USetupData.SourceRootDir + * Init USetupData.SetupInf + * Init USetupData.RequiredPartitionDiskSpace + * Init IsUnattendedSetup + * If unattended, init *List and sets the Codepage + * If unattended, init SelectedLanguageId + * If unattended, init USetupData.LanguageId + * + * RETURNS + * Number of the next page. + */ +static PAGE_NUMBER +SetupStartPage(PINPUT_RECORD Ir) +{ + ULONG Error; + PGENERIC_LIST_ENTRY ListEntry; + PCWSTR LocaleId; + + MUIDisplayPage(SETUP_INIT_PAGE); + + /* Initialize Setup, phase 1 */ + Error = InitializeSetup(&USetupData, 1); + if (Error != ERROR_SUCCESS) + { + MUIDisplayError(Error, Ir, POPUP_WAIT_ENTER); + return QUIT_PAGE; + } + + /* Initialize the user-mode PnP manager */ + if (!EnableUserModePnpManager()) + DPRINT1("The user-mode PnP manager could not initialize, expect unavailable devices!\n"); + + /* Wait for any immediate pending installations to finish */ + if (WaitNoPendingInstallEvents(NULL) != STATUS_WAIT_0) + DPRINT1("WaitNoPendingInstallEvents() failed to wait!\n"); + + CheckUnattendedSetup(&USetupData); + + if (IsUnattendedSetup) + { + // TODO: Read options from inf + /* Load the hardware, language and keyboard layout lists */ + + USetupData.ComputerList = CreateComputerTypeList(USetupData.SetupInf); + USetupData.DisplayList = CreateDisplayDriverList(USetupData.SetupInf); + USetupData.KeyboardList = CreateKeyboardDriverList(USetupData.SetupInf); + + USetupData.LanguageList = CreateLanguageList(USetupData.SetupInf, DefaultLanguage); + + /* new part */ + SelectedLanguageId = DefaultLanguage; + wcscpy(DefaultLanguage, USetupData.LocaleID); + USetupData.LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF); + + USetupData.LayoutList = CreateKeyboardLayoutList(USetupData.SetupInf, SelectedLanguageId, DefaultKBLayout); + + /* first we hack LanguageList */ + for (ListEntry = GetFirstListEntry(USetupData.LanguageList); ListEntry; + ListEntry = GetNextListEntry(ListEntry)) + { + LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id; + if (!wcsicmp(USetupData.LocaleID, LocaleId)) + { + DPRINT("found %S in LanguageList\n", LocaleId); + SetCurrentListEntry(USetupData.LanguageList, ListEntry); + break; + } + } + + /* now LayoutList */ + for (ListEntry = GetFirstListEntry(USetupData.LayoutList); ListEntry; + ListEntry = GetNextListEntry(ListEntry)) + { + LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id; + if (!wcsicmp(USetupData.LocaleID, LocaleId)) + { + DPRINT("found %S in LayoutList\n", LocaleId); + SetCurrentListEntry(USetupData.LayoutList, ListEntry); + break; + } + } + + SetConsoleCodePage(); + + return INSTALL_INTRO_PAGE; + } + + return LANGUAGE_PAGE; +} + + /* * Displays the LanguagePage. * @@ -690,109 +793,6 @@ LanguagePage(PINPUT_RECORD Ir) } -/* - * Start page - * - * Next pages: - * LanguagePage (at once, default) - * InstallIntroPage (at once, if unattended) - * QuitPage - * - * SIDEEFFECTS - * Init Sdi - * Init USetupData.SourcePath - * Init USetupData.SourceRootPath - * Init USetupData.SourceRootDir - * Init USetupData.SetupInf - * Init USetupData.RequiredPartitionDiskSpace - * Init IsUnattendedSetup - * If unattended, init *List and sets the Codepage - * If unattended, init SelectedLanguageId - * If unattended, init USetupData.LanguageId - * - * RETURNS - * Number of the next page. - */ -static PAGE_NUMBER -SetupStartPage(PINPUT_RECORD Ir) -{ - ULONG Error; - PGENERIC_LIST_ENTRY ListEntry; - PCWSTR LocaleId; - - MUIDisplayPage(SETUP_INIT_PAGE); - - /* Initialize Setup, phase 1 */ - Error = InitializeSetup(&USetupData, 1); - if (Error != ERROR_SUCCESS) - { - MUIDisplayError(Error, Ir, POPUP_WAIT_ENTER); - return QUIT_PAGE; - } - - /* Initialize the user-mode PnP manager */ - if (!EnableUserModePnpManager()) - DPRINT1("The user-mode PnP manager could not initialize, expect unavailable devices!\n"); - - /* Wait for any immediate pending installations to finish */ - if (WaitNoPendingInstallEvents(NULL) != STATUS_WAIT_0) - DPRINT1("WaitNoPendingInstallEvents() failed to wait!\n"); - - CheckUnattendedSetup(&USetupData); - - if (IsUnattendedSetup) - { - // TODO: Read options from inf - /* Load the hardware, language and keyboard layout lists */ - - USetupData.ComputerList = CreateComputerTypeList(USetupData.SetupInf); - USetupData.DisplayList = CreateDisplayDriverList(USetupData.SetupInf); - USetupData.KeyboardList = CreateKeyboardDriverList(USetupData.SetupInf); - - USetupData.LanguageList = CreateLanguageList(USetupData.SetupInf, DefaultLanguage); - - /* new part */ - SelectedLanguageId = DefaultLanguage; - wcscpy(DefaultLanguage, USetupData.LocaleID); - USetupData.LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF); - - USetupData.LayoutList = CreateKeyboardLayoutList(USetupData.SetupInf, SelectedLanguageId, DefaultKBLayout); - - /* first we hack LanguageList */ - for (ListEntry = GetFirstListEntry(USetupData.LanguageList); ListEntry; - ListEntry = GetNextListEntry(ListEntry)) - { - LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id; - if (!wcsicmp(USetupData.LocaleID, LocaleId)) - { - DPRINT("found %S in LanguageList\n", LocaleId); - SetCurrentListEntry(USetupData.LanguageList, ListEntry); - break; - } - } - - /* now LayoutList */ - for (ListEntry = GetFirstListEntry(USetupData.LayoutList); ListEntry; - ListEntry = GetNextListEntry(ListEntry)) - { - LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id; - if (!wcsicmp(USetupData.LocaleID, LocaleId)) - { - DPRINT("found %S in LayoutList\n", LocaleId); - SetCurrentListEntry(USetupData.LayoutList, ListEntry); - break; - } - } - - SetConsoleCodePage(); - - return INSTALL_INTRO_PAGE; - } - - return LANGUAGE_PAGE; -} - - /* * Displays the WelcomePage. *
10 months
1
0
0
0
[reactos] 01/01: [MSCTFIME] Implement CModeBias (#6515)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9262df661e9f679c2f73c…
commit 9262df661e9f679c2f73c95404454d1efafda696 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Feb 22 18:43:08 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Feb 22 18:43:08 2024 +0900 [MSCTFIME] Implement CModeBias (#6515) Supporting TIPs... JIRA issue: CORE-19360 - Rename compartment.cpp as misc.cpp. - Implement CModeBias class. --- dll/ime/msctfime/CMakeLists.txt | 2 +- dll/ime/msctfime/{compartment.cpp => misc.cpp} | 49 +++++++++++++++++++++++++- dll/ime/msctfime/{compartment.h => misc.h} | 14 +++++++- dll/ime/msctfime/msctfime.h | 7 +++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/dll/ime/msctfime/CMakeLists.txt b/dll/ime/msctfime/CMakeLists.txt index 3a48a7cbabb..0e5acc805b0 100644 --- a/dll/ime/msctfime/CMakeLists.txt +++ b/dll/ime/msctfime/CMakeLists.txt @@ -6,9 +6,9 @@ spec2def(msctfime.ime msctfime.spec) list(APPEND SOURCE bridge.cpp - compartment.cpp functions.cpp inputcontext.cpp + misc.cpp msctfime.cpp profile.cpp sinks.cpp diff --git a/dll/ime/msctfime/compartment.cpp b/dll/ime/msctfime/misc.cpp similarity index 76% rename from dll/ime/msctfime/compartment.cpp rename to dll/ime/msctfime/misc.cpp index d92b1b526f4..18e01939ada 100644 --- a/dll/ime/msctfime/compartment.cpp +++ b/dll/ime/msctfime/misc.cpp @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS msctfime.ime * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) - * PURPOSE: Supporting compartments + * PURPOSE: Miscellaneous of msctfime.ime * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ @@ -161,3 +161,50 @@ ClearCompartment( return hr; } + +/***********************************************************************/ + +struct MODEBIAS +{ + REFGUID m_guid; + LONG m_bias; +}; + +static const MODEBIAS g_ModeBiasMap[] = +{ + { GUID_MODEBIAS_FILENAME, 0x00000001 }, + { GUID_MODEBIAS_NUMERIC, 0x00000004 }, + { GUID_MODEBIAS_URLHISTORY, 0x00010000 }, + { GUID_MODEBIAS_DEFAULT, 0x00000000 }, + { GUID_MODEBIAS_NONE, 0x00000000 }, +}; + +void CModeBias::SetModeBias(REFGUID rguid) +{ + m_guid = rguid; +} + +GUID CModeBias::ConvertModeBias(LONG bias) +{ + const GUID *pguid = &GUID_NULL; + for (auto& item : g_ModeBiasMap) + { + if (item.m_bias == bias) + { + pguid = &item.m_guid; + break; + } + } + + return *pguid; +} + +LONG CModeBias::ConvertModeBias(REFGUID guid) +{ + for (auto& item : g_ModeBiasMap) + { + if (IsEqualGUID(guid, item.m_guid)) + return item.m_bias; + } + return 0; +} diff --git a/dll/ime/msctfime/compartment.h b/dll/ime/msctfime/misc.h similarity index 74% rename from dll/ime/msctfime/compartment.h rename to dll/ime/msctfime/misc.h index 88805566832..ca96a227f54 100644 --- a/dll/ime/msctfime/compartment.h +++ b/dll/ime/msctfime/misc.h @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS msctfime.ime * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) - * PURPOSE: Supporting compartments + * PURPOSE: Miscellaneous of msctfime.ime * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ @@ -42,3 +42,15 @@ ClearCompartment( IUnknown *pUnknown, REFGUID rguid, BOOL bThread); + +/***********************************************************************/ + +class CModeBias +{ +public: + GUID m_guid; + + GUID ConvertModeBias(LONG bias); + LONG ConvertModeBias(REFGUID guid); + void SetModeBias(REFGUID rguid); +}; diff --git a/dll/ime/msctfime/msctfime.h b/dll/ime/msctfime/msctfime.h index cb482318830..28597863047 100644 --- a/dll/ime/msctfime/msctfime.h +++ b/dll/ime/msctfime/msctfime.h @@ -50,13 +50,18 @@ static inline HIMC GetActiveContext(VOID) DEFINE_GUID(GUID_COMPARTMENT_CTFIME_DIMFLAGS, 0xA94C5FD2, 0xC471, 0x4031, 0x95, 0x46, 0x70, 0x9C, 0x17, 0x30, 0x0C, 0xB9); DEFINE_GUID(GUID_COMPARTMENT_CTFIME_CICINPUTCONTEXT, 0x85A688F7, 0x6DC8, 0x4F17, 0xA8, 0x3A, 0xB1, 0x1C, 0x09, 0xCD, 0xD7, 0xBF); +DEFINE_GUID(GUID_MODEBIAS_FILENAME, 0xD7F707FE, 0x44C6, 0x4FCA, 0x8E, 0x76, 0x86, 0xAB, 0x50, 0xC7, 0x93, 0x1B); +DEFINE_GUID(GUID_MODEBIAS_NUMERIC, 0x4021766C, 0xE872, 0x48FD, 0x9C, 0xEE, 0x4E, 0xC5, 0xC7, 0x5E, 0x16, 0xC3); +DEFINE_GUID(GUID_MODEBIAS_URLHISTORY, 0x8B0E54D9, 0x63F2, 0x4C68, 0x84, 0xD4, 0x79, 0xAE, 0xE7, 0xA5, 0x9F, 0x09); +DEFINE_GUID(GUID_MODEBIAS_DEFAULT, 0xF3DA8BD4, 0x0786, 0x49C2, 0x8C, 0x09, 0x68, 0x39, 0xD8, 0xB8, 0x4F, 0x58); +#define GUID_MODEBIAS_NONE GUID_NULL #include "resource.h" #include "bridge.h" -#include "compartment.h" #include "functions.h" #include "inputcontext.h" +#include "misc.h" #include "profile.h" #include "sinks.h" #include "tls.h"
10 months
1
0
0
0
[reactos] 01/01: [MSCTFIME] Implement CicBridge::OnSetOpenStatus (#6514)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7d0b5482f6ae2997d85f9…
commit 7d0b5482f6ae2997d85f9bba819333de2077f184 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Feb 22 17:28:40 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Feb 22 17:28:40 2024 +0900 [MSCTFIME] Implement CicBridge::OnSetOpenStatus (#6514) Supporting TIPs... JIRA issue: CORE-19360 - Add CicInputContext::EscbCompComplete method (stub). - Implement CicBridge::OnSetOpenStatus method. --- dll/ime/msctfime/bridge.cpp | 13 +++++++++++-- dll/ime/msctfime/functions.cpp | 2 +- dll/ime/msctfime/functions.h | 2 +- dll/ime/msctfime/inputcontext.cpp | 6 ++++++ dll/ime/msctfime/inputcontext.h | 1 + dll/ime/msctfime/tls.h | 2 +- dll/ime/msctfime/ui.cpp | 13 ++++++------- 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/dll/ime/msctfime/bridge.cpp b/dll/ime/msctfime/bridge.cpp index e7801024cf9..ed74a566328 100644 --- a/dll/ime/msctfime/bridge.cpp +++ b/dll/ime/msctfime/bridge.cpp @@ -178,6 +178,7 @@ HRESULT CicBridge::DestroyInputContext(TLS *pTLS, HIMC hIMC) return hr; } +/// @implemented ITfContext * CicBridge::GetInputContext(CicIMCCLock<CTFIMECONTEXT>& imeContext) { @@ -187,14 +188,22 @@ CicBridge::GetInputContext(CicIMCCLock<CTFIMECONTEXT>& imeContext) return pCicIC->m_pContext; } -/// @unimplemented +/// @implemented HRESULT CicBridge::OnSetOpenStatus( TLS *pTLS, ITfThreadMgr_P *pThreadMgr, CicIMCLock& imcLock, CicInputContext *pCicIC) { - return E_NOTIMPL; + if (!imcLock.get().fOpen && imcLock.ValidCompositionString()) + pCicIC->EscbCompComplete(imcLock); + + pTLS->m_bNowOpening = TRUE; + HRESULT hr = SetCompartmentDWORD(m_cliendId, pThreadMgr, + GUID_COMPARTMENT_KEYBOARD_OPENCLOSE, + imcLock.get().fOpen, FALSE); + pTLS->m_bNowOpening = FALSE; + return hr; } /// Selects the IME context. diff --git a/dll/ime/msctfime/functions.cpp b/dll/ime/msctfime/functions.cpp index 2852aece1cd..e3133022023 100644 --- a/dll/ime/msctfime/functions.cpp +++ b/dll/ime/msctfime/functions.cpp @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS msctfime.ime * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) - * PURPOSE: The functions of msctfime.ime + * PURPOSE: The functionalities of msctfime.ime * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ diff --git a/dll/ime/msctfime/functions.h b/dll/ime/msctfime/functions.h index 6938162a6e5..d0b7d8c2ebe 100644 --- a/dll/ime/msctfime/functions.h +++ b/dll/ime/msctfime/functions.h @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS msctfime.ime * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) - * PURPOSE: The functions of msctfime.ime + * PURPOSE: The functionalities of msctfime.ime * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ diff --git a/dll/ime/msctfime/inputcontext.cpp b/dll/ime/msctfime/inputcontext.cpp index 81344d26545..7362040c8fb 100644 --- a/dll/ime/msctfime/inputcontext.cpp +++ b/dll/ime/msctfime/inputcontext.cpp @@ -260,6 +260,12 @@ HRESULT CicInputContext::EscbClearDocFeedBuffer(CicIMCLock& imcLock, BOOL bFlag) return E_NOTIMPL; } +/// @unimplemented +HRESULT CicInputContext::EscbCompComplete(CicIMCLock& imcLock) +{ + return E_NOTIMPL; +} + /// @unimplemented HRESULT CicInputContext::SetupReconvertString( diff --git a/dll/ime/msctfime/inputcontext.h b/dll/ime/msctfime/inputcontext.h index b567304b779..185d9b8161b 100644 --- a/dll/ime/msctfime/inputcontext.h +++ b/dll/ime/msctfime/inputcontext.h @@ -91,6 +91,7 @@ public: HRESULT SetupDocFeedString(CicIMCLock& imcLock, UINT uCodePage); HRESULT EscbClearDocFeedBuffer(CicIMCLock& imcLock, BOOL bFlag); + HRESULT EscbCompComplete(CicIMCLock& imcLock); HRESULT SetupReconvertString( CicIMCLock& imcLock, ITfThreadMgr_P *pThreadMgr, diff --git a/dll/ime/msctfime/tls.h b/dll/ime/msctfime/tls.h index 28f6d427177..ae1a6000e9c 100644 --- a/dll/ime/msctfime/tls.h +++ b/dll/ime/msctfime/tls.h @@ -25,7 +25,7 @@ public: DWORD m_dwFlags2; DWORD m_dwUnknown2; BOOL m_bDestroyed; - DWORD m_dwNowOpening; + BOOL m_bNowOpening; DWORD m_NonEAComposition; DWORD m_cWnds; diff --git a/dll/ime/msctfime/ui.cpp b/dll/ime/msctfime/ui.cpp index 2fec663f97f..fb8ae4105a9 100644 --- a/dll/ime/msctfime/ui.cpp +++ b/dll/ime/msctfime/ui.cpp @@ -444,15 +444,14 @@ UI::~UI() delete m_pComp; } -/// @unimplemented +/// @implemented HRESULT UI::_Create() { m_pComp = new(cicNoThrow) UIComposition(); if (!m_pComp) return E_OUTOFMEMORY; - SetWindowLongPtrW(m_hWnd, UIGWLP_UI, (LONG_PTR)this); - //FIXME + ::SetWindowLongPtrW(m_hWnd, UIGWLP_UI, (LONG_PTR)this); return S_OK; } @@ -460,13 +459,13 @@ HRESULT UI::_Create() void UI::_Destroy() { m_pComp->OnDestroy(); - SetWindowLongPtrW(m_hWnd, UIGWLP_UI, 0); + ::SetWindowLongPtrW(m_hWnd, UIGWLP_UI, 0); } /// @implemented void UI::OnCreate(HWND hWnd) { - UI *pUI = (UI*)GetWindowLongPtrW(hWnd, UIGWLP_UI); + UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UIGWLP_UI); if (pUI) return; pUI = new(cicNoThrow) UI(hWnd); @@ -477,7 +476,7 @@ void UI::OnCreate(HWND hWnd) /// @implemented void UI::OnDestroy(HWND hWnd) { - UI *pUI = (UI*)GetWindowLongPtrW(hWnd, UIGWLP_UI); + UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UIGWLP_UI); if (!pUI) return; @@ -656,7 +655,7 @@ UIWndProc( /***********************************************************************/ -/// @unimplemented +/// @implemented BOOL RegisterImeClass(VOID) { WNDCLASSEXW wcx;
10 months
1
0
0
0
[reactos] 01/01: [MSCTFIME][CICERO] Implement CFnDocFeed (#6513)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f53f1334eda2daeb94e2c…
commit f53f1334eda2daeb94e2cf2d7722f4e6a76e06fa Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Feb 22 15:46:05 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Feb 22 15:46:05 2024 +0900 [MSCTFIME][CICERO] Implement CFnDocFeed (#6513) Supporting TIPs... JIRA issue: CORE-19360 - Add missing CicInputContext methods. - Implement CFnDocFeed class. --- dll/ime/msctfime/bridge.cpp | 13 ++--- dll/ime/msctfime/functions.cpp | 100 +++++++++++++++++++++++++++++++++++--- dll/ime/msctfime/inputcontext.cpp | 41 +++++++++++++--- dll/ime/msctfime/inputcontext.h | 12 ++++- dll/ime/msctfime/msctfime.cpp | 35 +++---------- dll/ime/msctfime/msctfime.h | 8 +++ dll/ime/msctfime/ui.cpp | 2 - sdk/lib/cicero/cicimc.h | 3 +- 8 files changed, 156 insertions(+), 58 deletions(-) diff --git a/dll/ime/msctfime/bridge.cpp b/dll/ime/msctfime/bridge.cpp index de9e6ba10ef..e7801024cf9 100644 --- a/dll/ime/msctfime/bridge.cpp +++ b/dll/ime/msctfime/bridge.cpp @@ -87,11 +87,8 @@ CicBridge::CreateInputContext( _In_ HIMC hIMC) { CicIMCLock imcLock(hIMC); - HRESULT hr = imcLock.m_hr; - if (!imcLock) - hr = E_FAIL; - if (FAILED(hr)) - return hr; + if (FAILED(imcLock.m_hr)) + return imcLock.m_hr; if (!imcLock.get().hCtfImeContext) { @@ -126,7 +123,7 @@ CicBridge::CreateInputContext( imeContext.get().m_pCicIC = pCicIC; } - hr = pCicIC->CreateInputContext(pTLS->m_pThreadMgr, imcLock); + HRESULT hr = pCicIC->CreateInputContext(pTLS->m_pThreadMgr, imcLock); if (FAILED(hr)) { pCicIC->Release(); @@ -149,8 +146,6 @@ HRESULT CicBridge::DestroyInputContext(TLS *pTLS, HIMC hIMC) { CicIMCLock imcLock(hIMC); HRESULT hr = imcLock.m_hr; - if (!imcLock) - hr = E_FAIL; if (FAILED(hr)) return hr; @@ -217,8 +212,6 @@ CicBridge::SelectEx( return imcLock.m_hr; CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext); - if (!imeContext) - imeContext.m_hr = E_FAIL; if (FAILED(imeContext.m_hr)) return imeContext.m_hr; diff --git a/dll/ime/msctfime/functions.cpp b/dll/ime/msctfime/functions.cpp index c9832f90cff..2852aece1cd 100644 --- a/dll/ime/msctfime/functions.cpp +++ b/dll/ime/msctfime/functions.cpp @@ -150,26 +150,112 @@ STDMETHODIMP_(ULONG) CFnDocFeed::Release() return m_cRefs; } -/// @unimplemented +/// @implemented STDMETHODIMP CFnDocFeed::DocFeed() { - return E_NOTIMPL; + TLS *pTLS = TLS::GetTLS(); + if (!pTLS) + return E_OUTOFMEMORY; + + HIMC hIMC = GetActiveContext(); + CicIMCLock imcLock(hIMC); + if (FAILED(imcLock.m_hr)) + return imcLock.m_hr; + + CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext); + if (FAILED(imeContext.m_hr)) + return imeContext.m_hr; + CicInputContext *pCicIC = imeContext.get().m_pCicIC; + if (!pCicIC) + return E_FAIL; + + UINT uCodePage = CP_ACP; + pTLS->m_pProfile->GetCodePageA(&uCodePage); + pCicIC->SetupDocFeedString(imcLock, uCodePage); + return S_OK; } -/// @unimplemented +/// @implemented STDMETHODIMP CFnDocFeed::ClearDocFeedBuffer() { - return E_NOTIMPL; + if (!TLS::GetTLS()) + return E_OUTOFMEMORY; + + HIMC hIMC = GetActiveContext(); + CicIMCLock imcLock(hIMC); + if (FAILED(imcLock.m_hr)) + return imcLock.m_hr; + + CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext); + if (FAILED(imeContext.m_hr)) + return imeContext.m_hr; + + CicInputContext *pCicIC = imeContext.get().m_pCicIC; + if (!pCicIC) + return E_FAIL; + + pCicIC->EscbClearDocFeedBuffer(imcLock, TRUE); + return S_OK; } /// @unimplemented STDMETHODIMP CFnDocFeed::StartReconvert() { - return E_NOTIMPL; + TLS *pTLS = TLS::GetTLS(); + if (!pTLS) + return E_OUTOFMEMORY; + auto *pThreadMgr = pTLS->m_pThreadMgr; + if (!pThreadMgr) + return E_OUTOFMEMORY; + + HIMC hIMC = GetActiveContext(); + CicIMCLock imcLock(hIMC); + if (FAILED(imcLock.m_hr)) + return imcLock.m_hr; + + CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext); + if (FAILED(imeContext.m_hr)) + return imeContext.m_hr; + CicInputContext *pCicIC = imeContext.get().m_pCicIC; + if (!pCicIC) + return E_FAIL; + + UINT uCodePage = CP_ACP; + pTLS->m_pProfile->GetCodePageA(&uCodePage); + + pCicIC->m_bReconverting = TRUE; + pCicIC->SetupReconvertString(imcLock, pThreadMgr, uCodePage, 0, 0); + pCicIC->EndReconvertString(imcLock); + pCicIC->m_bReconverting = FALSE; + return S_OK; } -/// @unimplemented +/// @implemented STDMETHODIMP CFnDocFeed::StartUndoCompositionString() { - return E_NOTIMPL; + TLS *pTLS = TLS::GetTLS(); + if (!pTLS) + return E_OUTOFMEMORY; + auto *pThreadMgr = pTLS->m_pThreadMgr; + if (!pThreadMgr) + return E_OUTOFMEMORY; + + HIMC hIMC = GetActiveContext(); + CicIMCLock imcLock(hIMC); + if (FAILED(imcLock.m_hr)) + return imcLock.m_hr; + + CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext); + if (FAILED(imeContext.m_hr)) + return imeContext.m_hr; + CicInputContext *pCicIC = imeContext.get().m_pCicIC; + if (!pCicIC) + return E_FAIL; + + UINT uCodePage = CP_ACP; + pTLS->m_pProfile->GetCodePageA(&uCodePage); + + pCicIC->SetupReconvertString(imcLock, pThreadMgr, uCodePage, 0, TRUE); + pCicIC->EndReconvertString(imcLock); + return S_OK; } diff --git a/dll/ime/msctfime/inputcontext.cpp b/dll/ime/msctfime/inputcontext.cpp index 1bdf64cb62e..81344d26545 100644 --- a/dll/ime/msctfime/inputcontext.cpp +++ b/dll/ime/msctfime/inputcontext.cpp @@ -65,7 +65,7 @@ CicInputContext::OnStartComposition( ITfCompositionView *pComposition, BOOL *pfOk) { - if ((m_cCompLocks <= 0) || m_dwUnknown6_5) + if ((m_cCompLocks <= 0) || m_bReconverting) { *pfOk = TRUE; ++m_cCompLocks; @@ -103,13 +103,10 @@ CicInputContext::GetGuidAtom( _Out_opt_ LPDWORD pdwGuidAtom) { CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCompStr); - HRESULT hr = imeContext.m_hr; - if (!imeContext) - hr = E_FAIL; - if (FAILED(hr)) - return hr; + if (FAILED(imeContext.m_hr)) + return imeContext.m_hr; - hr = E_FAIL; + HRESULT hr = E_FAIL; if (iAtom < m_cGuidAtoms) { *pdwGuidAtom = m_adwGuidAtoms[iAtom]; @@ -251,6 +248,36 @@ CicInputContext::OnCleanupContext( return S_OK; } +/// @unimplemented +HRESULT CicInputContext::SetupDocFeedString(CicIMCLock& imcLock, UINT uCodePage) +{ + return E_NOTIMPL; +} + +/// @unimplemented +HRESULT CicInputContext::EscbClearDocFeedBuffer(CicIMCLock& imcLock, BOOL bFlag) +{ + return E_NOTIMPL; +} + +/// @unimplemented +HRESULT +CicInputContext::SetupReconvertString( + CicIMCLock& imcLock, + ITfThreadMgr_P *pThreadMgr, + UINT uCodePage, + DWORD dwUnknown61, + BOOL bUndo) +{ + return E_NOTIMPL; +} + +/// @unimplemented +HRESULT CicInputContext::EndReconvertString(CicIMCLock& imcLock) +{ + return E_NOTIMPL; +} + /// Retrieves the IME information. /// @implemented HRESULT diff --git a/dll/ime/msctfime/inputcontext.h b/dll/ime/msctfime/inputcontext.h index 2273161926e..b567304b779 100644 --- a/dll/ime/msctfime/inputcontext.h +++ b/dll/ime/msctfime/inputcontext.h @@ -47,7 +47,7 @@ public: GUID m_guid; DWORD m_dwUnknown6[11]; BOOL m_bSelecting; - DWORD m_dwUnknown6_5; + BOOL m_bReconverting; LONG m_cCompLocks; DWORD m_dwUnknown7[5]; WORD m_cGuidAtoms; @@ -88,4 +88,14 @@ public: HRESULT CreateInputContext(_Inout_ ITfThreadMgr *pThreadMgr, _Inout_ CicIMCLock& imcLock); HRESULT DestroyInputContext(); + + HRESULT SetupDocFeedString(CicIMCLock& imcLock, UINT uCodePage); + HRESULT EscbClearDocFeedBuffer(CicIMCLock& imcLock, BOOL bFlag); + HRESULT SetupReconvertString( + CicIMCLock& imcLock, + ITfThreadMgr_P *pThreadMgr, + UINT uCodePage, + DWORD dwUnknown61, + BOOL bUndo); + HRESULT EndReconvertString(CicIMCLock& imcLock); }; diff --git a/dll/ime/msctfime/msctfime.cpp b/dll/ime/msctfime/msctfime.cpp index 445998d6a9c..87ca208819c 100644 --- a/dll/ime/msctfime/msctfime.cpp +++ b/dll/ime/msctfime/msctfime.cpp @@ -142,14 +142,6 @@ HRESULT InitDisplayAttrbuteLib(PCIC_LIBTHREAD pLibThread) return hr; } -HIMC GetActiveContext(VOID) -{ - HWND hwndFocus = ::GetFocus(); - if (!hwndFocus) - hwndFocus = ::GetActiveWindow(); - return ::ImmGetContext(hwndFocus); -} - /// @implemented HRESULT UninitDisplayAttrbuteLib(PCIC_LIBTHREAD pLibThread) { @@ -184,8 +176,6 @@ InternalSelectEx( _In_ LANGID LangID) { CicIMCLock imcLock(hIMC); - if (!imcLock) - imcLock.m_hr = E_FAIL; if (FAILED(imcLock.m_hr)) return imcLock.m_hr; @@ -608,25 +598,17 @@ CtfImeGetGuidAtom( TRACE("(%p, 0x%lX, %p)\n", hIMC, dwUnknown, pdwGuidAtom); CicIMCLock imcLock(hIMC); - - HRESULT hr = imcLock.m_hr; - if (!imcLock) - hr = E_FAIL; - if (FAILED(hr)) - return hr; + if (FAILED(imcLock.m_hr)) + return imcLock.m_hr; CicIMCCLock<CTFIMECONTEXT> imccLock(imcLock.get().hCtfImeContext); - hr = imccLock.m_hr; - if (!imccLock) - hr = E_FAIL; - if (FAILED(hr)) - return hr; + if (FAILED(imccLock.m_hr)) + return imccLock.m_hr; if (!imccLock.get().m_pCicIC) return E_OUTOFMEMORY; - hr = imccLock.get().m_pCicIC->GetGuidAtom(imcLock, dwUnknown, pdwGuidAtom); - return hr; + return imccLock.get().m_pCicIC->GetGuidAtom(imcLock, dwUnknown, pdwGuidAtom); } /*********************************************************************** @@ -641,13 +623,8 @@ CtfImeIsGuidMapEnable( TRACE("(%p)\n", hIMC); BOOL ret = FALSE; - HRESULT hr; CicIMCLock imcLock(hIMC); - - hr = imcLock.m_hr; - if (!imcLock) - hr = E_FAIL; - if (SUCCEEDED(hr)) + if (SUCCEEDED(imcLock.m_hr)) ret = !!(imcLock.get().fdwInit & INIT_GUIDMAP); return ret; diff --git a/dll/ime/msctfime/msctfime.h b/dll/ime/msctfime/msctfime.h index 7b2f2fff822..cb482318830 100644 --- a/dll/ime/msctfime/msctfime.h +++ b/dll/ime/msctfime/msctfime.h @@ -40,6 +40,14 @@ EXTERN_C BOOLEAN WINAPI DllShutdownInProgress(VOID); HRESULT InitDisplayAttrbuteLib(PCIC_LIBTHREAD pLibThread); HRESULT UninitDisplayAttrbuteLib(PCIC_LIBTHREAD pLibThread); +static inline HIMC GetActiveContext(VOID) +{ + HWND hwndFocus = ::GetFocus(); + if (!hwndFocus) + hwndFocus = ::GetActiveWindow(); + return ::ImmGetContext(hwndFocus); +} + DEFINE_GUID(GUID_COMPARTMENT_CTFIME_DIMFLAGS, 0xA94C5FD2, 0xC471, 0x4031, 0x95, 0x46, 0x70, 0x9C, 0x17, 0x30, 0x0C, 0xB9); DEFINE_GUID(GUID_COMPARTMENT_CTFIME_CICINPUTCONTEXT, 0x85A688F7, 0x6DC8, 0x4F17, 0xA8, 0x3A, 0xB1, 0x1C, 0x09, 0xCD, 0xD7, 0xBF); diff --git a/dll/ime/msctfime/ui.cpp b/dll/ime/msctfime/ui.cpp index 660d20824d6..2fec663f97f 100644 --- a/dll/ime/msctfime/ui.cpp +++ b/dll/ime/msctfime/ui.cpp @@ -357,8 +357,6 @@ STDMETHODIMP_(LRESULT) CDefCompFrameWindow::OnWindowPosChanged(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { CicIMCLock imcLock(m_hIMC); - if (!imcLock) - imcLock.m_hr = E_FAIL; if (SUCCEEDED(imcLock.m_hr)) ::SendMessage(imcLock.get().hWnd, WM_IME_NOTIFY, 0xF, (LPARAM)m_hIMC); return ::DefWindowProc(hWnd, uMsg, wParam, lParam); diff --git a/sdk/lib/cicero/cicimc.h b/sdk/lib/cicero/cicimc.h index 779884abfdd..7db0783cee5 100644 --- a/sdk/lib/cicero/cicimc.h +++ b/sdk/lib/cicero/cicimc.h @@ -45,8 +45,7 @@ class CicIMCCLock : public CIC_IMCC_LOCK<T_DATA> public: CicIMCCLock(HIMCC hIMCC) : CIC_IMCC_LOCK<T_DATA>(hIMCC) { - if (hIMCC) - _LockIMCC(this->m_hIMCC, &this->m_pIMCC); + this->m_hr = _LockIMCC(this->m_hIMCC, &this->m_pIMCC); } ~CicIMCCLock() {
10 months
1
0
0
0
[reactos] 01/01: [EXT2FS] Ext2Read(): Complete request on VCB_VOLUME_LOCKED case (#4770)
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0086d05007aaa4505afd5…
commit 0086d05007aaa4505afd5e1f38c87ac965aac840 Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com> AuthorDate: Wed Feb 21 16:31:09 2024 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Feb 21 07:31:09 2024 -0800 [EXT2FS] Ext2Read(): Complete request on VCB_VOLUME_LOCKED case (#4770) CORE-10645 Co-authored-by: Victor Martinez Calvo <vicmarcal(a)gmail.com> --- drivers/filesystems/ext2/src/read.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/filesystems/ext2/src/read.c b/drivers/filesystems/ext2/src/read.c index b01e97e1c35..b754299b496 100644 --- a/drivers/filesystems/ext2/src/read.c +++ b/drivers/filesystems/ext2/src/read.c @@ -905,6 +905,9 @@ Ext2Read (IN PEXT2_IRP_CONTEXT IrpContext) if (FlagOn(Vcb->Flags, VCB_VOLUME_LOCKED) && Vcb->LockFile != FileObject ) { Status = STATUS_ACCESS_DENIED; +#ifdef __REACTOS__ + bCompleteRequest = TRUE; +#endif _SEH2_LEAVE; }
10 months, 1 week
1
0
0
0
← Newer
1
2
3
4
5
...
13
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
Results per page:
10
25
50
100
200