https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df88fcf5ccd5ec43433c1…
commit df88fcf5ccd5ec43433c1bcb7ac0c9f88e0afa79
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Sun Dec 3 18:45:24 2017 +0300
[SHELL32_APITEST] SHParseDisplayName: More tests for relative paths
---
modules/rostests/apitests/shell32/SHParseDisplayName.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/modules/rostests/apitests/shell32/SHParseDisplayName.cpp
b/modules/rostests/apitests/shell32/SHParseDisplayName.cpp
index a1a37c3508..cc495dc811 100644
--- a/modules/rostests/apitests/shell32/SHParseDisplayName.cpp
+++ b/modules/rostests/apitests/shell32/SHParseDisplayName.cpp
@@ -46,7 +46,11 @@ struct test_data Tests[] =
{__LINE__, L" :", NULL, 0, E_INVALIDARG, 0},
{__LINE__, L"/", NULL, 0, E_INVALIDARG, 0},
{__LINE__, L"//", NULL, 0, E_INVALIDARG, 0},
+ /* This opens C:\ from Win+R and address bar */
{__LINE__, L"\\", NULL, 0, E_INVALIDARG, 0},
+ /* These two opens "C:\Program Files" from Win+R and address bar */
+ {__LINE__, L"\\Program Files", NULL, 0, E_INVALIDARG, 0},
+ {__LINE__, L"\\Program Files\\", NULL, 0, E_INVALIDARG, 0},
{__LINE__, L"\\\\?", NULL, 0, E_INVALIDARG, 0},
{__LINE__, L"\\\\?\\", NULL, 0, E_INVALIDARG, 0},
/* Tests for the shell: protocol */
@@ -139,6 +143,7 @@ UINT get_host_os_flag()
START_TEST(SHParseDisplayName)
{
HRESULT hr;
+ WCHAR winDir[MAX_PATH];
UINT os_flag = get_host_os_flag();
ok (os_flag != 0, "Incompatible os version %d!", os_flag);
if (os_flag == 0)
@@ -148,6 +153,9 @@ START_TEST(SHParseDisplayName)
hr = SHGetDesktopFolder(&psfDesktop);
ok(hr == S_OK, "hr = %lx\n", hr);
+ GetWindowsDirectoryW(winDir, _countof(winDir));
+ SetCurrentDirectoryW(winDir);
+
for (UINT i = 0; i < _countof(Tests); i ++)
{
if (Tests[i].ValidForVersion && !(Tests[i].ValidForVersion &
os_flag))