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
October 2022
----- 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
23 participants
162 discussions
Start a n
N
ew thread
[reactos] 01/01: [IMM32] Add reasoning for tracing (#4807)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e1df4f2d8f6206382b990…
commit e1df4f2d8f6206382b9902727d52b2681c672679 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Oct 26 12:01:33 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Oct 26 12:01:33 2022 +0900 [IMM32] Add reasoning for tracing (#4807) Follow-up of c2a9436 (#4798). Improve trace messages. CORE-11700 --- dll/win32/imm32/candidate.c | 18 ++++++++++++------ dll/win32/imm32/compstr.c | 13 ++++++------- dll/win32/imm32/ime.c | 43 +++++++++++++++++++++++++++++++------------ dll/win32/imm32/imm.c | 26 ++++++++++++++------------ dll/win32/imm32/keymsg.c | 17 +++++++---------- dll/win32/imm32/utils.c | 40 ++++++++++++++++++++-------------------- 6 files changed, 90 insertions(+), 67 deletions(-) diff --git a/dll/win32/imm32/candidate.c b/dll/win32/imm32/candidate.c index a1df77e7b33..df976e407c8 100644 --- a/dll/win32/imm32/candidate.c +++ b/dll/win32/imm32/candidate.c @@ -180,9 +180,15 @@ ImmGetCandidateListAW(HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWOR return 0; } - if (pCI->dwSize < sizeof(CANDIDATEINFO) || pCI->dwCount <= dwIndex) + if (pCI->dwSize < sizeof(CANDIDATEINFO)) + { + ERR("Too small\n"); + goto Quit; + } + + if (pCI->dwCount <= dwIndex) { - ERR("\n"); + ERR("Out of boundary\n"); goto Quit; } @@ -276,7 +282,7 @@ ImmGetCandidateListCountAW(HIMC hIMC, LPDWORD lpdwListCount, BOOL bAnsi) if (pCI->dwSize < sizeof(CANDIDATEINFO)) { - ERR("\n"); + ERR("Too small\n"); goto Quit; } @@ -378,7 +384,7 @@ ImmGetCandidateWindow(HIMC hIMC, DWORD dwIndex, LPCANDIDATEFORM lpCandidate) if (dwIndex >= MAX_CANDIDATEFORM) /* Windows didn't check but we do for security reason */ { - ERR("\n"); + ERR("Out of boundary\n"); return FALSE; } @@ -394,7 +400,7 @@ ImmGetCandidateWindow(HIMC hIMC, DWORD dwIndex, LPCANDIDATEFORM lpCandidate) } else { - ERR("\n"); + ERR("Out of boundary\n"); } ImmUnlockIMC(hIMC); @@ -414,7 +420,7 @@ BOOL WINAPI ImmSetCandidateWindow(HIMC hIMC, LPCANDIDATEFORM lpCandidate) if (lpCandidate->dwIndex >= MAX_CANDIDATEFORM) { - ERR("\n"); + ERR("Out of boundary\n"); return FALSE; } diff --git a/dll/win32/imm32/compstr.c b/dll/win32/imm32/compstr.c index 980e904e1c6..5486397f3f4 100644 --- a/dll/win32/imm32/compstr.c +++ b/dll/win32/imm32/compstr.c @@ -272,7 +272,7 @@ Imm32GetCompStrA(HIMC hIMC, const COMPOSITIONSTRING *pCS, DWORD dwIndex, break; default: - FIXME("\n"); + FIXME("0x%X\n", dwIndex); return IMM_ERROR_GENERAL; } } @@ -357,7 +357,7 @@ Imm32GetCompStrA(HIMC hIMC, const COMPOSITIONSTRING *pCS, DWORD dwIndex, break; default: - FIXME("\n"); + FIXME("0x%X\n", dwIndex); return IMM_ERROR_GENERAL; } } @@ -449,7 +449,7 @@ Imm32GetCompStrW(HIMC hIMC, const COMPOSITIONSTRING *pCS, DWORD dwIndex, break; default: - FIXME("\n"); + FIXME("0x%X\n", dwIndex); return IMM_ERROR_GENERAL; } } @@ -506,7 +506,7 @@ Imm32GetCompStrW(HIMC hIMC, const COMPOSITIONSTRING *pCS, DWORD dwIndex, break; default: - FIXME("\n"); + FIXME("0x%X\n", dwIndex); return IMM_ERROR_GENERAL; } } @@ -532,7 +532,7 @@ ImmSetCompositionStringAW(HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLe dwThreadId = (DWORD)NtUserQueryInputContext(hIMC, QIC_INPUTTHREADID); if (dwThreadId != GetCurrentThreadId()) { - ERR("\n"); + ERR("Thread mismatch\n"); return FALSE; } @@ -554,7 +554,7 @@ ImmSetCompositionStringAW(HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLe break; /* FALL THROUGH */ default: - ERR("\n"); + ERR("0x%X\n", dwIndex); ImmUnlockImeDpi(pImeDpi); return FALSE; } @@ -569,7 +569,6 @@ ImmSetCompositionStringAW(HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLe if (!Imm32OpenICAndCS(hIMC, &pIC, &pCS)) { - ERR("\n"); ImmUnlockImeDpi(pImeDpi); return FALSE; } diff --git a/dll/win32/imm32/ime.c b/dll/win32/imm32/ime.c index 9bc3cd6830a..d898c924570 100644 --- a/dll/win32/imm32/ime.c +++ b/dll/win32/imm32/ime.c @@ -125,32 +125,32 @@ BOOL APIENTRY Imm32InquireIme(PIMEDPI pImeDpi) if (pImeInfo->fdwProperty & ~VALID_IME_PROP) { - ERR("\n"); + ERR("Bad flags\n"); return FALSE; } if (pImeInfo->fdwConversionCaps & ~VALID_CMODE_CAPS) { - ERR("\n"); + ERR("Bad flags\n"); return FALSE; } if (pImeInfo->fdwSentenceCaps & ~VALID_SMODE_CAPS) { - ERR("\n"); + ERR("Bad flags\n"); return FALSE; } if (pImeInfo->fdwUICaps & ~VALID_UI_CAPS) { - ERR("\n"); + ERR("Bad flags\n"); return FALSE; } if (pImeInfo->fdwSCSCaps & ~VALID_SCS_CAPS) { - ERR("\n"); + ERR("Bad flags\n"); return FALSE; } if (pImeInfo->fdwSelectCaps & ~VALID_SELECT_CAPS) { - ERR("\n"); + ERR("Bad flags\n"); return FALSE; } @@ -223,7 +223,7 @@ BOOL APIENTRY Imm32LoadIME(PIMEINFOEX pImeInfoEx, PIMEDPI pImeDpi) fn = GetProcAddress(hIME, #name); \ if (fn) pImeDpi->name = (FN_##name)fn; \ else if (!(optional)) { \ - ERR("'%s' not found in the IME module '%s'.\n", #name, debugstr_w(szPath)); \ + ERR("'%s' not found in IME module '%s'.\n", #name, debugstr_w(szPath)); \ goto Failed; \ } \ } while (0); @@ -236,7 +236,6 @@ BOOL APIENTRY Imm32LoadIME(PIMEINFOEX pImeInfoEx, PIMEDPI pImeDpi) } else { - ERR("Imm32InquireIme failed\n"); Failed: ret = FALSE; FreeLibrary(pImeDpi->hInst); @@ -274,7 +273,10 @@ PIMEDPI APIENTRY Imm32LoadImeDpi(HKL hKL, BOOL bLock) LCID lcid; if (!IS_IME_HKL(hKL)) + { + TRACE("\n"); return NULL; + } if (!ImmGetImeInfoEx(&ImeInfoEx, ImeInfoExKeyboardLayout, &hKL)) { @@ -344,7 +346,7 @@ PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL) if (!IS_IME_HKL(hKL) && (!IS_CICERO_MODE() || IS_16BIT_MODE())) { - ERR("\n"); + TRACE("\n"); return NULL; } @@ -453,7 +455,10 @@ LRESULT WINAPI ImmPutImeMenuItemsIntoMappedFile(HIMC hIMC) hMapping = OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, L"ImmMenuInfo"); pView = MapViewOfFile(hMapping, FILE_MAP_ALL_ACCESS, 0, 0, 0); - if (!pView || pView->dwVersion != 1) + if (IS_NULL_UNEXPECTEDLY(pView)) + goto Quit; + + if (pView->dwVersion != 1) { ERR("\n"); goto Quit; @@ -798,7 +803,10 @@ HKL WINAPI ImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText) if (cLayouts) { pLayouts = ImmLocalAlloc(0, cLayouts * sizeof(REG_IME)); - if (!pLayouts || !Imm32GetImeLayout(pLayouts, cLayouts)) + if (IS_NULL_UNEXPECTEDLY(pLayouts)) + return NULL; + + if (!Imm32GetImeLayout(pLayouts, cLayouts)) { ERR("\n"); ImmLocalFree(pLayouts); @@ -883,7 +891,7 @@ HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd) { if (!IS_IMM_MODE()) { - WARN("\n"); + TRACE("\n"); return NULL; } @@ -1088,7 +1096,10 @@ UINT WINAPI ImmGetDescriptionA(HKL hKL, LPSTR lpszDescription, UINT uBufLen) TRACE("(%p,%p,%d)\n", hKL, lpszDescription, uBufLen); if (!IS_IME_HKL(hKL)) + { + TRACE("\n"); return 0; + } if (!ImmGetImeInfoEx(&info, ImeInfoExKeyboardLayout, &hKL)) { @@ -1115,7 +1126,10 @@ UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen) TRACE("(%p, %p, %d)\n", hKL, lpszDescription, uBufLen); if (!IS_IME_HKL(hKL)) + { + TRACE("\n"); return 0; + } if (!ImmGetImeInfoEx(&info, ImeInfoExKeyboardLayout, &hKL)) { @@ -1143,6 +1157,7 @@ UINT WINAPI ImmGetIMEFileNameA( HKL hKL, LPSTR lpszFileName, UINT uBufLen) if (!IS_IME_HKL(hKL)) { + TRACE("\n"); if (uBufLen > 0) lpszFileName[0] = 0; return 0; @@ -1182,6 +1197,7 @@ UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen) if (!IS_IME_HKL(hKL)) { + TRACE("\n"); if (uBufLen > 0) lpszFileName[0] = 0; return 0; @@ -1221,7 +1237,10 @@ DWORD WINAPI ImmGetProperty(HKL hKL, DWORD fdwIndex) TRACE("(%p, %lu)\n", hKL, fdwIndex); if (!IS_IME_HKL(hKL)) + { + TRACE("\n"); return FALSE; + } if (!ImmGetImeInfoEx(&ImeInfoEx, ImeInfoExKeyboardLayout, &hKL)) { diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index 117384111be..27d80d3a82d 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -90,7 +90,10 @@ BOOL WINAPI ImmLoadLayout(HKL hKL, PIMEINFOEX pImeInfoEx) pImeInfoEx->fLoadFlag = 0; - if (IS_ERROR_UNEXPECTEDLY(error) || dwType != REG_SZ) + if (IS_ERROR_UNEXPECTEDLY(error)) + return FALSE; + + if (dwType != REG_SZ) { ERR("\n"); return FALSE; @@ -145,7 +148,7 @@ BOOL WINAPI ImmFreeLayout(DWORD dwUnknown) StringCchPrintfW(szKBD, _countof(szKBD), L"%08X", LangID); if (!LoadKeyboardLayoutW(szKBD, KLF_ACTIVATE)) { - WARN("\n"); + WARN("Default to English US\n"); LoadKeyboardLayoutW(L"00000409", KLF_ACTIVATE | 0x200); } } @@ -497,7 +500,7 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC) if (!IS_IMM_MODE()) { - WARN("\n"); + TRACE("\n"); return NULL; } @@ -546,7 +549,7 @@ BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags) if (!IS_IMM_MODE()) { - WARN("\n"); + TRACE("\n"); return FALSE; } @@ -594,7 +597,7 @@ HIMC WINAPI ImmCreateContext(void) if (!IS_IMM_MODE()) { - WARN("\n"); + TRACE("\n"); return NULL; } @@ -651,7 +654,7 @@ BOOL APIENTRY Imm32DestroyInputContext(HIMC hIMC, HKL hKL, BOOL bKeep) if (!IS_IMM_MODE()) { - WARN("\n"); + TRACE("\n"); return FALSE; } @@ -661,7 +664,7 @@ BOOL APIENTRY Imm32DestroyInputContext(HIMC hIMC, HKL hKL, BOOL bKeep) if (pIMC->head.pti != Imm32CurrentPti()) { - ERR("\n"); + ERR("Thread mismatch\n"); return FALSE; } @@ -674,7 +677,7 @@ BOOL APIENTRY Imm32DestroyInputContext(HIMC hIMC, HKL hKL, BOOL bKeep) if ((pClientImc->dwFlags & CLIENTIMC_UNKNOWN2) && !bKeep) { - ERR("\n"); + ERR("Can't destroy for CLIENTIMC_UNKNOWN2\n"); return FALSE; } @@ -875,7 +878,7 @@ LPINPUTCONTEXT APIENTRY Imm32InternalLockIMC(HIMC hIMC, BOOL fSelect) if (!NtUserQueryInputContext(hIMC, QIC_DEFAULTWINDOWIME)) { - ERR("\n"); + ERR("No default IME window\n"); goto Failure; } @@ -891,7 +894,6 @@ LPINPUTCONTEXT APIENTRY Imm32InternalLockIMC(HIMC hIMC, BOOL fSelect) hNewKL = GetKeyboardLayout(dwThreadId); if (!Imm32CreateInputContext(hIMC, pIC, pClientImc, hNewKL, fSelect)) { - ERR("\n"); LocalUnlock(hIC); pClientImc->hInputContext = LocalFree(hIC); goto Failure; @@ -920,7 +922,7 @@ BOOL WINAPI ImmDestroyContext(HIMC hIMC) if (!IS_IMM_MODE()) { - WARN("\n"); + TRACE("\n"); return FALSE; } @@ -1175,7 +1177,7 @@ BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive) if (!IS_IMM_MODE()) { - WARN("\n"); + TRACE("\n"); return FALSE; } diff --git a/dll/win32/imm32/keymsg.c b/dll/win32/imm32/keymsg.c index 8e1cac90154..c759176e7d6 100644 --- a/dll/win32/imm32/keymsg.c +++ b/dll/win32/imm32/keymsg.c @@ -457,7 +457,7 @@ Imm32ProcessRequest(HIMC hIMC, PWND pWnd, DWORD dwCommand, LPVOID pData, BOOL bA if (dwCommand == 0 || dwCommand > IMR_DOCUMENTFEED) { - ERR("\n"); + ERR("Out of boundary\n"); return 0; /* Out of range */ } @@ -475,7 +475,7 @@ Imm32ProcessRequest(HIMC hIMC, PWND pWnd, DWORD dwCommand, LPVOID pData, BOOL bA pRS = pData; if (pRS && (pRS->dwVersion != 0 || pRS->dwSize < sizeof(RECONVERTSTRING))) { - ERR("\n"); + ERR("Invalid pRS\n"); return 0; } break; @@ -484,17 +484,14 @@ Imm32ProcessRequest(HIMC hIMC, PWND pWnd, DWORD dwCommand, LPVOID pData, BOOL bA pRS = pData; if (!pRS || pRS->dwVersion != 0) { - ERR("\n"); + ERR("Invalid pRS\n"); return 0; } break; default: - if (!pData) - { - ERR("\n"); + if (IS_NULL_UNEXPECTEDLY(pData)) return 0; - } break; } @@ -585,7 +582,7 @@ Imm32ProcessRequest(HIMC hIMC, PWND pWnd, DWORD dwCommand, LPVOID pData, BOOL bA break; default: - WARN("\n"); + WARN("0x%X\n", dwCommand); break; } @@ -634,7 +631,7 @@ DoIt: break; default: - WARN("\n"); + WARN("0x%X\n", dwCommand); break; } @@ -884,7 +881,7 @@ LRESULT WINAPI ImmSystemHandler(HIMC hIMC, WPARAM wParam, LPARAM lParam) return CtfImmSetLangBand((HWND)lParam, (wParam == IMS_SETLANGBAND)); default: - WARN("\n"); + WARN("%p\n", wParam); return 0; } } diff --git a/dll/win32/imm32/utils.c b/dll/win32/imm32/utils.c index b98697358e9..cd7cfd56bd2 100644 --- a/dll/win32/imm32/utils.c +++ b/dll/win32/imm32/utils.c @@ -73,7 +73,7 @@ BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID) WORD wPrimary = PRIMARYLANGID(LangID); if (wPrimary != LANG_JAPANESE || wPrimary != LANG_KOREAN) { - WARN("\n"); + TRACE("The country has no special IME support\n"); return FALSE; } return TRUE; @@ -104,7 +104,7 @@ HBITMAP Imm32LoadBitmapFromBytes(const BYTE *pb) hbm = CreateDIBSection(NULL, (LPBITMAPINFO)pbmci, DIB_RGB_COLORS, &pvBits, NULL, 0); if (!hbm || !GetObject(hbm, sizeof(BITMAP), &bm)) { - ERR("\n"); + ERR("Invalid bitmap\n"); return NULL; } @@ -117,7 +117,7 @@ HBITMAP Imm32LoadBitmapFromBytes(const BYTE *pb) cColors = 0; break; default: - ERR("\n"); + ERR("Invalid bitmap\n"); DeleteObject(hbm); return NULL; } @@ -131,7 +131,7 @@ HBITMAP Imm32LoadBitmapFromBytes(const BYTE *pb) ib += bm.bmWidthBytes * bm.bmHeight; if (ib > cbBytes) { - ERR("\n"); + ERR("Invalid bitmap\n"); DeleteObject(hbm); return NULL; } @@ -153,7 +153,7 @@ BOOL Imm32StoreBitmapToBytes(HBITMAP hbm, LPBYTE pbData, DWORD cbDataMax) if (!GetObject(hbm, sizeof(BITMAP), &bm)) { - ERR("\n"); + ERR("Invalid bitmap\n"); return FALSE; } @@ -173,7 +173,7 @@ BOOL Imm32StoreBitmapToBytes(HBITMAP hbm, LPBYTE pbData, DWORD cbDataMax) cColors = 0; break; default: - ERR("\n"); + ERR("Invalid bitmap\n"); return FALSE; } @@ -183,7 +183,7 @@ BOOL Imm32StoreBitmapToBytes(HBITMAP hbm, LPBYTE pbData, DWORD cbDataMax) cbBytes += bm.bmWidthBytes * bm.bmHeight; if (cbBytes > cbDataMax) { - ERR("\n"); + ERR("Too small\n"); return FALSE; } @@ -287,7 +287,7 @@ BOOL Imm32GetSystemLibraryPath(LPWSTR pszPath, DWORD cchPath, LPCWSTR pszFileNam { if (!pszFileName[0] || !GetSystemDirectoryW(pszPath, cchPath)) { - ERR("\n"); + ERR("Invalid filename\n"); return FALSE; } StringCchCatW(pszPath, cchPath, L"\\"); @@ -345,7 +345,7 @@ LPVOID FASTCALL ValidateHandleNoErr(HANDLE hObject, UINT uType) if (!NtUserValidateHandleSecure(hObject)) { - WARN("\n"); + WARN("Not a handle\n"); return NULL; } @@ -485,7 +485,7 @@ DWORD APIENTRY Imm32BuildHimcList(DWORD dwThreadId, HIMC **pphList) if (NT_ERROR(Status) || !dwCount) { - ERR("\n"); + ERR("Abnormal status\n"); ImmLocalFree(phNewList); return 0; } @@ -645,7 +645,7 @@ Imm32ReconvertWideFromAnsi(LPRECONVERTSTRING pDest, const RECONVERTSTRING *pSrc, if (pDest->dwSize < cbDest) { - ERR("\n"); + ERR("Too small\n"); return 0; } @@ -695,7 +695,10 @@ Imm32ReconvertAnsiFromWide(LPRECONVERTSTRING pDest, const RECONVERTSTRING *pSrc, LPSTR pchDest; if (pSrc->dwVersion != 0) + { + ERR("\n"); return 0; + } cchDest = WideCharToMultiByte(uCodePage, 0, pchSrc, pSrc->dwStrLen, NULL, 0, NULL, NULL); @@ -705,7 +708,7 @@ Imm32ReconvertAnsiFromWide(LPRECONVERTSTRING pDest, const RECONVERTSTRING *pSrc, if (pDest->dwSize < cbDest) { - ERR("\n"); + ERR("Too small\n"); return 0; } @@ -764,14 +767,14 @@ static BOOL APIENTRY Imm32LoadImeFixedInfo(PIMEINFOEX pInfoEx, LPCVOID pVerInfo) VS_FIXEDFILEINFO *pFixed; if (!s_fnVerQueryValueW(pVerInfo, L"\\", (LPVOID*)&pFixed, &cbFixed) || !cbFixed) { - ERR("\n"); + ERR("Fixed version info not available\n"); return FALSE; } /* NOTE: The IME module must contain a version info of input method driver. */ if (pFixed->dwFileType != VFT_DRV || pFixed->dwFileSubtype != VFT2_DRV_INPUTMETHOD) { - ERR("\n"); + ERR("DLL is not an IME\n"); return FALSE; } @@ -811,7 +814,7 @@ BOOL APIENTRY Imm32LoadImeLangAndDesc(PIMEINFOEX pInfoEx, LPCVOID pVerInfo) ret = s_fnVerQueryValueW(pVerInfo, L"\\VarFileInfo\\Translation", (LPVOID*)&pw, &cbData); if (!ret || !cbData) { - ERR("\n"); + ERR("Translation not available\n"); return FALSE; } @@ -978,10 +981,7 @@ UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts) lError = RegOpenKeyW(hkeyLayouts, szImeKey, &hkeyIME); /* Open the IME key */ if (IS_ERROR_UNEXPECTEDLY(lError)) - { - WARN("\n"); continue; - } /* Load the "Ime File" value */ szImeFileName[0] = 0; @@ -1000,7 +1000,7 @@ UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts) Imm32StrToUInt(szImeKey, &Value, 16); hKL = (HKL)(DWORD_PTR)Value; - if (!IS_IME_HKL(hKL)) + if (!IS_IME_HKL(hKL)) /* Not an IME */ { WARN("\n"); continue; @@ -1093,7 +1093,7 @@ BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayou if (iPreload >= MAX_PRELOAD) /* Not found */ { - WARN("\n"); + ERR("\n"); RegCloseKey(hkeyPreload); return FALSE; }
2 years, 2 months
1
0
0
0
[reactos] 01/01: [WIN32SS] Use GDI_HANDLE_* macros for readability (#4797)
by Thamatip Chitpong
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dd75ae8eca21320cdf9f5…
commit dd75ae8eca21320cdf9f5a225e87c8d187ee4b58 Author: Thamatip Chitpong <tangaming123456(a)outlook.com> AuthorDate: Wed Oct 26 07:17:01 2022 +0700 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Oct 26 02:17:01 2022 +0200 [WIN32SS] Use GDI_HANDLE_* macros for readability (#4797) --- win32ss/gdi/gdi32/misc/misc.c | 2 +- win32ss/gdi/gdi32/objects/gdiobj.c | 2 +- win32ss/gdi/ntgdi/palette.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/win32ss/gdi/gdi32/misc/misc.c b/win32ss/gdi/gdi32/misc/misc.c index f753e9bde0f..a1006c7b832 100644 --- a/win32ss/gdi/gdi32/misc/misc.c +++ b/win32ss/gdi/gdi32/misc/misc.c @@ -735,7 +735,7 @@ GdiFixUpHandle(HGDIOBJ hGdiObj) { PGDI_TABLE_ENTRY Entry; - if (((ULONG_PTR)(hGdiObj)) & GDI_HANDLE_UPPER_MASK ) + if (GDI_HANDLE_GET_UPPER(hGdiObj)) { return hGdiObj; } diff --git a/win32ss/gdi/gdi32/objects/gdiobj.c b/win32ss/gdi/gdi32/objects/gdiobj.c index 5f8d8e1f6c3..c1b6c2abe07 100644 --- a/win32ss/gdi/gdi32/objects/gdiobj.c +++ b/win32ss/gdi/gdi32/objects/gdiobj.c @@ -320,7 +320,7 @@ DeleteObject(HGDIOBJ hObject) return FALSE; /* Check if this is a stock object */ - if ((DWORD_PTR)hObject & GDI_HANDLE_STOCK_MASK) + if (GDI_HANDLE_IS_STOCKOBJ(hObject)) { /* Ignore the attempt to delete a stock object */ DPRINT1("Trying to delete system object 0x%p\n", hObject); diff --git a/win32ss/gdi/ntgdi/palette.c b/win32ss/gdi/ntgdi/palette.c index de0fe9c66c8..ac8b625792f 100644 --- a/win32ss/gdi/ntgdi/palette.c +++ b/win32ss/gdi/ntgdi/palette.c @@ -961,7 +961,7 @@ IntSetPaletteEntries( PPALETTE palGDI; ULONG numEntries; - if ((UINT_PTR)hpal & GDI_HANDLE_STOCK_MASK) + if (GDI_HANDLE_IS_STOCKOBJ(hpal)) { return 0; } @@ -1245,7 +1245,7 @@ NtGdiUnrealizeObject(HGDIOBJ hgdiobj) PPALETTE palGDI; if ( !hgdiobj || - ((UINT_PTR)hgdiobj & GDI_HANDLE_STOCK_MASK) || + GDI_HANDLE_IS_STOCKOBJ(hgdiobj) || !GDI_HANDLE_IS_TYPE(hgdiobj, GDI_OBJECT_TYPE_PALETTE) ) return Ret;
2 years, 2 months
1
0
0
0
[reactos] 01/01: [NTOS:MM] MmPurgeSegment: Fix wrong return value (#4801)
by Adam Słaboń
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=23e5d3fe251213bb5aeb7…
commit 23e5d3fe251213bb5aeb7cac0637ad2b3864208e Author: Adam Słaboń <asaillen(a)protonmail.com> AuthorDate: Wed Oct 26 02:15:16 2022 +0200 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Oct 26 02:15:16 2022 +0200 [NTOS:MM] MmPurgeSegment: Fix wrong return value (#4801) Return TRUE instead of NTSTATUS code which has a value of FALSE and may confuse caller. Fixes sporadic 0x7B bugcheck when booting from corrupted NTFS volume using WinXP ntfs.sys. --- ntoskrnl/mm/section.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c index 0ab7da4a648..1859d5ea6f1 100644 --- a/ntoskrnl/mm/section.c +++ b/ntoskrnl/mm/section.c @@ -4739,7 +4739,7 @@ MmPurgeSegment( if (!Segment) { /* Nothing to purge */ - return STATUS_SUCCESS; + return TRUE; } PurgeStart.QuadPart = Offset ? Offset->QuadPart : 0LL;
2 years, 2 months
1
0
0
0
[reactos] 01/01: [NTDLL:CSR] Don't hardcode types in sizeofs; move local variables into code blocks where they are used.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e7744236893499fecb422…
commit e7744236893499fecb422a6f303657cdcd58d11e Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Oct 23 01:48:20 2022 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Oct 26 01:45:26 2022 +0200 [NTDLL:CSR] Don't hardcode types in sizeofs; move local variables into code blocks where they are used. --- dll/ntdll/csr/capture.c | 10 ++++------ dll/ntdll/csr/connect.c | 35 +++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/dll/ntdll/csr/capture.c b/dll/ntdll/csr/capture.c index 1a388d467a4..9252a521f0a 100644 --- a/dll/ntdll/csr/capture.c +++ b/dll/ntdll/csr/capture.c @@ -261,7 +261,7 @@ CsrCaptureMessageString(IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer, /* Null-terminate the string if we don't take up the whole space */ if (CapturedString->Length < CapturedString->MaximumLength) - CapturedString->Buffer[CapturedString->Length] = '\0'; + CapturedString->Buffer[CapturedString->Length] = ANSI_NULL; } static VOID @@ -277,11 +277,9 @@ CsrCaptureMessageUnicodeStringInPlace(IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer, String->MaximumLength, (PSTRING)String); - /* Null-terminate the string */ - if (String->MaximumLength >= String->Length + sizeof(WCHAR)) - { - String->Buffer[String->Length / sizeof(WCHAR)] = L'\0'; - } + /* Null-terminate the string if we don't take up the whole space */ + if (String->Length + sizeof(WCHAR) <= String->MaximumLength) + String->Buffer[String->Length / sizeof(WCHAR)] = UNICODE_NULL; } /* diff --git a/dll/ntdll/csr/connect.c b/dll/ntdll/csr/connect.c index f9d007b701f..98033274e44 100644 --- a/dll/ntdll/csr/connect.c +++ b/dll/ntdll/csr/connect.c @@ -49,7 +49,7 @@ CsrpConnectToServer(IN PWSTR ObjectDirectory) SID_IDENTIFIER_AUTHORITY NtSidAuthority = {SECURITY_NT_AUTHORITY}; PSID SystemSid = NULL; CSR_API_CONNECTINFO ConnectionInfo; - ULONG ConnectionInfoLength = sizeof(CSR_API_CONNECTINFO); + ULONG ConnectionInfoLength = sizeof(ConnectionInfo); DPRINT("%s(%S)\n", __FUNCTION__, ObjectDirectory); @@ -100,13 +100,13 @@ CsrpConnectToServer(IN PWSTR ObjectDirectory) } /* Set up the port view structures to match them with the section */ - LpcWrite.Length = sizeof(PORT_VIEW); + LpcWrite.Length = sizeof(LpcWrite); LpcWrite.SectionHandle = CsrSectionHandle; LpcWrite.SectionOffset = 0; LpcWrite.ViewSize = CsrSectionViewSize.u.LowPart; LpcWrite.ViewBase = 0; LpcWrite.ViewRemoteBase = 0; - LpcRead.Length = sizeof(REMOTE_PORT_VIEW); + LpcRead.Length = sizeof(LpcRead); LpcRead.ViewSize = 0; LpcRead.ViewBase = 0; @@ -202,12 +202,6 @@ CsrClientConnectToServer(IN PWSTR ObjectDirectory, { NTSTATUS Status; PIMAGE_NT_HEADERS NtHeader; - UNICODE_STRING CsrSrvName; - HANDLE hCsrSrv; - ANSI_STRING CsrServerRoutineName; - CSR_API_MESSAGE ApiMessage; - PCSR_CLIENT_CONNECT ClientConnect = &ApiMessage.Data.CsrClientConnect; - PCSR_CAPTURE_BUFFER CaptureBuffer; DPRINT("CsrClientConnectToServer: %lx %p\n", ServerId, ConnectionInfo); @@ -241,8 +235,11 @@ CsrClientConnectToServer(IN PWSTR ObjectDirectory, /* Now we can check if we are inside or not */ if (InsideCsrProcess) { + UNICODE_STRING CsrSrvName; + HANDLE hCsrSrv; + ANSI_STRING CsrServerRoutineName; + /* We're inside, so let's find csrsrv */ - DPRINT("Next-GEN CSRSS support\n"); RtlInitUnicodeString(&CsrSrvName, L"csrsrv"); Status = LdrGetDllHandle(NULL, NULL, @@ -267,6 +264,10 @@ CsrClientConnectToServer(IN PWSTR ObjectDirectory, /* Now check if connection info is given */ if (ConnectionInfo) { + CSR_API_MESSAGE ApiMessage; + PCSR_CLIENT_CONNECT ClientConnect = &ApiMessage.Data.CsrClientConnect; + PCSR_CAPTURE_BUFFER CaptureBuffer; + /* Well, we're definitely in a client now */ InsideCsrProcess = FALSE; @@ -307,7 +308,7 @@ CsrClientConnectToServer(IN PWSTR ObjectDirectory, Status = CsrClientCallServer(&ApiMessage, CaptureBuffer, CSR_CREATE_API_NUMBER(CSRSRV_SERVERDLL_INDEX, CsrpClientConnect), - sizeof(CSR_CLIENT_CONNECT)); + sizeof(*ClientConnect)); /* Copy the updated connection info data back into the user buffer */ RtlMoveMemory(ConnectionInfo, @@ -368,8 +369,6 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, IN ULONG DataLength) { NTSTATUS Status; - ULONG PointerCount; - PULONG_PTR OffsetPointer; /* Make sure the length is valid */ if (DataLength > (MAXSHORT - sizeof(CSR_API_MESSAGE))) @@ -397,6 +396,9 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, /* Check if we are already inside a CSR Server */ if (!InsideCsrProcess) { + ULONG PointerCount; + PULONG_PTR OffsetPointer; + /* Check if we got a Capture Buffer */ if (CaptureBuffer) { @@ -471,12 +473,13 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, } else { - /* This is a server-to-server call. Save our CID and do a direct call. */ - DPRINT("Next gen server-to-server call\n"); + /* This is a server-to-server call */ + DPRINT("Server-to-server call\n"); - /* We check this equality inside CsrValidateMessageBuffer */ + /* Save our CID; we check this equality inside CsrValidateMessageBuffer */ ApiMessage->Header.ClientId = NtCurrentTeb()->ClientId; + /* Do a direct call */ Status = CsrServerApiRoutine(&ApiMessage->Header, &ApiMessage->Header);
2 years, 2 months
1
0
0
0
[reactos] 04/04: [SMSS] Initial SmpInit() call initializes the *first handle* (index 0) in the array.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cb8c8693e0907cbd9be9a…
commit cb8c8693e0907cbd9be9a7235ed62c5f77adb5cf Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Oct 23 18:38:56 2022 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Oct 26 00:44:41 2022 +0200 [SMSS] Initial SmpInit() call initializes the *first handle* (index 0) in the array. --- base/system/smss/smss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/system/smss/smss.c b/base/system/smss/smss.c index 27b8306b87e..d568becc6dc 100644 --- a/base/system/smss/smss.c +++ b/base/system/smss/smss.c @@ -472,7 +472,7 @@ _main(IN INT argc, _SEH2_TRY { /* Initialize SMSS */ - Status = SmpInit(&InitialCommand, Handles); + Status = SmpInit(&InitialCommand, &Handles[0]); if (!NT_SUCCESS(Status)) { DPRINT1("SMSS: SmpInit return failure - Status == %x\n", Status);
2 years, 2 months
1
0
0
0
[reactos] 03/04: [NTDLL] Properly stub out RtlRegisterThreadWithCsrss() in spec file.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5cfb71baf86e19dcecfb1…
commit 5cfb71baf86e19dcecfb1d663366387a4ad6cb34 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Oct 23 18:03:16 2022 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Oct 26 00:43:57 2022 +0200 [NTDLL] Properly stub out RtlRegisterThreadWithCsrss() in spec file. --- dll/ntdll/def/ntdll.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/ntdll/def/ntdll.spec b/dll/ntdll/def/ntdll.spec index 3cd201aa3d4..30f9a4c7a1e 100644 --- a/dll/ntdll/def/ntdll.spec +++ b/dll/ntdll/def/ntdll.spec @@ -1100,7 +1100,7 @@ @ stdcall RtlRealPredecessor(ptr) @ stdcall RtlRealSuccessor(ptr) @ stdcall RtlRegisterSecureMemoryCacheCallback(ptr) -@ stub -version=0x600+ RtlRegisterThreadWithCsrss +@ stdcall -stub -version=0x600+ RtlRegisterThreadWithCsrss() @ stdcall RtlRegisterWait(ptr ptr ptr ptr long long) @ stdcall RtlReleaseActivationContext(ptr) @ stdcall RtlReleaseMemoryStream(ptr)
2 years, 2 months
1
0
0
0
[reactos] 02/04: [SMSS][NTOS:MM] Get rid of the remaining sprintf_nt hacks. (#4799)
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0997e9023c2242974026c…
commit 0997e9023c2242974026cc397805318b96425714 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Oct 21 19:33:57 2022 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Oct 26 00:41:23 2022 +0200 [SMSS][NTOS:MM] Get rid of the remaining sprintf_nt hacks. (#4799) --- base/system/smss/smss.c | 19 ++++--------------- ntoskrnl/mm/ARM3/sysldr.c | 36 ++++++++++++++---------------------- 2 files changed, 18 insertions(+), 37 deletions(-) diff --git a/base/system/smss/smss.c b/base/system/smss/smss.c index 6e9fb6081c0..27b8306b87e 100644 --- a/base/system/smss/smss.c +++ b/base/system/smss/smss.c @@ -25,18 +25,6 @@ HANDLE SmpInitialCommandProcessId; /* FUNCTIONS ******************************************************************/ -/* GCC's incompetence strikes again */ -VOID -sprintf_nt(IN PCHAR Buffer, - IN PCHAR Format, - IN ...) -{ - va_list ap; - va_start(ap, Format); - sprintf(Buffer, Format, ap); - va_end(ap); -} - NTSTATUS NTAPI SmpExecuteImage(IN PUNICODE_STRING FileName, @@ -176,9 +164,10 @@ SmpInvokeAutoChk(IN PUNICODE_STRING FileName, if (Flags & SMP_INVALID_PATH) { /* It wasn't, so create an error message to print on the screen */ - sprintf_nt(MessageBuffer, - "%wZ program not found - skipping AUTOCHECK\r\n", - FileName); + RtlStringCbPrintfA(MessageBuffer, + sizeof(MessageBuffer), + "%wZ program not found - skipping AUTOCHECK\r\n", + FileName); RtlInitAnsiString(&MessageString, MessageBuffer); if (NT_SUCCESS(RtlAnsiStringToUnicodeString(&Destination, &MessageString, diff --git a/ntoskrnl/mm/ARM3/sysldr.c b/ntoskrnl/mm/ARM3/sysldr.c index 31181b69fc9..35b538259f3 100644 --- a/ntoskrnl/mm/ARM3/sysldr.c +++ b/ntoskrnl/mm/ARM3/sysldr.c @@ -16,19 +16,6 @@ #define MODULE_INVOLVED_IN_ARM3 #include <mm/ARM3/miarm.h> -static -inline -VOID -sprintf_nt(IN PCHAR Buffer, - IN PCHAR Format, - IN ...) -{ - va_list ap; - va_start(ap, Format); - vsprintf(Buffer, Format, ap); - va_end(ap); -} - /* GLOBALS ********************************************************************/ LIST_ENTRY PsLoadedModuleList; @@ -2908,7 +2895,7 @@ MmLoadSystemImage(IN PUNICODE_STRING FileName, OBJECT_ATTRIBUTES ObjectAttributes; IO_STATUS_BLOCK IoStatusBlock; PIMAGE_NT_HEADERS NtHeader; - UNICODE_STRING BaseName, BaseDirectory, PrefixName, UnicodeTemp; + UNICODE_STRING BaseName, BaseDirectory, PrefixName; PLDR_DATA_TABLE_ENTRY LdrEntry = NULL; ULONG EntrySize, DriverSize; PLOAD_IMPORTS LoadedImports = MM_SYSLDR_NO_IMPORTS; @@ -2920,7 +2907,7 @@ MmLoadSystemImage(IN PUNICODE_STRING FileName, BOOLEAN LockOwned = FALSE; PLIST_ENTRY NextEntry; IMAGE_INFO ImageInfo; - STRING AnsiTemp; + PAGED_CODE(); /* Detect session-load */ @@ -3364,6 +3351,9 @@ LoaderScan: if (MiCacheImageSymbols(LdrEntry->DllBase)) #endif { + UNICODE_STRING UnicodeTemp; + STRING AnsiTemp; + /* Check if the system root is present */ if ((PrefixName.Length > (11 * sizeof(WCHAR))) && !(_wcsnicmp(PrefixName.Buffer, L"\\SystemRoot", 11))) @@ -3372,18 +3362,20 @@ LoaderScan: UnicodeTemp = PrefixName; UnicodeTemp.Buffer += 11; UnicodeTemp.Length -= (11 * sizeof(WCHAR)); - sprintf_nt(Buffer, - "%ws%wZ", - &SharedUserData->NtSystemRoot[2], - &UnicodeTemp); + RtlStringCbPrintfA(Buffer, + MAXIMUM_FILENAME_LENGTH, + "%ws%wZ", + &SharedUserData->NtSystemRoot[2], + &UnicodeTemp); } else { /* Build the name */ - sprintf_nt(Buffer, "%wZ", &BaseName); + RtlStringCbPrintfA(Buffer, MAXIMUM_FILENAME_LENGTH, + "%wZ", &BaseName); } - /* Setup the ansi string */ + /* Setup the ANSI string */ RtlInitString(&AnsiTemp, Buffer); /* Notify the debugger */ @@ -3523,7 +3515,7 @@ MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName) UNICODE_STRING HalName = RTL_CONSTANT_STRING(L"hal.dll"); ULONG Modules = 0; - /* Convert routine to ansi name */ + /* Convert routine to ANSI name */ Status = RtlUnicodeStringToAnsiString(&AnsiRoutineName, SystemRoutineName, TRUE);
2 years, 2 months
1
0
0
0
[reactos] 01/04: [CSRSRV] Remove deprecated dependency on smdll. (#4799)
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=426598c6f71d88c3774de…
commit 426598c6f71d88c3774de4f8ab62c7e968cf4981 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Oct 21 16:13:22 2022 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Oct 26 00:41:13 2022 +0200 [CSRSRV] Remove deprecated dependency on smdll. (#4799) --- subsystems/win32/csrsrv/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsystems/win32/csrsrv/CMakeLists.txt b/subsystems/win32/csrsrv/CMakeLists.txt index fc7dae1bb40..3ee512e5dd9 100644 --- a/subsystems/win32/csrsrv/CMakeLists.txt +++ b/subsystems/win32/csrsrv/CMakeLists.txt @@ -21,7 +21,7 @@ add_library(csrsrv MODULE set_module_type(csrsrv nativedll) target_link_libraries(csrsrv ${PSEH_LIB} smlib) -add_importlibs(csrsrv smdll ntdll) +add_importlibs(csrsrv ntdll) add_pch(csrsrv srv.h SOURCE) add_dependencies(csrsrv psdk bugcodes) add_cd_file(TARGET csrsrv DESTINATION reactos/system32 FOR all)
2 years, 2 months
1
0
0
0
[reactos] 03/03: [NTUSER] Fix issue when cursor/caret is static
by Jose Carlos Jesus
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9701bbcf6d6a4bbcdd6d0…
commit 9701bbcf6d6a4bbcdd6d0cdbe9b639dfa6cadb43 Author: Jose Carlos Jesus <zecarlos1957(a)hotmail.com> AuthorDate: Fri Jan 14 19:32:52 2022 +0000 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Tue Oct 25 23:54:31 2022 +0300 [NTUSER] Fix issue when cursor/caret is static Also remove the check that Windows doesn't do. CORE-17929 --- win32ss/user/ntuser/caret.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/win32ss/user/ntuser/caret.c b/win32ss/user/ntuser/caret.c index 24fadf6e16e..52ebb1bdb22 100644 --- a/win32ss/user/ntuser/caret.c +++ b/win32ss/user/ntuser/caret.c @@ -10,11 +10,6 @@ #include <win32k.h> DBG_DEFAULT_CHANNEL(UserCaret); -/* DEFINES *****************************************************************/ - -#define MIN_CARETBLINKRATE 100 -#define MAX_CARETBLINKRATE 10000 - /* FUNCTIONS *****************************************************************/ VOID FASTCALL @@ -189,13 +184,6 @@ IntSetCaretBlinkTime(UINT uMSeconds) { /* Don't save the new value to the registry! */ - /* Windows doesn't do this check */ - if((uMSeconds < MIN_CARETBLINKRATE) || (uMSeconds > MAX_CARETBLINKRATE)) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - gpsi->dtCaretBlink = uMSeconds; return TRUE; @@ -300,7 +288,15 @@ BOOL FASTCALL co_UserShowCaret(PWND Window OPTIONAL) { IntNotifyWinEvent(EVENT_OBJECT_SHOW, pWnd, OBJID_CARET, OBJID_CARET, 0); } - IntSetTimer(pWnd, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM); + if ((INT)gpsi->dtCaretBlink > 0) + { + IntSetTimer(pWnd, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM); + } + else if (ThreadQueue->CaretInfo.Visible) + { + ThreadQueue->CaretInfo.Showing = 1; + co_IntDrawCaret(pWnd, &ThreadQueue->CaretInfo); + } } return TRUE; } @@ -366,7 +362,7 @@ NtUserCreateCaret( ThreadQueue->CaretInfo.Visible = 0; ThreadQueue->CaretInfo.Showing = 0; - IntSetTimer( Window, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM ); + IntSetTimer(Window, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM); IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_CARET, CHILDID_SELF, 0);
2 years, 2 months
1
0
0
0
[reactos] 02/03: [ACCESS][MAIN] Fix setting cursor/caret blinking rate
by Jose Carlos Jesus
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c0eb40713051eab0c38c6…
commit c0eb40713051eab0c38c6663c9d762e0505ac863 Author: Jose Carlos Jesus <zecarlos1957(a)hotmail.com> AuthorDate: Fri Dec 31 12:27:42 2021 +0000 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Tue Oct 25 23:54:28 2022 +0300 [ACCESS][MAIN] Fix setting cursor/caret blinking rate - Save uCaretBlinkTime to CursorBlinkRate registry key - Also fix blinking rate never reaching None CORE-17929 --- dll/cpl/access/display.c | 52 ++++++++++++++++++++++++++++++++++++++--- dll/cpl/main/keyboard.c | 61 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 107 insertions(+), 6 deletions(-) diff --git a/dll/cpl/access/display.c b/dll/cpl/access/display.c index 843e4a1024e..03e1959b6ea 100644 --- a/dll/cpl/access/display.c +++ b/dll/cpl/access/display.c @@ -13,6 +13,31 @@ #define ID_BLINK_TIMER 346 +static VOID +UpdateCaretBlinkTimeReg( + _In_ UINT uCaretBlinkTime) +{ + HKEY hKey; + WCHAR szBuffer[12]; + + if (RegOpenKeyExW(HKEY_CURRENT_USER, + L"Control Panel\\Desktop", + 0, KEY_SET_VALUE, + &hKey) != ERROR_SUCCESS) + { + return; + } + + wsprintf(szBuffer, L"%d", uCaretBlinkTime); + + RegSetValueExW(hKey, L"CursorBlinkRate", + 0, REG_SZ, + (CONST BYTE*)szBuffer, + (wcslen(szBuffer) + 1) * sizeof(WCHAR)); + + RegCloseKey(hKey); +} + static VOID FillColorSchemeComboBox(HWND hwnd) { @@ -164,7 +189,16 @@ DisplayPageProc(HWND hwndDlg, SendDlgItemMessage(hwndDlg, IDC_CURSOR_WIDTH_TRACK, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(pGlobalData->uCaretWidth - 1)); /* Start the blink timer */ - SetTimer(hwndDlg, ID_BLINK_TIMER, pGlobalData->uCaretBlinkTime, NULL); + pGlobalData->uCaretBlinkTime = pGlobalData->uCaretBlinkTime >= 1200 ? -1 : pGlobalData->uCaretBlinkTime; + if ((INT)pGlobalData->uCaretBlinkTime > 0) + { + SetTimer(hwndDlg, ID_BLINK_TIMER, pGlobalData->uCaretBlinkTime, NULL); + } + else + { + PostMessage(hwndDlg, WM_TIMER, ID_BLINK_TIMER, 0); + } + return TRUE; case WM_COMMAND: @@ -196,7 +230,15 @@ DisplayPageProc(HWND hwndDlg, i = SendDlgItemMessage(hwndDlg, IDC_CURSOR_BLINK_TRACK, TBM_GETPOS, 0, 0); pGlobalData->uCaretBlinkTime = (12 - (UINT)i) * 100; KillTimer(hwndDlg, ID_BLINK_TIMER); - SetTimer(hwndDlg, ID_BLINK_TIMER, pGlobalData->uCaretBlinkTime, NULL); + pGlobalData->uCaretBlinkTime = pGlobalData->uCaretBlinkTime >= 1200 ? -1 : pGlobalData->uCaretBlinkTime; + if ((INT)pGlobalData->uCaretBlinkTime > 0) + { + SetTimer(hwndDlg, ID_BLINK_TIMER, pGlobalData->uCaretBlinkTime, NULL); + } + else if (pGlobalData->fShowCaret) + { + SendMessage(hwndDlg, WM_TIMER, ID_BLINK_TIMER, 0); + } PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; @@ -243,7 +285,11 @@ DisplayPageProc(HWND hwndDlg, lppsn = (LPPSHNOTIFY)lParam; if (lppsn->hdr.code == PSN_APPLY) { - SetCaretBlinkTime(pGlobalData->uCaretBlinkTime); + if (SetCaretBlinkTime(pGlobalData->uCaretBlinkTime)) + { + UpdateCaretBlinkTimeReg(pGlobalData->uCaretBlinkTime); + } + SystemParametersInfo(SPI_SETCARETWIDTH, 0, IntToPtr(pGlobalData->uCaretWidth), diff --git a/dll/cpl/main/keyboard.c b/dll/cpl/main/keyboard.c index c3f7b1ce69c..59af3bb8cb0 100644 --- a/dll/cpl/main/keyboard.c +++ b/dll/cpl/main/keyboard.c @@ -39,6 +39,31 @@ typedef struct _SPEED_DATA RECT rcCursor; } SPEED_DATA, *PSPEED_DATA; +static VOID +UpdateCaretBlinkTimeReg( + _In_ UINT uCaretBlinkTime) +{ + HKEY hKey; + WCHAR szBuffer[12]; + + if (RegOpenKeyExW(HKEY_CURRENT_USER, + L"Control Panel\\Desktop", + 0, KEY_SET_VALUE, + &hKey) != ERROR_SUCCESS) + { + return; + } + + wsprintf(szBuffer, L"%d", uCaretBlinkTime); + + RegSetValueExW(hKey, L"CursorBlinkRate", + 0, REG_SZ, + (CONST BYTE*)szBuffer, + (wcslen(szBuffer) + 1) * sizeof(WCHAR)); + + RegCloseKey(hKey); +} + /* Property page dialog callback */ static INT_PTR CALLBACK KeyboardSpeedProc(IN HWND hwndDlg, @@ -97,7 +122,16 @@ KeyboardSpeedProc(IN HWND hwndDlg, SendDlgItemMessage(hwndDlg, IDC_SLIDER_CURSOR_BLINK, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(12 - (pSpeedData->uCaretBlinkTime / 100))); /* Start the blink timer */ - SetTimer(hwndDlg, ID_BLINK_TIMER, pSpeedData->uCaretBlinkTime, NULL); + pSpeedData->uCaretBlinkTime = pSpeedData->uCaretBlinkTime >= 1200 ? -1 : pSpeedData->uCaretBlinkTime; + if ((INT)pSpeedData->uCaretBlinkTime > 0) + { + SetTimer(hwndDlg, ID_BLINK_TIMER, pSpeedData->uCaretBlinkTime, NULL); + } + else + { + PostMessage(hwndDlg, WM_TIMER, ID_BLINK_TIMER, 0); + } + break; case WM_HSCROLL: @@ -172,7 +206,15 @@ KeyboardSpeedProc(IN HWND hwndDlg, case TB_ENDTRACK: pSpeedData->uCaretBlinkTime = (12 - (UINT)SendDlgItemMessage(hwndDlg, IDC_SLIDER_CURSOR_BLINK, TBM_GETPOS, 0, 0)) * 100; KillTimer(hwndDlg, ID_BLINK_TIMER); - SetTimer(hwndDlg, ID_BLINK_TIMER, pSpeedData->uCaretBlinkTime, NULL); + pSpeedData->uCaretBlinkTime = pSpeedData->uCaretBlinkTime >= 1200 ? -1 : pSpeedData->uCaretBlinkTime; + if ((INT)pSpeedData->uCaretBlinkTime > 0) + { + SetTimer(hwndDlg, ID_BLINK_TIMER, pSpeedData->uCaretBlinkTime, NULL); + } + else if (pSpeedData->fShowCursor) + { + SendMessage(hwndDlg, WM_TIMER, ID_BLINK_TIMER, 0); + } SetCaretBlinkTime(pSpeedData->uCaretBlinkTime); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; @@ -180,7 +222,15 @@ KeyboardSpeedProc(IN HWND hwndDlg, case TB_THUMBTRACK: pSpeedData->uCaretBlinkTime = (12 - (UINT)HIWORD(wParam)) * 100; KillTimer(hwndDlg, ID_BLINK_TIMER); - SetTimer(hwndDlg, ID_BLINK_TIMER, pSpeedData->uCaretBlinkTime, NULL); + pSpeedData->uCaretBlinkTime = pSpeedData->uCaretBlinkTime >= 1200 ? -1 : pSpeedData->uCaretBlinkTime; + if ((INT)pSpeedData->uCaretBlinkTime > 0) + { + SetTimer(hwndDlg, ID_BLINK_TIMER, pSpeedData->uCaretBlinkTime, NULL); + } + else if (pSpeedData->fShowCursor) + { + SendMessage(hwndDlg, WM_TIMER, ID_BLINK_TIMER, 0); + } SetCaretBlinkTime(pSpeedData->uCaretBlinkTime); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; @@ -215,6 +265,11 @@ KeyboardSpeedProc(IN HWND hwndDlg, { case PSN_APPLY: /* Set the new keyboard settings */ + if (pSpeedData->uOrigCaretBlinkTime != pSpeedData->uCaretBlinkTime) + { + UpdateCaretBlinkTimeReg(pSpeedData->uCaretBlinkTime); + } + SystemParametersInfo(SPI_SETKEYBOARDDELAY, pSpeedData->nKeyboardDelay, 0,
2 years, 2 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200