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
May 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
31 participants
165 discussions
Start a n
N
ew thread
[reactos] 01/01: [GDI32] Fix GetObjectW() GDI_OBJECT_TYPE_BRUSH handling. (#4394)
by Victor Martinez Calvo
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b57be0a746fd9b42fed0e…
commit b57be0a746fd9b42fed0e9ac5cf88eaf222ce11d Author: Victor Martinez Calvo <vicmarcal(a)gmail.com> AuthorDate: Tue May 3 16:00:21 2022 +0200 Commit: GitHub <noreply(a)github.com> CommitDate: Tue May 3 16:00:21 2022 +0200 [GDI32] Fix GetObjectW() GDI_OBJECT_TYPE_BRUSH handling. (#4394) This fixes the last GetObjectW apitest case: ok_long(GetObjectA(hBrush, 0, &TestStruct), 0); - When "cbSize" is "0", GetObjectW shouldn't return "sizeof(LOGBRUSH)" but 0. - Rely in BRUSH::cjGetObject behavior which returns 0 when cjSize is 0. Co-authored-by: Víctor Martínez Calvo <victormartinez(a)alub.io> --- win32ss/gdi/gdi32/objects/gdiobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32ss/gdi/gdi32/objects/gdiobj.c b/win32ss/gdi/gdi32/objects/gdiobj.c index 96617881fc4..5f8d8e1f6c3 100644 --- a/win32ss/gdi/gdi32/objects/gdiobj.c +++ b/win32ss/gdi/gdi32/objects/gdiobj.c @@ -206,7 +206,7 @@ GetObjectW( break; case GDI_OBJECT_TYPE_BRUSH: - if (!lpBuffer || !cbSize) return sizeof(LOGBRUSH); + if (!lpBuffer) return sizeof(LOGBRUSH); break; case GDI_OBJECT_TYPE_BITMAP:
2 years, 7 months
1
0
0
0
[reactos] 01/01: [SHELL32] Add multiple status bar parts to the file browser (#4401)
by Russell Johnson
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3e2df36561ee2360dcbb0…
commit 3e2df36561ee2360dcbb08f59aa9837ec479351f Author: Russell Johnson <russell.johnson(a)superdark.net> AuthorDate: Tue May 3 06:52:23 2022 -0700 Commit: GitHub <noreply(a)github.com> CommitDate: Tue May 3 16:52:23 2022 +0300 [SHELL32] Add multiple status bar parts to the file browser (#4401) The file browser now has a status bar like Windows Server 2003 does. This includes the sizes of the files, as well as the location. In certain folders (Network, Desktop, etc.) the status bar is hidden. Currently it does not handle this in the same way as Windows Shell does, however it's a good first step to make it work properly. CORE-17603 Signed-off-by: Russell Johnson <russell.johnson(a)superdark.net> Reviewed-by: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> Reviewed-by: Mark Jansen <mark.jansen(a)reactos.org> Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> Reviewed-by: Giannis Adamopoulos <gadamopoulos(a)reactos.org> Reviewed-by: Stanislav Motylkov <x86corez(a)gmail.com> --- dll/win32/shell32/CDefView.cpp | 146 ++++++++++++++++++++++++---- dll/win32/shell32/folders/CDrivesFolder.cpp | 11 --- dll/win32/shell32/wine/pidl.c | 11 +++ dll/win32/shell32/wine/pidl.h | 1 + 4 files changed, 139 insertions(+), 30 deletions(-) diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index 8ee02097f55..67889f4aedc 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -2,6 +2,7 @@ * ShellView * * Copyright 1998,1999 <juergen.schmied(a)debitel.net> + * Copyright 2022 Russell Johnson <russell.johnson(a)superdark.net> * * This is the view visualizing the data provided by the shellfolder. * No direct access to data from pidls should be done from here. @@ -117,11 +118,14 @@ class CDefView : CComPtr<IContextMenu> m_pCM; BOOL m_isEditing; + BOOL m_isParentFolderSpecial; CLSID m_Category; BOOL m_Destroyed; SFVM_CUSTOMVIEWINFO_DATA m_viewinfo_data; + HICON m_hMyComputerIcon; + private: HRESULT _MergeToolbar(); BOOL _Sort(); @@ -129,6 +133,8 @@ class CDefView : HRESULT _GetSnapToGrid(); void _MoveSelectionOnAutoArrange(POINT pt); INT _FindInsertableIndexFromPoint(POINT pt); + void _HandleStatusBarResize(int width); + void _ForceStatusBarResize(); public: CDefView(); @@ -393,6 +399,7 @@ CDefView::CDefView() : m_iDragOverItem(0), m_cScrollDelay(0), m_isEditing(FALSE), + m_isParentFolderSpecial(FALSE), m_Destroyed(FALSE) { ZeroMemory(&m_FolderSettings, sizeof(m_FolderSettings)); @@ -402,6 +409,8 @@ CDefView::CDefView() : m_viewinfo_data.clrText = GetSysColor(COLOR_WINDOWTEXT); m_viewinfo_data.clrTextBack = GetSysColor(COLOR_WINDOW); m_viewinfo_data.hbmBack = NULL; + + m_hMyComputerIcon = LoadIconW(shell32_hInstance, MAKEINTRESOURCEW(IDI_SHELL_COMPUTER_DESKTOP)); } CDefView::~CDefView() @@ -505,21 +514,74 @@ void CDefView::CheckToolbar() void CDefView::UpdateStatusbar() { WCHAR szFormat[MAX_PATH] = {0}; - WCHAR szObjects[MAX_PATH] = {0}; + WCHAR szPartText[MAX_PATH] = {0}; UINT cSelectedItems; cSelectedItems = m_ListView.GetSelectedCount(); if (cSelectedItems) { LoadStringW(shell32_hInstance, IDS_OBJECTS_SELECTED, szFormat, _countof(szFormat)); - StringCchPrintfW(szObjects, MAX_PATH, szFormat, cSelectedItems); + StringCchPrintfW(szPartText, _countof(szPartText), szFormat, cSelectedItems); } else { LoadStringW(shell32_hInstance, IDS_OBJECTS, szFormat, _countof(szFormat)); - StringCchPrintfW(szObjects, MAX_PATH, szFormat, m_ListView.GetItemCount()); + StringCchPrintfW(szPartText, _countof(szPartText), szFormat, m_ListView.GetItemCount()); + } + + LRESULT lResult; + m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETTEXT, 0, (LPARAM)szPartText, &lResult); + + /* Don't bother with the extra processing if we only have one StatusBar part. */ + if (!m_isParentFolderSpecial) + { + DWORD uTotalFileSize = 0; + WORD uFileFlags = LVNI_ALL; + LPARAM pIcon = NULL; + INT nItem = -1; + bool bIsOnlyFoldersSelected = true; + + /* If we have something selected then only count selected file sizes. */ + if (cSelectedItems) + { + uFileFlags = LVNI_SELECTED; + } + + while ((nItem = m_ListView.GetNextItem(nItem, uFileFlags)) >= 0) + { + PCUITEMID_CHILD pidl = _PidlByItem(nItem); + + uTotalFileSize += _ILGetFileSize(pidl, NULL, 0); + + if (!_ILIsFolder(pidl)) + { + bIsOnlyFoldersSelected = false; + } + } + + /* Don't show the file size text if there is 0 bytes in the folder + * OR we only have folders selected. */ + if ((cSelectedItems && !bIsOnlyFoldersSelected) || uTotalFileSize) + { + StrFormatByteSizeW(uTotalFileSize, szPartText, _countof(szPartText)); + } + else + { + *szPartText = 0; + } + + m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETTEXT, 1, (LPARAM)szPartText, &lResult); + + /* If we are in a Recycle Bin folder then show no text for the location part. */ + if (!_ILIsBitBucket(m_pidlParent)) + { + LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szPartText, _countof(szPartText)); + pIcon = (LPARAM)m_hMyComputerIcon; + } + + m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETICON, 2, pIcon, &lResult); + m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETTEXT, 2, (LPARAM)szPartText, &lResult); } - m_pShellBrowser->SetStatusTextSB(szObjects); } /********************************************************** @@ -1196,6 +1258,21 @@ LRESULT CDefView::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl m_hAccel = LoadAcceleratorsW(shell32_hInstance, MAKEINTRESOURCEW(IDA_SHELLVIEW)); + BOOL bPreviousParentSpecial = m_isParentFolderSpecial; + + /* A folder is special if it is the Desktop folder, + * a network folder, or a Control Panel folder. */ + m_isParentFolderSpecial = _ILIsDesktop(m_pidlParent) || _ILIsNetHood(m_pidlParent) + || _ILIsControlPanel(ILFindLastID(m_pidlParent)); + + /* Only force StatusBar part refresh if the state + * changed from the previous folder. */ + if (bPreviousParentSpecial != m_isParentFolderSpecial) + { + /* This handles changing StatusBar parts. */ + _ForceStatusBarResize(); + } + UpdateStatusbar(); return S_OK; @@ -1645,6 +1722,9 @@ LRESULT CDefView::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled _DoFolderViewCB(SFVM_SIZE, 0, 0); + _HandleStatusBarResize(wWidth); + UpdateStatusbar(); + return 0; } @@ -2432,10 +2512,6 @@ HRESULT WINAPI CDefView::EnableModeless(BOOL fEnable) HRESULT WINAPI CDefView::UIActivate(UINT uState) { - // CHAR szName[MAX_PATH]; - LRESULT lResult; - int nPartArray[1] = { -1}; - TRACE("(%p)->(state=%x) stub\n", this, uState); /* don't do anything if the state isn't really changing */ @@ -2450,18 +2526,10 @@ HRESULT WINAPI CDefView::UIActivate(UINT uState) /* only do This if we are active */ if (uState != SVUIA_DEACTIVATE) { + _ForceStatusBarResize(); - /* - GetFolderPath is not a method of IShellFolder - IShellFolder_GetFolderPath( m_pSFParent, szName, sizeof(szName) ); - */ - /* set the number of parts */ - m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, 1, (LPARAM)nPartArray, &lResult); - - /* set the text for the parts */ - /* - m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETTEXTA, 0, (LPARAM)szName, &lResult); - */ + /* Set the text for the status bar */ + UpdateStatusbar(); } return S_OK; @@ -3503,6 +3571,46 @@ INT CDefView::_FindInsertableIndexFromPoint(POINT pt) return nCount; } +void CDefView::_HandleStatusBarResize(int nWidth) +{ + LRESULT lResult; + + if (m_isParentFolderSpecial) + { + int nPartArray[] = {-1}; + m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, _countof(nPartArray), (LPARAM)nPartArray, &lResult); + return; + } + + int nFileSizePartLength = 125; + const int nLocationPartLength = 150; + const int nRightPartsLength = nFileSizePartLength + nLocationPartLength; + int nObjectsPartLength = nWidth - nRightPartsLength; + + /* If the window is small enough just divide each part into thirds + * This is the behavior of Windows Server 2003. */ + if (nObjectsPartLength <= nLocationPartLength) + nObjectsPartLength = nFileSizePartLength = nWidth / 3; + + int nPartArray[] = {nObjectsPartLength, nObjectsPartLength + nFileSizePartLength, -1}; + + m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, _countof(nPartArray), (LPARAM)nPartArray, &lResult); +} + +void CDefView::_ForceStatusBarResize() +{ + /* Get the handle for the status bar */ + HWND fStatusBar; + m_pShellBrowser->GetControlWindow(FCW_STATUS, &fStatusBar); + + /* Get the size of our status bar */ + RECT statusBarSize; + ::GetWindowRect(fStatusBar, &statusBarSize); + + /* Resize the status bar */ + _HandleStatusBarResize(statusBarSize.right - statusBarSize.left); +} + typedef CSimpleMap<LPARAM, INT> CLParamIndexMap; static INT CALLBACK diff --git a/dll/win32/shell32/folders/CDrivesFolder.cpp b/dll/win32/shell32/folders/CDrivesFolder.cpp index a64182e1dc9..fe5e8f5bb38 100644 --- a/dll/win32/shell32/folders/CDrivesFolder.cpp +++ b/dll/win32/shell32/folders/CDrivesFolder.cpp @@ -819,17 +819,6 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO return hr; } -static BOOL _ILIsControlPanel(LPCITEMIDLIST pidl) -{ - GUID *guid = _ILGetGUIDPointer(pidl); - - TRACE("(%p)\n", pidl); - - if (guid) - return IsEqualIID(*guid, CLSID_ControlPanel); - return FALSE; -} - /************************************************************************** * CDrivesFolder::GetAttributesOf */ diff --git a/dll/win32/shell32/wine/pidl.c b/dll/win32/shell32/wine/pidl.c index 1f27557db9b..2ee8c4650fc 100644 --- a/dll/win32/shell32/wine/pidl.c +++ b/dll/win32/shell32/wine/pidl.c @@ -1917,6 +1917,17 @@ BOOL _ILIsNetHood(LPCITEMIDLIST pidl) return FALSE; } +BOOL _ILIsControlPanel(LPCITEMIDLIST pidl) +{ + IID *iid = _ILGetGUIDPointer(pidl); + + TRACE("(%p)\n", pidl); + + if (iid) + return IsEqualIID(iid, &CLSID_ControlPanel); + return FALSE; +} + BOOL _ILIsMyComputer(LPCITEMIDLIST pidl) { REFIID iid = _ILGetGUIDPointer(pidl); diff --git a/dll/win32/shell32/wine/pidl.h b/dll/win32/shell32/wine/pidl.h index 7e8c5200df9..e6e0bd6425e 100644 --- a/dll/win32/shell32/wine/pidl.h +++ b/dll/win32/shell32/wine/pidl.h @@ -239,6 +239,7 @@ BOOL _ILIsMyComputer (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN; BOOL _ILIsMyDocuments (LPCITEMIDLIST pidl); BOOL _ILIsBitBucket (LPCITEMIDLIST pidl); BOOL _ILIsNetHood (LPCITEMIDLIST pidl); +BOOL _ILIsControlPanel (LPCITEMIDLIST pidl); #endif BOOL _ILIsDrive (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN; BOOL _ILIsFolder (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN;
2 years, 7 months
1
0
0
0
[reactos] 01/01: [NTUSER] Fix UserDestroyInputContet (again and again) (#4482)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2ef605d428d9057c98faa…
commit 2ef605d428d9057c98faa9e034c6b47dae520263 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue May 3 10:17:30 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue May 3 10:17:30 2022 +0900 [NTUSER] Fix UserDestroyInputContet (again and again) (#4482) Add call of UserMarkObjectDestroy. Fix hung-up. CORE-11700 --- win32ss/user/ntuser/ime.c | 1 + 1 file changed, 1 insertion(+) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index 88c484dce82..966e4d0e5d0 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -1468,6 +1468,7 @@ BOOLEAN UserDestroyInputContext(PVOID Object) if (!pIMC) return TRUE; + UserMarkObjectDestroy(pIMC); UserDeleteObject(UserHMGetHandle(pIMC), TYPE_INPUTCONTEXT); return TRUE; }
2 years, 7 months
1
0
0
0
[reactos] 01/01: [NTUSER] Fix UserDestroyInputContext (again) (#4476)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4a748a3a97ebf153d8826…
commit 4a748a3a97ebf153d8826aa47a2dadfc3e374498 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue May 3 03:43:26 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue May 3 03:43:26 2022 +0900 [NTUSER] Fix UserDestroyInputContext (again) (#4476) Fix the HIMC handle leak. CORE-11700 --- win32ss/user/ntuser/ime.c | 7 +++++-- win32ss/user/ntuser/object.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index f8cd3778512..88c484dce82 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -1465,10 +1465,11 @@ VOID UserFreeInputContext(PVOID Object) BOOLEAN UserDestroyInputContext(PVOID Object) { PIMC pIMC = Object; - if (!pIMC || !UserMarkObjectDestroy(pIMC)) + if (!pIMC) return TRUE; - return UserDeleteObject(UserHMGetHandle(pIMC), TYPE_INPUTCONTEXT); + UserDeleteObject(UserHMGetHandle(pIMC), TYPE_INPUTCONTEXT); + return TRUE; } // Win: DestroyInputContext @@ -1560,6 +1561,7 @@ PIMC FASTCALL UserCreateInputContext(ULONG_PTR dwClientImcData) // Release the extra reference (UserCreateObject added 2 references). UserDereferenceObject(pIMC); + ASSERT(pIMC->head.cLockObj == 1); if (dwClientImcData) // Non-first time. { @@ -1572,6 +1574,7 @@ PIMC FASTCALL UserCreateInputContext(ULONG_PTR dwClientImcData) // Add the first one (default) to the list. UserAssignmentLock((PVOID*)&pti->spDefaultImc, pIMC); pIMC->pImcNext = NULL; + ASSERT(pIMC->head.cLockObj == 2); // UserAssignmentUnlock'ed at ExitThreadCallback } pIMC->dwClientImcData = dwClientImcData; // Set it. diff --git a/win32ss/user/ntuser/object.c b/win32ss/user/ntuser/object.c index 492d4ab2b6b..26c407f0b56 100644 --- a/win32ss/user/ntuser/object.c +++ b/win32ss/user/ntuser/object.c @@ -582,6 +582,7 @@ UserCreateObject( PUSER_HANDLE_TABLE ht, return Object; } +// Win: HMMarkObjectDestroy BOOL FASTCALL UserMarkObjectDestroy(PVOID Object)
2 years, 7 months
1
0
0
0
[reactos] 01/01: [WIN32SS] Improve selection of 'closest graphic mode'
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=14d50cc6c088a5b8bf14c…
commit 14d50cc6c088a5b8bf14c84b22ce44e18e9b6b1f Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sun May 1 14:35:02 2022 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Sun May 1 16:36:48 2022 +0200 [WIN32SS] Improve selection of 'closest graphic mode' If color depth is not provided (in registry), try to find a 32 bit one. If not found, fall back to first available graphic mode. CORE-18027 --- win32ss/gdi/eng/ldevobj.c | 98 ++++++++++++++++++++++++++++++----------------- 1 file changed, 62 insertions(+), 36 deletions(-) diff --git a/win32ss/gdi/eng/ldevobj.c b/win32ss/gdi/eng/ldevobj.c index cf618635735..cb6a8bbbe32 100644 --- a/win32ss/gdi/eng/ldevobj.c +++ b/win32ss/gdi/eng/ldevobj.c @@ -669,6 +669,31 @@ LDEVOBJ_bBuildDevmodeList( return TRUE; } +static +BOOL +LDEVOBJ_bGetClosestMode( + _Inout_ PGRAPHICS_DEVICE pGraphicsDevice, + _In_ PDEVMODEW RequestedMode, + _Out_ PDEVMODEW *pSelectedMode) +{ + if (pGraphicsDevice->cDevModes == 0) + return FALSE; + + /* Search a 32bit mode (if not already specified) */ + if (!(RequestedMode->dmFields & DM_BITSPERPEL)) + { + RequestedMode->dmBitsPerPel = 32; + RequestedMode->dmFields |= DM_BITSPERPEL; + } + if (LDEVOBJ_bProbeAndCaptureDevmode(pGraphicsDevice, RequestedMode, pSelectedMode, FALSE)) + return TRUE; + + /* Fall back to first mode */ + WARN("Fall back to first available mode\n"); + *pSelectedMode = pGraphicsDevice->pDevModeList[0].pdm; + return TRUE; +} + BOOL LDEVOBJ_bProbeAndCaptureDevmode( _Inout_ PGRAPHICS_DEVICE pGraphicsDevice, @@ -683,46 +708,47 @@ LDEVOBJ_bProbeAndCaptureDevmode( if (!LDEVOBJ_bBuildDevmodeList(pGraphicsDevice)) return FALSE; - /* Search if requested mode exists */ - for (i = 0; i < pGraphicsDevice->cDevModes; i++) + if (bSearchClosestMode) { - pdmCurrent = pGraphicsDevice->pDevModeList[i].pdm; - - /* Compare asked DEVMODE fields - * Only compare those that are valid in both DEVMODE structs */ - dwFields = pdmCurrent->dmFields & RequestedMode->dmFields; - - /* For now, we only need those */ - if ((dwFields & DM_BITSPERPEL) && - (pdmCurrent->dmBitsPerPel != RequestedMode->dmBitsPerPel)) continue; - if ((dwFields & DM_PELSWIDTH) && - (pdmCurrent->dmPelsWidth != RequestedMode->dmPelsWidth)) continue; - if ((dwFields & DM_PELSHEIGHT) && - (pdmCurrent->dmPelsHeight != RequestedMode->dmPelsHeight)) continue; - if ((dwFields & DM_DISPLAYFREQUENCY) && - (pdmCurrent->dmDisplayFrequency != RequestedMode->dmDisplayFrequency)) continue; - - pdmSelected = pdmCurrent; - break; + /* Search the closest mode */ + if (!LDEVOBJ_bGetClosestMode(pGraphicsDevice, RequestedMode, &pdmSelected)) + return FALSE; + ASSERT(pdmSelected); } - - if (!pdmSelected) + else { - WARN("Requested mode not found (%dx%dx%d %d Hz)\n", - RequestedMode->dmFields & DM_PELSWIDTH ? RequestedMode->dmPelsWidth : 0, - RequestedMode->dmFields & DM_PELSHEIGHT ? RequestedMode->dmPelsHeight : 0, - RequestedMode->dmFields & DM_BITSPERPEL ? RequestedMode->dmBitsPerPel : 0, - RequestedMode->dmFields & DM_DISPLAYFREQUENCY ? RequestedMode->dmDisplayFrequency : 0); - if (!bSearchClosestMode || pGraphicsDevice->cDevModes == 0) - return FALSE; + /* Search if requested mode exists */ + for (i = 0; i < pGraphicsDevice->cDevModes; i++) + { + pdmCurrent = pGraphicsDevice->pDevModeList[i].pdm; + + /* Compare asked DEVMODE fields + * Only compare those that are valid in both DEVMODE structs */ + dwFields = pdmCurrent->dmFields & RequestedMode->dmFields; + + /* For now, we only need those */ + if ((dwFields & DM_BITSPERPEL) && + (pdmCurrent->dmBitsPerPel != RequestedMode->dmBitsPerPel)) continue; + if ((dwFields & DM_PELSWIDTH) && + (pdmCurrent->dmPelsWidth != RequestedMode->dmPelsWidth)) continue; + if ((dwFields & DM_PELSHEIGHT) && + (pdmCurrent->dmPelsHeight != RequestedMode->dmPelsHeight)) continue; + if ((dwFields & DM_DISPLAYFREQUENCY) && + (pdmCurrent->dmDisplayFrequency != RequestedMode->dmDisplayFrequency)) continue; + + pdmSelected = pdmCurrent; + break; + } - /* FIXME: need to search the closest mode instead of taking the first one */ - pdmSelected = pGraphicsDevice->pDevModeList[0].pdm; - WARN("Replacing it by %dx%dx%d %d Hz\n", - pdmSelected->dmFields & DM_PELSWIDTH ? pdmSelected->dmPelsWidth : 0, - pdmSelected->dmFields & DM_PELSHEIGHT ? pdmSelected->dmPelsHeight : 0, - pdmSelected->dmFields & DM_BITSPERPEL ? pdmSelected->dmBitsPerPel : 0, - pdmSelected->dmFields & DM_DISPLAYFREQUENCY ? pdmSelected->dmDisplayFrequency : 0); + if (!pdmSelected) + { + WARN("Requested mode not found (%dx%dx%d %d Hz)\n", + RequestedMode->dmFields & DM_PELSWIDTH ? RequestedMode->dmPelsWidth : 0, + RequestedMode->dmFields & DM_PELSHEIGHT ? RequestedMode->dmPelsHeight : 0, + RequestedMode->dmFields & DM_BITSPERPEL ? RequestedMode->dmBitsPerPel : 0, + RequestedMode->dmFields & DM_DISPLAYFREQUENCY ? RequestedMode->dmDisplayFrequency : 0); + return FALSE; + } } /* Allocate memory for output */
2 years, 7 months
1
0
0
0
← Newer
1
...
14
15
16
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