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
September 2021
----- 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
25 participants
144 discussions
Start a n
N
ew thread
[reactos] 02/05: [BROWSEUI] Fix early error handling, to be taken only when ParseNow() is run (and fixes "Use of uninitialized variable hr" RTC error). Addendum to commit d8e47d61.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ffc4febb0cda008e8f693…
commit ffc4febb0cda008e8f693fc4d67c700bb7cb413f Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Sep 17 18:58:07 2021 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Sep 19 00:17:04 2021 +0200 [BROWSEUI] Fix early error handling, to be taken only when ParseNow() is run (and fixes "Use of uninitialized variable hr" RTC error). Addendum to commit d8e47d61. --- dll/win32/browseui/addresseditbox.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dll/win32/browseui/addresseditbox.cpp b/dll/win32/browseui/addresseditbox.cpp index 4d7b3dc7c57..4e018cc5bc1 100644 --- a/dll/win32/browseui/addresseditbox.cpp +++ b/dll/win32/browseui/addresseditbox.cpp @@ -168,8 +168,8 @@ cleanup: if (pidlCurrent) ILFree(pidlCurrent); if (address != input) - delete [] address; - delete [] input; + delete[] address; + delete[] input; return hr; } @@ -192,19 +192,19 @@ HRESULT STDMETHODCALLTYPE CAddressEditBox::Execute(long paramC) HRESULT hr; /* - * Parse the path is it wasn't parsed + * Parse the path if it wasn't parsed */ if (!pidlLastParsed) + { hr = ParseNow(0); - /* - * If the destination path doesn't exist then display an error message - */ - if (hr == HRESULT_FROM_WIN32(ERROR_INVALID_DRIVE) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) - return ShowFileNotFoundError(hr); + /* If the destination path doesn't exist then display an error message */ + if (hr == HRESULT_FROM_WIN32(ERROR_INVALID_DRIVE) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) + return ShowFileNotFoundError(hr); - if (!pidlLastParsed) - return E_FAIL; + if (!pidlLastParsed) + return E_FAIL; + } /* * Get the IShellBrowser and IBrowserService interfaces of the shell browser
3 years, 3 months
1
0
0
0
[reactos] 01/05: [BROWSEUI] Minor formatting.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6072ee976609ee5dd62d1…
commit 6072ee976609ee5dd62d123330f22bddc52dc521 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Sep 17 19:15:31 2021 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Sep 19 00:17:03 2021 +0200 [BROWSEUI] Minor formatting. --- dll/win32/browseui/CAutoComplete.cpp | 2 +- dll/win32/browseui/CAutoComplete.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dll/win32/browseui/CAutoComplete.cpp b/dll/win32/browseui/CAutoComplete.cpp index a6d6bc84817..2b33198a5fe 100644 --- a/dll/win32/browseui/CAutoComplete.cpp +++ b/dll/win32/browseui/CAutoComplete.cpp @@ -783,7 +783,7 @@ VOID CAutoComplete::SelectItem(INT iItem) m_hwndList.EnsureVisible(iItem, FALSE); } -VOID CAutoComplete::DoAutoAppend(AC_THREAD *pThread) +VOID CAutoComplete::DoAutoAppend(PAC_THREAD pThread) { if (!CanAutoAppend()) // can we auto-append? return; // don't append diff --git a/dll/win32/browseui/CAutoComplete.h b/dll/win32/browseui/CAutoComplete.h index 586a878d154..af3bddabde7 100644 --- a/dll/win32/browseui/CAutoComplete.h +++ b/dll/win32/browseui/CAutoComplete.h @@ -219,7 +219,8 @@ protected: WNDPROC m_fnOldEditProc; // old textbox procedure EDITWORDBREAKPROCW m_fnOldWordBreakProc; HANDLE m_hThread; - AC_THREAD *m_pThread; + PAC_THREAD m_pThread; + // The following variables are non-POD: CStringW m_strText; // internal text (used in selecting item and reverting text) CStringW m_strStemText; // dirname + '\\' @@ -231,6 +232,7 @@ protected: CComPtr<IACList> m_pACList; // for IACList::Expand to update the list CSimpleArray<CStringW> m_innerList; // inner list CSimpleArray<CStringW> m_outerList; // outer list + // protected methods VOID UpdateDropDownState(); VOID CalcRects(BOOL bDowner, RECT& rcListView, RECT& rcScrollBar, RECT& rcSizeBox) const; @@ -241,6 +243,7 @@ protected: VOID ExtractInnerList(CSimpleArray<CStringW>& outerList, const CSimpleArray<CStringW>& innerList, const CString& strText); + // message map BEGIN_MSG_MAP(CAutoComplete) MESSAGE_HANDLER(AUTOCOMP_START, OnAutoCompStart) @@ -261,6 +264,7 @@ protected: MESSAGE_HANDLER(WM_TIMER, OnTimer) MESSAGE_HANDLER(WM_VSCROLL, OnVScroll) END_MSG_MAP() + // message handlers LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled); LRESULT OnNCDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
3 years, 3 months
1
0
0
0
[reactos] 01/01: [IMM32] Define Imm32HeapFree macro and use it (#3962)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5b522667a66bc8c9313e2…
commit 5b522667a66bc8c9313e206af4316df02c8fe716 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Sep 19 01:52:05 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Sep 19 01:52:05 2021 +0900 [IMM32] Define Imm32HeapFree macro and use it (#3962) - Define Imm32HeapFree macro in precomp.h and use it. - Omit some NULL checks (for HeapFree). CORE-11700 --- dll/win32/imm32/ime.c | 30 ++++++++++---------------- dll/win32/imm32/imm.c | 14 ++++++------ dll/win32/imm32/keymsg.c | 10 ++++----- dll/win32/imm32/nt3.c | 2 +- dll/win32/imm32/precomp.h | 3 +++ dll/win32/imm32/regword.c | 54 ++++++++++++++++------------------------------- dll/win32/imm32/utils.c | 4 ++-- 7 files changed, 45 insertions(+), 72 deletions(-) diff --git a/dll/win32/imm32/ime.c b/dll/win32/imm32/ime.c index 80a2c50f33c..75f538c5c91 100644 --- a/dll/win32/imm32/ime.c +++ b/dll/win32/imm32/ime.c @@ -221,7 +221,7 @@ PIMEDPI APIENTRY Ime32LoadImeDpi(HKL hKL, BOOL bLock) if (!Imm32LoadImeInfo(&ImeInfoEx, pImeDpiNew)) { - HeapFree(g_hImm32Heap, 0, pImeDpiNew); + Imm32HeapFree(pImeDpiNew); return FALSE; } @@ -236,7 +236,7 @@ PIMEDPI APIENTRY Ime32LoadImeDpi(HKL hKL, BOOL bLock) RtlLeaveCriticalSection(&g_csImeDpi); Imm32FreeImeDpi(pImeDpiNew, FALSE); - HeapFree(g_hImm32Heap, 0, pImeDpiNew); + Imm32HeapFree(pImeDpiNew); return pImeDpiFound; } else @@ -477,7 +477,7 @@ VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi) } Imm32FreeImeDpi(pImeDpi, TRUE); - HeapFree(g_hImm32Heap, 0, pImeDpi); + Imm32HeapFree(pImeDpi); RtlLeaveCriticalSection(&g_csImeDpi); } @@ -1228,10 +1228,8 @@ ImmGetConversionListA(HKL hKL, HIMC hIMC, LPCSTR pSrc, LPCANDIDATELIST lpDst, ret = CandidateListWideToAnsi(pCL, lpDst, dwBufLen, CP_ACP); Quit: - if (pszSrcW) - HeapFree(g_hImm32Heap, 0, pszSrcW); - if (pCL) - HeapFree(g_hImm32Heap, 0, pCL); + Imm32HeapFree(pszSrcW); + Imm32HeapFree(pCL); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -1285,10 +1283,8 @@ ImmGetConversionListW(HKL hKL, HIMC hIMC, LPCWSTR pSrc, LPCANDIDATELIST lpDst, ret = CandidateListAnsiToWide(pCL, lpDst, dwBufLen, CP_ACP); Quit: - if (pszSrcA) - HeapFree(g_hImm32Heap, 0, pszSrcA); - if (pCL) - HeapFree(g_hImm32Heap, 0, pCL); + Imm32HeapFree(pszSrcA); + Imm32HeapFree(pCL); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -1429,10 +1425,8 @@ DoIt: SendMessageW(hWnd, WM_IME_SYSTEM, 0x1A, 0); Quit: - if (RegWordW.lpReading) - HeapFree(g_hImm32Heap, 0, RegWordW.lpReading); - if (RegWordW.lpWord) - HeapFree(g_hImm32Heap, 0, RegWordW.lpWord); + Imm32HeapFree(RegWordW.lpReading); + Imm32HeapFree(RegWordW.lpWord); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -1488,10 +1482,8 @@ DoIt: SendMessageW(hWnd, WM_IME_SYSTEM, 0x1A, 0); Quit: - if (RegWordA.lpReading) - HeapFree(g_hImm32Heap, 0, RegWordA.lpReading); - if (RegWordA.lpWord) - HeapFree(g_hImm32Heap, 0, RegWordA.lpWord); + Imm32HeapFree(RegWordA.lpReading); + Imm32HeapFree(RegWordA.lpWord); ImmUnlockImeDpi(pImeDpi); return ret; } diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index 6092b354d74..0351cdae680 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -321,7 +321,7 @@ HIMC WINAPI ImmCreateContext(void) hIMC = NtUserCreateInputContext(pClientImc); if (hIMC == NULL) { - HeapFree(g_hImm32Heap, 0, pClientImc); + Imm32HeapFree(pClientImc); return NULL; } @@ -464,7 +464,7 @@ PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc) if (!NtUserUpdateInputContext(hImc, 0, pClientImc)) { - HeapFree(g_hImm32Heap, 0, pClientImc); + Imm32HeapFree(pClientImc); return NULL; } @@ -499,7 +499,7 @@ VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc) LocalFree(hImc); RtlDeleteCriticalSection(&pClientImc->cs); - HeapFree(g_hImm32Heap, 0, pClientImc); + Imm32HeapFree(pClientImc); } static HIMC APIENTRY Imm32GetContextEx(HWND hWnd, DWORD dwContextFlags) @@ -867,10 +867,8 @@ HKL WINAPI ImmInstallIMEA(LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText) hKL = ImmInstallIMEW(pszFileNameW, pszLayoutTextW); Quit: - if (pszFileNameW) - HeapFree(g_hImm32Heap, 0, pszFileNameW); - if (pszLayoutTextW) - HeapFree(g_hImm32Heap, 0, pszLayoutTextW); + Imm32HeapFree(pszFileNameW); + Imm32HeapFree(pszLayoutTextW); return hKL; } @@ -1183,7 +1181,7 @@ BOOL WINAPI ImmEnumInputContext(DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lPara break; } - HeapFree(g_hImm32Heap, 0, phList); + Imm32HeapFree(phList); return ret; } diff --git a/dll/win32/imm32/keymsg.c b/dll/win32/imm32/keymsg.c index 6c5ad757db6..69a26aed9be 100644 --- a/dll/win32/imm32/keymsg.c +++ b/dll/win32/imm32/keymsg.c @@ -497,8 +497,7 @@ BOOL WINAPI ImmGenerateMessage(HIMC hIMC) } Quit: - if (pTrans) - HeapFree(g_hImm32Heap, 0, pTrans); + Imm32HeapFree(pTrans); if (hMsgBuf) ImmUnlockIMCC(hMsgBuf); pIC->dwNumMsgBuf = 0; /* done */ @@ -557,8 +556,8 @@ Imm32PostMessages(HWND hwnd, HIMC hIMC, DWORD dwCount, LPTRANSMSG lpTransMsg) } #ifdef IMM_NT3_SUPPORT - if (pNewTransMsg && pNewTransMsg != lpTransMsg) - HeapFree(g_hImm32Heap, 0, pNewTransMsg); + if (pNewTransMsg != lpTransMsg) + Imm32HeapFree(pNewTransMsg); #endif } @@ -678,8 +677,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD } Quit: - if (pList) - HeapFree(g_hImm32Heap, 0, pList); + Imm32HeapFree(pList); ImmUnlockImeDpi(pImeDpi); ImmUnlockIMC(hIMC); ImmReleaseContext(hwnd, hIMC); diff --git a/dll/win32/imm32/nt3.c b/dll/win32/imm32/nt3.c index 14171de8df2..e1e8b263311 100644 --- a/dll/win32/imm32/nt3.c +++ b/dll/win32/imm32/nt3.c @@ -166,7 +166,7 @@ DoDefault: } } - HeapFree(g_hImm32Heap, 0, pTempList); + Imm32HeapFree(pTempList); return ret; } diff --git a/dll/win32/imm32/precomp.h b/dll/win32/imm32/precomp.h index b96a9afa695..ecd05ca85f0 100644 --- a/dll/win32/imm32/precomp.h +++ b/dll/win32/imm32/precomp.h @@ -72,7 +72,10 @@ BOOL Imm32GetSystemLibraryPath(LPWSTR pszPath, DWORD cchPath, LPCWSTR pszFileNam VOID APIENTRY LogFontAnsiToWide(const LOGFONTA *plfA, LPLOGFONTW plfW); VOID APIENTRY LogFontWideToAnsi(const LOGFONTW *plfW, LPLOGFONTA plfA); PWND FASTCALL ValidateHwndNoErr(HWND hwnd); + LPVOID APIENTRY Imm32HeapAlloc(DWORD dwFlags, DWORD dwBytes); +#define Imm32HeapFree(lpData) HeapFree(g_hImm32Heap, 0, (lpData)) + LPWSTR APIENTRY Imm32WideFromAnsi(LPCSTR pszA); LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW); PIMEDPI APIENTRY ImmLockOrLoadImeDpi(HKL hKL); diff --git a/dll/win32/imm32/regword.c b/dll/win32/imm32/regword.c index ceac66e8e38..8d9fa43fa3e 100644 --- a/dll/win32/imm32/regword.c +++ b/dll/win32/imm32/regword.c @@ -51,10 +51,8 @@ Imm32EnumWordProcA2W(LPCSTR pszReadingA, DWORD dwStyle, LPCSTR pszRegisterA, LPV lpEnumData->ret = ret; Quit: - if (pszReadingW) - HeapFree(g_hImm32Heap, 0, pszReadingW); - if (pszRegisterW) - HeapFree(g_hImm32Heap, 0, pszRegisterW); + Imm32HeapFree(pszReadingW); + Imm32HeapFree(pszRegisterW); return ret; } @@ -83,10 +81,8 @@ Imm32EnumWordProcW2A(LPCWSTR pszReadingW, DWORD dwStyle, LPCWSTR pszRegisterW, L lpEnumData->ret = ret; Quit: - if (pszReadingA) - HeapFree(g_hImm32Heap, 0, pszReadingA); - if (pszRegisterA) - HeapFree(g_hImm32Heap, 0, pszRegisterA); + Imm32HeapFree(pszReadingA); + Imm32HeapFree(pszRegisterA); return ret; } @@ -140,10 +136,8 @@ ImmEnumRegisterWordA(HKL hKL, REGISTERWORDENUMPROCA lpfnEnumProc, ret = EnumDataW2A.ret; Quit: - if (pszReadingW) - HeapFree(g_hImm32Heap, 0, pszReadingW); - if (pszRegisterW) - HeapFree(g_hImm32Heap, 0, pszRegisterW); + Imm32HeapFree(pszReadingW); + Imm32HeapFree(pszRegisterW); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -198,10 +192,8 @@ ImmEnumRegisterWordW(HKL hKL, REGISTERWORDENUMPROCW lpfnEnumProc, ret = EnumDataA2W.ret; Quit: - if (pszReadingA) - HeapFree(g_hImm32Heap, 0, pszReadingA); - if (pszRegisterA) - HeapFree(g_hImm32Heap, 0, pszRegisterA); + Imm32HeapFree(pszReadingA); + Imm32HeapFree(pszRegisterA); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -259,8 +251,7 @@ UINT WINAPI ImmGetRegisterWordStyleA(HKL hKL, UINT nItem, LPSTYLEBUFA lpStyleBuf } Quit: - if (pNewStylesW) - HeapFree(g_hImm32Heap, 0, pNewStylesW); + Imm32HeapFree(pNewStylesW); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -317,8 +308,7 @@ UINT WINAPI ImmGetRegisterWordStyleW(HKL hKL, UINT nItem, LPSTYLEBUFW lpStyleBuf } Quit: - if (pNewStylesA) - HeapFree(g_hImm32Heap, 0, pNewStylesA); + Imm32HeapFree(pNewStylesA); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -364,10 +354,8 @@ ImmRegisterWordA(HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszRegister ret = pImeDpi->ImeRegisterWord(pszReadingW, dwStyle, pszRegisterW); Quit: - if (pszReadingW) - HeapFree(g_hImm32Heap, 0, pszReadingW); - if (pszRegisterW) - HeapFree(g_hImm32Heap, 0, pszRegisterW); + Imm32HeapFree(pszReadingW); + Imm32HeapFree(pszRegisterW); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -413,10 +401,8 @@ ImmRegisterWordW(HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszRegist ret = pImeDpi->ImeRegisterWord(pszReadingA, dwStyle, pszRegisterA); Quit: - if (pszReadingA) - HeapFree(g_hImm32Heap, 0, pszReadingA); - if (pszRegisterA) - HeapFree(g_hImm32Heap, 0, pszRegisterA); + Imm32HeapFree(pszReadingA); + Imm32HeapFree(pszRegisterA); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -462,10 +448,8 @@ ImmUnregisterWordA(HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszUnregi ret = pImeDpi->ImeUnregisterWord(pszReadingW, dwStyle, pszUnregisterW); Quit: - if (pszReadingW) - HeapFree(g_hImm32Heap, 0, pszReadingW); - if (pszUnregisterW) - HeapFree(g_hImm32Heap, 0, pszUnregisterW); + Imm32HeapFree(pszReadingW); + Imm32HeapFree(pszUnregisterW); ImmUnlockImeDpi(pImeDpi); return ret; } @@ -511,10 +495,8 @@ ImmUnregisterWordW(HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszUnre ret = pImeDpi->ImeUnregisterWord(pszReadingA, dwStyle, pszUnregisterA); Quit: - if (pszReadingA) - HeapFree(g_hImm32Heap, 0, pszReadingA); - if (pszUnregisterA) - HeapFree(g_hImm32Heap, 0, pszUnregisterA); + Imm32HeapFree(pszReadingA); + Imm32HeapFree(pszUnregisterA); ImmUnlockImeDpi(pImeDpi); return ret; } diff --git a/dll/win32/imm32/utils.c b/dll/win32/imm32/utils.c index c6c277efba3..2289ea895e0 100644 --- a/dll/win32/imm32/utils.c +++ b/dll/win32/imm32/utils.c @@ -162,7 +162,7 @@ DWORD APIENTRY Imm32AllocAndBuildHimcList(DWORD dwThreadId, HIMC **pphList) Status = NtUserBuildHimcList(dwThreadId, dwCount, phNewList, &dwCount); while (Status == STATUS_BUFFER_TOO_SMALL) { - HeapFree(g_hImm32Heap, 0, phNewList); + Imm32HeapFree(phNewList); if (cRetry++ >= MAX_RETRY) return 0; @@ -175,7 +175,7 @@ DWORD APIENTRY Imm32AllocAndBuildHimcList(DWORD dwThreadId, HIMC **pphList) if (NT_ERROR(Status) || !dwCount) { - HeapFree(g_hImm32Heap, 0, phNewList); + Imm32HeapFree(phNewList); return 0; }
3 years, 3 months
1
0
0
0
[reactos] 01/01: [IMM32] Rewrite ImmAssociateContextEx (#3961)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df6fff78bbe6563fedd0e…
commit df6fff78bbe6563fedd0e5c20ee2b51bf704c462 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Sep 16 19:29:49 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Sep 16 19:29:49 2021 +0900 [IMM32] Rewrite ImmAssociateContextEx (#3961) - Rewrite ImmAssociateContextEx function. - Modify NtUserAssociateInputContext prototype. CORE-11700 --- dll/win32/imm32/imm.c | 68 ++++++++++++++++++++++--------------------- sdk/include/psdk/imm.h | 1 + win32ss/include/ntuser.h | 5 +--- win32ss/user/ntuser/ntstubs.c | 5 +--- 4 files changed, 38 insertions(+), 41 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index 21832a5a3bc..6092b354d74 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -254,48 +254,50 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC) return old; } -/* - * Helper function for ImmAssociateContextEx - */ -static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam) -{ - HIMC hImc = (HIMC)lParam; - ImmAssociateContext(hwnd,hImc); - return TRUE; -} - /*********************************************************************** * ImmAssociateContextEx (IMM32.@) */ BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags) { - TRACE("(%p, %p, 0x%x):\n", hWnd, hIMC, dwFlags); + HWND hwndFocus; + PWND pFocusWnd; + HIMC hOldIMC = NULL; + DWORD dwValue; - if (!hWnd) + TRACE("(%p, %p, 0x%lX)\n", hWnd, hIMC, dwFlags); + + if (!g_psi || !(g_psi->dwSRVIFlags & SRVINFO_IMM32)) return FALSE; - switch (dwFlags) - { - case 0: - ImmAssociateContext(hWnd,hIMC); - return TRUE; - case IACE_DEFAULT: - { - HIMC defaultContext = get_default_context( hWnd ); - if (!defaultContext) return FALSE; - ImmAssociateContext(hWnd,defaultContext); - return TRUE; - } - case IACE_IGNORENOCONTEXT: - if (GetPropW(hWnd,szwWineIMCProperty)) - ImmAssociateContext(hWnd,hIMC); - return TRUE; - case IACE_CHILDREN: - EnumChildWindows(hWnd,_ImmAssociateContextExEnumProc,(LPARAM)hIMC); - return TRUE; - default: - FIXME("Unknown dwFlags 0x%x\n",dwFlags); + if (hIMC && !(dwFlags & IACE_DEFAULT) && Imm32IsCrossThreadAccess(hIMC)) return FALSE; + + hwndFocus = (HWND)NtUserQueryWindow(hWnd, QUERY_WINDOW_FOCUS); + pFocusWnd = ValidateHwndNoErr(hwndFocus); + if (pFocusWnd) + hOldIMC = pFocusWnd->hImc; + + dwValue = NtUserAssociateInputContext(hWnd, hIMC, dwFlags); + switch (dwValue) + { + case 0: + return TRUE; + + case 1: + pFocusWnd = ValidateHwndNoErr(hwndFocus); + if (pFocusWnd) + { + hIMC = pFocusWnd->hImc; + if (hIMC != hOldIMC) + { + ImmSetActiveContext(hwndFocus, hOldIMC, FALSE); + ImmSetActiveContext(hwndFocus, hIMC, TRUE); + } + } + return TRUE; + + default: + return FALSE; } } diff --git a/sdk/include/psdk/imm.h b/sdk/include/psdk/imm.h index f28b8e69f3c..6232ee115ff 100644 --- a/sdk/include/psdk/imm.h +++ b/sdk/include/psdk/imm.h @@ -627,6 +627,7 @@ BOOL WINAPI ImmConfigureIMEW(_In_ HKL, _In_ HWND, _In_ DWORD, _In_ LPVOID); #define ImmConfigureIME WINELIB_NAME_AW(ImmConfigureIME) HIMC WINAPI ImmCreateContext(void); +BOOL WINAPI ImmSetActiveContext(HWND hwnd, HIMC hIMC, BOOL fFlag); BOOL WINAPI ImmDestroyContext(_In_ HIMC hIMC); BOOL WINAPI ImmDisableIME(_In_ DWORD idThread); BOOL WINAPI ImmEnumInputContext(_In_ DWORD, _In_ IMCENUMPROC, _In_ LPARAM); diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 636392365fb..6d463ddb69a 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -1317,10 +1317,7 @@ C_ASSERT(sizeof(CLIENTIMC) == 0x34); DWORD NTAPI -NtUserAssociateInputContext( - DWORD dwUnknown1, - DWORD dwUnknown2, - DWORD dwUnknown3); +NtUserAssociateInputContext(HWND hWnd, HIMC hIMC, DWORD dwFlags); NTSTATUS NTAPI diff --git a/win32ss/user/ntuser/ntstubs.c b/win32ss/user/ntuser/ntstubs.c index 4de9ea36a58..6a1b3c4673e 100644 --- a/win32ss/user/ntuser/ntstubs.c +++ b/win32ss/user/ntuser/ntstubs.c @@ -11,10 +11,7 @@ DBG_DEFAULT_CHANNEL(UserMisc); DWORD APIENTRY -NtUserAssociateInputContext( - DWORD dwUnknown1, - DWORD dwUnknown2, - DWORD dwUnknown3) +NtUserAssociateInputContext(HWND hWnd, HIMC hIMC, DWORD dwFlags) { STUB return 0;
3 years, 3 months
1
0
0
0
[reactos] 01/01: [IMM32] Rewrite ImmEscapeA/W (#3959)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=afb6c8a12957f4b3f138a…
commit afb6c8a12957f4b3f138ae434a741dcb20bb0fcb Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Sep 16 19:27:43 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Sep 16 19:27:43 2021 +0900 [IMM32] Rewrite ImmEscapeA/W (#3959) - Rewrite ImmEscapeA and ImmEscapeW functions. - Delete useless legacy code. CORE-11700 --- dll/win32/imm32/ime.c | 178 ++++++++++++++++++++++++++++++++++++++++ dll/win32/imm32/imm.c | 199 --------------------------------------------- dll/win32/imm32/precomp.h | 1 + win32ss/include/imetable.h | 2 +- 4 files changed, 180 insertions(+), 200 deletions(-) diff --git a/dll/win32/imm32/ime.c b/dll/win32/imm32/ime.c index 3edb95b08ef..80a2c50f33c 100644 --- a/dll/win32/imm32/ime.c +++ b/dll/win32/imm32/ime.c @@ -276,6 +276,20 @@ PIMEDPI APIENTRY ImmLockOrLoadImeDpi(HKL hKL) return pImeDpi; } +static LRESULT APIENTRY +ImeDpi_Escape(PIMEDPI pImeDpi, HIMC hIMC, UINT uSubFunc, LPVOID lpData, HKL hKL) +{ + if (IS_IME_HKL(hKL)) + return pImeDpi->ImeEscape(hIMC, uSubFunc, lpData); + + if (g_psi && (g_psi->dwSRVIFlags & SRVINFO_CICERO_ENABLED)) + { + if (pImeDpi->CtfImeEscapeEx) + return pImeDpi->CtfImeEscapeEx(hIMC, uSubFunc, lpData, hKL); + } + return 0; +} + /*********************************************************************** * ImmIsIME (IMM32.@) */ @@ -650,6 +664,170 @@ DWORD WINAPI ImmGetProperty(HKL hKL, DWORD fdwIndex) return dwValue; } +/*********************************************************************** + * ImmEscapeA (IMM32.@) + */ +LRESULT WINAPI ImmEscapeA(HKL hKL, HIMC hIMC, UINT uSubFunc, LPVOID lpData) +{ + LRESULT ret; + PIMEDPI pImeDpi; + INT cch; + CHAR szA[MAX_IMM_FILENAME]; + WCHAR szW[MAX_IMM_FILENAME]; + + TRACE("(%p, %p, %u, %p)\n", hKL, hIMC, uSubFunc, lpData); + + pImeDpi = ImmLockOrLoadImeDpi(hKL); + if (!pImeDpi) + return 0; + + if (!(pImeDpi->ImeInfo.fdwProperty & IME_PROP_UNICODE) || !lpData) + { + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL); + ImmUnlockImeDpi(pImeDpi); + return ret; + } + + switch (uSubFunc) + { + case IME_ESC_SEQUENCE_TO_INTERNAL: + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL); + + cch = 0; + if (HIWORD(ret)) + szW[cch++] = HIWORD(ret); + if (LOWORD(ret)) + szW[cch++] = LOWORD(ret); + + cch = WideCharToMultiByte(pImeDpi->uCodePage, 0, szW, cch, szA, _countof(szA), + NULL, NULL); + switch (cch) + { + case 1: + ret = MAKEWORD(szA[0], 0); + break; + case 2: + ret = MAKEWORD(szA[1], szA[0]); + break; + case 3: + ret = MAKELONG(MAKEWORD(szA[2], szA[1]), MAKEWORD(szA[0], 0)); + break; + case 4: + ret = MAKELONG(MAKEWORD(szA[3], szA[2]), MAKEWORD(szA[1], szA[0])); + break; + default: + ret = 0; + break; + } + break; + + case IME_ESC_GET_EUDC_DICTIONARY: + case IME_ESC_IME_NAME: + case IME_ESC_GETHELPFILENAME: + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, szW, hKL); + if (ret) + { + szW[_countof(szW) - 1] = 0; + WideCharToMultiByte(pImeDpi->uCodePage, 0, szW, -1, + lpData, MAX_IMM_FILENAME, NULL, NULL); + ((LPSTR)lpData)[MAX_IMM_FILENAME - 1] = 0; + } + break; + + case IME_ESC_SET_EUDC_DICTIONARY: + case IME_ESC_HANJA_MODE: + MultiByteToWideChar(pImeDpi->uCodePage, MB_PRECOMPOSED, + lpData, -1, szW, _countof(szW)); + szW[_countof(szW) - 1] = 0; + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, szW, hKL); + break; + + default: + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL); + break; + } + + ImmUnlockImeDpi(pImeDpi); + return ret; +} + +/*********************************************************************** + * ImmEscapeW (IMM32.@) + */ +LRESULT WINAPI ImmEscapeW(HKL hKL, HIMC hIMC, UINT uSubFunc, LPVOID lpData) +{ + LRESULT ret; + PIMEDPI pImeDpi; + INT cch; + CHAR szA[MAX_IMM_FILENAME]; + WCHAR szW[MAX_IMM_FILENAME]; + WORD word; + + TRACE("(%p, %p, %u, %p)\n", hKL, hIMC, uSubFunc, lpData); + + pImeDpi = ImmLockOrLoadImeDpi(hKL); + if (!pImeDpi) + return 0; + + if ((pImeDpi->ImeInfo.fdwProperty & IME_PROP_UNICODE) || !lpData) + { + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL); + ImmUnlockImeDpi(pImeDpi); + return ret; + } + + switch (uSubFunc) + { + case IME_ESC_SEQUENCE_TO_INTERNAL: + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL); + + word = LOWORD(ret); + cch = 0; + if (HIBYTE(word)) + szA[cch++] = HIBYTE(word); + if (LOBYTE(word)) + szA[cch++] = LOBYTE(word); + + cch = MultiByteToWideChar(pImeDpi->uCodePage, MB_PRECOMPOSED, + szA, cch, szW, _countof(szW)); + switch (cch) + { + case 1: ret = szW[0]; break; + case 2: ret = MAKELONG(szW[1], szW[0]); break; + default: ret = 0; break; + } + break; + + case IME_ESC_GET_EUDC_DICTIONARY: + case IME_ESC_IME_NAME: + case IME_ESC_GETHELPFILENAME: + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, szA, hKL); + if (ret) + { + szA[_countof(szA) - 1] = 0; + MultiByteToWideChar(pImeDpi->uCodePage, MB_PRECOMPOSED, + szA, -1, lpData, MAX_IMM_FILENAME); + ((LPWSTR)lpData)[MAX_IMM_FILENAME - 1] = 0; + } + break; + + case IME_ESC_SET_EUDC_DICTIONARY: + case IME_ESC_HANJA_MODE: + WideCharToMultiByte(pImeDpi->uCodePage, 0, + lpData, -1, szA, _countof(szA), NULL, NULL); + szA[_countof(szA) - 1] = 0; + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, szA, hKL); + break; + + default: + ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL); + break; + } + + ImmUnlockImeDpi(pImeDpi); + return ret; +} + /*********************************************************************** * ImmGetOpenStatus (IMM32.@) */ diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index a07a6c6965a..21832a5a3bc 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -146,21 +146,7 @@ typedef struct tagInputContextData #define WINE_IMC_VALID_MAGIC 0x56434D49 -typedef struct _tagIMMThreadData -{ - struct list entry; - DWORD threadID; - HIMC defaultContext; - HWND hwndDefault; - BOOL disableIME; - DWORD windowRefs; -} IMMThreadData; - -static struct list ImmHklList = LIST_INIT(ImmHklList); -static struct list ImmThreadDataList = LIST_INIT(ImmThreadDataList); - static const WCHAR szwWineIMCProperty[] = {'W','i','n','e','I','m','m','H','I','M','C','P','r','o','p','e','r','t','y',0}; - static const WCHAR szImeFileW[] = {'I','m','e',' ','F','i','l','e',0}; static const WCHAR szLayoutTextW[] = {'L','a','y','o','u','t',' ','T','e','x','t',0}; static const WCHAR szImeRegFmt[] = {'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','K','e','y','b','o','a','r','d',' ','L','a','y','o','u','t','s','\\','%','0','8','l','x',0}; @@ -170,115 +156,6 @@ static inline BOOL is_himc_ime_unicode(const InputContextData *data) return !!(data->immKbd->imeInfo.fdwProperty & IME_PROP_UNICODE); } -static inline BOOL is_kbd_ime_unicode(const ImmHkl *hkl) -{ - return !!(hkl->imeInfo.fdwProperty & IME_PROP_UNICODE); -} - -static InputContextData* get_imc_data(HIMC hIMC); - -static HMODULE load_graphics_driver(void) -{ - static const WCHAR display_device_guid_propW[] = { - '_','_','w','i','n','e','_','d','i','s','p','l','a','y','_', - 'd','e','v','i','c','e','_','g','u','i','d',0 }; - static const WCHAR key_pathW[] = { - 'S','y','s','t','e','m','\\', - 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', - 'C','o','n','t','r','o','l','\\', - 'V','i','d','e','o','\\','{',0}; - static const WCHAR displayW[] = {'}','\\','0','0','0','0',0}; - static const WCHAR driverW[] = {'G','r','a','p','h','i','c','s','D','r','i','v','e','r',0}; - - HMODULE ret = 0; - HKEY hkey; - DWORD size; - WCHAR path[MAX_PATH]; - WCHAR key[ARRAY_SIZE( key_pathW ) + ARRAY_SIZE( displayW ) + 40]; - UINT guid_atom = HandleToULong( GetPropW( GetDesktopWindow(), display_device_guid_propW )); - - if (!guid_atom) return 0; - memcpy( key, key_pathW, sizeof(key_pathW) ); - if (!GlobalGetAtomNameW( guid_atom, key + lstrlenW(key), 40 )) return 0; - lstrcatW( key, displayW ); - if (RegOpenKeyW( HKEY_LOCAL_MACHINE, key, &hkey )) return 0; - size = sizeof(path); - if (!RegQueryValueExW( hkey, driverW, NULL, NULL, (BYTE *)path, &size )) ret = LoadLibraryW( path ); - RegCloseKey( hkey ); - TRACE( "%s %p\n", debugstr_w(path), ret ); - return ret; -} - -/* ImmHkl loading and freeing */ -#define LOAD_FUNCPTR(f) if((ptr->p##f = (LPVOID)GetProcAddress(ptr->hIME, #f)) == NULL){WARN("Can't find function %s in ime\n", #f);} -static ImmHkl *IMM_GetImmHkl(HKL hkl) -{ - ImmHkl *ptr; - WCHAR filename[MAX_PATH]; - - TRACE("Seeking ime for keyboard %p\n",hkl); - - LIST_FOR_EACH_ENTRY(ptr, &ImmHklList, ImmHkl, entry) - { - if (ptr->hkl == hkl) - return ptr; - } - /* not found... create it */ - - ptr = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ImmHkl)); - - ptr->hkl = hkl; - if (ImmGetIMEFileNameW(hkl, filename, MAX_PATH)) ptr->hIME = LoadLibraryW(filename); - if (!ptr->hIME) ptr->hIME = load_graphics_driver(); - if (ptr->hIME) - { - LOAD_FUNCPTR(ImeInquire); - if (!ptr->pImeInquire || !ptr->pImeInquire(&ptr->imeInfo, ptr->imeClassName, NULL)) - { - FreeLibrary(ptr->hIME); - ptr->hIME = NULL; - } - else - { - LOAD_FUNCPTR(ImeDestroy); - LOAD_FUNCPTR(ImeSelect); - if (!ptr->pImeSelect || !ptr->pImeDestroy) - { - FreeLibrary(ptr->hIME); - ptr->hIME = NULL; - } - else - { - LOAD_FUNCPTR(ImeConfigure); - LOAD_FUNCPTR(ImeEscape); - LOAD_FUNCPTR(ImeSetActiveContext); - LOAD_FUNCPTR(ImeToAsciiEx); - LOAD_FUNCPTR(NotifyIME); - LOAD_FUNCPTR(ImeRegisterWord); - LOAD_FUNCPTR(ImeUnregisterWord); - LOAD_FUNCPTR(ImeEnumRegisterWord); - LOAD_FUNCPTR(ImeSetCompositionString); - LOAD_FUNCPTR(ImeConversionList); - LOAD_FUNCPTR(ImeProcessKey); - LOAD_FUNCPTR(ImeGetRegisterWordStyle); - LOAD_FUNCPTR(ImeGetImeMenuItems); - /* make sure our classname is WCHAR */ - if (!is_kbd_ime_unicode(ptr)) - { - WCHAR bufW[17]; - MultiByteToWideChar(CP_ACP, 0, (LPSTR)ptr->imeClassName, - -1, bufW, 17); - lstrcpyW(ptr->imeClassName, bufW); - } - } - } - } - list_add_head(&ImmHklList,&ptr->entry); - - return ptr; -} -#undef LOAD_FUNCPTR - static InputContextData* get_imc_data(HIMC hIMC) { InputContextData *data = (InputContextData *)hIMC; @@ -553,82 +430,6 @@ BOOL WINAPI ImmDestroyContext(HIMC hIMC) return Imm32CleanupContext(hIMC, hKL, FALSE); } -static inline BOOL EscapeRequiresWA(UINT uEscape) -{ - if (uEscape == IME_ESC_GET_EUDC_DICTIONARY || - uEscape == IME_ESC_SET_EUDC_DICTIONARY || - uEscape == IME_ESC_IME_NAME || - uEscape == IME_ESC_GETHELPFILENAME) - return TRUE; - return FALSE; -} - -/*********************************************************************** - * ImmEscapeA (IMM32.@) - */ -LRESULT WINAPI ImmEscapeA(HKL hKL, HIMC hIMC, UINT uEscape, LPVOID lpData) -{ - ImmHkl *immHkl = IMM_GetImmHkl(hKL); - TRACE("(%p, %p, %d, %p):\n", hKL, hIMC, uEscape, lpData); - - if (immHkl->hIME && immHkl->pImeEscape) - { - if (!EscapeRequiresWA(uEscape) || !is_kbd_ime_unicode(immHkl)) - return immHkl->pImeEscape(hIMC,uEscape,lpData); - else - { - WCHAR buffer[81]; /* largest required buffer should be 80 */ - LRESULT rc; - if (uEscape == IME_ESC_SET_EUDC_DICTIONARY) - { - MultiByteToWideChar(CP_ACP,0,lpData,-1,buffer,81); - rc = immHkl->pImeEscape(hIMC,uEscape,buffer); - } - else - { - rc = immHkl->pImeEscape(hIMC,uEscape,buffer); - WideCharToMultiByte(CP_ACP,0,buffer,-1,lpData,80, NULL, NULL); - } - return rc; - } - } - else - return 0; -} - -/*********************************************************************** - * ImmEscapeW (IMM32.@) - */ -LRESULT WINAPI ImmEscapeW(HKL hKL, HIMC hIMC, UINT uEscape, LPVOID lpData) -{ - ImmHkl *immHkl = IMM_GetImmHkl(hKL); - TRACE("(%p, %p, %d, %p):\n", hKL, hIMC, uEscape, lpData); - - if (immHkl->hIME && immHkl->pImeEscape) - { - if (!EscapeRequiresWA(uEscape) || is_kbd_ime_unicode(immHkl)) - return immHkl->pImeEscape(hIMC,uEscape,lpData); - else - { - CHAR buffer[81]; /* largest required buffer should be 80 */ - LRESULT rc; - if (uEscape == IME_ESC_SET_EUDC_DICTIONARY) - { - WideCharToMultiByte(CP_ACP,0,lpData,-1,buffer,81, NULL, NULL); - rc = immHkl->pImeEscape(hIMC,uEscape,buffer); - } - else - { - rc = immHkl->pImeEscape(hIMC,uEscape,buffer); - MultiByteToWideChar(CP_ACP,0,buffer,-1,lpData,80); - } - return rc; - } - } - else - return 0; -} - static PCLIENTIMC APIENTRY Imm32GetClientImcCache(void) { // FIXME: Do something properly here diff --git a/dll/win32/imm32/precomp.h b/dll/win32/imm32/precomp.h index 6efcbf70fe1..b96a9afa695 100644 --- a/dll/win32/imm32/precomp.h +++ b/dll/win32/imm32/precomp.h @@ -49,6 +49,7 @@ #define IMM_INVALID_CANDFORM ULONG_MAX #define INVALID_HOTKEY_ID 0xFFFFFFFF #define MAX_CANDIDATEFORM 4 +#define MAX_IMM_FILENAME 80 #define LANGID_CHINESE_SIMPLIFIED MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED) #define LANGID_CHINESE_TRADITIONAL MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL) diff --git a/win32ss/include/imetable.h b/win32ss/include/imetable.h index 96d18de18b4..d9d0929757d 100644 --- a/win32ss/include/imetable.h +++ b/win32ss/include/imetable.h @@ -17,6 +17,6 @@ DEFINE_IME_ENTRY(BOOL, ImeSetCompositionString, (HIMC hIMC, DWORD dwIndex, LPCVO DEFINE_IME_ENTRY(DWORD, ImeGetImeMenuItems, (HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOW lpImeParentMenu, LPIMEMENUITEMINFOW lpImeMenu, DWORD dwSize), FALSE) DEFINE_IME_ENTRY(DWORD, CtfImeInquireExW, (VOID /* FIXME: unknown */), TRUE) DEFINE_IME_ENTRY(DWORD, CtfImeSelectEx, (VOID /* FIXME: unknown */), TRUE) -DEFINE_IME_ENTRY(DWORD, CtfImeEscapeEx, (VOID /* FIXME: unknown */), TRUE) +DEFINE_IME_ENTRY(LRESULT, CtfImeEscapeEx, (HIMC hIMC, UINT uSubFunc, LPVOID lpData, HKL hKL), TRUE) DEFINE_IME_ENTRY(DWORD, CtfImeGetGuidAtom, (VOID /* FIXME: unknown */), TRUE) DEFINE_IME_ENTRY(DWORD, CtfImeIsGuidMapEnable, (VOID /* FIXME: unknown */), TRUE)
3 years, 3 months
1
0
0
0
[reactos] 06/06: [GITHUB] Use 64bit LLVM for both 32bit and 64bit clang-cl builds
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f17c2c0db9cf20762d07f…
commit f17c2c0db9cf20762d07f559413b90fdda6b435e Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Mon Sep 13 23:42:19 2021 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Sep 14 17:58:23 2021 +0300 [GITHUB] Use 64bit LLVM for both 32bit and 64bit clang-cl builds --- .github/workflows/build.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d96b52c09c..2ccb6da912a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -173,13 +173,7 @@ jobs: steps: - name: Install ninja run: choco install -y ninja - - name: Install LLVM (x86) - if: ${{ matrix.arch == 'i386' }} - run: | - choco install --x86 -y llvm - echo "LLVM_PATH=${env:PROGRAMFILES(X86)}\llvm\bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: Install LLVM (amd64) - if: ${{ matrix.arch == 'amd64' }} + - name: Install LLVM run: | choco install -y llvm echo "LLVM_PATH=${env:PROGRAMFILES}\llvm\bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
3 years, 3 months
1
0
0
0
[reactos] 05/06: [CMAKE] Fixes for clang-cl build
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=62d1a2c884da401adb381…
commit 62d1a2c884da401adb381798d712490930aeff83 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Mon Sep 13 23:39:03 2021 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Sep 14 17:58:23 2021 +0300 [CMAKE] Fixes for clang-cl build - User lib.exe instead of llvm-lib due to incompatibility - Avoid wrapping resource compiler with cmcldeps - Fix several conditional flags --- ntoskrnl/CMakeLists.txt | 2 +- sdk/cmake/config.cmake | 2 +- toolchain-msvc.cmake | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt index b0cf73eec86..9109a7bc3c7 100644 --- a/ntoskrnl/CMakeLists.txt +++ b/ntoskrnl/CMakeLists.txt @@ -8,7 +8,7 @@ endif() include(ntos.cmake) -if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") +if(NOT MSVC) # Make sure we don't duplicate some symbols add_compile_options(-fno-common) endif() diff --git a/sdk/cmake/config.cmake b/sdk/cmake/config.cmake index 63e5d71f0dd..75a63261eb6 100644 --- a/sdk/cmake/config.cmake +++ b/sdk/cmake/config.cmake @@ -79,7 +79,7 @@ else() message("WARNING: the compiler has not been recognized") endif() -if(MSVC AND (NOT USE_CLANG_CL)) +if(MSVC) set(KDBG FALSE CACHE BOOL "Whether to compile in the integrated kernel debugger.") if(CMAKE_BUILD_TYPE STREQUAL "Release") diff --git a/toolchain-msvc.cmake b/toolchain-msvc.cmake index 97921b216f7..12e499fd3ad 100644 --- a/toolchain-msvc.cmake +++ b/toolchain-msvc.cmake @@ -24,6 +24,10 @@ if(USE_CLANG_CL) set(CMAKE_CXX_COMPILER clang-cl) # Clang now defaults to lld-link which we're not compatible with yet set(CMAKE_LINKER link) + # llvm-lib with link.exe can't generate proper delayed imports + set(CMAKE_AR lib) + set(CMAKE_C_COMPILER_AR lib) + set(CMAKE_CXX_COMPILER_AR lib) # Explicitly set target so CMake doesn't get confused if (ARCH STREQUAL "amd64") set(CMAKE_C_COMPILER_TARGET "x86_64-pc-windows-msvc") @@ -38,6 +42,11 @@ if(USE_CLANG_CL) set(CMAKE_C_COMPILER_TARGET "i686-pc-windows-msvc") set(CMAKE_CXX_COMPILER_TARGET "i686-pc-windows-msvc") endif() + + # Avoid wrapping RC compiler with cmcldeps utility for clang-cl. + # Otherwise it breaks cross-compilation (32bit ReactOS cannot be compiled by 64bit LLVM), + # target architecture is not passed properly + set(CMAKE_NINJA_CMCLDEPS_RC OFF) else() set(CMAKE_C_COMPILER cl) set(CMAKE_CXX_COMPILER cl)
3 years, 3 months
1
0
0
0
[reactos] 04/06: [WIN32SS:GDI] Add a sanity assert
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d74eb54b06ccc905dbd45…
commit d74eb54b06ccc905dbd45256a0b3b1e9deeadb7c Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Mon Sep 13 23:37:34 2021 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Sep 14 17:58:23 2021 +0300 [WIN32SS:GDI] Add a sanity assert --- win32ss/gdi/eng/pdevobj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/win32ss/gdi/eng/pdevobj.c b/win32ss/gdi/eng/pdevobj.c index eb05e237039..a9f959b4b23 100644 --- a/win32ss/gdi/eng/pdevobj.c +++ b/win32ss/gdi/eng/pdevobj.c @@ -365,6 +365,7 @@ EngpCreatePDEV( } else { + ASSERT(gpPrimaryGraphicsDevice); pGraphicsDevice = gpPrimaryGraphicsDevice; }
3 years, 3 months
1
0
0
0
[reactos] 03/06: [KERNEL32] FindFirstFileExW: fix syscall buffer alignment
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=655ddfa8e2ffb3de5c2a8…
commit 655ddfa8e2ffb3de5c2a8e2ad09606209c2e7a66 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Mon Sep 13 21:13:14 2021 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Sep 14 17:58:22 2021 +0300 [KERNEL32] FindFirstFileExW: fix syscall buffer alignment NtQueryDirectoryFile required the FileInformation buffer to be ULONG-aligned. Declare the aligned buffer explicitly. --- dll/win32/kernel32/client/file/find.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dll/win32/kernel32/client/file/find.c b/dll/win32/kernel32/client/file/find.c index b5fe7713e53..0fa21ae34be 100644 --- a/dll/win32/kernel32/client/file/find.c +++ b/dll/win32/kernel32/client/file/find.c @@ -687,9 +687,10 @@ FindFirstFileExW(IN LPCWSTR lpFileName, /* * May represent many FILE_BOTH_DIR_INFORMATION * or many FILE_FULL_DIR_INFORMATION structures. + * NOTE: NtQueryDirectoryFile requires the buffer to be ULONG-aligned */ - BYTE DirectoryInfo[FIND_DATA_SIZE]; - DIR_INFORMATION DirInfo = {&DirectoryInfo}; + DECLSPEC_ALIGN(4) BYTE DirectoryInfo[FIND_DATA_SIZE]; + DIR_INFORMATION DirInfo = { .DirInfo = &DirectoryInfo }; /* The search filter is always unused */ if (lpSearchFilter)
3 years, 3 months
1
0
0
0
[reactos] 02/06: [CMAKE] Fix invalid usage of list()
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4e389a992dc4f517f2a96…
commit 4e389a992dc4f517f2a96ef92675aeef8ffd73bd Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Mon Sep 13 20:13:40 2021 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Sep 14 17:58:22 2021 +0300 [CMAKE] Fix invalid usage of list() list() functions expects numerical indices for modification operations and silently converts everything else to a number (old behaviour). CMake 3.21 now checks this and throws a warning --- sdk/cmake/CMakeMacros.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index f254ce3f054..7e4cb21cbe0 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -287,10 +287,10 @@ function(add_cd_file) endif() # do we add it to all CDs? - list(FIND _CD_FOR all __cd) + list(FIND _CD_FOR "all" __cd) if(NOT __cd EQUAL -1) - list(REMOVE_AT _CD_FOR __cd) - list(INSERT _CD_FOR __cd "bootcd;livecd;regtest") + list(REMOVE_ITEM _CD_FOR "all") + list(APPEND _CD_FOR "bootcd;livecd;regtest") endif() # do we add it to bootcd?
3 years, 3 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
15
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Results per page:
10
25
50
100
200