Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 65426)
+++ CMakeLists.txt	(working copy)
@@ -1,7 +1,7 @@
 
 set_cpp(WITH_RUNTIME)
-add_executable(shell32_apitest menu.cpp testlist.c)
+add_executable(shell32_apitest menu.cpp testlist.c shellpath.c)
 target_link_libraries(shell32_apitest wine uuid)
 set_module_type(shell32_apitest win32cui)
-add_importlibs(shell32_apitest msvcrt kernel32 user32 gdi32 shell32 ole32 shlwapi)
+add_importlibs(shell32_apitest userenv msvcrt advapi32 kernel32 user32 gdi32 shell32 ole32 shlwapi)
 add_cd_file(TARGET shell32_apitest DESTINATION reactos/bin FOR all)
Index: shellpath.c
===================================================================
--- shellpath.c	(revision 0)
+++ shellpath.c	(working copy)
@@ -0,0 +1,611 @@
+/*
+ * PROJECT:         ReactOS api tests
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * PURPOSE:         Test for shell path functions
+ * PROGRAMMERS:     David Quintana
+ */
+
+#include "shelltest.h"
+
+#include <userenv.h>
+
+typedef struct _PathResult
+{
+    HRESULT hResult;
+    LPCWSTR szPath;
+} PathResult;
+
+typedef struct _PathGroup
+{
+    PathResult resNull;
+    PathResult resToken;
+    PathResult resDefaultUser;
+} PathGroup;
+
+typedef struct _PathTest
+{
+    int csidl;
+    LPCSTR szCsidl;
+    DWORD callFlags;
+    PathGroup results;
+    DWORD testFlags;
+} PathTest;
+
+#define TEST_IS_OPTIONAL_VERIFY 0x01
+#define TEST_IS_BROKEN          0x02
+#define TEST_IS_WOW64           0x04
+#define TEST_IS_OPTIONAL_ALWAYS 0x08
+#define TEST_SKIP_VERIFY        0x10
+#define TEST_REQUIRES_VERIFY    0x20
+#define ERR_FILENOTFOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
+
+#define TEST_CSIDL_CURRENT(csidl, h1, r1, h2, r2, h3, r3, r4...) { csidl, #csidl, SHGFP_TYPE_CURRENT, { {h1, r1}, {h2, r2}, {h3, r3} }, r4 }
+#define TEST_CSIDL_DEFAULT(csidl, h1, r1, h2, r2, h3, r3, r4...) { csidl, #csidl, SHGFP_TYPE_DEFAULT, { {h1, r1}, {h2, r2}, {h3, r3} }, r4 }
+
+/* Most tests have the same content for NULL and hToken because we can't test with another users' context. */
+/* TODO: Prepare another users' session other than the running one so that NULL is different than hToken. */
+/* Another TODO: Make these tests compatible with NT6 and up, which use different names for the special folders. */
+PathTest pathTests [] = {
+    /* CURRENT values */
+    TEST_CSIDL_CURRENT(CSIDL_DESKTOP,
+        S_OK, L"%ROSTEST_USER_PF%\\Desktop",
+        S_OK, L"%ROSTEST_USER_PF%\\Desktop",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Desktop",
+        TEST_SKIP_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_INTERNET, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_CURRENT(CSIDL_PROGRAMS,
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs",
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Start Menu\\Programs"),
+    TEST_CSIDL_CURRENT(CSIDL_CONTROLS, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_CURRENT(CSIDL_PRINTERS, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_CURRENT(CSIDL_PERSONAL,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents"),
+    TEST_CSIDL_CURRENT(CSIDL_FAVORITES,
+        S_OK, L"%ROSTEST_USER_PF%\\Favorites",
+        S_OK, L"%ROSTEST_USER_PF%\\Favorites",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Favorites"),
+    TEST_CSIDL_CURRENT(CSIDL_STARTUP,
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Start Menu\\Programs\\Startup"),
+    TEST_CSIDL_CURRENT(CSIDL_RECENT,
+        S_OK, L"%ROSTEST_USER_PF%\\Recent",
+        S_OK, L"%ROSTEST_USER_PF%\\Recent",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Recent"),
+    TEST_CSIDL_CURRENT(CSIDL_SENDTO,
+        S_OK, L"%ROSTEST_USER_PF%\\SendTo",
+        S_OK, L"%ROSTEST_USER_PF%\\SendTo",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\SendTo"),
+    TEST_CSIDL_CURRENT(CSIDL_BITBUCKET, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_CURRENT(CSIDL_STARTMENU,
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu",
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Start Menu"),
+    TEST_CSIDL_CURRENT(CSIDL_MYDOCUMENTS,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents"),
+    TEST_CSIDL_CURRENT(CSIDL_MYMUSIC,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Music",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Music",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents\\My Music",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_MYVIDEO,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Videos",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Videos",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents\\My Videos",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_DESKTOPDIRECTORY,
+        S_OK, L"%ROSTEST_USER_PF%\\Desktop",
+        S_OK, L"%ROSTEST_USER_PF%\\Desktop",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Desktop"),
+    TEST_CSIDL_CURRENT(CSIDL_DRIVES, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_CURRENT(CSIDL_NETWORK, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_CURRENT(CSIDL_NETHOOD,
+        S_OK, L"%ROSTEST_USER_PF%\\NetHood",
+        S_OK, L"%ROSTEST_USER_PF%\\NetHood",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\NetHood"),
+    TEST_CSIDL_CURRENT(CSIDL_FONTS,
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Fonts",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Fonts",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Fonts"),
+    TEST_CSIDL_CURRENT(CSIDL_TEMPLATES,
+        S_OK, L"%ROSTEST_USER_PF%\\Templates",
+        S_OK, L"%ROSTEST_USER_PF%\\Templates",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Templates"),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_STARTMENU,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu",
+        TEST_REQUIRES_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_PROGRAMS,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs",
+        TEST_REQUIRES_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_STARTUP,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Startup",
+        TEST_REQUIRES_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_DESKTOPDIRECTORY,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Desktop",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Desktop",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Desktop"),
+    TEST_CSIDL_CURRENT(CSIDL_APPDATA,
+        S_OK, L"%ROSTEST_USER_PF%\\Application Data",
+        S_OK, L"%ROSTEST_USER_PF%\\Application Data",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Application Data"),
+    TEST_CSIDL_CURRENT(CSIDL_PRINTHOOD,
+        S_OK, L"%ROSTEST_USER_PF%\\PrintHood",
+        S_OK, L"%ROSTEST_USER_PF%\\PrintHood",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\PrintHood"),
+    TEST_CSIDL_CURRENT(CSIDL_LOCAL_APPDATA,
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Application Data",
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Application Data",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Local Settings\\Application Data"),
+    TEST_CSIDL_CURRENT(CSIDL_ALTSTARTUP, S_FALSE, NULL, S_FALSE, NULL, S_FALSE, NULL),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_ALTSTARTUP, S_FALSE, NULL, S_FALSE, NULL, S_FALSE, NULL,
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_FAVORITES,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Favorites",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Favorites",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Favorites"),
+    TEST_CSIDL_CURRENT(CSIDL_INTERNET_CACHE,
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Temporary Internet Files",
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Temporary Internet Files",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Local Settings\\Temporary Internet Files"),
+    TEST_CSIDL_CURRENT(CSIDL_COOKIES,
+        S_OK, L"%ROSTEST_USER_PF%\\Cookies",
+        S_OK, L"%ROSTEST_USER_PF%\\Cookies",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Cookies"),
+    TEST_CSIDL_CURRENT(CSIDL_HISTORY,
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\History",
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\History",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Local Settings\\History"),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_APPDATA,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Application Data",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Application Data",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Application Data"),
+    TEST_CSIDL_CURRENT(CSIDL_WINDOWS,
+        S_OK, L"%ROSTEST_SYSTEMROOT%",
+        S_OK, L"%ROSTEST_SYSTEMROOT%",
+        S_OK, L"%ROSTEST_SYSTEMROOT%"),
+    TEST_CSIDL_CURRENT(CSIDL_SYSTEM,
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32"),
+    TEST_CSIDL_CURRENT(CSIDL_PROGRAM_FILES,
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files"),
+    TEST_CSIDL_CURRENT(CSIDL_MYPICTURES,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Pictures",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Pictures",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents\\My Pictures",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_PROFILE,
+        S_OK, L"%ROSTEST_USER_PF%",
+        S_OK, L"%ROSTEST_USER_PF%",
+        S_OK, L"%ROSTEST_DEFAULT_PF%",
+        TEST_SKIP_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_SYSTEMX86, /* TODO: SysWow64 in X64 OS only */
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32"),
+    TEST_CSIDL_CURRENT(CSIDL_PROGRAM_FILESX86, /* TODO: Program Files (x86) in X64 OS only */
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)",
+        TEST_IS_WOW64),
+    TEST_CSIDL_CURRENT(CSIDL_PROGRAM_FILES_COMMON, /* TODO: Valid only on Windows XP */
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files\\Common Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files\\Common Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files\\Common Files"),
+    TEST_CSIDL_CURRENT(CSIDL_PROGRAM_FILES_COMMONX86, /* TODO: Valid only on Windows XP, Program Files (x86) in X64 OS only */
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)\\Common Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)\\Common Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)\\Common Files",
+        TEST_IS_WOW64),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_TEMPLATES,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Templates",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Templates",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Templates"),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_DOCUMENTS,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents"),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_ADMINTOOLS,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Administrative Tools",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Administrative Tools",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Administrative Tools",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_ADMINTOOLS,
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Administrative Tools",
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Administrative Tools",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Start Menu\\Programs\\Administrative Tools",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_CONNECTIONS, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_MUSIC,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Music",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Music",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Music",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_PICTURES,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Pictures",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Pictures",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Pictures",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_VIDEO,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Videos",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Videos",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Videos",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_RESOURCES,
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources"),
+    TEST_CSIDL_CURRENT(CSIDL_RESOURCES_LOCALIZED,
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources\\0409",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources\\0409",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources\\0409",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_COMMON_OEM_LINKS, S_FALSE, NULL, S_FALSE, NULL, S_FALSE, NULL,
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_CDBURN_AREA,
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Application Data\\Microsoft\\CD Burning",
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Application Data\\Microsoft\\CD Burning",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Local Settings\\Application Data\\Microsoft\\CD Burning",
+        TEST_IS_OPTIONAL_VERIFY),
+    TEST_CSIDL_CURRENT(CSIDL_COMPUTERSNEARME, E_FAIL, NULL, E_FAIL, NULL, E_FAIL, NULL),
+    TEST_CSIDL_CURRENT(CSIDL_PROFILES, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+
+    /* DEFAULT values */
+    TEST_CSIDL_DEFAULT(CSIDL_DESKTOP,
+        S_OK, L"%ROSTEST_USER_PF%\\Desktop",
+        S_OK, L"%ROSTEST_USER_PF%\\Desktop",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Desktop"),
+    TEST_CSIDL_DEFAULT(CSIDL_INTERNET, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_DEFAULT(CSIDL_PROGRAMS,
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs",
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Start Menu\\Programs"),
+    TEST_CSIDL_DEFAULT(CSIDL_CONTROLS, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_DEFAULT(CSIDL_PRINTERS, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_DEFAULT(CSIDL_PERSONAL,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents"),
+    TEST_CSIDL_DEFAULT(CSIDL_FAVORITES,
+        S_OK, L"%ROSTEST_USER_PF%\\Favorites",
+        S_OK, L"%ROSTEST_USER_PF%\\Favorites",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Favorites"),
+    TEST_CSIDL_DEFAULT(CSIDL_STARTUP,
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Start Menu\\Programs\\Startup"),
+    TEST_CSIDL_DEFAULT(CSIDL_RECENT,
+        S_OK, L"%ROSTEST_USER_PF%\\Recent",
+        S_OK, L"%ROSTEST_USER_PF%\\Recent",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Recent"),
+    TEST_CSIDL_DEFAULT(CSIDL_SENDTO,
+        S_OK, L"%ROSTEST_USER_PF%\\SendTo",
+        S_OK, L"%ROSTEST_USER_PF%\\SendTo",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\SendTo"),
+    TEST_CSIDL_DEFAULT(CSIDL_BITBUCKET, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_DEFAULT(CSIDL_STARTMENU,
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu",
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Start Menu"),
+    TEST_CSIDL_DEFAULT(CSIDL_MYDOCUMENTS,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents"),
+    TEST_CSIDL_DEFAULT(CSIDL_MYMUSIC,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Music",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Music",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents\\My Music"),
+    TEST_CSIDL_DEFAULT(CSIDL_MYVIDEO,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Videos",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Videos",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents\\My Videos"),
+    TEST_CSIDL_DEFAULT(CSIDL_DESKTOPDIRECTORY,
+        S_OK, L"%ROSTEST_USER_PF%\\Desktop",
+        S_OK, L"%ROSTEST_USER_PF%\\Desktop",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Desktop"),
+    TEST_CSIDL_DEFAULT(CSIDL_DRIVES, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_DEFAULT(CSIDL_NETWORK, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_DEFAULT(CSIDL_NETHOOD,
+        S_OK, L"%ROSTEST_USER_PF%\\NetHood",
+        S_OK, L"%ROSTEST_USER_PF%\\NetHood",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\NetHood"),
+    TEST_CSIDL_DEFAULT(CSIDL_FONTS,
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Fonts",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Fonts",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Fonts"),
+    TEST_CSIDL_DEFAULT(CSIDL_TEMPLATES,
+        S_OK, L"%ROSTEST_USER_PF%\\Templates",
+        S_OK, L"%ROSTEST_USER_PF%\\Templates",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Templates"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_STARTMENU,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_PROGRAMS,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_STARTUP,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Startup"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_DESKTOPDIRECTORY,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Desktop",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Desktop",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Desktop"),
+    TEST_CSIDL_DEFAULT(CSIDL_APPDATA,
+        S_OK, L"%ROSTEST_USER_PF%\\Application Data",
+        S_OK, L"%ROSTEST_USER_PF%\\Application Data",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Application Data"),
+    TEST_CSIDL_DEFAULT(CSIDL_PRINTHOOD,
+        S_OK, L"%ROSTEST_USER_PF%\\PrintHood",
+        S_OK, L"%ROSTEST_USER_PF%\\PrintHood",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\PrintHood"),
+    TEST_CSIDL_DEFAULT(CSIDL_LOCAL_APPDATA,
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Application Data",
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Application Data",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Local Settings\\Application Data"),
+    TEST_CSIDL_DEFAULT(CSIDL_ALTSTARTUP,
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Start Menu\\Programs\\Startup"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_ALTSTARTUP,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Startup",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Startup"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_FAVORITES,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Favorites",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Favorites",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Favorites"),
+    TEST_CSIDL_DEFAULT(CSIDL_INTERNET_CACHE,
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Temporary Internet Files",
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Temporary Internet Files",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Local Settings\\Temporary Internet Files"),
+    TEST_CSIDL_DEFAULT(CSIDL_COOKIES,
+        S_OK, L"%ROSTEST_USER_PF%\\Cookies",
+        S_OK, L"%ROSTEST_USER_PF%\\Cookies",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Cookies"),
+    TEST_CSIDL_DEFAULT(CSIDL_HISTORY,
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\History",
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\History",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Local Settings\\History"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_APPDATA,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Application Data",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Application Data",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Application Data"),
+    TEST_CSIDL_DEFAULT(CSIDL_WINDOWS,
+        S_OK, L"%ROSTEST_SYSTEMROOT%",
+        S_OK, L"%ROSTEST_SYSTEMROOT%",
+        S_OK, L"%ROSTEST_SYSTEMROOT%"),
+    TEST_CSIDL_DEFAULT(CSIDL_SYSTEM,
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32"),
+    TEST_CSIDL_DEFAULT(CSIDL_PROGRAM_FILES,
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files"),
+    TEST_CSIDL_DEFAULT(CSIDL_MYPICTURES,
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Pictures",
+        S_OK, L"%ROSTEST_USER_PF%\\My Documents\\My Pictures",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\My Documents\\My Pictures"),
+    TEST_CSIDL_DEFAULT(CSIDL_PROFILE,
+        S_OK, L"%ROSTEST_USER_PF%",
+        S_OK, L"%ROSTEST_USER_PF%",
+        S_OK, L"%ROSTEST_DEFAULT_PF%"),
+    TEST_CSIDL_DEFAULT(CSIDL_SYSTEMX86, /* TODO: SysWow64 in X64 OS only */
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\System32"),
+    TEST_CSIDL_DEFAULT(CSIDL_PROGRAM_FILESX86, /* TODO: Program Files (x86) in X64 OS only */
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)",
+        TEST_IS_WOW64),
+    TEST_CSIDL_DEFAULT(CSIDL_PROGRAM_FILES_COMMON, /* TODO: Valid only on Windows XP */
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files\\Common Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files\\Common Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files\\Common Files"),
+    TEST_CSIDL_DEFAULT(CSIDL_PROGRAM_FILES_COMMONX86, /* TODO: Valid only on Windows XP, Program Files (x86) in X64 OS only */
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)\\Common Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)\\Common Files",
+        S_OK, L"%ROSTEST_SYSTEMDRIVE%\\Program Files (x86)\\Common Files",
+        TEST_IS_WOW64),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_TEMPLATES,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Templates",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Templates",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Templates"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_DOCUMENTS,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_ADMINTOOLS,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Administrative Tools",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Administrative Tools",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Start Menu\\Programs\\Administrative Tools"),
+    TEST_CSIDL_DEFAULT(CSIDL_ADMINTOOLS,
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Administrative Tools",
+        S_OK, L"%ROSTEST_USER_PF%\\Start Menu\\Programs\\Administrative Tools",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Start Menu\\Programs\\Administrative Tools"),
+    TEST_CSIDL_DEFAULT(CSIDL_CONNECTIONS, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_MUSIC,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Music",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Music",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Music"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_PICTURES,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Pictures",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Pictures",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Pictures"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_VIDEO,
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Videos",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Videos",
+        S_OK, L"%ROSTEST_COMMON_PF%\\Documents\\My Videos"),
+    TEST_CSIDL_DEFAULT(CSIDL_RESOURCES,
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources"),
+    TEST_CSIDL_DEFAULT(CSIDL_RESOURCES_LOCALIZED, /* uses locale subfolder if verify is enabled */
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources\\0409",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources\\0409",
+        S_OK, L"%ROSTEST_SYSTEMROOT%\\Resources\\0409",
+        TEST_SKIP_VERIFY),
+    TEST_CSIDL_DEFAULT(CSIDL_COMMON_OEM_LINKS,
+        S_OK, L"%ROSTEST_COMMON_PF%\\OEM Links",
+        S_OK, L"%ROSTEST_COMMON_PF%\\OEM Links",
+        S_OK, L"%ROSTEST_COMMON_PF%\\OEM Links"),
+    TEST_CSIDL_DEFAULT(CSIDL_CDBURN_AREA,
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Application Data\\Microsoft\\CD Burning",
+        S_OK, L"%ROSTEST_USER_PF%\\Local Settings\\Application Data\\Microsoft\\CD Burning",
+        S_OK, L"%ROSTEST_DEFAULT_PF%\\Local Settings\\Application Data\\Microsoft\\CD Burning"),
+    TEST_CSIDL_DEFAULT(CSIDL_COMPUTERSNEARME, E_FAIL, NULL, E_FAIL, NULL, E_FAIL, NULL),
+    TEST_CSIDL_DEFAULT(CSIDL_PROFILES, E_INVALIDARG, NULL, E_INVALIDARG, NULL, E_INVALIDARG, NULL),
+
+    // Mark the end of the list
+    { -1 }
+};
+
+void TestGetShellFolder(HANDLE hToken, PathTest * test, PathResult * expectedResults, BOOL verify)
+{
+    int cmp;
+    HRESULT hr;
+    WCHAR pathResult[MAX_PATH];
+    WCHAR pathExpected[MAX_PATH];
+
+    if (verify)
+    {
+        hr = SHGetFolderPathW(NULL, test->csidl, hToken, test->callFlags, pathResult);
+
+        if (hr != S_OK && (test->testFlags & TEST_IS_OPTIONAL_VERIFY))
+        {
+            skip("SHGetFolderPathW(%s,%p,%lx) optional folder skipped (1).\n", test->szCsidl, hToken, test->callFlags);
+            return;
+        }
+    }
+    else
+    {
+        hr = SHGetFolderPathW(NULL, test->csidl | CSIDL_FLAG_DONT_VERIFY, hToken, test->callFlags, pathResult);
+
+        if (hr != S_OK && (test->testFlags & TEST_REQUIRES_VERIFY))
+        {
+            return;
+        }
+    }
+
+    if (hr == ERR_FILENOTFOUND && (test->testFlags & TEST_IS_OPTIONAL_ALWAYS))
+    {
+        skip("SHGetFolderPathW(%s,%p,%lx) optional folder skipped (%d).\n", test->szCsidl, hToken, test->callFlags, verify);
+        return;
+    }
+
+    if (hr == E_FAIL && (test->testFlags & TEST_IS_WOW64))
+    {
+        skip("SHGetFolderPathW(%s,%p,%lx) test requires WOW64.\n", test->szCsidl, hToken, test->callFlags);
+        return;
+    }
+
+    ok(hr == expectedResults->hResult, "SHGetFolderPathW(%s,%p,%lx) unexpected hresult %08lx, expected %08lx (%d).\n", test->szCsidl, hToken, test->callFlags, hr, expectedResults->hResult, verify);
+
+    /* In the first case, we can't continue due to the function having failed.
+    In the second case we can't continue due to not expecting it to return anything. */
+    if (expectedResults->hResult != S_OK)
+    {
+        if (hr == S_OK)
+        {
+            trace("\tThe returned path was: %S\n", pathResult);
+        }
+        return;
+    }
+
+    if (!ExpandEnvironmentStringsW(expectedResults->szPath, pathExpected, _countof(pathExpected)))
+    {
+        wcscpy(pathExpected, expectedResults->szPath);
+    }
+
+    if (hr != S_OK)
+    {
+        trace("\tThe expected path was: %S\n", pathExpected);
+        return;
+    }
+
+    cmp = lstrcmpiW(pathResult, pathExpected);
+
+    ok(cmp == 0, "SHGetFolderPathW(%s,%p,%lx) unexpected path '%S' (%d).\n", test->szCsidl, hToken, test->callFlags, pathResult,verify);
+    if (cmp)
+    {
+        trace("\tThe expected path was: %S\n", pathExpected);
+        return;
+    }
+
+}
+
+void TestGetShellFolderList(HANDLE hToken, PathTest * tests)
+{
+    for (; tests->csidl >= 0; tests++)
+    {
+        if (!(tests->testFlags & TEST_REQUIRES_VERIFY))
+        {
+            TestGetShellFolder(NULL, tests, &(tests->results.resNull), FALSE);
+            TestGetShellFolder(hToken, tests, &(tests->results.resToken), FALSE);
+            TestGetShellFolder((HANDLE) -1, tests, &(tests->results.resDefaultUser), FALSE);
+        }
+        if (!(tests->testFlags & TEST_SKIP_VERIFY))
+        {
+            TestGetShellFolder(NULL, tests, &(tests->results.resNull), TRUE);
+            TestGetShellFolder(hToken, tests, &(tests->results.resToken), TRUE);
+            TestGetShellFolder((HANDLE) -1, tests, &(tests->results.resDefaultUser), TRUE);
+        }
+    }
+}
+
+void PrepareEnvironmentVariables(HANDLE hToken)
+{
+    WCHAR szProfileFolder[MAX_PATH];
+    WCHAR szDriveRoot[MAX_PATH];
+    DWORD count = _countof(szProfileFolder);
+
+    GetUserProfileDirectoryW(hToken, szProfileFolder, &count);
+    SetEnvironmentVariableW(L"ROSTEST_USER_PF", szProfileFolder);
+
+    count = _countof(szProfileFolder);
+    GetAllUsersProfileDirectoryW(szProfileFolder, &count);
+    SetEnvironmentVariableW(L"ROSTEST_COMMON_PF", szProfileFolder);
+
+    count = _countof(szProfileFolder);
+    GetDefaultUserProfileDirectoryW(szProfileFolder, &count);
+    SetEnvironmentVariableW(L"ROSTEST_DEFAULT_PF", szProfileFolder);
+
+    count = _countof(szProfileFolder);
+    GetProfilesDirectoryW(szProfileFolder, &count);
+    SetEnvironmentVariableW(L"ROSTEST_PROFILES", szProfileFolder);
+
+    count = _countof(szProfileFolder);
+    GetWindowsDirectoryW(szProfileFolder, count);
+    SetEnvironmentVariableW(L"ROSTEST_SYSTEMROOT", szProfileFolder);
+
+    _wsplitpath(szProfileFolder, szDriveRoot, NULL, NULL, NULL);
+
+    SetEnvironmentVariableW(L"ROSTEST_SYSTEMDRIVE", szDriveRoot);
+}
+
+START_TEST(shellpath)
+{
+    HANDLE hToken;
+    OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken);
+
+    trace("Begin Path Tests...\n");
+    PrepareEnvironmentVariables(hToken);
+    TestGetShellFolderList(hToken, pathTests);
+}
Index: shelltest.h
===================================================================
--- shelltest.h	(revision 65426)
+++ shelltest.h	(working copy)
@@ -25,6 +25,7 @@
 #define test_S_OK(hres, message) ok(hres == S_OK, "%s (0x%lx instead of S_OK)\n",message, hResult);
 #define test_HRES(hres, hresExpected, message) ok(hres == hresExpected, "%s (0x%lx instead of 0x%lx)\n",message, hResult,hresExpected);
 
+#if __cplusplus
 DEFINE_GUID(CLSID_MenuBandSite, 0xE13EF4E4, 0xD2F2, 0x11D0, 0x98, 0x16, 0x00, 0xC0, 0x4F, 0xD9, 0x19, 0x72);
 
 template<typename Interface>
@@ -61,4 +62,4 @@
 
     virtual ~CUnknownBase() {}
 };
-
+#endif
\ No newline at end of file
Index: testlist.c
===================================================================
--- testlist.c	(revision 65426)
+++ testlist.c	(working copy)
@@ -4,10 +4,11 @@
 #include <wine/test.h>
 
 extern void func_menu(void);
+extern void func_shellpath(void);
 
 const struct test winetest_testlist[] =
 {
     { "menu", func_menu },
-    
+    { "shellpath", func_shellpath },
     { 0, 0 }
 };
