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
April 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
22 participants
157 discussions
Start a n
N
ew thread
[reactos] 01/01: [NTUSER] Do assignment lock at NtUserSetThreadLayoutHandles (#4459)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5df5ef2bdf55290960442…
commit 5df5ef2bdf5529096044211c41876b2aed1770c6 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Apr 19 08:41:13 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Apr 19 08:41:13 2022 +0900 [NTUSER] Do assignment lock at NtUserSetThreadLayoutHandles (#4459) - Use UserAssignmentLock in NtUserSetThreadLayoutHandles. - Add Win: comments to many functions. - Rename glcid as glcidSystem. CORE-11700 --- win32ss/user/ntuser/callback.c | 1 + win32ss/user/ntuser/ime.c | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/win32ss/user/ntuser/callback.c b/win32ss/user/ntuser/callback.c index 9b5ac56965a..4e1c053e4bf 100644 --- a/win32ss/user/ntuser/callback.c +++ b/win32ss/user/ntuser/callback.c @@ -1247,6 +1247,7 @@ co_UserCBClientPrinterThunk( PVOID pkt, INT InSize, PVOID pvOutData, INT OutSize return 0; } +// Win: ClientImmProcessKey DWORD APIENTRY co_IntImmProcessKey(HWND hWnd, HKL hKL, UINT vKey, LPARAM lParam, DWORD dwHotKeyID) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index 6b6e17391ef..eccaca5fd93 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -55,9 +55,10 @@ typedef struct tagIMEHOTKEY HKL hKL; } IMEHOTKEY, *PIMEHOTKEY; -PIMEHOTKEY gpImeHotKeyList = NULL; -LCID glcid = 0; +PIMEHOTKEY gpImeHotKeyList = NULL; // Win: gpImeHotKeyListHeader +LCID glcidSystem = 0; // Win: glcidSystem +// Win: GetAppImeCompatFlags DWORD FASTCALL IntGetImeCompatFlags(PTHREADINFO pti) { if (!pti) @@ -66,6 +67,7 @@ DWORD FASTCALL IntGetImeCompatFlags(PTHREADINFO pti) return pti->ppi->dwImeCompatFlags; } +// Win: GetLangIdMatchLevel UINT FASTCALL IntGetImeHotKeyLanguageScore(HKL hKL, LANGID HotKeyLangId) { LCID lcid; @@ -86,15 +88,16 @@ UINT FASTCALL IntGetImeHotKeyLanguageScore(HKL hKL, LANGID HotKeyLangId) if (HotKeyLangId == LANGIDFROMLCID(lcid)) return 2; - if (glcid == 0) - ZwQueryDefaultLocale(FALSE, &glcid); + if (glcidSystem == 0) + ZwQueryDefaultLocale(FALSE, &glcidSystem); - if (HotKeyLangId == LANGIDFROMLCID(glcid)) + if (HotKeyLangId == LANGIDFROMLCID(glcidSystem)) return 1; return 0; } +// Win: GetActiveHKL HKL FASTCALL IntGetActiveKeyboardLayout(VOID) { PTHREADINFO pti; @@ -109,6 +112,7 @@ HKL FASTCALL IntGetActiveKeyboardLayout(VOID) return UserGetKeyboardLayout(0); } +// Win: GetHotKeyLangID static LANGID FASTCALL IntGetImeHotKeyLangId(DWORD dwHotKeyId) { #define IME_CHOTKEY 0x10 @@ -155,6 +159,7 @@ static VOID FASTCALL IntAddImeHotKey(PIMEHOTKEY *ppList, PIMEHOTKEY pHotKey) } } +// Win: FindImeHotKeyByID static PIMEHOTKEY FASTCALL IntGetImeHotKeyById(PIMEHOTKEY pList, DWORD dwHotKeyId) { PIMEHOTKEY pNode; @@ -166,6 +171,7 @@ static PIMEHOTKEY FASTCALL IntGetImeHotKeyById(PIMEHOTKEY pList, DWORD dwHotKeyI return NULL; } +// Win: FindImeHotKeyByKeyWithLang static PIMEHOTKEY APIENTRY IntGetImeHotKeyByKeyAndLang(PIMEHOTKEY pList, UINT uModKeys, UINT uLeftRight, UINT uVirtualKey, LANGID TargetLangId) @@ -197,6 +203,7 @@ IntGetImeHotKeyByKeyAndLang(PIMEHOTKEY pList, UINT uModKeys, UINT uLeftRight, return NULL; } +// Win: DeleteImeHotKey static VOID FASTCALL IntDeleteImeHotKey(PIMEHOTKEY *ppList, PIMEHOTKEY pHotKey) { PIMEHOTKEY pNode; @@ -219,6 +226,7 @@ static VOID FASTCALL IntDeleteImeHotKey(PIMEHOTKEY *ppList, PIMEHOTKEY pHotKey) } } +// Win: FindImeHotKeyByKey PIMEHOTKEY IntGetImeHotKeyByKey(PIMEHOTKEY pList, UINT uModKeys, UINT uLeftRight, UINT uVirtualKey) { @@ -486,6 +494,7 @@ Quit: return ret; } +// Win: GetTopLevelWindow PWND FASTCALL IntGetTopLevelWindow(PWND pwnd) { if (!pwnd) @@ -526,7 +535,7 @@ NtUserSetThreadLayoutHandles(HKL hNewKL, HKL hOldKL) if (IS_IME_HKL(hNewKL) != IS_IME_HKL(hOldKL)) pti->hklPrev = hOldKL; - pti->KeyboardLayout = pNewKL; + UserAssignmentLock((PVOID*)&pti->KeyboardLayout, pNewKL); Quit: UserLeave(); @@ -566,6 +575,7 @@ DWORD FASTCALL UserBuildHimcList(PTHREADINFO pti, DWORD dwCount, HIMC *phList) return dwRealCount; } +// Win: xxxImmProcessKey UINT FASTCALL IntImmProcessKey(PUSER_MESSAGE_QUEUE MessageQueue, PWND pWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -739,6 +749,7 @@ Quit: return ret; } +// Win: SetConvMode static VOID FASTCALL UserSetImeConversionKeyState(PTHREADINFO pti, DWORD dwConversion) { HKL hKL; @@ -1494,6 +1505,7 @@ Quit: return ret; } +// Win: UpdateInputContext BOOL FASTCALL UserUpdateInputContext(PIMC pIMC, DWORD dwType, DWORD_PTR dwValue) { PTHREADINFO pti = GetW32ThreadInfo();
2 years, 8 months
1
0
0
0
[reactos] 01/01: [NTUSER][USER32] Implement ImeWnd_OnImeNotify (#4457)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c35488ec708c1671e78d5…
commit c35488ec708c1671e78d5572a17282e0b923c184 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Apr 19 07:48:16 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Apr 19 07:48:16 2022 +0900 [NTUSER][USER32] Implement ImeWnd_OnImeNotify (#4457) - Add code to ImeWnd_OnImeNotify function. - Insert ASSERT(pimeui->spwnd != NULL); to some functions. - Renaming: s/THREADSTATE_UNKNOWN17/THREADSTATE_CHECKCONIME/. - Improve ImeWnd_OnImeSetContext function. CORE-11700 --- win32ss/include/ntuser.h | 2 +- win32ss/user/ntuser/misc.c | 2 +- win32ss/user/user32/misc/imm.c | 40 +++++++++++++++++++++++++++++++--------- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 56e13e2229e..0eea35fffa4 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -2578,7 +2578,7 @@ enum ThreadStateRoutines THREADSTATE_OLDKEYBOARDLAYOUT, THREADSTATE_ISWINLOGON, THREADSTATE_ISWINLOGON2, - THREADSTATE_UNKNOWN17, + THREADSTATE_CHECKCONIME, THREADSTATE_GETTHREADINFO, THREADSTATE_PROGMANWINDOW, /* FIXME: Delete this HACK */ THREADSTATE_TASKMANWINDOW, /* FIXME: Delete this HACK */ diff --git a/win32ss/user/ntuser/misc.c b/win32ss/user/ntuser/misc.c index 5b1d3ecad83..e24e41b9a81 100644 --- a/win32ss/user/ntuser/misc.c +++ b/win32ss/user/ntuser/misc.c @@ -335,7 +335,7 @@ NtUserGetThreadState( case THREADSTATE_ISWINLOGON2: ret = (gpidLogon == PsGetCurrentProcessId()); break; - case THREADSTATE_UNKNOWN17: + case THREADSTATE_CHECKCONIME: /* FIXME */ break; } diff --git a/win32ss/user/user32/misc/imm.c b/win32ss/user/user32/misc/imm.c index f47d91096fb..6fa8eafd1d6 100644 --- a/win32ss/user/user32/misc/imm.c +++ b/win32ss/user/user32/misc/imm.c @@ -170,6 +170,8 @@ User32SendImeUIMessage(PIMEUI pimeui, UINT uMsg, WPARAM wParam, LPARAM lParam, B HWND hwndUI = pimeui->hwndUI; PWND pwnd, pwndUI; + ASSERT(pimeui->spwnd != NULL); + pwnd = pimeui->spwnd; pwndUI = ValidateHwnd(hwndUI); if (!pwnd || (pwnd->state & WNDS_DESTROYED) || (pwnd->state2 & WNDS2_INDESTROY) || @@ -195,6 +197,8 @@ static VOID User32NotifyOpenStatus(PIMEUI pimeui, HWND hwndIMC, BOOL bOpen) { WPARAM wParam = (bOpen ? IMN_OPENSTATUSWINDOW : IMN_CLOSESTATUSWINDOW); + ASSERT(pimeui->spwnd != NULL); + pimeui->fShowStatus = bOpen; if (LOWORD(GetWin32ClientInfo()->dwExpWinVer) >= 0x400) @@ -216,9 +220,12 @@ static VOID User32SetImeWindowOfImc(HIMC hIMC, HWND hImeWnd) // Win: ImeSetImc static VOID User32UpdateImcOfImeUI(PIMEUI pimeui, HIMC hNewIMC) { - HWND hImeWnd = UserHMGetHandle(pimeui->spwnd); + HWND hImeWnd; HIMC hOldIMC = pimeui->hIMC; + ASSERT(pimeui->spwnd != NULL); + hImeWnd = UserHMGetHandle(pimeui->spwnd); + if (hNewIMC == hOldIMC) return; @@ -237,7 +244,9 @@ static LRESULT ImeWnd_OnImeNotify(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) LRESULT ret = 0; HIMC hIMC; LPINPUTCONTEXT pIC; - HWND hwndUI, hwndIMC; + HWND hwndUI, hwndIMC, hImeWnd, hwndOwner; + + ASSERT(pimeui->spwnd != NULL); switch (wParam) { @@ -252,9 +261,14 @@ static LRESULT ImeWnd_OnImeNotify(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) { NtUserNotifyIMEStatus(hwndIMC, pIC->fOpen, pIC->fdwConversion); } - else + else if (gfConIme == TRUE && pimeui->spwnd) { - // TODO: + hImeWnd = UserHMGetHandle(pimeui->spwnd); + hwndOwner = GetWindow(hImeWnd, GW_OWNER); + if (hwndOwner) + { + NtUserNotifyIMEStatus(hwndOwner, pIC->fOpen, pIC->fdwConversion); + } } IMM_FN(ImmUnlockIMC)(hIMC); @@ -284,6 +298,8 @@ static HWND User32CreateImeUIWindow(PIMEUI pimeui, HKL hKL) CHAR szUIClass[32]; PWND pwnd = pimeui->spwnd; + ASSERT(pimeui->spwnd != NULL); + if (!pwnd || !IMM_FN(ImmGetImeInfoEx)(&ImeInfoEx, ImeInfoExKeyboardLayout, &hKL)) return NULL; @@ -549,6 +565,8 @@ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) COMPOSITIONFORM CompForm; UINT iCandForm; + ASSERT(pimeui->spwnd != NULL); + switch (wParam) { case 0x05: @@ -688,12 +706,13 @@ LRESULT ImeWnd_OnImeSetContext(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) LRESULT ret; HIMC hIMC; LPINPUTCONTEXTDX pIC; - HWND hwndFocus, hwndOldImc, hwndNewImc, hImeWnd, hwndActive; + HWND hwndFocus, hwndOldImc, hwndNewImc, hImeWnd, hwndActive, hwndOwner; PWND pwndFocus, pwndOldImc, pwndNewImc, pImeWnd, pwndOwner; COMPOSITIONFORM CompForm; pimeui->fActivate = !!wParam; hwndOldImc = pimeui->hwndIMC; + ASSERT(pimeui->spwnd != NULL); if (wParam) { @@ -702,14 +721,17 @@ LRESULT ImeWnd_OnImeSetContext(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) if (gfConIme == -1) { - gfConIme = (INT)NtUserGetThreadState(THREADSTATE_UNKNOWN17); + gfConIme = (INT)NtUserGetThreadState(THREADSTATE_CHECKCONIME); if (gfConIme) pimeui->fCtrlShowStatus = FALSE; } + hImeWnd = UserHMGetHandle(pimeui->spwnd); + if (gfConIme) { - pwndOwner = pimeui->spwnd->spwndOwner; + hwndOwner = GetWindow(hImeWnd, GW_OWNER); + pwndOwner = ValidateHwnd(hwndOwner); if (pwndOwner) { User32UpdateImcOfImeUI(pimeui, pwndOwner->hImc); @@ -721,7 +743,6 @@ LRESULT ImeWnd_OnImeSetContext(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) return User32SendImeUIMessage(pimeui, WM_IME_SETCONTEXT, wParam, lParam, TRUE); } - hImeWnd = UserHMGetHandle(pimeui->spwnd); hwndFocus = (HWND)NtUserQueryWindow(hImeWnd, QUERY_WINDOW_FOCUS); hIMC = IMM_FN(ImmGetContext)(hwndFocus); @@ -786,7 +807,8 @@ LRESULT ImeWnd_OnImeSetContext(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) if (wParam) { - if (pwndFocus && pimeui->spwnd->head.pti == pwndFocus->head.pti) + pImeWnd = ValidateHwnd(hImeWnd); + if (pwndFocus && pImeWnd && pImeWnd->head.pti == pwndFocus->head.pti) { hwndNewImc = pimeui->hwndIMC; if (pimeui->fShowStatus)
2 years, 8 months
1
0
0
0
[reactos] 01/01: [UMPNPMGR] PNP_CreateDevInst: A phantom device can only be created if the device did not exist before
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f3ac86713d7b519910e28…
commit f3ac86713d7b519910e28430b5909c164b8fbe44 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Tue Apr 19 00:09:27 2022 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Tue Apr 19 00:09:54 2022 +0200 [UMPNPMGR] PNP_CreateDevInst: A phantom device can only be created if the device did not exist before --- base/services/umpnpmgr/rpcserver.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c index 140f1efa91a..25461975ee0 100644 --- a/base/services/umpnpmgr/rpcserver.c +++ b/base/services/umpnpmgr/rpcserver.c @@ -3052,6 +3052,7 @@ PNP_CreateDevInst( PNP_RPC_STRING_LEN ulLength, DWORD ulFlags) { + HKEY hKey = NULL; CONFIGRET ret = CR_SUCCESS; DPRINT("PNP_CreateDevInst(%p %S %S %lu 0x%08lx)\n", @@ -3075,8 +3076,18 @@ PNP_CreateDevInst( return ret; } + /* Try to open the device instance key */ + RegOpenKeyEx(hEnumKey, pszDeviceID, 0, KEY_READ | KEY_WRITE, &hKey); + if (ulFlags & CM_CREATE_DEVNODE_PHANTOM) { + /* Fail, if the device already exists */ + if (hKey != NULL) + { + ret = CR_ALREADY_SUCH_DEVINST; + goto done; + } + /* Create the phantom device instance */ ret = CreateDeviceInstance(pszDeviceID, TRUE); } @@ -3086,6 +3097,10 @@ PNP_CreateDevInst( ret = CreateDeviceInstance(pszDeviceID, FALSE); } +done: + if (hKey) + RegCloseKey(hKey); + DPRINT("PNP_CreateDevInst() done (returns %lx)\n", ret); return ret;
2 years, 8 months
1
0
0
0
[reactos] 01/01: [WIN32SS] Fix buffer overflow in MDEVOBJ when having more than 10 display devices
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c391b1eab5000f793b63…
commit 2c391b1eab5000f793b63db6ee2e90ffb64280fa Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Mon Apr 18 19:49:31 2022 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon Apr 18 20:01:37 2022 +0200 [WIN32SS] Fix buffer overflow in MDEVOBJ when having more than 10 display devices --- win32ss/gdi/eng/mdevobj.c | 20 +++++++++++++++++++- win32ss/gdi/eng/mdevobj.h | 10 ++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/win32ss/gdi/eng/mdevobj.c b/win32ss/gdi/eng/mdevobj.c index 2bc3b54d03f..2b6ce26b0ca 100644 --- a/win32ss/gdi/eng/mdevobj.c +++ b/win32ss/gdi/eng/mdevobj.c @@ -73,7 +73,7 @@ MDEVOBJ_Create( pdm ? pdm->dmBitsPerPel : 0, pdm ? pdm->dmDisplayFrequency : 0); - pmdev = ExAllocatePoolZero(PagedPool, sizeof(MDEVOBJ), GDITAG_MDEV); + pmdev = ExAllocatePoolZero(PagedPool, sizeof(MDEVOBJ) + sizeof(MDEVDISPLAY), GDITAG_MDEV); if (!pmdev) { ERR("Failed to allocate memory for MDEV\n"); @@ -170,6 +170,24 @@ MDEVOBJ_Create( if (ppdev) { /* Great. We have a found a matching PDEV. Store it in MDEV */ + if (pmdev->cDev >= 1) + { + /* We have to reallocate MDEV to add space for the new display */ + PMDEVOBJ pmdevBigger = ExAllocatePoolZero(PagedPool, sizeof(MDEVOBJ) + (pmdev->cDev + 1) * sizeof(MDEVDISPLAY), GDITAG_MDEV); + if (!pmdevBigger) + { + WARN("Failed to allocate memory for MDEV. Skipping display '%S'\n", pGraphicsDevice->szWinDeviceName); + continue; + } + else + { + /* Copy existing data */ + RtlCopyMemory(pmdevBigger, pmdev, sizeof(MDEVOBJ) + pmdev->cDev * sizeof(MDEVDISPLAY)); + ExFreePoolWithTag(pmdev, GDITAG_MDEV); + pmdev = pmdevBigger; + } + } + TRACE("Adding '%S' to MDEV %p\n", pGraphicsDevice->szWinDeviceName, pmdev); PDEVOBJ_vReference(ppdev); pmdev->dev[pmdev->cDev].ppdev = ppdev; diff --git a/win32ss/gdi/eng/mdevobj.h b/win32ss/gdi/eng/mdevobj.h index 6dfb7aea4cf..9da0f0a89e9 100644 --- a/win32ss/gdi/eng/mdevobj.h +++ b/win32ss/gdi/eng/mdevobj.h @@ -5,14 +5,16 @@ typedef struct _PDEVOBJ *PPDEVOBJ; +typedef struct _MDEVDISPLAY +{ + PPDEVOBJ ppdev; +} MDEVDISPLAY, *PMDEVDISPLAY; + typedef struct _MDEVOBJ { ULONG cDev; PPDEVOBJ ppdevGlobal; - struct - { - PPDEVOBJ ppdev; - } dev[10]; /* FIXME: max number of displays. Needs dynamic allocation */ + MDEVDISPLAY dev[0]; } MDEVOBJ, *PMDEVOBJ; /* Globals ********************************************************************/
2 years, 8 months
1
0
0
0
[reactos] 01/01: [UMPNPMGR] PNP_CreateDevInst: Support the creation of phantom devices
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8897a890c94ed83f4e341…
commit 8897a890c94ed83f4e34147b63dc58b2108e16d7 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Apr 18 19:53:18 2022 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Apr 18 19:53:18 2022 +0200 [UMPNPMGR] PNP_CreateDevInst: Support the creation of phantom devices --- base/services/umpnpmgr/rpcserver.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c index ae7337ce8eb..140f1efa91a 100644 --- a/base/services/umpnpmgr/rpcserver.c +++ b/base/services/umpnpmgr/rpcserver.c @@ -2877,8 +2877,11 @@ done: } -static CONFIGRET -CreateDeviceInstance(LPWSTR pszDeviceID) +static +CONFIGRET +CreateDeviceInstance( + _In_ LPWSTR pszDeviceID, + _In_ BOOL bPhantomDevice) { WCHAR szEnumerator[MAX_DEVICE_ID_LEN]; WCHAR szDevice[MAX_DEVICE_ID_LEN]; @@ -2962,6 +2965,17 @@ CreateDeviceInstance(LPWSTR pszDeviceID) return CR_REGISTRY_ERROR; } + if (bPhantomDevice) + { + DWORD dwPhantomValue = 1; + RegSetValueExW(hKeyInstance, + L"Phantom", + 0, + REG_DWORD, + (PBYTE)&dwPhantomValue, + sizeof(dwPhantomValue)); + } + /* Create the 'Control' sub key */ lError = RegCreateKeyExW(hKeyInstance, L"Control", @@ -3061,8 +3075,16 @@ PNP_CreateDevInst( return ret; } - /* Create the device instance */ - ret = CreateDeviceInstance(pszDeviceID); + if (ulFlags & CM_CREATE_DEVNODE_PHANTOM) + { + /* Create the phantom device instance */ + ret = CreateDeviceInstance(pszDeviceID, TRUE); + } + else + { + /* Create the device instance */ + ret = CreateDeviceInstance(pszDeviceID, FALSE); + } DPRINT("PNP_CreateDevInst() done (returns %lx)\n", ret);
2 years, 8 months
1
0
0
0
[reactos] 01/01: [WIN32SS] Fix some memory leaks (introduced in 21ddeb76d91c851d95b6ab563517f5ee071b9848)
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aa80cfb46e8550c4dce2b…
commit aa80cfb46e8550c4dce2b3b212b199c752863510 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Mon Apr 18 16:22:30 2022 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon Apr 18 16:23:52 2022 +0200 [WIN32SS] Fix some memory leaks (introduced in 21ddeb76d91c851d95b6ab563517f5ee071b9848) --- win32ss/gdi/eng/ldevobj.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/win32ss/gdi/eng/ldevobj.c b/win32ss/gdi/eng/ldevobj.c index 0051a4c3842..cf618635735 100644 --- a/win32ss/gdi/eng/ldevobj.c +++ b/win32ss/gdi/eng/ldevobj.c @@ -596,11 +596,13 @@ LDEVOBJ_bBuildDevmodeList( if (!pdminfo) { ERR("Could not allocate devmodeinfo\n"); + ExFreePoolWithTag(pdm, GDITAG_DEVMODE); continue; } pdminfo->cbdevmode = cbSize; RtlCopyMemory(pdminfo->adevmode, pdm, cbSize); + ExFreePoolWithTag(pdm, GDITAG_DEVMODE); /* Attach the mode info to the device */ pdminfo->pdmiNext = pGraphicsDevice->pdevmodeInfo;
2 years, 8 months
1
0
0
0
[reactos] 01/01: [UMPNPMGR] Move device id generation into a separate function and limit device instance number
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f63e8f8a03c8c689b599d…
commit f63e8f8a03c8c689b599d83c57184ece1634c818 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Apr 18 14:14:11 2022 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Apr 18 14:14:11 2022 +0200 [UMPNPMGR] Move device id generation into a separate function and limit device instance number --- base/services/umpnpmgr/rpcserver.c | 79 +++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 30 deletions(-) diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c index be39d95c4c2..ae7337ce8eb 100644 --- a/base/services/umpnpmgr/rpcserver.c +++ b/base/services/umpnpmgr/rpcserver.c @@ -2983,6 +2983,51 @@ CreateDeviceInstance(LPWSTR pszDeviceID) } +static +CONFIGRET +GenerateDeviceID( + _Inout_ LPWSTR pszDeviceID, + _In_ PNP_RPC_STRING_LEN ulLength) +{ + WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN]; + HKEY hKey; + DWORD dwInstanceNumber; + DWORD dwError = ERROR_SUCCESS; + CONFIGRET ret = CR_SUCCESS; + + /* Generated ID is: Root\<Device ID>\<Instance number> */ + dwInstanceNumber = 0; + while (dwError == ERROR_SUCCESS) + { + if (dwInstanceNumber >= 10000) + return CR_FAILURE; + + swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu", + pszDeviceID, dwInstanceNumber); + + /* Try to open the enum key of the device instance */ + dwError = RegOpenKeyEx(hEnumKey, szGeneratedInstance, 0, KEY_QUERY_VALUE, &hKey); + if (dwError == ERROR_SUCCESS) + { + RegCloseKey(hKey); + dwInstanceNumber++; + } + } + + /* pszDeviceID is an out parameter too for generated IDs */ + if (wcslen(szGeneratedInstance) > ulLength) + { + ret = CR_BUFFER_SMALL; + } + else + { + wcscpy(pszDeviceID, szGeneratedInstance); + } + + return ret; +} + + /* Function 28 */ DWORD WINAPI @@ -3010,36 +3055,10 @@ PNP_CreateDevInst( if (ulFlags & CM_CREATE_DEVNODE_GENERATE_ID) { - WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN]; - DWORD dwInstanceNumber; - DWORD dwError = ERROR_SUCCESS; - HKEY hKey; - - /* Generated ID is: Root\<Device ID>\<Instance number> */ - dwInstanceNumber = 0; - while (dwError == ERROR_SUCCESS) - { - swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu", - pszDeviceID, dwInstanceNumber); - - /* Try to open the enum key of the device instance */ - dwError = RegOpenKeyEx(hEnumKey, szGeneratedInstance, 0, KEY_QUERY_VALUE, &hKey); - if (dwError == ERROR_SUCCESS) - { - RegCloseKey(hKey); - dwInstanceNumber++; - } - } - - /* pszDeviceID is an out parameter too for generated IDs */ - if (wcslen(szGeneratedInstance) > ulLength) - { - ret = CR_BUFFER_SMALL; - } - else - { - wcscpy(pszDeviceID, szGeneratedInstance); - } + ret = GenerateDeviceID(pszDeviceID, + ulLength); + if (ret != CR_SUCCESS) + return ret; } /* Create the device instance */
2 years, 8 months
1
0
0
0
[reactos] 01/01: [UMPNPMGR] PNP_CreateDevInst: Do not create a new device while generating a device id
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=426687becf36fb4c9a51e…
commit 426687becf36fb4c9a51e7dc64e65ad0d969391b Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Apr 18 12:59:41 2022 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Apr 18 12:59:41 2022 +0200 [UMPNPMGR] PNP_CreateDevInst: Do not create a new device while generating a device id --- base/services/umpnpmgr/rpcserver.c | 41 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c index 1262e46d661..be39d95c4c2 100644 --- a/base/services/umpnpmgr/rpcserver.c +++ b/base/services/umpnpmgr/rpcserver.c @@ -3012,39 +3012,38 @@ PNP_CreateDevInst( { WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN]; DWORD dwInstanceNumber; + DWORD dwError = ERROR_SUCCESS; + HKEY hKey; /* Generated ID is: Root\<Device ID>\<Instance number> */ dwInstanceNumber = 0; - do + while (dwError == ERROR_SUCCESS) { swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu", pszDeviceID, dwInstanceNumber); - /* Try to create a device instance with this ID */ - ret = CreateDeviceInstance(szGeneratedInstance); - - dwInstanceNumber++; + /* Try to open the enum key of the device instance */ + dwError = RegOpenKeyEx(hEnumKey, szGeneratedInstance, 0, KEY_QUERY_VALUE, &hKey); + if (dwError == ERROR_SUCCESS) + { + RegCloseKey(hKey); + dwInstanceNumber++; + } } - while (ret == CR_ALREADY_SUCH_DEVINST); - if (ret == CR_SUCCESS) + /* pszDeviceID is an out parameter too for generated IDs */ + if (wcslen(szGeneratedInstance) > ulLength) { - /* pszDeviceID is an out parameter too for generated IDs */ - if (wcslen(szGeneratedInstance) > ulLength) - { - ret = CR_BUFFER_SMALL; - } - else - { - wcscpy(pszDeviceID, szGeneratedInstance); - } + ret = CR_BUFFER_SMALL; + } + else + { + wcscpy(pszDeviceID, szGeneratedInstance); } } - else - { - /* Create the device instance */ - ret = CreateDeviceInstance(pszDeviceID); - } + + /* Create the device instance */ + ret = CreateDeviceInstance(pszDeviceID); DPRINT("PNP_CreateDevInst() done (returns %lx)\n", ret);
2 years, 8 months
1
0
0
0
[reactos] 01/01: [UMPNPMGR] PNP_GetRelatedDeviceInstance must return the root device as the parent of non-existing devices
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=11886ebec2ad98d4d9f0e…
commit 11886ebec2ad98d4d9f0e75e88bcaa355e11596d Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Apr 18 09:48:03 2022 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Apr 18 09:48:03 2022 +0200 [UMPNPMGR] PNP_GetRelatedDeviceInstance must return the root device as the parent of non-existing devices --- base/services/umpnpmgr/rpcserver.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c index 470a9b67622..1262e46d661 100644 --- a/base/services/umpnpmgr/rpcserver.c +++ b/base/services/umpnpmgr/rpcserver.c @@ -413,6 +413,17 @@ IsRootDeviceInstanceID( } +static +BOOL +IsPresentDeviceInstanceID( + _In_ LPWSTR pszDeviceInstanceID) +{ + DWORD ulStatus, ulProblem; + + return (GetDeviceStatus(pszDeviceInstanceID, &ulStatus, &ulProblem) == CR_SUCCESS); +} + + static CONFIGRET OpenConfigurationKey( @@ -781,10 +792,29 @@ PNP_GetRelatedDeviceInstance( if (!IsValidDeviceInstanceID(pDeviceID)) return CR_INVALID_DEVINST; - /* The root device does not have a parent device or sibling devices */ - if ((ulRelationship == PNP_GET_PARENT_DEVICE_INSTANCE) || - (ulRelationship == PNP_GET_SIBLING_DEVICE_INSTANCE)) + if (ulRelationship == PNP_GET_PARENT_DEVICE_INSTANCE) + { + /* The root device does not have a parent */ + if (IsRootDeviceInstanceID(pDeviceID)) + return CR_NO_SUCH_DEVINST; + + /* Return the root device for non existing devices */ + if (!IsPresentDeviceInstanceID(pDeviceID)) + { + if ((wcslen(szRootDeviceInstanceID) + 1) > *pulLength) + { + *pulLength = wcslen(szRootDeviceInstanceID) + 1; + return CR_BUFFER_SMALL; + } + + wcscpy(pRelatedDeviceId, szRootDeviceInstanceID); + *pulLength = wcslen(szRootDeviceInstanceID) + 1; + return CR_SUCCESS; + } + } + else if (ulRelationship == PNP_GET_SIBLING_DEVICE_INSTANCE) { + /* The root device does not have siblings */ if (IsRootDeviceInstanceID(pDeviceID)) return CR_NO_SUCH_DEVINST; }
2 years, 8 months
1
0
0
0
[reactos] 03/03: [BOOTDATA] Fix some services groups + MUP driver group.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=94d144f8a577123e36bf6…
commit 94d144f8a577123e36bf611383eaa46b1e151b32 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Apr 18 02:17:44 2022 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Apr 18 02:40:34 2022 +0200 [BOOTDATA] Fix some services groups + MUP driver group. Restore MUP again back to its "Network" group. CORE-12107 This reverts commit 21fc538c (r75355), that reverted part of commit e145ed06 (r72450). In addition: noticed by Serge Gautherie (see CORE-12107): - AudioSrv belongs to "AudioGroup" (and not "Audio" that doesn't exist). - lanmanworkstation belongs to "NetworkProvider" (without a space). --- boot/bootdata/hivesys.inf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boot/bootdata/hivesys.inf b/boot/bootdata/hivesys.inf index 507f09cc7c5..7017bb41447 100644 --- a/boot/bootdata/hivesys.inf +++ b/boot/bootdata/hivesys.inf @@ -1579,7 +1579,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\swenum","Type",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","DisplayName",0x00000000,%AUDIO_SERVICE% HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","Description",0x00000000,%AUDIO_SERVICE_DESCRIPTION% HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","ErrorControl",0x00010001,0x00000000 -HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","Group",0x00000000,"Audio" +HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","Group",0x00000000,"AudioGroup" HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","ImagePath",0x00020000,"%SystemRoot%\system32\audiosrv.exe" HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","ObjectName",0x00000000,"LocalSystem" HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","Start",0x00010001,0x00000003 @@ -1674,7 +1674,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\lanmanserver\Parameters","ServiceDll",0x HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","DisplayName",0x00000000,%WORKSTATION_SERVICE% HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","Description",0x00000000,%WORKSTATION_SERVICE_DESCRIPTION% HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","Group",0x00000000,"Network Provider" +HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","Group",0x00000000,"NetworkProvider" HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","ImagePath",0x00020000,"%SystemRoot%\system32\svchost.exe -k netsvcs" HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","ObjectName",0x00000000,"LocalSystem" HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","Start",0x00010001,0x00000002 @@ -1684,7 +1684,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation\Parameters","ServiceDl ; Multiple UNC provider driver HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Description",0x00000000,"Multiple UNC Provider (MUP)" HKLM,"SYSTEM\CurrentControlSet\Services\Mup","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Group",0x00000000,"File System" +HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Group",0x00000000,"Network" HKLM,"SYSTEM\CurrentControlSet\Services\Mup","ImagePath",0x00020000,"system32\drivers\mup.sys" HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Start",0x00010001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Type",0x00010001,0x00000002
2 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200