2 * Tests for special shell folders
4 * Copyright 2008 Robert Shearman for CodeWeavers
5 * Copyright 2008 Owen Rudge
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #define WIN32_LEAN_AND_MEAN
31 #include "wine/test.h"
33 /* Tests for My Network Places */
34 static void test_parse_for_entire_network(void)
36 static const WCHAR entire_network_path
[] = {
37 ':',':','{','2','0','8','D','2','C','6','0','-','3','A','E','A','-',
38 '1','0','6','9','-','A','2','D','7','-','0','8','0','0','2','B','3','0','3','0','9','D',
39 '}','\\','E','n','t','i','r','e','N','e','t','w','o','r','k',0 };
40 IShellFolder
*psfDesktop
;
42 DWORD eaten
= 0xdeadbeef;
47 hr
= SHGetDesktopFolder(&psfDesktop
);
48 ok(hr
== S_OK
, "SHGetDesktopFolder failed with error 0x%x\n", hr
);
50 hr
= IShellFolder_ParseDisplayName(psfDesktop
, NULL
, NULL
, (LPWSTR
)entire_network_path
, &eaten
, &pidl
, &attr
);
51 ok(hr
== S_OK
, "IShellFolder_ParseDisplayName failed with error 0x%x\n", hr
);
53 ok(eaten
== 0xdeadbeef, "eaten should not have been set to %u\n", eaten
);
54 expected_attr
= SFGAO_HASSUBFOLDER
|SFGAO_FOLDER
|SFGAO_FILESYSANCESTOR
|SFGAO_STORAGEANCESTOR
|SFGAO_HASPROPSHEET
|SFGAO_CANLINK
;
56 ok(attr
== expected_attr
, "attr should be 0x%x, not 0x%x\n", expected_attr
, attr
);
61 /* Tests for Control Panel */
62 static void test_parse_for_control_panel(void)
64 /* path of My Computer\Control Panel */
65 static const WCHAR control_panel_path
[] = {
66 ':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}','\\',
67 ':',':','{','2','1','E','C','2','0','2','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','D','-','0','8','0','0','2','B','3','0','3','0','9','D','}', 0 };
68 IShellFolder
*psfDesktop
;
70 DWORD eaten
= 0xdeadbeef;
75 hr
= SHGetDesktopFolder(&psfDesktop
);
76 ok(hr
== S_OK
, "SHGetDesktopFolder failed with error 0x%x\n", hr
);
78 hr
= IShellFolder_ParseDisplayName(psfDesktop
, NULL
, NULL
, (LPWSTR
)control_panel_path
, &eaten
, &pidl
, &attr
);
79 ok(hr
== S_OK
, "IShellFolder_ParseDisplayName failed with error 0x%x\n", hr
);
80 todo_wine
ok(eaten
== 0xdeadbeef, "eaten should not have been set to %u\n", eaten
);
82 expected_attr
= SFGAO_CANLINK
| SFGAO_FOLDER
| SFGAO_HASSUBFOLDER
;
83 todo_wine
ok(attr
== expected_attr
, "attr should be 0x%x, not 0x%x\n", expected_attr
, attr
);
89 START_TEST(shfldr_special
)
91 test_parse_for_entire_network();
92 test_parse_for_control_panel();