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
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2020
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
25 participants
382 discussions
Start a n
N
ew thread
[reactos] 01/01: [SDK][INCLUDE] Add SHGetValueGoodBootA/W prototypes
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=efde1f42685098d04743f…
commit efde1f42685098d04743f8484f718d6db316ffab Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Sep 18 17:22:16 2020 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Fri Sep 18 17:22:16 2020 +0900 [SDK][INCLUDE] Add SHGetValueGoodBootA/W prototypes --- sdk/include/reactos/shlwapi_undoc.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h index f2b48278973..7117d1c190b 100644 --- a/sdk/include/reactos/shlwapi_undoc.h +++ b/sdk/include/reactos/shlwapi_undoc.h @@ -123,6 +123,11 @@ DWORD WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr, PVOID WINAPI SHLockSharedEx(HANDLE hData, DWORD dwProcessId, BOOL bWriteAccess); +DWORD WINAPI SHGetValueGoodBootA(HKEY hkey, LPCSTR pSubKey, LPCSTR pValue, + LPDWORD pwType, LPVOID pvData, LPDWORD pbData); +DWORD WINAPI SHGetValueGoodBootW(HKEY hkey, LPCWSTR pSubKey, LPCWSTR pValue, + LPDWORD pwType, LPVOID pvData, LPDWORD pbData); + int WINAPIV ShellMessageBoxWrapW(
4 years, 1 month
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Add SHAnsiToUnicodeCP and SHUnicodeToAnsiCP prototypes
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=733d6cebeda73e800b659…
commit 733d6cebeda73e800b65951d77f1f7a68d2d2b6b Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Sep 18 17:09:29 2020 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Fri Sep 18 17:09:29 2020 +0900 [SDK][INCLUDE] Add SHAnsiToUnicodeCP and SHUnicodeToAnsiCP prototypes --- sdk/include/reactos/shlwapi_undoc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h index a56ed24ed9d..f2b48278973 100644 --- a/sdk/include/reactos/shlwapi_undoc.h +++ b/sdk/include/reactos/shlwapi_undoc.h @@ -118,6 +118,9 @@ HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObj DWORD WINAPI SHAnsiToUnicode(LPCSTR lpSrcStr, LPWSTR lpDstStr, INT iLen); INT WINAPI SHUnicodeToAnsi(LPCWSTR lpSrcStr, LPSTR lpDstStr, INT iLen); +DWORD WINAPI SHAnsiToUnicodeCP(DWORD dwCp, LPCSTR lpSrcStr, LPWSTR lpDstStr, int iLen); +DWORD WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr, int dstlen); + PVOID WINAPI SHLockSharedEx(HANDLE hData, DWORD dwProcessId, BOOL bWriteAccess); int
4 years, 1 month
1
0
0
0
[reactos] 01/01: [CMD] HISTORY: Fix command output (missing linefeed) (#3205)
by Kyle Katarn
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ac2b2ef8c7d74a664f4de…
commit ac2b2ef8c7d74a664f4de8dce9ebc7f2deef57bb Author: Kyle Katarn <contact(a)kcsoftwares.com> AuthorDate: Fri Sep 18 00:17:08 2020 +0200 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Sep 18 00:17:08 2020 +0200 [CMD] HISTORY: Fix command output (missing linefeed) (#3205) CORE-12603 Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> --- base/shell/cmd/history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/shell/cmd/history.c b/base/shell/cmd/history.c index 3c709a7ecf0..d0f3f40c5c1 100644 --- a/base/shell/cmd/history.c +++ b/base/shell/cmd/history.c @@ -113,7 +113,7 @@ INT CommandHistory(LPTSTR param) else { for (h_tmp = Top->prev; h_tmp != Bottom; h_tmp = h_tmp->prev) - ConErrPuts(h_tmp->string); + ConOutPrintf(_T("%s\n"), h_tmp->string); } return 0; }
4 years, 1 month
1
0
0
0
[reactos] 01/01: [KERNEL32] Improve SetComputerNameExW (#3171)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=378b26ce2714c8039e239…
commit 378b26ce2714c8039e23932e0fa4e365c149c106 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Sep 17 23:51:47 2020 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Sep 17 23:51:47 2020 +0900 [KERNEL32] Improve SetComputerNameExW (#3171) Reduce failures of kernel32_apitest SetComputerNameExW testcase and improve SetComputerNameExW. --- dll/win32/kernel32/client/compname.c | 96 ++++++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 25 deletions(-) diff --git a/dll/win32/kernel32/client/compname.c b/dll/win32/kernel32/client/compname.c index 46d05e78d32..2b4b335d4f7 100644 --- a/dll/win32/kernel32/client/compname.c +++ b/dll/win32/kernel32/client/compname.c @@ -21,16 +21,19 @@ * PROJECT: ReactOS system libraries * PURPOSE: Computer name functions * FILE: dll/win32/kernel32/client/compname.c - * PROGRAMER: Eric Kohl + * PROGRAMERS: Eric Kohl + * Katayama Hirofumi MZ */ /* INCLUDES ******************************************************************/ #include <k32.h> +#include <windns.h> #define NDEBUG #include <debug.h> +typedef NTSTATUS (WINAPI *FN_DnsValidateName_W)(LPCWSTR, DNS_NAME_FORMAT); /* FUNCTIONS *****************************************************************/ @@ -451,6 +454,31 @@ GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize) return ret; } +static +BOOL +BaseVerifyDnsName(LPCWSTR lpDnsName) +{ + HINSTANCE hDNSAPI; + FN_DnsValidateName_W fnValidate; + NTSTATUS Status; + BOOL ret = FALSE; + + hDNSAPI = LoadLibraryW(L"dnsapi.dll"); + if (hDNSAPI == NULL) + return FALSE; + + fnValidate = (FN_DnsValidateName_W)GetProcAddress(hDNSAPI, "DnsValidateName_W"); + if (fnValidate) + { + Status = (*fnValidate)(lpDnsName, DnsNameHostnameLabel); + if (Status == STATUS_SUCCESS || Status == DNS_ERROR_NON_RFC_NAME) + ret = TRUE; + } + + FreeLibrary(hDNSAPI); + + return ret; +} /* * @implemented @@ -460,39 +488,56 @@ BOOL IsValidComputerName(COMPUTER_NAME_FORMAT NameType, LPCWSTR lpComputerName) { - PWCHAR p; - ULONG Length; + size_t Length; + static const WCHAR s_szInvalidChars[] = + L"\"/\\[]:|<>+=;,?" + L"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F" + L"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - /* FIXME: do verification according to NameType */ + if (lpComputerName == NULL) + return FALSE; - Length = 0; - p = (PWCHAR)lpComputerName; +#define MAX_COMPUTER_NAME_EX 64 + /* Get string length */ + if (!NT_SUCCESS(RtlStringCchLengthW(lpComputerName, MAX_COMPUTER_NAME_EX + 1, &Length))) + return FALSE; +#undef MAX_COMPUTER_NAME_EX - while (*p != 0) - { - if (!(iswctype(*p, _ALPHA | _DIGIT) || *p == L'!' || *p == L'@' || *p == L'#' || - *p == L'$' || *p == L'%' || *p == L'^' || *p == L'&' || *p == L'\'' || - *p == L')' || *p == L'(' || *p == L'.' || *p == L'-' || *p == L'_' || - *p == L'{' || *p == L'}' || *p == L'~')) - return FALSE; + /* An empty name is invalid, except a DNS name */ + if (Length == 0 && NameType != ComputerNamePhysicalDnsDomain) + return FALSE; - Length++; - p++; + /* Leading or trailing spaces are invalid */ + if (Length > 0 && + (lpComputerName[0] == L' ' || lpComputerName[Length - 1] == L' ')) + { + return FALSE; } - if (NameType == ComputerNamePhysicalDnsDomain) - return TRUE; - - if (Length == 0) + /* Check whether the name contains any invalid character */ + if (wcscspn(lpComputerName, s_szInvalidChars) < Length) return FALSE; - if (NameType == ComputerNamePhysicalNetBIOS && - Length > MAX_COMPUTERNAME_LENGTH) - return FALSE; + switch (NameType) + { + case ComputerNamePhysicalNetBIOS: + if (Length > MAX_COMPUTERNAME_LENGTH) + return FALSE; + return TRUE; - return TRUE; -} + case ComputerNamePhysicalDnsDomain: + /* An empty DNS name is valid */ + if (Length != 0) + return BaseVerifyDnsName(lpComputerName); + return TRUE; + + case ComputerNamePhysicalDnsHostname: + return BaseVerifyDnsName(lpComputerName); + default: + return FALSE; + } +} static BOOL @@ -547,6 +592,7 @@ SetComputerNameToRegistry(LPCWSTR RegistryKey, NtFlushKey(KeyHandle); NtClose(KeyHandle); + SetLastError(ERROR_SUCCESS); return TRUE; } @@ -637,7 +683,7 @@ SetComputerNameExW(COMPUTER_NAME_FORMAT NameType, lpBuffer); default: - SetLastError (ERROR_INVALID_PARAMETER); + SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } }
4 years, 1 month
1
0
0
0
[reactos] 01/01: [COMCTL32][SHELL32] Fix arrow keys and reordering on ListView (#3162)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8c87489a43ce04b4f8a83…
commit 8c87489a43ce04b4f8a83bf75a5c1712a315146f Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Sep 17 22:18:34 2020 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Sep 17 22:18:34 2020 +0900 [COMCTL32][SHELL32] Fix arrow keys and reordering on ListView (#3162) - Disable special auto-arrange codes in LISTVIEW_GetNextItem function. - Add auto-arrange reordering codes on CDefView. CORE-16875 --- dll/win32/comctl32/listview.c | 10 +++ dll/win32/shell32/CDefView.cpp | 192 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 191 insertions(+), 11 deletions(-) diff --git a/dll/win32/comctl32/listview.c b/dll/win32/comctl32/listview.c index e26457b48dc..4119c27a90a 100644 --- a/dll/win32/comctl32/listview.c +++ b/dll/win32/comctl32/listview.c @@ -7449,7 +7449,9 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF UINT uMask = 0; LVFINDINFOW lvFindInfo; INT nCountPerColumn; +#ifndef __REACTOS__ INT nCountPerRow; +#endif INT i; TRACE("nItem=%d, uFlags=%x, nItemCount=%d\n", nItem, uFlags, infoPtr->nItemCount); @@ -7490,6 +7492,7 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF } else { +#ifndef __REACTOS__ /* Special case for autoarrange - move 'til the top of a list */ if (is_autoarrange(infoPtr)) { @@ -7502,6 +7505,7 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF } return -1; } +#endif lvFindInfo.flags = LVFI_NEARESTXY; lvFindInfo.vkDirection = VK_UP; LISTVIEW_GetItemPosition(infoPtr, nItem, &lvFindInfo.pt); @@ -7525,6 +7529,7 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF } else { +#ifndef __REACTOS__ /* Special case for autoarrange - move 'til the bottom of a list */ if (is_autoarrange(infoPtr)) { @@ -7537,6 +7542,7 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF } return -1; } +#endif lvFindInfo.flags = LVFI_NEARESTXY; lvFindInfo.vkDirection = VK_DOWN; LISTVIEW_GetItemPosition(infoPtr, nItem, &lvFindInfo.pt); @@ -7561,6 +7567,7 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF } else if ((infoPtr->uView == LV_VIEW_SMALLICON) || (infoPtr->uView == LV_VIEW_ICON)) { +#ifndef __REACTOS__ /* Special case for autoarrange - move 'til the beginning of a row */ if (is_autoarrange(infoPtr)) { @@ -7573,6 +7580,7 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF } return -1; } +#endif lvFindInfo.flags = LVFI_NEARESTXY; lvFindInfo.vkDirection = VK_LEFT; LISTVIEW_GetItemPosition(infoPtr, nItem, &lvFindInfo.pt); @@ -7597,6 +7605,7 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF } else if ((infoPtr->uView == LV_VIEW_SMALLICON) || (infoPtr->uView == LV_VIEW_ICON)) { +#ifndef __REACTOS__ /* Special case for autoarrange - move 'til the end of a row */ if (is_autoarrange(infoPtr)) { @@ -7609,6 +7618,7 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF } return -1; } +#endif lvFindInfo.flags = LVFI_NEARESTXY; lvFindInfo.vkDirection = VK_RIGHT; LISTVIEW_GetItemPosition(infoPtr, nItem, &lvFindInfo.pt); diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index 6495b08610e..b3ed556acf4 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -57,6 +57,20 @@ typedef struct to call TrackPopupMenu and let it use the 0 value as an indication that the menu was canceled */ #define CONTEXT_MENU_BASE_ID 1 +/* Convert client coordinates to listview coordinates */ +static void +ClientToListView(HWND hwndLV, POINT *ppt) +{ + POINT Origin; + + /* FIXME: LVM_GETORIGIN is broken. See CORE-17266 */ + if (!ListView_GetOrigin(hwndLV, &Origin)) + return; + + ppt->x += Origin.x; + ppt->y += Origin.y; +} + class CDefView : public CWindowImpl<CDefView, CWindow, CControlWinTraits>, public CComObjectRootEx<CComMultiThreadModelNoCS>, @@ -117,6 +131,8 @@ class CDefView : BOOL _Sort(); HRESULT _DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM lParam); HRESULT _GetSnapToGrid(); + void _MoveSelectionOnAutoArrange(POINT pt); + INT _FindInsertableIndexFromPoint(POINT pt); public: CDefView(); @@ -2019,6 +2035,7 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl m_pSourceDataObject = pda; m_ptFirstMousePos = params->ptAction; ClientToScreen(&m_ptFirstMousePos); + ::ClientToListView(m_ListView, &m_ptFirstMousePos); HIMAGELIST big_icons, small_icons; Shell_GetImageLists(&big_icons, &small_icons); @@ -3263,6 +3280,7 @@ HRESULT CDefView::drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEf } m_ptLastMousePos = htinfo.pt; + ::ClientToListView(m_ListView, &m_ptLastMousePos); /* We need to check if we drag the selection over itself */ if (lResult != -1 && m_pSourceDataObject.p != NULL) @@ -3378,6 +3396,150 @@ HRESULT WINAPI CDefView::DragLeave() return S_OK; } +INT CDefView::_FindInsertableIndexFromPoint(POINT pt) +{ + RECT rcBound; + INT i, nCount = m_ListView.GetItemCount(); + DWORD dwSpacing; + INT dx, dy; + BOOL bSmall = ((m_ListView.GetStyle() & LVS_TYPEMASK) != LVS_ICON); + + /* FIXME: LVM_GETORIGIN is broken. See CORE-17266 */ + pt.x += m_ListView.GetScrollPos(SB_HORZ); + pt.y += m_ListView.GetScrollPos(SB_VERT); + + if (m_ListView.GetStyle() & LVS_ALIGNLEFT) + { + // vertically + for (i = 0; i < nCount; ++i) + { + dwSpacing = ListView_GetItemSpacing(m_ListView, bSmall); + dx = LOWORD(dwSpacing); + dy = HIWORD(dwSpacing); + ListView_GetItemRect(m_ListView, i, &rcBound, LVIR_SELECTBOUNDS); + rcBound.right = rcBound.left + dx; + rcBound.bottom = rcBound.top + dy; + if (pt.x < rcBound.right && pt.y < (rcBound.top + rcBound.bottom) / 2) + { + return i; + } + } + for (i = nCount - 1; i >= 0; --i) + { + ListView_GetItemRect(m_ListView, i, &rcBound, LVIR_SELECTBOUNDS); + if (rcBound.left < pt.x && rcBound.top < pt.y) + { + return i + 1; + } + } + } + else + { + // horizontally + for (i = 0; i < nCount; ++i) + { + dwSpacing = ListView_GetItemSpacing(m_ListView, bSmall); + dx = LOWORD(dwSpacing); + dy = HIWORD(dwSpacing); + ListView_GetItemRect(m_ListView, i, &rcBound, LVIR_SELECTBOUNDS); + rcBound.right = rcBound.left + dx; + rcBound.bottom = rcBound.top + dy; + if (pt.y < rcBound.bottom && pt.x < rcBound.left) + { + return i; + } + if (pt.y < rcBound.bottom && pt.x < rcBound.right) + { + return i + 1; + } + } + for (i = nCount - 1; i >= 0; --i) + { + ListView_GetItemRect(m_ListView, i, &rcBound, LVIR_SELECTBOUNDS); + if (rcBound.left < pt.x && rcBound.top < pt.y) + { + return i + 1; + } + } + } + + return nCount; +} + +typedef CSimpleMap<LPARAM, INT> CLParamIndexMap; + +static INT CALLBACK +SelectionMoveCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) +{ + CLParamIndexMap *pmap = (CLParamIndexMap *)lParamSort; + INT i1 = pmap->Lookup(lParam1), i2 = pmap->Lookup(lParam2); + if (i1 < i2) + return -1; + if (i1 > i2) + return 1; + return 0; +} + +void CDefView::_MoveSelectionOnAutoArrange(POINT pt) +{ + // get insertable index from position + INT iPosition = _FindInsertableIndexFromPoint(pt); + + // create identity mapping of indexes + CSimpleArray<INT> array; + INT nCount = m_ListView.GetItemCount(); + for (INT i = 0; i < nCount; ++i) + { + array.Add(i); + } + + // re-ordering mapping + INT iItem = -1; + while ((iItem = m_ListView.GetNextItem(iItem, LVNI_SELECTED)) >= 0) + { + INT iFrom = iItem, iTo = iPosition; + if (iFrom < iTo) + --iTo; + if (iFrom >= nCount) + iFrom = nCount - 1; + if (iTo >= nCount) + iTo = nCount - 1; + + // shift indexes by swapping (like a bucket relay) + if (iFrom < iTo) + { + for (INT i = iFrom; i < iTo; ++i) + { + // swap array[i] and array[i + 1] + INT tmp = array[i]; + array[i] = array[i + 1]; + array[i + 1] = tmp; + } + } + else + { + for (INT i = iFrom; i > iTo; --i) + { + // swap array[i] and array[i - 1] + INT tmp = array[i]; + array[i] = array[i - 1]; + array[i - 1] = tmp; + } + } + } + + // create mapping (ListView's lParam to index) from array + CLParamIndexMap map; + for (INT i = 0; i < nCount; ++i) + { + LPARAM lParam = m_ListView.GetItemData(array[i]); + map.Add(lParam, i); + } + + // finally sort + m_ListView.SortItems(SelectionMoveCompareFunc, &map); +} + HRESULT WINAPI CDefView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) { ImageList_DragLeave(m_hWnd); @@ -3393,23 +3555,31 @@ HRESULT WINAPI CDefView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINT m_pCurDropTarget.Release(); } - /* Restore the selection */ - m_ListView.SetItemState(-1, 0, LVIS_SELECTED); - for (UINT i = 0 ; i < m_cidl; i++) - SelectItem(m_apidl[i], SVSI_SELECT); + POINT ptDrop = { pt.x, pt.y }; + ::ScreenToClient(m_ListView, &ptDrop); + ::ClientToListView(m_ListView, &ptDrop); + m_ptLastMousePos = ptDrop; - /* Reposition the items */ - int lvIndex = -1; - while ((lvIndex = m_ListView.GetNextItem(lvIndex, LVNI_SELECTED)) > -1) + m_ListView.SetRedraw(FALSE); + if (m_ListView.GetStyle() & LVS_AUTOARRANGE) + { + _MoveSelectionOnAutoArrange(m_ptLastMousePos); + } + else { POINT ptItem; - if (m_ListView.GetItemPosition(lvIndex, &ptItem)) + INT iItem = -1; + while ((iItem = m_ListView.GetNextItem(iItem, LVNI_SELECTED)) >= 0) { - ptItem.x += pt.x - m_ptFirstMousePos.x; - ptItem.y += pt.y - m_ptFirstMousePos.y; - m_ListView.SetItemPosition(lvIndex, &ptItem); + if (m_ListView.GetItemPosition(iItem, &ptItem)) + { + ptItem.x += m_ptLastMousePos.x - m_ptFirstMousePos.x; + ptItem.y += m_ptLastMousePos.y - m_ptFirstMousePos.y; + m_ListView.SetItemPosition(iItem, &ptItem); + } } } + m_ListView.SetRedraw(TRUE); } else if (m_pCurDropTarget) {
4 years, 1 month
1
0
0
0
[reactos] 179/179: [DBGHELP_WINETEST] Add from wine-staging 5.16
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f66c66f72ab8b1ce05d0…
commit 0f66c66f72ab8b1ce05d01f88624033cb7dc23b7 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Mon Sep 14 14:17:10 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:36:03 2020 +0200 [DBGHELP_WINETEST] Add from wine-staging 5.16 --- modules/rostests/winetests/CMakeLists.txt | 1 + modules/rostests/winetests/dbghelp/CMakeLists.txt | 6 + modules/rostests/winetests/dbghelp/dbghelp.c | 144 ++++++++++++++++++++++ modules/rostests/winetests/dbghelp/testlist.c | 12 ++ sdk/tools/winesync/dbghelp.cfg | 1 + 5 files changed, 164 insertions(+) diff --git a/modules/rostests/winetests/CMakeLists.txt b/modules/rostests/winetests/CMakeLists.txt index fb8df2e9709..45a146c75d9 100644 --- a/modules/rostests/winetests/CMakeLists.txt +++ b/modules/rostests/winetests/CMakeLists.txt @@ -36,6 +36,7 @@ add_subdirectory(cryptui) add_subdirectory(d3dcompiler_43) add_subdirectory(d3drm) add_subdirectory(d3dx9_36) +add_subdirectory(dbghelp) add_subdirectory(devenum) add_subdirectory(dinput) add_subdirectory(dinput8) diff --git a/modules/rostests/winetests/dbghelp/CMakeLists.txt b/modules/rostests/winetests/dbghelp/CMakeLists.txt new file mode 100644 index 00000000000..2cc768a42ff --- /dev/null +++ b/modules/rostests/winetests/dbghelp/CMakeLists.txt @@ -0,0 +1,6 @@ + +add_executable(dbghelp_winetest dbghelp.c testlist.c) +target_compile_definitions(dbghelp_winetest PRIVATE WINETEST_USE_DBGSTR_LONGLONG) +set_module_type(dbghelp_winetest win32cui) +add_importlibs(dbghelp_winetest dbghelp gdi32 user32 msvcrt kernel32 ntdll) +add_rostests_file(TARGET dbghelp_winetest) diff --git a/modules/rostests/winetests/dbghelp/dbghelp.c b/modules/rostests/winetests/dbghelp/dbghelp.c new file mode 100644 index 00000000000..214adb7b16b --- /dev/null +++ b/modules/rostests/winetests/dbghelp/dbghelp.c @@ -0,0 +1,144 @@ +/* + * Copyright 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "windef.h" +#include "verrsrc.h" +#include "dbghelp.h" +#include "wine/test.h" + +#if defined(__i386__) || defined(__x86_64__) + +static DWORD CALLBACK stack_walk_thread(void *arg) +{ + DWORD count = SuspendThread(GetCurrentThread()); + ok(!count, "got %d\n", count); + return 0; +} + +static void test_stack_walk(void) +{ + char si_buf[sizeof(SYMBOL_INFO) + 200]; + SYMBOL_INFO *si = (SYMBOL_INFO *)si_buf; + STACKFRAME64 frame = {{0}}, frame0; + BOOL found_our_frame = FALSE; + DWORD machine; + HANDLE thread; + DWORD64 disp; + CONTEXT ctx; + DWORD count; + BOOL ret; + + thread = CreateThread(NULL, 0, stack_walk_thread, NULL, 0, NULL); + + /* wait for the thread to suspend itself */ + do + { + Sleep(50); + count = SuspendThread(thread); + ResumeThread(thread); + } + while (!count); + + ctx.ContextFlags = CONTEXT_CONTROL; + ret = GetThreadContext(thread, &ctx); + ok(ret, "got error %u\n", ret); + + frame.AddrPC.Mode = AddrModeFlat; + frame.AddrFrame.Mode = AddrModeFlat; + frame.AddrStack.Mode = AddrModeFlat; + +#ifdef __i386__ + machine = IMAGE_FILE_MACHINE_I386; + + frame.AddrPC.Segment = ctx.SegCs; + frame.AddrPC.Offset = ctx.Eip; + frame.AddrFrame.Segment = ctx.SegSs; + frame.AddrFrame.Offset = ctx.Ebp; + frame.AddrStack.Segment = ctx.SegSs; + frame.AddrStack.Offset = ctx.Esp; +#elif defined(__x86_64__) + machine = IMAGE_FILE_MACHINE_AMD64; + + frame.AddrPC.Segment = ctx.SegCs; + frame.AddrPC.Offset = ctx.Rip; + frame.AddrFrame.Segment = ctx.SegSs; + frame.AddrFrame.Offset = ctx.Rbp; + frame.AddrStack.Segment = ctx.SegSs; + frame.AddrStack.Offset = ctx.Rsp; +#endif + frame0 = frame; + + /* first invocation just calculates the return address */ + ret = StackWalk64(machine, GetCurrentProcess(), thread, &frame, &ctx, NULL, + SymFunctionTableAccess64, SymGetModuleBase64, NULL); + ok(ret, "StackWalk64() failed: %u\n", GetLastError()); + ok(frame.AddrPC.Offset == frame0.AddrPC.Offset, "expected %s, got %s\n", + wine_dbgstr_longlong(frame0.AddrPC.Offset), + wine_dbgstr_longlong(frame.AddrPC.Offset)); + ok(frame.AddrStack.Offset == frame0.AddrStack.Offset, "expected %s, got %s\n", + wine_dbgstr_longlong(frame0.AddrStack.Offset), + wine_dbgstr_longlong(frame.AddrStack.Offset)); + ok(frame.AddrReturn.Offset && frame.AddrReturn.Offset != frame.AddrPC.Offset, + "got bad return address %s\n", wine_dbgstr_longlong(frame.AddrReturn.Offset)); + + while (frame.AddrReturn.Offset) + { + char *addr; + + ret = StackWalk64(machine, GetCurrentProcess(), thread, &frame, &ctx, NULL, + SymFunctionTableAccess64, SymGetModuleBase64, NULL); + ok(ret, "StackWalk64() failed: %u\n", GetLastError()); + + addr = (void *)(DWORD_PTR)frame.AddrPC.Offset; + + if (addr > (char *)stack_walk_thread && addr < (char *)stack_walk_thread + 0x100) + { + found_our_frame = TRUE; + + si->SizeOfStruct = sizeof(SYMBOL_INFO); + si->MaxNameLen = 200; + if (SymFromAddr(GetCurrentProcess(), frame.AddrPC.Offset, &disp, si)) + ok(!strcmp(si->Name, "stack_walk_thread"), "got wrong name %s\n", si->Name); + } + } + + ret = StackWalk64(machine, GetCurrentProcess(), thread, &frame, &ctx, NULL, + SymFunctionTableAccess64, SymGetModuleBase64, NULL); + ok(!ret, "StackWalk64() should have failed\n"); + + ok(found_our_frame, "didn't find stack_walk_thread frame\n"); +} + +#else /* __i386__ || __x86_64__ */ + +static void test_stack_walk(void) +{ +} + +#endif /* __i386__ || __x86_64__ */ + +START_TEST(dbghelp) +{ + BOOL ret = SymInitialize(GetCurrentProcess(), NULL, TRUE); + ok(ret, "got error %u\n", GetLastError()); + + test_stack_walk(); + + ret = SymCleanup(GetCurrentProcess()); + ok(ret, "got error %u\n", GetLastError()); +} diff --git a/modules/rostests/winetests/dbghelp/testlist.c b/modules/rostests/winetests/dbghelp/testlist.c new file mode 100644 index 00000000000..b78c165301a --- /dev/null +++ b/modules/rostests/winetests/dbghelp/testlist.c @@ -0,0 +1,12 @@ +/* Automatically generated file; DO NOT EDIT!! */ + +#define STANDALONE +#include <wine/test.h> + +extern void func_dbghelp(void); + +const struct test winetest_testlist[] = +{ + { "dbghelp", func_dbghelp }, + { 0, 0 } +}; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 3b1605ae74b..bd721b981a3 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -1,5 +1,6 @@ directories: dlls/dbghelp: dll/win32/dbghelp + dlls/dbghelp/tests: modules/rostests/winetests/dbghelp files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
4 years, 1 month
1
0
0
0
[reactos] 178/179: [DOC] Update README.WINE to reflect dbghelp latest status
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f2cf465dba1655c982922…
commit f2cf465dba1655c9829226b8b0aeda213412f609 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 11 19:57:56 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:36:03 2020 +0200 [DOC] Update README.WINE to reflect dbghelp latest status --- media/doc/README.WINE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 72af1000226..3273024a322 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -66,7 +66,7 @@ dll/win32/cryptdll # Synced to WineStaging-4.18 dll/win32/cryptnet # Synced to WineStaging-4.18 dll/win32/cryptui # Synced to WineStaging-4.18 dll/win32/dbgeng # Synced to WineStaging-4.18 -dll/win32/dbghelp # Synced to WineStaging-3.9 +dll/win32/dbghelp # Synced to WineStaging-5.16 dll/win32/dciman32 # Synced to WineStaging-3.3 dll/win32/faultrep # Synced to WineStaging-4.18 dll/win32/fontsub # Synced to WineStaging-2.9
4 years, 1 month
1
0
0
0
[reactos] 177/179: [WINESYNC]: dbghelp is now in sync with wine-staging wine-5.16
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7837dcfc600e108bd35b3…
commit 7837dcfc600e108bd35b3ac755be06ed6a758d4f Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 11 19:56:54 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:36:02 2020 +0200 [WINESYNC]: dbghelp is now in sync with wine-staging wine-5.16 --- sdk/tools/winesync/dbghelp.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 14f279794a5..3b1605ae74b 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: 7e965d60b542c0baa6f79605f45669a2ea9bceb8 + wine: wine-5.16
4 years, 1 month
1
0
0
0
[reactos] 176/179: [WINESYNC] dbghelp: Always check for debug symbols in BINDIR.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c15a8e78b03b20016ef96…
commit c15a8e78b03b20016ef96e8e1584bdb430bc3359 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:54:10 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:36:02 2020 +0200 [WINESYNC] dbghelp: Always check for debug symbols in BINDIR. wine-staging patch by Sebastian Lackner <sebastian(a)fds-team.de> --- dll/win32/dbghelp/elf_module.c | 1 + ...01-dbghelp__Always_check_for_debug_symbols_in_BINDIR.diff | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index e44629f016e..923608f35e3 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -1436,6 +1436,7 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename, load_elf.elf_info = elf_info; ret = search_unix_path(filename, process_getenv(pcs, L"LD_LIBRARY_PATH"), elf_load_file_cb, &load_elf) + || search_unix_path(filename, BINDIR, elf_load_file_cb, &load_elf) || search_dll_path(pcs, filename, elf_load_file_cb, &load_elf); } diff --git a/sdk/tools/winesync/dbghelp_staging/0001-dbghelp__Always_check_for_debug_symbols_in_BINDIR.diff b/sdk/tools/winesync/dbghelp_staging/0001-dbghelp__Always_check_for_debug_symbols_in_BINDIR.diff new file mode 100644 index 00000000000..1fba125a79c --- /dev/null +++ b/sdk/tools/winesync/dbghelp_staging/0001-dbghelp__Always_check_for_debug_symbols_in_BINDIR.diff @@ -0,0 +1,12 @@ +diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c +index e44629f..923608f 100644 +--- a/dll/win32/dbghelp/elf_module.c ++++ b/dll/win32/dbghelp/elf_module.c +@@ -1436,6 +1436,7 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename, + load_elf.elf_info = elf_info; + + ret = search_unix_path(filename, process_getenv(pcs, L"LD_LIBRARY_PATH"), elf_load_file_cb, &load_elf) ++ || search_unix_path(filename, BINDIR, elf_load_file_cb, &load_elf) + || search_dll_path(pcs, filename, elf_load_file_cb, &load_elf); + } +
4 years, 1 month
1
0
0
0
[reactos] 175/179: [WINESYNC] dbghelp: Add xmm and mxcsr register mapping functions for i386.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=767cb4cff47ff324ee20d…
commit 767cb4cff47ff324ee20d26f6e077fb31a95b566 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:53:59 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:36:02 2020 +0200 [WINESYNC] dbghelp: Add xmm and mxcsr register mapping functions for i386. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 7e965d60b542c0baa6f79605f45669a2ea9bceb8 by Vijay Kiran Kamuju <infyquest(a)gmail.com> --- dll/win32/dbghelp/cpu_i386.c | 10 ++++++++++ sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dll/win32/dbghelp/cpu_i386.c b/dll/win32/dbghelp/cpu_i386.c index 78f477115d7..23c1fb02c67 100644 --- a/dll/win32/dbghelp/cpu_i386.c +++ b/dll/win32/dbghelp/cpu_i386.c @@ -610,6 +610,16 @@ static void *i386_fetch_context_reg(union ctx *pctx, unsigned regno, unsigned *s case CV_REG_FS: *size = sizeof(ctx->SegFs); return &ctx->SegFs; case CV_REG_GS: *size = sizeof(ctx->SegGs); return &ctx->SegGs; + case CV_REG_XMM0 + 0: *size = 16; return &ctx->ExtendedRegisters[10*16]; + case CV_REG_XMM0 + 1: *size = 16; return &ctx->ExtendedRegisters[11*16]; + case CV_REG_XMM0 + 2: *size = 16; return &ctx->ExtendedRegisters[12*16]; + case CV_REG_XMM0 + 3: *size = 16; return &ctx->ExtendedRegisters[13*16]; + case CV_REG_XMM0 + 4: *size = 16; return &ctx->ExtendedRegisters[14*16]; + case CV_REG_XMM0 + 5: *size = 16; return &ctx->ExtendedRegisters[15*16]; + case CV_REG_XMM0 + 6: *size = 16; return &ctx->ExtendedRegisters[16*16]; + case CV_REG_XMM0 + 7: *size = 16; return &ctx->ExtendedRegisters[17*16]; + + case CV_REG_MXCSR: *size = sizeof(DWORD); return &ctx->ExtendedRegisters[24]; } FIXME("Unknown register %x\n", regno); return NULL; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 2fecd3ea9c7..14f279794a5 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: 70b2d181b1547dbe3c2a62e57c6afb0ee903f358 + wine: 7e965d60b542c0baa6f79605f45669a2ea9bceb8
4 years, 1 month
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
39
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Results per page:
10
25
50
100
200