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 2021
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
21 participants
173 discussions
Start a n
N
ew thread
[reactos] 01/01: [BROWSEUI] auto-completion: Reduce failures in ACListISF (#3589)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2eaf0afcd2e0c91876fa5…
commit 2eaf0afcd2e0c91876fa534dd5f6e74740eb0a75 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Apr 6 21:56:40 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Apr 6 21:56:40 2021 +0900 [BROWSEUI] auto-completion: Reduce failures in ACListISF (#3589) Reduce failures in ACListISF testcase. Skip left space in auto-completion. Accept the pair of drive letter and colon. CORE-9281 --- dll/win32/browseui/aclistisf.cpp | 122 ++++++++++++++++++--------------------- dll/win32/browseui/aclistisf.h | 6 +- 2 files changed, 59 insertions(+), 69 deletions(-) diff --git a/dll/win32/browseui/aclistisf.cpp b/dll/win32/browseui/aclistisf.cpp index cd087ec2f3f..458ab046b5b 100644 --- a/dll/win32/browseui/aclistisf.cpp +++ b/dll/win32/browseui/aclistisf.cpp @@ -174,7 +174,9 @@ HRESULT CACListISF::GetDisplayName(LPCITEMIDLIST pidlChild, CComHeapPtr<WCHAR>& return hr; } -HRESULT CACListISF::GetPathName(LPCITEMIDLIST pidlChild, CComHeapPtr<WCHAR>& pszPath) +HRESULT +CACListISF::GetPaths(LPCITEMIDLIST pidlChild, CComHeapPtr<WCHAR>& pszRaw, + CComHeapPtr<WCHAR>& pszExpanded) { TRACE("(%p, %p)\n", this, pidlChild); @@ -183,29 +185,24 @@ HRESULT CACListISF::GetPathName(LPCITEMIDLIST pidlChild, CComHeapPtr<WCHAR>& psz if (FAILED_UNEXPECTEDLY(hr)) return hr; - CStringW szPath; - if (m_szExpand.GetLength() && m_iNextLocation == LT_DIRECTORY) + CStringW szRawPath, szExpanded; + if (m_szRawPath.GetLength() && m_iNextLocation == LT_DIRECTORY) { - INT cchExpand = m_szExpand.GetLength(); - if (StrCmpNIW(pszChild, m_szExpand, cchExpand) != 0 || + INT cchExpand = m_szRawPath.GetLength(); + if (StrCmpNIW(pszChild, m_szRawPath, cchExpand) != 0 || pszChild[0] != L'\\' || pszChild[1] != L'\\') { - szPath = m_szExpand; + szRawPath = m_szRawPath; + szExpanded = m_szExpanded; } } - szPath += pszChild; + szRawPath += pszChild; + szExpanded += pszChild; - INT cchMax = szPath.GetLength() + 1; - CComHeapPtr<WCHAR> pszFullPath; - if (!pszFullPath.Allocate(cchMax)) - { - ERR("Out of memory\n"); - return E_OUTOFMEMORY; - } - - StringCchCopyW(pszFullPath, cchMax, szPath); - pszPath.Attach(pszFullPath.Detach()); - TRACE("pszPath: '%S'\n", static_cast<LPCWSTR>(pszPath)); + SHStrDupW(szRawPath, &pszRaw); + SHStrDupW(szExpanded, &pszExpanded); + TRACE("pszRaw: '%S'\n", static_cast<LPCWSTR>(pszRaw)); + TRACE("pszExpanded: '%S'\n", static_cast<LPCWSTR>(pszExpanded)); return S_OK; } @@ -232,7 +229,7 @@ STDMETHODIMP CACListISF::Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) HRESULT hr; CComHeapPtr<ITEMIDLIST> pidlChild; - CComHeapPtr<WCHAR> pszPathName; + CComHeapPtr<WCHAR> pszRawPath, pszExpanded; do { @@ -243,38 +240,16 @@ STDMETHODIMP CACListISF::Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) if (hr != S_OK) break; - pszPathName.Free(); - GetPathName(pidlChild, pszPathName); - if (!pszPathName) + pszRawPath.Free(); + pszExpanded.Free(); + GetPaths(pidlChild, pszRawPath, pszExpanded); + if (!pszRawPath || !pszExpanded) continue; - if (m_dwOptions & (ACLO_FILESYSONLY | ACLO_FILESYSDIRS)) - { - DWORD attrs = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM; - LPCITEMIDLIST pidlRef = pidlChild; - hr = m_pShellFolder->GetAttributesOf(1, &pidlRef, &attrs); - if (SUCCEEDED(hr)) - { - if (!(attrs & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) - continue; - } - } - - if (m_dwOptions & ACLO_FILESYSDIRS) - { - if (wcschr(pszPathName, L'%') != NULL) - { - WCHAR szPath[MAX_PATH]; - ExpandEnvironmentStringsW(pszPathName, szPath, _countof(szPath)); - if (!PathIsDirectoryW(szPath)) - continue; - } - else - { - if (!PathIsDirectoryW(pszPathName)) - continue; - } - } + if ((m_dwOptions & ACLO_FILESYSDIRS) && !PathIsDirectoryW(pszExpanded)) + continue; + else if ((m_dwOptions & ACLO_FILESYSONLY) && !PathFileExistsW(pszExpanded)) + continue; hr = S_OK; break; @@ -283,7 +258,7 @@ STDMETHODIMP CACListISF::Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) if (hr == S_OK) { - *rgelt = pszPathName.Detach(); + *rgelt = pszRawPath.Detach(); if (pceltFetched) *pceltFetched = 1; } @@ -301,7 +276,7 @@ STDMETHODIMP CACListISF::Reset() TRACE("(%p)\n", this); m_iNextLocation = LT_DIRECTORY; - m_szExpand = L""; + m_szRawPath = L""; SHELLSTATE ss = { 0 }; SHGetSetSettings(&ss, SSF_SHOWALLOBJECTS, FALSE); @@ -341,34 +316,48 @@ STDMETHODIMP CACListISF::Expand(LPCOLESTR pszExpand) { TRACE("(%p, %ls)\n", this, pszExpand); - m_szExpand = pszExpand; + m_szRawPath = pszExpand; m_iNextLocation = LT_DIRECTORY; + // skip left space + while (*pszExpand == L' ') + ++pszExpand; + // expand environment variables (%WINDIR% etc.) - WCHAR szExpanded[MAX_PATH]; - if (wcschr(pszExpand, L'%') != NULL && - ExpandEnvironmentStringsW(pszExpand, szExpanded, _countof(szExpanded))) - { - pszExpand = szExpanded; - } + WCHAR szExpanded[MAX_PATH], szPath1[MAX_PATH], szPath2[MAX_PATH]; + ExpandEnvironmentStringsW(pszExpand, szExpanded, _countof(szExpanded)); + pszExpand = szExpanded; // get full path - WCHAR szPath1[MAX_PATH], szPath2[MAX_PATH]; - if (PathIsRelativeW(pszExpand) && - SHGetPathFromIDListW(m_pidlCurDir, szPath1) && - PathCombineW(szPath2, szPath1, pszExpand)) + if (szExpanded[0] && szExpanded[1] == L':' && szExpanded[2] == 0) { - pszExpand = szPath2; + // 'C:' --> 'C:\' + szExpanded[2] = L'\\'; + szExpanded[3] = 0; + } + else + { + if (PathIsRelativeW(pszExpand) && + SHGetPathFromIDListW(m_pidlCurDir, szPath1) && + PathCombineW(szPath2, szPath1, pszExpand)) + { + pszExpand = szPath2; + } + GetFullPathNameW(pszExpand, _countof(szPath1), szPath1, NULL); + pszExpand = szPath1; } - GetFullPathNameW(pszExpand, _countof(szPath1), szPath1, NULL); CComHeapPtr<ITEMIDLIST> pidl; - HRESULT hr = SHParseDisplayName(szPath1, NULL, &pidl, NULL, NULL); + m_szExpanded = pszExpand; + HRESULT hr = SHParseDisplayName(m_szExpanded, NULL, &pidl, NULL, NULL); if (SUCCEEDED(hr)) { hr = SetLocation(pidl.Detach()); if (FAILED_UNEXPECTEDLY(hr)) - m_szExpand = L""; + { + m_szRawPath = L""; + m_szExpanded = L""; + } } return hr; } @@ -448,4 +437,3 @@ STDMETHODIMP CACListISF::SetDirectory(LPCWSTR pwzPath) m_pidlCurDir.Attach(pidl); return S_OK; } - diff --git a/dll/win32/browseui/aclistisf.h b/dll/win32/browseui/aclistisf.h index abc63efd45c..d09b47c3c8f 100644 --- a/dll/win32/browseui/aclistisf.h +++ b/dll/win32/browseui/aclistisf.h @@ -43,7 +43,8 @@ private: DWORD m_dwOptions; LOCATION_TYPE m_iNextLocation; BOOL m_fShowHidden; - CStringW m_szExpand; + CStringW m_szRawPath; + CStringW m_szExpanded; CComHeapPtr<ITEMIDLIST> m_pidlLocation; CComHeapPtr<ITEMIDLIST> m_pidlCurDir; CComPtr<IEnumIDList> m_pEnumIDList; @@ -57,7 +58,8 @@ public: HRESULT NextLocation(); HRESULT SetLocation(LPITEMIDLIST pidl); HRESULT GetDisplayName(LPCITEMIDLIST pidlChild, CComHeapPtr<WCHAR>& pszChild); - HRESULT GetPathName(LPCITEMIDLIST pidlChild, CComHeapPtr<WCHAR>& pszPath); + HRESULT GetPaths(LPCITEMIDLIST pidlChild, CComHeapPtr<WCHAR>& pszRaw, + CComHeapPtr<WCHAR>& pszExpanded); // *** IEnumString methods *** STDMETHODIMP Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) override;
3 years, 8 months
1
0
0
0
[reactos] 01/01: [FONTEXT_APITEST] Follow-up of #3585 (deb928c)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a105b5d355facb69042dc…
commit a105b5d355facb69042dc525c8b3b701fd62182c Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Apr 6 09:02:53 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Tue Apr 6 09:02:53 2021 +0900 [FONTEXT_APITEST] Follow-up of #3585 (deb928c) Strengthen GetDisplayNameOf testcase. CORE-9281, CORE-16444 --- .../rostests/apitests/fontext/GetDisplayNameOf.cpp | 97 +++++++++++++++++----- 1 file changed, 74 insertions(+), 23 deletions(-) diff --git a/modules/rostests/apitests/fontext/GetDisplayNameOf.cpp b/modules/rostests/apitests/fontext/GetDisplayNameOf.cpp index a0c164d6683..ac0c7abb425 100644 --- a/modules/rostests/apitests/fontext/GetDisplayNameOf.cpp +++ b/modules/rostests/apitests/fontext/GetDisplayNameOf.cpp @@ -3,6 +3,7 @@ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) * PURPOSE: Tests for fontext GetDisplayNameOf behavior * COPYRIGHT: Copyright 2021 Mark Jansen <mark.jansen(a)reactos.org> + * Copyright 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ #include <ntstatus.h> @@ -15,6 +16,7 @@ #include <shlobj.h> #include <shlwapi.h> #include <shellutils.h> +#include <versionhelpers.h> #include "wine/test.h" static HRESULT Initialize(CComPtr<IShellFolder>& spFolder) @@ -39,45 +41,68 @@ static HRESULT Initialize(CComPtr<IShellFolder>& spFolder) hr = desktopFolder->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &spFolder)); ok_hex(hr, S_OK); + if (FAILED(hr)) + { + skip("BindToObject failed\n"); + return hr; + } + return hr; } -static void Test_GetDisplayNameOf(CComPtr<IShellFolder>& spFolder) +static void +Test_GetDisplayNameOf(CComPtr<IShellFolder>& spFolder, + DWORD dwFlags, LPCWSTR text, BOOL fRelative) { CComPtr<IEnumIDList> fontsEnum; HRESULT hr = spFolder->EnumObjects(NULL, SHCONTF_NONFOLDERS, &fontsEnum); - ok_hex(hr, S_OK); if (FAILED(hr)) + { + skip("EnumObjects failed\n"); return; + } - CComHeapPtr<ITEMIDLIST> fontPidl; - ULONG fetched = 0; - hr = fontsEnum->Next(1, &fontPidl, &fetched); - STRRET strret; - hr = spFolder->GetDisplayNameOf(fontPidl, SHGDN_FORPARSING, &strret); - ok_hex(hr, S_OK); - if (FAILED(hr)) - return; + BOOL bFound = FALSE; + for (;;) + { + CComHeapPtr<ITEMIDLIST> fontPidl; + ULONG fetched = 0; + hr = fontsEnum->Next(1, &fontPidl, &fetched); + if (FAILED(hr) || hr == S_FALSE) + break; - WCHAR Buf[MAX_PATH]; - hr = StrRetToBufW(&strret, fontPidl, Buf, _countof(Buf)); - ok_hex(hr, S_OK); - if (FAILED(hr)) - return; + STRRET strret; + hr = spFolder->GetDisplayNameOf(fontPidl, dwFlags, &strret); + if (FAILED(hr)) + continue; + + WCHAR Buf[MAX_PATH]; + hr = StrRetToBufW(&strret, fontPidl, Buf, _countof(Buf)); + if (FAILED(hr)) + continue; - // On 2k3 where this is not a custom IShellFolder, it will return something like: - // 'C:\\WINDOWS\\Fonts\\arial.ttf' - // On Vista+ this results in something like: - // 'C:\\Windows\\Fonts\\System Bold' - BOOL bRelative = PathIsRelativeW(Buf); - trace("Path: %s\n", wine_dbgstr_w(Buf)); - ok(bRelative == FALSE, "Path not relative? (%s)\n", wine_dbgstr_w(Buf)); + trace("Path: %s\n", wine_dbgstr_w(Buf)); + if (lstrcmpiW(text, Buf) == 0) + { + bFound = TRUE; + ok_int(PathIsRelativeW(Buf), fRelative); + break; + } + } + + ok_int(bFound, TRUE); } START_TEST(GetDisplayNameOf) { + if (IsWindowsVistaOrGreater()) + { + skip("Vista+\n"); + return; + } + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); { @@ -85,7 +110,33 @@ START_TEST(GetDisplayNameOf) HRESULT hr = Initialize(spFolder); if (SUCCEEDED(hr)) { - Test_GetDisplayNameOf(spFolder); + WCHAR szPath[MAX_PATH]; + SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, 0, szPath); + PathAppendW(szPath, L"arial.ttf"); + + trace("SHGDN_NORMAL\n"); + Test_GetDisplayNameOf(spFolder, SHGDN_NORMAL, L"arial.ttf", TRUE); + + trace("SHGDN_INFOLDER\n"); + Test_GetDisplayNameOf(spFolder, SHGDN_INFOLDER, L"arial.ttf", TRUE); + + trace("SHGDN_FORPARSING\n"); + Test_GetDisplayNameOf(spFolder, SHGDN_FORPARSING, szPath, FALSE); + + trace("SHGDN_INFOLDER | SHGDN_FORPARSING\n"); + Test_GetDisplayNameOf(spFolder, SHGDN_INFOLDER | SHGDN_FORPARSING, L"arial.ttf", TRUE); + + trace("SHGDN_FORADDRESSBAR\n"); + Test_GetDisplayNameOf(spFolder, SHGDN_FORADDRESSBAR, L"arial.ttf", TRUE); + + trace("SHGDN_INFOLDER | SHGDN_FORADDRESSBAR\n"); + Test_GetDisplayNameOf(spFolder, SHGDN_INFOLDER | SHGDN_FORADDRESSBAR, L"arial.ttf", TRUE); + + trace("SHGDN_FORPARSING | SHGDN_FORADDRESSBAR\n"); + Test_GetDisplayNameOf(spFolder, SHGDN_FORPARSING | SHGDN_FORADDRESSBAR, szPath, FALSE); + + trace("SHGDN_INFOLDER | SHGDN_FORPARSING | SHGDN_FORADDRESSBAR\n"); + Test_GetDisplayNameOf(spFolder, SHGDN_INFOLDER | SHGDN_FORPARSING | SHGDN_FORADDRESSBAR, L"arial.ttf", TRUE); } }
3 years, 8 months
1
0
0
0
[reactos] 01/01: [FONTEXT_APITEST] Show that fontext returns absolute paths with SHGDN_FORPARSING (#3585)
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=deb928c4bceb9a2c61390…
commit deb928c4bceb9a2c6139095f367f63b890b1e81c Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Tue Apr 6 00:54:58 2021 +0200 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Apr 6 07:54:58 2021 +0900 [FONTEXT_APITEST] Show that fontext returns absolute paths with SHGDN_FORPARSING (#3585) Add GetDisplayNameOf testcase. CORE-9281, CORE-16444 --- modules/rostests/apitests/fontext/CMakeLists.txt | 3 +- .../rostests/apitests/fontext/GetDisplayNameOf.cpp | 93 ++++++++++++++++++++++ modules/rostests/apitests/fontext/testlist.c | 2 + 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/modules/rostests/apitests/fontext/CMakeLists.txt b/modules/rostests/apitests/fontext/CMakeLists.txt index 0cb5e6a637a..059506fdc3a 100644 --- a/modules/rostests/apitests/fontext/CMakeLists.txt +++ b/modules/rostests/apitests/fontext/CMakeLists.txt @@ -6,11 +6,12 @@ add_definitions( -D_UNICODE) list(APPEND SOURCE + GetDisplayNameOf.cpp shellext.cpp testlist.c) add_executable(fontext_apitest ${SOURCE}) set_module_type(fontext_apitest win32cui) target_link_libraries(fontext_apitest uuid ${PSEH_LIB} cpprt atl_classes) -add_importlibs(fontext_apitest oleaut32 ole32 shell32 user32 msvcrt kernel32 ntdll) +add_importlibs(fontext_apitest oleaut32 shlwapi ole32 shell32 user32 msvcrt kernel32 ntdll) add_rostests_file(TARGET fontext_apitest) diff --git a/modules/rostests/apitests/fontext/GetDisplayNameOf.cpp b/modules/rostests/apitests/fontext/GetDisplayNameOf.cpp new file mode 100644 index 00000000000..a0c164d6683 --- /dev/null +++ b/modules/rostests/apitests/fontext/GetDisplayNameOf.cpp @@ -0,0 +1,93 @@ +/* + * PROJECT: fontext_apitest + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Tests for fontext GetDisplayNameOf behavior + * COPYRIGHT: Copyright 2021 Mark Jansen <mark.jansen(a)reactos.org> + */ + +#include <ntstatus.h> +#define WIN32_NO_STATUS +#include <windef.h> +#include <ntndk.h> +#include <atlbase.h> +#include <atlcom.h> +#include <shellapi.h> +#include <shlobj.h> +#include <shlwapi.h> +#include <shellutils.h> +#include "wine/test.h" + +static HRESULT Initialize(CComPtr<IShellFolder>& spFolder) +{ + WCHAR Path[MAX_PATH] = {0}; + HRESULT hr = SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, 0, Path); + ok_hex(hr, S_OK); + if (FAILED(hr)) + return hr; + + CComPtr<IShellFolder> desktopFolder; + hr = SHGetDesktopFolder(&desktopFolder); + ok_hex(hr, S_OK); + if (FAILED(hr)) + return hr; + + CComHeapPtr<ITEMIDLIST> pidl; + hr = desktopFolder->ParseDisplayName(NULL, NULL, Path, NULL, &pidl, NULL); + ok_hex(hr, S_OK); + if (FAILED(hr)) + return hr; + + hr = desktopFolder->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &spFolder)); + ok_hex(hr, S_OK); + return hr; +} + +static void Test_GetDisplayNameOf(CComPtr<IShellFolder>& spFolder) +{ + CComPtr<IEnumIDList> fontsEnum; + HRESULT hr = spFolder->EnumObjects(NULL, SHCONTF_NONFOLDERS, &fontsEnum); + + ok_hex(hr, S_OK); + if (FAILED(hr)) + return; + + CComHeapPtr<ITEMIDLIST> fontPidl; + ULONG fetched = 0; + hr = fontsEnum->Next(1, &fontPidl, &fetched); + STRRET strret; + hr = spFolder->GetDisplayNameOf(fontPidl, SHGDN_FORPARSING, &strret); + ok_hex(hr, S_OK); + if (FAILED(hr)) + return; + + WCHAR Buf[MAX_PATH]; + hr = StrRetToBufW(&strret, fontPidl, Buf, _countof(Buf)); + ok_hex(hr, S_OK); + if (FAILED(hr)) + return; + + // On 2k3 where this is not a custom IShellFolder, it will return something like: + // 'C:\\WINDOWS\\Fonts\\arial.ttf' + // On Vista+ this results in something like: + // 'C:\\Windows\\Fonts\\System Bold' + BOOL bRelative = PathIsRelativeW(Buf); + trace("Path: %s\n", wine_dbgstr_w(Buf)); + ok(bRelative == FALSE, "Path not relative? (%s)\n", wine_dbgstr_w(Buf)); +} + + +START_TEST(GetDisplayNameOf) +{ + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + { + CComPtr<IShellFolder> spFolder; + HRESULT hr = Initialize(spFolder); + if (SUCCEEDED(hr)) + { + Test_GetDisplayNameOf(spFolder); + } + } + + CoUninitialize(); +} diff --git a/modules/rostests/apitests/fontext/testlist.c b/modules/rostests/apitests/fontext/testlist.c index 08fc9631feb..e8f34141731 100644 --- a/modules/rostests/apitests/fontext/testlist.c +++ b/modules/rostests/apitests/fontext/testlist.c @@ -3,10 +3,12 @@ #define STANDALONE #include <wine/test.h> +extern void func_GetDisplayNameOf(void); extern void func_shellext(void); const struct test winetest_testlist[] = { + { "GetDisplayNameOf", func_GetDisplayNameOf }, { "shellext", func_shellext }, { 0, 0 } };
3 years, 8 months
1
0
0
0
[reactos] 01/01: [PARTMGR] Volume devices do not have compatible IDs and their instance IDs are not unique
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a959d6e47389ca3ff5d7e…
commit a959d6e47389ca3ff5d7e8f298bf4384a7f09cdc Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Apr 5 15:34:55 2021 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Apr 5 15:35:21 2021 +0200 [PARTMGR] Volume devices do not have compatible IDs and their instance IDs are not unique --- drivers/storage/partmgr/partition.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/storage/partmgr/partition.c b/drivers/storage/partmgr/partition.c index 3ce6ab7873c..cfd00fa5ce5 100644 --- a/drivers/storage/partmgr/partition.c +++ b/drivers/storage/partmgr/partition.c @@ -301,7 +301,6 @@ PartitionHandleQueryId( ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES; break; case BusQueryHardwareIDs: - case BusQueryCompatibleIDs: { static WCHAR volumeID[] = L"STORAGE\\Volume\0"; @@ -376,7 +375,7 @@ PartitionHandleQueryCapabilities( devCaps->RawDeviceOK = TRUE; devCaps->NoDisplayInUI = TRUE; devCaps->Address = PartExt->OnDiskNumber; - devCaps->UniqueID = 1; + devCaps->UniqueID = FALSE; return STATUS_SUCCESS; }
3 years, 8 months
1
0
0
0
[reactos] 01/01: [BROWSEUI] Accept environment variables in ACLO_FILESYSDIRS
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fefac1fb1df1f084afdb2…
commit fefac1fb1df1f084afdb21e70e1148e3483d8507 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Apr 5 22:20:01 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Apr 5 22:20:01 2021 +0900 [BROWSEUI] Accept environment variables in ACLO_FILESYSDIRS Properly handle ACLO_FILESYSDIRS. CORE-9281 --- dll/win32/browseui/aclistisf.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dll/win32/browseui/aclistisf.cpp b/dll/win32/browseui/aclistisf.cpp index 4ddeb8f2207..cd087ec2f3f 100644 --- a/dll/win32/browseui/aclistisf.cpp +++ b/dll/win32/browseui/aclistisf.cpp @@ -260,8 +260,21 @@ STDMETHODIMP CACListISF::Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) } } - if ((m_dwOptions & ACLO_FILESYSDIRS) && !PathIsDirectoryW(pszPathName)) - continue; + if (m_dwOptions & ACLO_FILESYSDIRS) + { + if (wcschr(pszPathName, L'%') != NULL) + { + WCHAR szPath[MAX_PATH]; + ExpandEnvironmentStringsW(pszPathName, szPath, _countof(szPath)); + if (!PathIsDirectoryW(szPath)) + continue; + } + else + { + if (!PathIsDirectoryW(pszPathName)) + continue; + } + } hr = S_OK; break;
3 years, 8 months
1
0
0
0
[reactos] 01/01: [NTOS:PNP] PiSetDevNodeText: Do not overwrite existing DeviceDesc values
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d8c38c4b4c2066d770af7…
commit d8c38c4b4c2066d770af75471889f735e6bb4ad3 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Apr 5 14:33:09 2021 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Apr 5 14:33:48 2021 +0200 [NTOS:PNP] PiSetDevNodeText: Do not overwrite existing DeviceDesc values CORE-17513 --- ntoskrnl/io/pnpmgr/devaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/io/pnpmgr/devaction.c b/ntoskrnl/io/pnpmgr/devaction.c index 1cf30fa8575..638dccb8dcd 100644 --- a/ntoskrnl/io/pnpmgr/devaction.c +++ b/ntoskrnl/io/pnpmgr/devaction.c @@ -1101,13 +1101,13 @@ PiSetDevNodeText( return; } - // Step 1: write DeviceDesc key if not exists + // Step 1: Write the DeviceDesc value if does not exist UNICODE_STRING valDeviceDesc = RTL_CONSTANT_STRING(L"DeviceDesc"); ULONG len; status = ZwQueryValueKey(InstanceKey, &valDeviceDesc, KeyValueBasicInformation, NULL, 0, &len); - if (!NT_SUCCESS(status)) + if (status == STATUS_OBJECT_NAME_NOT_FOUND) { PWSTR deviceDesc = NULL; status = PiIrpQueryDeviceText(DeviceNode, localeId, DeviceTextDescription, &deviceDesc);
3 years, 8 months
1
0
0
0
[reactos] 01/01: [BROWSEUI] Accept environment variables on auto-completion
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=badcfb2f7dc84ed8c585d…
commit badcfb2f7dc84ed8c585d5be051bfe1f33f778fb Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Apr 5 17:20:35 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Apr 5 17:20:35 2021 +0900 [BROWSEUI] Accept environment variables on auto-completion Expand %WINDIR%, %SystemRoot% etc. at CACListISF::Expand. CORE-9281 --- dll/win32/browseui/aclistisf.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dll/win32/browseui/aclistisf.cpp b/dll/win32/browseui/aclistisf.cpp index 4e62b8a5e97..4ddeb8f2207 100644 --- a/dll/win32/browseui/aclistisf.cpp +++ b/dll/win32/browseui/aclistisf.cpp @@ -331,6 +331,14 @@ STDMETHODIMP CACListISF::Expand(LPCOLESTR pszExpand) m_szExpand = pszExpand; m_iNextLocation = LT_DIRECTORY; + // expand environment variables (%WINDIR% etc.) + WCHAR szExpanded[MAX_PATH]; + if (wcschr(pszExpand, L'%') != NULL && + ExpandEnvironmentStringsW(pszExpand, szExpanded, _countof(szExpanded))) + { + pszExpand = szExpanded; + } + // get full path WCHAR szPath1[MAX_PATH], szPath2[MAX_PATH]; if (PathIsRelativeW(pszExpand) && @@ -427,3 +435,4 @@ STDMETHODIMP CACListISF::SetDirectory(LPCWSTR pwzPath) m_pidlCurDir.Attach(pidl); return S_OK; } +
3 years, 8 months
1
0
0
0
[reactos] 01/01: [BROWSEUI] Follow-up of #3582
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a5950308fd0fafa0dc2e1…
commit a5950308fd0fafa0dc2e1a28ce7e40602c259ba4 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Apr 5 07:43:40 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Apr 5 07:43:40 2021 +0900 [BROWSEUI] Follow-up of #3582 Also fixes VK_HOME and VK_END. CORE-9281 --- dll/win32/browseui/CAutoComplete.cpp | 4 ---- dll/win32/browseui/aclhistory.cpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/dll/win32/browseui/CAutoComplete.cpp b/dll/win32/browseui/CAutoComplete.cpp index d23b6d5cb78..df0291021f0 100644 --- a/dll/win32/browseui/CAutoComplete.cpp +++ b/dll/win32/browseui/CAutoComplete.cpp @@ -883,7 +883,6 @@ BOOL CAutoComplete::OnEditKeyDown(WPARAM wParam, LPARAM lParam) UINT vk = (UINT)wParam; // virtual key switch (vk) { - case VK_HOME: case VK_END: case VK_UP: case VK_DOWN: case VK_PRIOR: case VK_NEXT: // is suggestion available? @@ -1017,9 +1016,6 @@ BOOL CAutoComplete::OnListUpDown(UINT vk) INT cItems = m_hwndList.GetItemCount(); // the number of items switch (vk) { - case VK_HOME: case VK_END: - m_hwndList.SendMessageW(WM_KEYDOWN, vk, 0); - break; case VK_UP: if (iItem == -1) iItem = cItems - 1; diff --git a/dll/win32/browseui/aclhistory.cpp b/dll/win32/browseui/aclhistory.cpp index 30412e023e8..683fdbaf8ed 100644 --- a/dll/win32/browseui/aclhistory.cpp +++ b/dll/win32/browseui/aclhistory.cpp @@ -27,7 +27,7 @@ STDMETHODIMP CACLHistory::Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) if (celt != 1) return E_NOTIMPL; // FIXME: *rgelt, *pceltFetched, return value - return E_FAIL; + return S_FALSE; } STDMETHODIMP CACLHistory::Reset()
3 years, 8 months
1
0
0
0
[reactos] 01/01: [BROWSEUI][BROWSEUI_APITEST] Add CLSID_ACLHistory stubs (#3582)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ab7d8f3616089d903a633…
commit ab7d8f3616089d903a6337908a9fb8fa033b3394 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Apr 5 04:20:18 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Apr 5 04:20:18 2021 +0900 [BROWSEUI][BROWSEUI_APITEST] Add CLSID_ACLHistory stubs (#3582) - Initial implement CLSID_ACLHistory as stub. - Add IACLHistory testcase into browseui_apitest. CORE-9281 --- dll/win32/browseui/CMakeLists.txt | 1 + dll/win32/browseui/aclhistory.cpp | 51 ++++++++++++++++++++ dll/win32/browseui/aclhistory.h | 34 +++++++++++++ dll/win32/browseui/browseui.cpp | 1 + dll/win32/browseui/browseui.rc | 1 + dll/win32/browseui/precomp.h | 1 + dll/win32/browseui/res/autocompletehistory.rgs | 13 +++++ dll/win32/browseui/resource.h | 1 + modules/rostests/apitests/browseui/CMakeLists.txt | 3 +- modules/rostests/apitests/browseui/IACLHistory.cpp | 56 ++++++++++++++++++++++ modules/rostests/apitests/browseui/testlist.c | 2 + 11 files changed, 163 insertions(+), 1 deletion(-) diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt index 9d199f6c996..d606fbfbb18 100644 --- a/dll/win32/browseui/CMakeLists.txt +++ b/dll/win32/browseui/CMakeLists.txt @@ -8,6 +8,7 @@ spec2def(browseui.dll browseui.spec ADD_IMPORTLIB) list(APPEND SOURCE ACLCustomMRU.cpp ACLCustomMRU.h + aclhistory.cpp aclistisf.cpp aclmulti.cpp addressband.cpp diff --git a/dll/win32/browseui/aclhistory.cpp b/dll/win32/browseui/aclhistory.cpp new file mode 100644 index 00000000000..30412e023e8 --- /dev/null +++ b/dll/win32/browseui/aclhistory.cpp @@ -0,0 +1,51 @@ +/* + * PROJECT: ReactOS Shell + * LICENSE: LGPL-2.0-or-later (
https://spdx.org/licenses/LGPL-2.0-or-later
) + * PURPOSE: Implement CLSID_ACLHistory for auto-completion + * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + */ + +#include "precomp.h" + +CACLHistory::CACLHistory() +{ + TRACE("CACLHistory::CACLHistory(%p)\n", this); +} + +CACLHistory::~CACLHistory() +{ + TRACE("CACLHistory::~CACLHistory(%p)\n", this); +} + +STDMETHODIMP CACLHistory::Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) +{ + FIXME("CACLHistory::Next(%p, %lu, %p, %p): stub\n", this, celt, rgelt, pceltFetched); + if (pceltFetched) + *pceltFetched = 0; + if (rgelt) + *rgelt = NULL; + if (celt != 1) + return E_NOTIMPL; + // FIXME: *rgelt, *pceltFetched, return value + return E_FAIL; +} + +STDMETHODIMP CACLHistory::Reset() +{ + FIXME("CACLHistory::Reset(%p): stub\n", this); + return S_OK; +} + +STDMETHODIMP CACLHistory::Skip(ULONG celt) +{ + TRACE("CACLHistory::Clone(%p, %lu)\n", this, celt); + return E_NOTIMPL; +} + +STDMETHODIMP CACLHistory::Clone(IEnumString **ppenum) +{ + FIXME("CACLHistory::Clone(%p, %p): stub\n", this, ppenum); + if (ppenum) + *ppenum = NULL; + return E_NOTIMPL; +} diff --git a/dll/win32/browseui/aclhistory.h b/dll/win32/browseui/aclhistory.h new file mode 100644 index 00000000000..b4a6b6a9d0b --- /dev/null +++ b/dll/win32/browseui/aclhistory.h @@ -0,0 +1,34 @@ +/* + * PROJECT: ReactOS Shell + * LICENSE: LGPL-2.0-or-later (
https://spdx.org/licenses/LGPL-2.0-or-later
) + * PURPOSE: Implement CLSID_ACLHistory for auto-completion + * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + */ + +#pragma once + +class CACLHistory + : public CComCoClass<CACLHistory, &CLSID_ACLHistory> + , public CComObjectRootEx<CComMultiThreadModelNoCS> + , public IEnumString +{ +public: + CACLHistory(); + virtual ~CACLHistory(); + + // *** IEnumString methods *** + STDMETHODIMP Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) override; + STDMETHODIMP Skip(ULONG celt) override; + STDMETHODIMP Reset() override; + STDMETHODIMP Clone(IEnumString **ppenum) override; + +public: + DECLARE_REGISTRY_RESOURCEID(IDR_ACLHISTORY) + DECLARE_NOT_AGGREGATABLE(CACLHistory) + + DECLARE_PROTECT_FINAL_CONSTRUCT() + + BEGIN_COM_MAP(CACLHistory) + COM_INTERFACE_ENTRY_IID(IID_IEnumString, IEnumString) + END_COM_MAP() +}; diff --git a/dll/win32/browseui/browseui.cpp b/dll/win32/browseui/browseui.cpp index de1f8bb95ad..ea5b000365f 100644 --- a/dll/win32/browseui/browseui.cpp +++ b/dll/win32/browseui/browseui.cpp @@ -138,6 +138,7 @@ public: BEGIN_OBJECT_MAP(ObjectMap) OBJECT_ENTRY(CLSID_ACLCustomMRU, CACLCustomMRU) OBJECT_ENTRY(CLSID_AutoComplete, CAutoComplete) +OBJECT_ENTRY(CLSID_ACLHistory, CACLHistory) OBJECT_ENTRY(CLSID_ACLMulti, CACLMulti) OBJECT_ENTRY(CLSID_ACListISF, CACListISF) OBJECT_ENTRY(CLSID_SH_AddressBand, CAddressBand) diff --git a/dll/win32/browseui/browseui.rc b/dll/win32/browseui/browseui.rc index 774e346c0de..5a6eee380cd 100644 --- a/dll/win32/browseui/browseui.rc +++ b/dll/win32/browseui/browseui.rc @@ -33,6 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDR_ADDRESSBAND REGISTRY "res/addressband.rgs" IDR_ADDRESSEDITBOX REGISTRY "res/addresseditbox.rgs" IDR_ACLMULTI REGISTRY "res/autocompletecontainer.rgs" +IDR_ACLHISTORY REGISTRY "res/autocompletehistory.rgs" IDR_BANDPROXY REGISTRY "res/bandproxy.rgs" IDR_BANDSITE REGISTRY "res/rebarbandsite.rgs" IDR_BANDSITEMENU REGISTRY "res/bandsitemenu.rgs" diff --git a/dll/win32/browseui/precomp.h b/dll/win32/browseui/precomp.h index 02c27054544..67fe4c33208 100644 --- a/dll/win32/browseui/precomp.h +++ b/dll/win32/browseui/precomp.h @@ -38,6 +38,7 @@ #include "resource.h" #include "ACLCustomMRU.h" +#include "aclhistory.h" #include "aclistisf.h" #include "aclmulti.h" #include "addressband.h" diff --git a/dll/win32/browseui/res/autocompletehistory.rgs b/dll/win32/browseui/res/autocompletehistory.rgs new file mode 100644 index 00000000000..dfb40b6a6da --- /dev/null +++ b/dll/win32/browseui/res/autocompletehistory.rgs @@ -0,0 +1,13 @@ +HKCR +{ + NoRemove CLSID + { + ForceRemove {00BB2764-6A77-11D0-A535-00C04FD7D062} = s 'ReactOS History AutoComplete List' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + } + } +} diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h index 1890dc0676a..4bbe766b964 100644 --- a/dll/win32/browseui/resource.h +++ b/dll/win32/browseui/resource.h @@ -109,6 +109,7 @@ #define IDR_FINDFOLDER 147 #define IDR_USERASSIST 148 #define IDR_SHELLTASKSCHEDULER 149 +#define IDR_ACLHISTORY 150 #define IDS_SMALLICONS 12301 #define IDS_LARGEICONS 12302 diff --git a/modules/rostests/apitests/browseui/CMakeLists.txt b/modules/rostests/apitests/browseui/CMakeLists.txt index a3448d69535..c325bf3d423 100644 --- a/modules/rostests/apitests/browseui/CMakeLists.txt +++ b/modules/rostests/apitests/browseui/CMakeLists.txt @@ -5,7 +5,8 @@ include_directories( list(APPEND SOURCE ACListISF.cpp IACLCustomMRU.cpp - IAutoComplete.cpp + IACLHistory.cpp + IAutoComplete.cpp SHEnumClassesOfCategories.cpp SHExplorerParseCmdLine.c testlist.c) diff --git a/modules/rostests/apitests/browseui/IACLHistory.cpp b/modules/rostests/apitests/browseui/IACLHistory.cpp new file mode 100644 index 00000000000..68d25dc0a6a --- /dev/null +++ b/modules/rostests/apitests/browseui/IACLHistory.cpp @@ -0,0 +1,56 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: LGPL-2.0-or-later (
https://spdx.org/licenses/LGPL-2.0-or-later
) + * PURPOSE: Test for IACLHistory objects + * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + */ + +#define _UNICODE +#define UNICODE +#include <apitest.h> +#include <shlobj.h> +#include <atlbase.h> +#include <atlcom.h> +#include <stdio.h> +#include <shellutils.h> + +struct CCoInit +{ + CCoInit() { hres = CoInitialize(NULL); } + ~CCoInit() { if (SUCCEEDED(hres)) { CoUninitialize(); } } + HRESULT hres; +}; + +START_TEST(IACLHistory) +{ + CCoInit init; + ok_hex(init.hres, S_OK); + if (FAILED(init.hres)) + { + skip("CoInitialize failed with 0x%08lX\n", init.hres); + return; + } + + HRESULT hr; + CComPtr<IUnknown> pHistory; + hr = CoCreateInstance(CLSID_ACLHistory, NULL, CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IUnknown, &pHistory)); + ok_long(hr, S_OK); + ok_int(!!pHistory, TRUE); + + CComPtr<IEnumString> pEnum; + hr = pHistory->QueryInterface(IID_PPV_ARG(IEnumString, &pEnum)); + ok_long(hr, S_OK); + + hr = pEnum->Reset(); + ok_long(hr, S_OK); + hr = pEnum->Reset(); + ok_long(hr, S_OK); + + hr = pEnum->Skip(0); + ok_long(hr, E_NOTIMPL); + hr = pEnum->Skip(1); + ok_long(hr, E_NOTIMPL); + hr = pEnum->Skip(3); + ok_long(hr, E_NOTIMPL); +} diff --git a/modules/rostests/apitests/browseui/testlist.c b/modules/rostests/apitests/browseui/testlist.c index 20918608eeb..facd05a2a3c 100644 --- a/modules/rostests/apitests/browseui/testlist.c +++ b/modules/rostests/apitests/browseui/testlist.c @@ -5,6 +5,7 @@ extern void func_ACListISF(void); extern void func_IACLCustomMRU(void); +extern void func_IACLHistory(void); extern void func_IAutoComplete(void); extern void func_SHEnumClassesOfCategories(void); extern void func_SHExplorerParseCmdLine(void); @@ -13,6 +14,7 @@ const struct test winetest_testlist[] = { { "ACListISF", func_ACListISF }, { "IACLCustomMRU", func_IACLCustomMRU }, + { "IACLHistory", func_IACLHistory }, { "IAutoComplete", func_IAutoComplete }, { "SHEnumClassesOfCategories", func_SHEnumClassesOfCategories }, { "SHExplorerParseCmdLine", func_SHExplorerParseCmdLine },
3 years, 8 months
1
0
0
0
[reactos] 01/01: [DEVMGR] Display hexadecimal values of Capabilities, ConfigFlags, DevnodeFlags and CsFlags
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6c4b4a107bb40b09749e6…
commit 6c4b4a107bb40b09749e6c4abf9232032eaf4001 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Apr 4 11:44:38 2021 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Apr 4 11:44:38 2021 +0200 [DEVMGR] Display hexadecimal values of Capabilities, ConfigFlags, DevnodeFlags and CsFlags --- dll/win32/devmgr/properties/advprop.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dll/win32/devmgr/properties/advprop.cpp b/dll/win32/devmgr/properties/advprop.cpp index 37c7d7ce4d2..bfbffff6853 100644 --- a/dll/win32/devmgr/properties/advprop.cpp +++ b/dll/win32/devmgr/properties/advprop.cpp @@ -952,6 +952,8 @@ DisplayDevicePropertyText(IN PDEVADVPROP_INFO dap, { case SPDRP_CAPABILITIES: index = 0; + swprintf(dap->szTemp, L"%08lx", dwValue); + SetListViewText(hwndListView, index++, dap->szTemp); if (dwValue & CM_DEVCAP_LOCKSUPPORTED) SetListViewText(hwndListView, index++, L"CM_DEVCAP_LOCKSUPPORTED"); if (dwValue & CM_DEVCAP_EJECTSUPPORTED) @@ -976,6 +978,8 @@ DisplayDevicePropertyText(IN PDEVADVPROP_INFO dap, case SPDRP_CONFIGFLAGS: index = 0; + swprintf(dap->szTemp, L"%08lx", dwValue); + SetListViewText(hwndListView, index++, dap->szTemp); if (dwValue & CONFIGFLAG_DISABLED) SetListViewText(hwndListView, index++, L"CONFIGFLAG_DISABLED"); if (dwValue & CONFIGFLAG_REMOVED) @@ -1035,6 +1039,8 @@ DisplayDevNodeFlags(IN PDEVADVPROP_INFO dap, dap->hMachine); index = 0; + swprintf(dap->szTemp, L"%08lx", dwStatus); + SetListViewText(hwndListView, index++, dap->szTemp); if (dwStatus & DN_ROOT_ENUMERATED) SetListViewText(hwndListView, index++, L"DN_ROOT_ENUMERATED"); if (dwStatus & DN_DRIVER_LOADED) @@ -1101,9 +1107,6 @@ DisplayDevNodeFlags(IN PDEVADVPROP_INFO dap, SetListViewText(hwndListView, index++, L"DN_NO_SHOW_IN_DM"); if (dwStatus & DN_BOOT_LOG_PROB) SetListViewText(hwndListView, index++, L"DN_BOOT_LOG_PROB"); - -// swprintf(dap->szTemp, L"0x%08x", dwStatus); -// SetListViewText(hwndListView, 0, dap->szTemp); } @@ -1152,6 +1155,9 @@ DisplayCsFlags(IN PDEVADVPROP_INFO dap, dap->hMachine); index = 0; + swprintf(dap->szTemp, L"%08lx", dwValue); + SetListViewText(hwndListView, index++, dap->szTemp); + if (dwValue & CSCONFIGFLAG_DISABLED) SetListViewText(hwndListView, index++, L"CSCONFIGFLAG_DISABLED");
3 years, 8 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Results per page:
10
25
50
100
200