28#define WINVER_VISTA 0x0600
31#define ok_hr(status, expected) ok_hex(status, expected)
34#define test_at_end (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : test_at_end_imp
35#define test_ExpectDrives (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : test_ExpectDrives_imp
36#define test_ExpectFolders (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : test_ExpectFolders_imp
37#define winetest_ok_hr(expression, expected) \
39 int _value = (expression); \
40 winetest_ok(_value == (expected), "Wrong value for '%s', expected: " #expected " (0x%x), got: 0x%x\n", \
41 #expression, (int)(expected), _value); \
46 CComHeapPtr<OLECHAR>
Result;
47 ULONG Fetched = 12345;
50 winetest_ok(Fetched == 0
u,
"Expected Fetched to be 0, was: %lu\n", Fetched);
55static bool GetDisplayname(CComPtr<IShellFolder>& spDrives, CComHeapPtr<ITEMIDLIST>& pidl, CComHeapPtr<WCHAR>& DisplayName)
88 CComPtr<IShellFolder> spDesktop;
91 CComPtr<IShellFolder> spTarget;
100 spTarget = spDesktop;
103 SHCONTF EnumFlags = SHCONTF_FOLDERS | SHCONTF_INIT_ON_FIRST_NEXT;
105 EnumFlags |= SHCONTF_INCLUDEHIDDEN;
107 EnumFlags |= SHCONTF_NONFOLDERS;
109 CComPtr<IEnumIDList> spEnumIDList;
115 CComHeapPtr<ITEMIDLIST> pidl;
117 while (spEnumIDList->Next(1, &pidl,
NULL) ==
S_OK)
119 CComHeapPtr<WCHAR> DisplayName;
123 CComHeapPtr<OLECHAR>
Result;
125 hr = EnumStr->Next(1, &
Result, &Fetched);
153 CComPtr<IEnumString> EnumStr;
158 skip(
"CoCreateInstance failed\n");
162 CComPtr<IACList2> ACList;
166 skip(
"QueryInterface failed\n");
178 CComHeapPtr<ITEMIDLIST> pidlDiskRoot;
182 skip(
"SHParseDisplayName failed\n");
198 CComPtr<IEnumString> EnumStr;
203 skip(
"CoCreateInstance failed\n");
207 CComPtr<IACList2> ACList;
211 skip(
"QueryInterface failed\n");
215 CComPtr<ICurrentWorkingDirectory> CurrentWorkingDir;
219 skip(
"QueryInterface failed\n");
237 CComHeapPtr<ITEMIDLIST> pidlDiskRoot;
242 ok_hr(
hr = CurrentWorkingDir->SetDirectory(Buffer2),
S_OK);
257 ok_hr(
hr = CurrentWorkingDir->SetDirectory(Buffer2),
S_OK);
313 hr = EnumStr->Next(1, &psz, &cGot);
320 hr = EnumStr->Next(1, &psz, &cGot);
331 hr = EnumStr->Next(1, &psz, &cGot);
336 hr = EnumStr->Next(1, &psz, &cGot);
347 hr = EnumStr->Next(1, &psz, &cGot);
352 hr = EnumStr->Next(1, &psz, &cGot);
385 CComPtr<IEnumString> EnumStr;
390 skip(
"CoCreateInstance failed\n");
394 CComPtr<IACList2> ACList;
398 skip(
"QueryInterface failed\n");
402 CComPtr<ICurrentWorkingDirectory> CurrentWorkingDir;
406 skip(
"QueryInterface failed\n");
422 ok_hr(
hr = CurrentWorkingDir->SetDirectory(
L"C:\\BROWSEUI-1\\TEST1"),
S_OK);
425 ok_hr(
hr = ACList->Expand(
L"C:\\BROWSEUI-2\\TEST1\\"),
S_OK);
430 hr = EnumStr->Next(1, &psz, &cGot);
432 ok_wstr(psz,
L"C:\\BROWSEUI-2\\TEST1\\TEST4");
435 hr = EnumStr->Next(1, &psz, &cGot);
442 ok_hr(
hr = ACList->Expand(
L"C:\\BROWSEUI-1\\TEST1\\"),
S_OK);
444 hr = EnumStr->Next(1, &psz, &cGot);
446 ok_wstr(psz,
L"C:\\BROWSEUI-1\\TEST1\\TEST3");
449 hr = EnumStr->Next(1, &psz, &cGot);
456 ok_hr(
hr = CurrentWorkingDir->SetDirectory(
L"C:\\BROWSEUI-2\\TEST1"),
S_OK);
461 hr = EnumStr->Next(1, &psz, &cGot);
466 hr = EnumStr->Next(1, &psz, &cGot);
473 ok_hr(
hr = ACList->Expand(
L"\\BROWSEUI-2\\TEST1\\"),
S_OK);
475 hr = EnumStr->Next(1, &psz, &cGot);
477 ok_wstr(psz,
L"\\BROWSEUI-2\\TEST1\\TEST4");
480 hr = EnumStr->Next(1, &psz, &cGot);
500 CComPtr<IACList2> ACList;
505 skip(
"CoCreateInstance failed\n");
510 DWORD CurrentOption = 0xdeadbeef;
511 ok_hr(ACList->GetOptions(&CurrentOption),
S_OK);
516 CComPtr<IEnumString> EnumStr;
520 skip(
"QueryInterface failed\n");
524 CComPtr<IPersistFolder> PersistFolder;
528 skip(
"QueryInterface failed\n");
532 CComHeapPtr<ITEMIDLIST> pidlMyComputer;
536 skip(
"SHGetSpecialFolderLocation failed\n");
540 hr = EnumStr->Reset();
555 CComHeapPtr<ITEMIDLIST> pidlDiskRoot;
581 CComPtr<IEnumString> EnumStr;
586 skip(
"CoCreateInstance failed\n");
590 CComPtr<IACList2> ACList;
594 skip(
"QueryInterface failed\n");
605 CComPtr<IEnumString> EnumStr;
610 skip(
"CoCreateInstance failed\n");
614 CComPtr<IACList2> ACList;
618 skip(
"QueryInterface failed\n");
622 CComHeapPtr<ITEMIDLIST> pidlFavorites;
626 skip(
"SHGetSpecialFolderLocation failed\n");
637 CComPtr<IEnumString> EnumStr;
642 skip(
"CoCreateInstance failed\n");
646 CComPtr<IACList2> ACList;
650 skip(
"QueryInterface failed\n");
658 CComHeapPtr<ITEMIDLIST> pidlDiskRoot;
662 skip(
"SHParseDisplayName failed\n");
676 CComPtr<IEnumString> EnumStr;
681 skip(
"CoCreateInstance failed\n");
685 CComPtr<IACList2> ACList;
689 skip(
"QueryInterface failed\n");
697 CComHeapPtr<ITEMIDLIST> pidlDiskRoot;
716 pRtlGetVersion(&rtlinfo);
732 skip(
"CoInitialize failed\n");
static void test_ExpectDrives_imp(CComPtr< IEnumString > &EnumStr, CComHeapPtr< ITEMIDLIST > &pidlTarget)
static void test_ACListISF_CURRENTDIR()
#define test_ExpectFolders
static void test_ACListISF_DESKTOP()
static void test_ACListISF_FILESYSDIRS()
static void test_ACListISF_CURRENTDIR2()
static void test_ACListISF_FILESYSONLY()
static void test_ACListISF_MYCOMPUTER()
static void GetEnvStatus()
ExpectOptions operator|(const ExpectOptions &left, const ExpectOptions &right)
static void test_ACListISF_NONE()
static DWORD g_WinVersion
static void test_ExpectFolders_imp(CComPtr< IEnumString > &EnumStr, LPITEMIDLIST pidlTarget, const WCHAR *Root, ExpectOptions options)
#define ok_hr(status, expected)
static bool GetDisplayname(CComPtr< IShellFolder > &spDrives, CComHeapPtr< ITEMIDLIST > &pidl, CComHeapPtr< WCHAR > &DisplayName)
static void test_ACListISF_FAVORITES()
#define winetest_ok_hr(expression, expected)
#define test_ExpectDrives
static void test_at_end_imp(CComPtr< IEnumString > &EnumStr)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define GetProcAddress(x, y)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
UINT WINAPI GetSystemWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
HRESULT WINAPI StrRetToStrW(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPWSTR *ppszName)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
VOID WINAPI CoTaskMemFree(LPVOID ptr)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
const GUID IID_IEnumString
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
#define SSF_SHOWALLOBJECTS
ITEMIDLIST UNALIGNED * LPITEMIDLIST
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
root entry for file system trees
ULONG dwOSVersionInfoSize
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
#define IID_PPV_ARG(Itype, ppType)