mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[SHELL32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
svn path=/trunk/; revision=74889
This commit is contained in:
parent
980868b1f9
commit
3145e7c7c1
10 changed files with 663 additions and 166 deletions
|
@ -27,7 +27,7 @@ list(APPEND SOURCE
|
||||||
add_executable(shell32_winetest ${SOURCE})
|
add_executable(shell32_winetest ${SOURCE})
|
||||||
target_link_libraries(shell32_winetest uuid)
|
target_link_libraries(shell32_winetest uuid)
|
||||||
set_module_type(shell32_winetest win32cui)
|
set_module_type(shell32_winetest win32cui)
|
||||||
add_importlibs(shell32_winetest shell32 ole32 oleaut32 user32 advapi32 msvcrt kernel32)
|
add_importlibs(shell32_winetest shell32 ole32 oleaut32 user32 gdi32 advapi32 msvcrt kernel32)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_importlibs(shell32_winetest ntdll)
|
add_importlibs(shell32_winetest ntdll)
|
||||||
|
|
|
@ -71,6 +71,10 @@ DEFINE_GUID(IID_UnknownInterface17, 0x3d5d8c60, 0x21e4, 0x4b03, 0x83,0xb8, 0xc
|
||||||
DEFINE_GUID(IID_UnknownInterface18, 0x1fc45c07, 0x9e35, 0x4276, 0xad,0x7f, 0x08,0x60,0x3a,0xa0,0xf6,0x0f);
|
DEFINE_GUID(IID_UnknownInterface18, 0x1fc45c07, 0x9e35, 0x4276, 0xad,0x7f, 0x08,0x60,0x3a,0xa0,0xf6,0x0f);
|
||||||
DEFINE_GUID(IID_UnknownInterface19, 0xacd9b67a, 0xceab, 0x4c6c, 0x90,0xa1, 0xe8,0x57,0xc6,0x59,0xe3,0x9d);
|
DEFINE_GUID(IID_UnknownInterface19, 0xacd9b67a, 0xceab, 0x4c6c, 0x90,0xa1, 0xe8,0x57,0xc6,0x59,0xe3,0x9d);
|
||||||
DEFINE_GUID(IID_UnknownInterface20, 0xd0fe6f62, 0xdea4, 0x46c9, 0x9d,0xae, 0x36,0xcb,0x13,0x99,0x78,0xfa);
|
DEFINE_GUID(IID_UnknownInterface20, 0xd0fe6f62, 0xdea4, 0x46c9, 0x9d,0xae, 0x36,0xcb,0x13,0x99,0x78,0xfa);
|
||||||
|
DEFINE_GUID(IID_UnknownInterface21, 0x732c1ccd, 0xbc5c, 0x4065, 0x88,0xcb, 0xfb,0x5b,0xce,0xa7,0x1f,0x66);
|
||||||
|
DEFINE_GUID(IID_UnknownInterface22, 0xc13b3d3a, 0x10d6, 0x43f5, 0x98,0xdb, 0xb7,0xdd,0xd9,0x87,0xb3,0x3d);
|
||||||
|
DEFINE_GUID(IID_UnknownInterface23, 0x2e228ba3, 0xea25, 0x4378, 0x97,0xb6, 0xd5,0x74,0xfa,0xeb,0xa3,0x56);
|
||||||
|
DEFINE_GUID(IID_UnknownInterface24, 0xd56a2092, 0x7dbf, 0x4144, 0xa1,0x10, 0xc2,0x96,0x3a,0x70,0x98,0x32);
|
||||||
|
|
||||||
static HWND hwnd;
|
static HWND hwnd;
|
||||||
|
|
||||||
|
@ -571,7 +575,7 @@ static void test_QueryInterface(void)
|
||||||
test_qinterface(IID_IUnknown, S_OK);
|
test_qinterface(IID_IUnknown, S_OK);
|
||||||
test_qinterface(IID_IExplorerBrowser, S_OK);
|
test_qinterface(IID_IExplorerBrowser, S_OK);
|
||||||
test_qinterface(IID_IShellBrowser, S_OK);
|
test_qinterface(IID_IShellBrowser, S_OK);
|
||||||
todo_wine test_qinterface(IID_IOleWindow, S_OK);
|
test_qinterface(IID_IOleWindow, S_OK);
|
||||||
test_qinterface(IID_ICommDlgBrowser, S_OK);
|
test_qinterface(IID_ICommDlgBrowser, S_OK);
|
||||||
test_qinterface(IID_ICommDlgBrowser2, S_OK);
|
test_qinterface(IID_ICommDlgBrowser2, S_OK);
|
||||||
test_qinterface(IID_ICommDlgBrowser3, S_OK);
|
test_qinterface(IID_ICommDlgBrowser3, S_OK);
|
||||||
|
@ -960,6 +964,13 @@ static void test_SetSite(void)
|
||||||
{ &IID_UnknownInterface16, &IID_UnknownInterface16, 0, NULL },
|
{ &IID_UnknownInterface16, &IID_UnknownInterface16, 0, NULL },
|
||||||
{ &IID_UnknownInterface17, &IID_UnknownInterface17, 0, NULL },
|
{ &IID_UnknownInterface17, &IID_UnknownInterface17, 0, NULL },
|
||||||
{ &IID_UnknownInterface17, &IID_UnknownInterface19, 0, NULL },
|
{ &IID_UnknownInterface17, &IID_UnknownInterface19, 0, NULL },
|
||||||
|
/* Win 10 */
|
||||||
|
{ &IID_UnknownInterface21, &IID_UnknownInterface21, 0, NULL },
|
||||||
|
{ &IID_UnknownInterface21, &IID_IFileDialog, 0, NULL },
|
||||||
|
{ &IID_UnknownInterface22, &IID_UnknownInterface22, 0, NULL },
|
||||||
|
{ &IID_UnknownInterface23, &IID_UnknownInterface23, 0, NULL },
|
||||||
|
{ &IID_UnknownInterface24, &IID_UnknownInterface24, 0, NULL },
|
||||||
|
{ &IID_UnknownInterface24, &IID_IFileDialog, 0, NULL },
|
||||||
|
|
||||||
/* Other services requested in Vista, Windows 2008 but not in Windows 7 */
|
/* Other services requested in Vista, Windows 2008 but not in Windows 7 */
|
||||||
{ &IID_IBrowserSettings_Vista, &IID_IBrowserSettings_Vista, 0, NULL },
|
{ &IID_IBrowserSettings_Vista, &IID_IBrowserSettings_Vista, 0, NULL },
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include "shlwapi.h"
|
#include "shlwapi.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
#include "initguid.h"
|
||||||
|
|
||||||
#define EXPECT_HR(hr,hr_exp) \
|
#define EXPECT_HR(hr,hr_exp) \
|
||||||
ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
|
ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
|
||||||
|
|
||||||
|
@ -37,6 +39,9 @@ static HRESULT (WINAPI *pSHGetNameFromIDList)(PCIDLIST_ABSOLUTE,SIGDN,PWSTR*);
|
||||||
static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *);
|
static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *);
|
||||||
static DWORD (WINAPI *pGetLongPathNameW)(LPCWSTR, LPWSTR, DWORD);
|
static DWORD (WINAPI *pGetLongPathNameW)(LPCWSTR, LPWSTR, DWORD);
|
||||||
|
|
||||||
|
/* Updated Windows 7 has a new IShellDispatch6 in its typelib */
|
||||||
|
DEFINE_GUID(IID_IWin7ShellDispatch6, 0x34936ba1, 0x67ad, 0x4c41, 0x99,0xb8, 0x8c,0x12,0xdf,0xf1,0xe9,0x74);
|
||||||
|
|
||||||
static void init_function_pointers(void)
|
static void init_function_pointers(void)
|
||||||
{
|
{
|
||||||
HMODULE hshell32, hkernel32;
|
HMODULE hshell32, hkernel32;
|
||||||
|
@ -52,6 +57,48 @@ static void init_function_pointers(void)
|
||||||
|
|
||||||
static void test_namespace(void)
|
static void test_namespace(void)
|
||||||
{
|
{
|
||||||
|
static const ShellSpecialFolderConstants special_folders[] =
|
||||||
|
{
|
||||||
|
ssfDESKTOP,
|
||||||
|
ssfPROGRAMS,
|
||||||
|
ssfCONTROLS,
|
||||||
|
ssfPRINTERS,
|
||||||
|
ssfPERSONAL,
|
||||||
|
ssfFAVORITES,
|
||||||
|
ssfSTARTUP,
|
||||||
|
ssfRECENT,
|
||||||
|
ssfSENDTO,
|
||||||
|
ssfBITBUCKET,
|
||||||
|
ssfSTARTMENU,
|
||||||
|
ssfDESKTOPDIRECTORY,
|
||||||
|
ssfDRIVES,
|
||||||
|
ssfNETWORK,
|
||||||
|
ssfNETHOOD,
|
||||||
|
ssfFONTS,
|
||||||
|
ssfTEMPLATES,
|
||||||
|
ssfCOMMONSTARTMENU,
|
||||||
|
ssfCOMMONPROGRAMS,
|
||||||
|
ssfCOMMONSTARTUP,
|
||||||
|
ssfCOMMONDESKTOPDIR,
|
||||||
|
ssfAPPDATA,
|
||||||
|
ssfPRINTHOOD,
|
||||||
|
ssfLOCALAPPDATA,
|
||||||
|
ssfALTSTARTUP,
|
||||||
|
ssfCOMMONALTSTARTUP,
|
||||||
|
ssfCOMMONFAVORITES,
|
||||||
|
ssfINTERNETCACHE,
|
||||||
|
ssfCOOKIES,
|
||||||
|
ssfHISTORY,
|
||||||
|
ssfCOMMONAPPDATA,
|
||||||
|
ssfWINDOWS,
|
||||||
|
ssfSYSTEM,
|
||||||
|
ssfPROGRAMFILES,
|
||||||
|
ssfMYPICTURES,
|
||||||
|
ssfPROFILE,
|
||||||
|
ssfSYSTEMx86,
|
||||||
|
ssfPROGRAMFILESx86,
|
||||||
|
};
|
||||||
|
|
||||||
static const WCHAR backslashW[] = {'\\',0};
|
static const WCHAR backslashW[] = {'\\',0};
|
||||||
static const WCHAR clsidW[] = {
|
static const WCHAR clsidW[] = {
|
||||||
':',':','{','6','4','5','F','F','0','4','0','-','5','0','8','1','-',
|
':',':','{','6','4','5','F','F','0','4','0','-','5','0','8','1','-',
|
||||||
|
@ -67,7 +114,7 @@ static void test_namespace(void)
|
||||||
FolderItem *item;
|
FolderItem *item;
|
||||||
VARIANT var;
|
VARIANT var;
|
||||||
BSTR title, item_path;
|
BSTR title, item_path;
|
||||||
int len;
|
int len, i;
|
||||||
|
|
||||||
r = CoCreateInstance(&CLSID_Shell, NULL, CLSCTX_INPROC_SERVER,
|
r = CoCreateInstance(&CLSID_Shell, NULL, CLSCTX_INPROC_SERVER,
|
||||||
&IID_IShellDispatch, (LPVOID*)&sd);
|
&IID_IShellDispatch, (LPVOID*)&sd);
|
||||||
|
@ -86,6 +133,21 @@ static void test_namespace(void)
|
||||||
ok(r == S_FALSE, "expected S_FALSE, got %08x\n", r);
|
ok(r == S_FALSE, "expected S_FALSE, got %08x\n", r);
|
||||||
ok(folder == NULL, "expected NULL, got %p\n", folder);
|
ok(folder == NULL, "expected NULL, got %p\n", folder);
|
||||||
|
|
||||||
|
/* test valid folder ids */
|
||||||
|
for (i = 0; i < sizeof(special_folders)/sizeof(special_folders[0]); i++)
|
||||||
|
{
|
||||||
|
V_VT(&var) = VT_I4;
|
||||||
|
V_I4(&var) = special_folders[i];
|
||||||
|
folder = (void*)0xdeadbeef;
|
||||||
|
r = IShellDispatch_NameSpace(sd, var, &folder);
|
||||||
|
if (special_folders[i] == ssfALTSTARTUP || special_folders[i] == ssfCOMMONALTSTARTUP)
|
||||||
|
ok(r == S_OK || broken(r == S_FALSE) /* winxp */, "Failed to get folder for index %#x, got %08x\n", special_folders[i], r);
|
||||||
|
else
|
||||||
|
ok(r == S_OK, "Failed to get folder for index %#x, got %08x\n", special_folders[i], r);
|
||||||
|
if (folder)
|
||||||
|
Folder_Release(folder);
|
||||||
|
}
|
||||||
|
|
||||||
V_VT(&var) = VT_I4;
|
V_VT(&var) = VT_I4;
|
||||||
V_I4(&var) = -1;
|
V_I4(&var) = -1;
|
||||||
folder = (void*)0xdeadbeef;
|
folder = (void*)0xdeadbeef;
|
||||||
|
@ -93,6 +155,8 @@ static void test_namespace(void)
|
||||||
todo_wine {
|
todo_wine {
|
||||||
ok(r == S_FALSE, "expected S_FALSE, got %08x\n", r);
|
ok(r == S_FALSE, "expected S_FALSE, got %08x\n", r);
|
||||||
ok(folder == NULL, "got %p\n", folder);
|
ok(folder == NULL, "got %p\n", folder);
|
||||||
|
if (r == S_OK)
|
||||||
|
Folder_Release(folder);
|
||||||
}
|
}
|
||||||
V_VT(&var) = VT_I4;
|
V_VT(&var) = VT_I4;
|
||||||
V_I4(&var) = ssfPROGRAMFILES;
|
V_I4(&var) = ssfPROGRAMFILES;
|
||||||
|
@ -345,7 +409,7 @@ static void test_items(void)
|
||||||
ok(r == S_OK, "Folder::Items failed: %08x\n", r);
|
ok(r == S_OK, "Folder::Items failed: %08x\n", r);
|
||||||
ok(!!items, "items is null\n");
|
ok(!!items, "items is null\n");
|
||||||
r = FolderItems_QueryInterface(items, &IID_FolderItems2, (void**)&items2);
|
r = FolderItems_QueryInterface(items, &IID_FolderItems2, (void**)&items2);
|
||||||
ok(r == S_OK || broken(E_NOINTERFACE) /* xp and later */, "FolderItems::QueryInterface failed: %08x\n", r);
|
ok(r == S_OK || broken(r == E_NOINTERFACE) /* xp and later */, "FolderItems::QueryInterface failed: %08x\n", r);
|
||||||
ok(!!items2 || broken(!items2) /* xp and later */, "items2 is null\n");
|
ok(!!items2 || broken(!items2) /* xp and later */, "items2 is null\n");
|
||||||
r = FolderItems_QueryInterface(items, &IID_FolderItems3, (void**)&items3);
|
r = FolderItems_QueryInterface(items, &IID_FolderItems3, (void**)&items3);
|
||||||
ok(r == S_OK, "FolderItems::QueryInterface failed: %08x\n", r);
|
ok(r == S_OK, "FolderItems::QueryInterface failed: %08x\n", r);
|
||||||
|
@ -356,9 +420,7 @@ static void test_items(void)
|
||||||
r = FolderItems_get_Count(items, NULL);
|
r = FolderItems_get_Count(items, NULL);
|
||||||
|
|
||||||
r = FolderItems_get_Count(items, &lcount);
|
r = FolderItems_get_Count(items, &lcount);
|
||||||
todo_wine
|
|
||||||
ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r);
|
ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r);
|
||||||
todo_wine
|
|
||||||
ok(!lcount, "expected 0 files, got %d\n", lcount);
|
ok(!lcount, "expected 0 files, got %d\n", lcount);
|
||||||
|
|
||||||
V_VT(&var) = VT_I4;
|
V_VT(&var) = VT_I4;
|
||||||
|
@ -529,6 +591,7 @@ static void test_ShellFolderViewDual(void)
|
||||||
&IID_IShellDispatch5,
|
&IID_IShellDispatch5,
|
||||||
&IID_IShellDispatch4,
|
&IID_IShellDispatch4,
|
||||||
&IID_IShellDispatch2,
|
&IID_IShellDispatch2,
|
||||||
|
&IID_IWin7ShellDispatch6,
|
||||||
&IID_NULL
|
&IID_NULL
|
||||||
};
|
};
|
||||||
IShellFolderViewDual *viewdual;
|
IShellFolderViewDual *viewdual;
|
||||||
|
|
|
@ -27,10 +27,13 @@
|
||||||
#include "shobjidl.h"
|
#include "shobjidl.h"
|
||||||
#include "shlobj.h"
|
#include "shlobj.h"
|
||||||
#include "shellapi.h"
|
#include "shellapi.h"
|
||||||
|
#include "commoncontrols.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
#include "shell32_test.h"
|
#include "shell32_test.h"
|
||||||
|
|
||||||
|
#include <reactos/undocshell.h>
|
||||||
|
|
||||||
#ifndef SLDF_HAS_LOGO3ID
|
#ifndef SLDF_HAS_LOGO3ID
|
||||||
# define SLDF_HAS_LOGO3ID 0x00000800 /* not available in the Vista SDK */
|
# define SLDF_HAS_LOGO3ID 0x00000800 /* not available in the Vista SDK */
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,6 +46,7 @@ static HRESULT (WINAPI *pSHGetStockIconInfo)(SHSTOCKICONID, UINT, SHSTOCKICONINF
|
||||||
static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR, LPSTR, DWORD);
|
static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR, LPSTR, DWORD);
|
||||||
static DWORD (WINAPI *pGetShortPathNameA)(LPCSTR, LPSTR, DWORD);
|
static DWORD (WINAPI *pGetShortPathNameA)(LPCSTR, LPSTR, DWORD);
|
||||||
static UINT (WINAPI *pSHExtractIconsW)(LPCWSTR, int, int, int, HICON *, UINT *, UINT, UINT);
|
static UINT (WINAPI *pSHExtractIconsW)(LPCWSTR, int, int, int, HICON *, UINT *, UINT, UINT);
|
||||||
|
static BOOL (WINAPI *pIsProcessDPIAware)(void);
|
||||||
|
|
||||||
static const GUID _IID_IShellLinkDataList = {
|
static const GUID _IID_IShellLinkDataList = {
|
||||||
0x45e2b4ae, 0xb1c3, 0x11d0,
|
0x45e2b4ae, 0xb1c3, 0x11d0,
|
||||||
|
@ -1150,11 +1154,257 @@ static void test_propertystore(void)
|
||||||
IShellLinkW_Release(linkW);
|
IShellLinkW_Release(linkW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_ExtractIcon(void)
|
||||||
|
{
|
||||||
|
static const WCHAR nameW[] = {'\\','e','x','t','r','a','c','t','i','c','o','n','_','t','e','s','t','.','t','x','t',0};
|
||||||
|
static const WCHAR shell32W[] = {'s','h','e','l','l','3','2','.','d','l','l',0};
|
||||||
|
WCHAR pathW[MAX_PATH];
|
||||||
|
HICON hicon, hicon2;
|
||||||
|
char path[MAX_PATH];
|
||||||
|
HANDLE file;
|
||||||
|
int r;
|
||||||
|
ICONINFO info;
|
||||||
|
BITMAP bm;
|
||||||
|
|
||||||
|
/* specified instance handle */
|
||||||
|
hicon = ExtractIconA(GetModuleHandleA("shell32.dll"), NULL, 0);
|
||||||
|
todo_wine
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
hicon2 = ExtractIconA(GetModuleHandleA("shell32.dll"), "shell32.dll", -1);
|
||||||
|
ok(hicon2 != NULL, "Got icon %p\n", hicon2);
|
||||||
|
|
||||||
|
/* existing index */
|
||||||
|
hicon = ExtractIconA(NULL, "shell32.dll", 0);
|
||||||
|
ok(hicon != NULL && HandleToLong(hicon) != -1, "Got icon %p\n", hicon);
|
||||||
|
DestroyIcon(hicon);
|
||||||
|
|
||||||
|
/* returns number of resources */
|
||||||
|
hicon = ExtractIconA(NULL, "shell32.dll", -1);
|
||||||
|
ok(HandleToLong(hicon) > 1 && hicon == hicon2, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
/* invalid index, valid dll name */
|
||||||
|
hicon = ExtractIconA(NULL, "shell32.dll", 3000);
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
/* Create a temporary non-executable file */
|
||||||
|
GetTempPathA(sizeof(path), path);
|
||||||
|
strcat(path, "\\extracticon_test.txt");
|
||||||
|
file = CreateFileA(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
ok(file != INVALID_HANDLE_VALUE, "Failed to create a test file\n");
|
||||||
|
CloseHandle(file);
|
||||||
|
|
||||||
|
hicon = ExtractIconA(NULL, path, 0);
|
||||||
|
todo_wine
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
hicon = ExtractIconA(NULL, path, -1);
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
hicon = ExtractIconA(NULL, path, 1);
|
||||||
|
todo_wine
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
r = DeleteFileA(path);
|
||||||
|
ok(r, "failed to delete file %s (%d)\n", path, GetLastError());
|
||||||
|
|
||||||
|
/* same for W variant */
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
/* specified instance handle, crashes on XP, 2k3 */
|
||||||
|
hicon = ExtractIconW(GetModuleHandleA("shell32.dll"), NULL, 0);
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
}
|
||||||
|
hicon2 = ExtractIconW(GetModuleHandleA("shell32.dll"), shell32W, -1);
|
||||||
|
ok(hicon2 != NULL, "Got icon %p\n", hicon2);
|
||||||
|
|
||||||
|
/* existing index */
|
||||||
|
hicon = ExtractIconW(NULL, shell32W, 0);
|
||||||
|
ok(hicon != NULL && HandleToLong(hicon) != -1, "Got icon %p\n", hicon);
|
||||||
|
GetIconInfo(hicon, &info);
|
||||||
|
GetObjectW(info.hbmColor, sizeof(bm), &bm);
|
||||||
|
ok(bm.bmWidth == GetSystemMetrics(SM_CXICON), "got %d\n", bm.bmWidth);
|
||||||
|
ok(bm.bmHeight == GetSystemMetrics(SM_CYICON), "got %d\n", bm.bmHeight);
|
||||||
|
DestroyIcon(hicon);
|
||||||
|
|
||||||
|
/* returns number of resources */
|
||||||
|
hicon = ExtractIconW(NULL, shell32W, -1);
|
||||||
|
ok(HandleToLong(hicon) > 1 && hicon == hicon2, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
/* invalid index, valid dll name */
|
||||||
|
hicon = ExtractIconW(NULL, shell32W, 3000);
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
/* Create a temporary non-executable file */
|
||||||
|
GetTempPathW(sizeof(pathW)/sizeof(pathW[0]), pathW);
|
||||||
|
lstrcatW(pathW, nameW);
|
||||||
|
file = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
ok(file != INVALID_HANDLE_VALUE, "Failed to create a test file\n");
|
||||||
|
CloseHandle(file);
|
||||||
|
|
||||||
|
hicon = ExtractIconW(NULL, pathW, 0);
|
||||||
|
todo_wine
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
hicon = ExtractIconW(NULL, pathW, -1);
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
hicon = ExtractIconW(NULL, pathW, 1);
|
||||||
|
todo_wine
|
||||||
|
ok(hicon == NULL, "Got icon %p\n", hicon);
|
||||||
|
|
||||||
|
r = DeleteFileW(pathW);
|
||||||
|
ok(r, "failed to delete file %s (%d)\n", path, GetLastError());
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_ExtractAssociatedIcon(void)
|
||||||
|
{
|
||||||
|
char pathA[MAX_PATH];
|
||||||
|
HICON hicon;
|
||||||
|
WORD index;
|
||||||
|
|
||||||
|
/* empty path */
|
||||||
|
index = 0;
|
||||||
|
*pathA = 0;
|
||||||
|
hicon = ExtractAssociatedIconA(NULL, pathA, &index);
|
||||||
|
todo_wine {
|
||||||
|
ok(hicon != NULL, "Got icon %p\n", hicon);
|
||||||
|
ok(!*pathA, "Unexpected path %s\n", pathA);
|
||||||
|
ok(index == 0, "Unexpected index %u\n", index);
|
||||||
|
}
|
||||||
|
DestroyIcon(hicon);
|
||||||
|
|
||||||
|
/* by index */
|
||||||
|
index = 0;
|
||||||
|
strcpy(pathA, "shell32.dll");
|
||||||
|
hicon = ExtractAssociatedIconA(NULL, pathA, &index);
|
||||||
|
ok(hicon != NULL, "Got icon %p\n", hicon);
|
||||||
|
ok(!strcmp(pathA, "shell32.dll"), "Unexpected path %s\n", pathA);
|
||||||
|
ok(index == 0, "Unexpected index %u\n", index);
|
||||||
|
DestroyIcon(hicon);
|
||||||
|
|
||||||
|
/* valid dll name, invalid index */
|
||||||
|
index = 5000;
|
||||||
|
strcpy(pathA, "user32.dll");
|
||||||
|
hicon = ExtractAssociatedIconA(NULL, pathA, &index);
|
||||||
|
CharLowerBuffA(pathA, strlen(pathA));
|
||||||
|
todo_wine {
|
||||||
|
ok(hicon != NULL, "Got icon %p\n", hicon);
|
||||||
|
ok(!!strstr(pathA, "shell32.dll"), "Unexpected path %s\n", pathA);
|
||||||
|
}
|
||||||
|
ok(index != 5000, "Unexpected index %u\n", index);
|
||||||
|
DestroyIcon(hicon);
|
||||||
|
|
||||||
|
/* associated icon */
|
||||||
|
index = 0xcaca;
|
||||||
|
strcpy(pathA, "dummy.exe");
|
||||||
|
hicon = ExtractAssociatedIconA(NULL, pathA, &index);
|
||||||
|
CharLowerBuffA(pathA, strlen(pathA));
|
||||||
|
todo_wine {
|
||||||
|
ok(hicon != NULL, "Got icon %p\n", hicon);
|
||||||
|
ok(!!strstr(pathA, "shell32.dll"), "Unexpected path %s\n", pathA);
|
||||||
|
}
|
||||||
|
ok(index != 0xcaca, "Unexpected index %u\n", index);
|
||||||
|
DestroyIcon(hicon);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int get_shell_icon_size(void)
|
||||||
|
{
|
||||||
|
char buf[10];
|
||||||
|
DWORD value = 32, size = sizeof(buf), type;
|
||||||
|
HKEY key;
|
||||||
|
|
||||||
|
if (!RegOpenKeyA( HKEY_CURRENT_USER, "Control Panel\\Desktop\\WindowMetrics", &key ))
|
||||||
|
{
|
||||||
|
if (!RegQueryValueExA( key, "Shell Icon Size", NULL, &type, (BYTE *)buf, &size ) && type == REG_SZ)
|
||||||
|
value = atoi( buf );
|
||||||
|
RegCloseKey( key );
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_SHGetImageList(void)
|
||||||
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
IImageList *list, *list2;
|
||||||
|
BOOL ret;
|
||||||
|
HIMAGELIST lg, sm;
|
||||||
|
ULONG start_refs, refs;
|
||||||
|
int i, width, height, expect;
|
||||||
|
BOOL dpi_aware = pIsProcessDPIAware && pIsProcessDPIAware();
|
||||||
|
|
||||||
|
hr = SHGetImageList( SHIL_LARGE, &IID_IImageList, (void **)&list );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
start_refs = IImageList_AddRef( list );
|
||||||
|
IImageList_Release( list );
|
||||||
|
|
||||||
|
hr = SHGetImageList( SHIL_LARGE, &IID_IImageList, (void **)&list2 );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
ok( list == list2, "lists differ\n" );
|
||||||
|
refs = IImageList_AddRef( list );
|
||||||
|
IImageList_Release( list );
|
||||||
|
ok( refs == start_refs + 1, "got %d, start_refs %d\n", refs, start_refs );
|
||||||
|
IImageList_Release( list2 );
|
||||||
|
|
||||||
|
hr = SHGetImageList( SHIL_SMALL, &IID_IImageList, (void **)&list2 );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
|
||||||
|
ret = Shell_GetImageLists( &lg, &sm );
|
||||||
|
ok( ret, "got %d\n", ret );
|
||||||
|
ok( lg == (HIMAGELIST)list, "mismatch\n" );
|
||||||
|
ok( sm == (HIMAGELIST)list2, "mismatch\n" );
|
||||||
|
|
||||||
|
/* Shell_GetImageLists doesn't take a reference */
|
||||||
|
refs = IImageList_AddRef( list );
|
||||||
|
IImageList_Release( list );
|
||||||
|
ok( refs == start_refs, "got %d, start_refs %d\n", refs, start_refs );
|
||||||
|
|
||||||
|
IImageList_Release( list2 );
|
||||||
|
IImageList_Release( list );
|
||||||
|
|
||||||
|
/* Test the icon sizes */
|
||||||
|
for (i = 0; i <= SHIL_LAST; i++)
|
||||||
|
{
|
||||||
|
hr = SHGetImageList( i, &IID_IImageList, (void **)&list );
|
||||||
|
ok( hr == S_OK ||
|
||||||
|
broken( i == SHIL_JUMBO && hr == E_INVALIDARG ), /* XP and 2003 */
|
||||||
|
"%d: got %08x\n", i, hr );
|
||||||
|
if (FAILED(hr)) continue;
|
||||||
|
IImageList_GetIconSize( list, &width, &height );
|
||||||
|
switch (i)
|
||||||
|
{
|
||||||
|
case SHIL_LARGE:
|
||||||
|
if (dpi_aware) expect = GetSystemMetrics( SM_CXICON );
|
||||||
|
else expect = get_shell_icon_size();
|
||||||
|
break;
|
||||||
|
case SHIL_SMALL:
|
||||||
|
if (dpi_aware) expect = GetSystemMetrics( SM_CXICON ) / 2;
|
||||||
|
else expect = GetSystemMetrics( SM_CXSMICON );
|
||||||
|
break;
|
||||||
|
case SHIL_EXTRALARGE:
|
||||||
|
expect = (GetSystemMetrics( SM_CXICON ) * 3) / 2;
|
||||||
|
break;
|
||||||
|
case SHIL_SYSSMALL:
|
||||||
|
expect = GetSystemMetrics( SM_CXSMICON );
|
||||||
|
break;
|
||||||
|
case SHIL_JUMBO:
|
||||||
|
expect = 256;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
todo_wine_if(i == SHIL_SYSSMALL && dpi_aware && expect != GetSystemMetrics( SM_CXICON ) / 2)
|
||||||
|
{
|
||||||
|
ok( width == expect, "%d: got %d expect %d\n", i, width, expect );
|
||||||
|
ok( height == expect, "%d: got %d expect %d\n", i, height, expect );
|
||||||
|
}
|
||||||
|
IImageList_Release( list );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(shelllink)
|
START_TEST(shelllink)
|
||||||
{
|
{
|
||||||
HRESULT r;
|
HRESULT r;
|
||||||
HMODULE hmod = GetModuleHandleA("shell32.dll");
|
HMODULE hmod = GetModuleHandleA("shell32.dll");
|
||||||
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
|
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
|
||||||
|
HMODULE huser32 = GetModuleHandleA("user32.dll");
|
||||||
|
|
||||||
pILFree = (void *)GetProcAddress(hmod, (LPSTR)155);
|
pILFree = (void *)GetProcAddress(hmod, (LPSTR)155);
|
||||||
pILIsEqual = (void *)GetProcAddress(hmod, (LPSTR)21);
|
pILIsEqual = (void *)GetProcAddress(hmod, (LPSTR)21);
|
||||||
|
@ -1164,6 +1414,7 @@ START_TEST(shelllink)
|
||||||
pGetLongPathNameA = (void *)GetProcAddress(hkernel32, "GetLongPathNameA");
|
pGetLongPathNameA = (void *)GetProcAddress(hkernel32, "GetLongPathNameA");
|
||||||
pGetShortPathNameA = (void *)GetProcAddress(hkernel32, "GetShortPathNameA");
|
pGetShortPathNameA = (void *)GetProcAddress(hkernel32, "GetShortPathNameA");
|
||||||
pSHExtractIconsW = (void *)GetProcAddress(hmod, "SHExtractIconsW");
|
pSHExtractIconsW = (void *)GetProcAddress(hmod, "SHExtractIconsW");
|
||||||
|
pIsProcessDPIAware = (void *)GetProcAddress(huser32, "IsProcessDPIAware");
|
||||||
|
|
||||||
r = CoInitialize(NULL);
|
r = CoInitialize(NULL);
|
||||||
ok(r == S_OK, "CoInitialize failed (0x%08x)\n", r);
|
ok(r == S_OK, "CoInitialize failed (0x%08x)\n", r);
|
||||||
|
@ -1178,6 +1429,9 @@ START_TEST(shelllink)
|
||||||
test_SHGetStockIconInfo();
|
test_SHGetStockIconInfo();
|
||||||
test_SHExtractIcons();
|
test_SHExtractIcons();
|
||||||
test_propertystore();
|
test_propertystore();
|
||||||
|
test_ExtractIcon();
|
||||||
|
test_ExtractAssociatedIcon();
|
||||||
|
test_SHGetImageList();
|
||||||
|
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -866,7 +866,7 @@ static void test_SHCreateSessionKey(void)
|
||||||
|
|
||||||
if (!pSHCreateSessionKey)
|
if (!pSHCreateSessionKey)
|
||||||
{
|
{
|
||||||
skip("SHCreateSessionKey is not implemented\n");
|
win_skip("SHCreateSessionKey is not implemented\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -889,12 +889,38 @@ static void test_SHCreateSessionKey(void)
|
||||||
RegCloseKey(hkey2);
|
RegCloseKey(hkey2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_dragdrophelper(void)
|
||||||
|
{
|
||||||
|
IDragSourceHelper *dragsource;
|
||||||
|
IDropTargetHelper *target;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
hr = CoCreateInstance(&CLSID_DragDropHelper, NULL, CLSCTX_INPROC_SERVER, &IID_IDropTargetHelper, (void **)&target);
|
||||||
|
ok(hr == S_OK, "Failed to create IDropTargetHelper, %#x\n", hr);
|
||||||
|
|
||||||
|
hr = IDropTargetHelper_QueryInterface(target, &IID_IDragSourceHelper, (void **)&dragsource);
|
||||||
|
ok(hr == S_OK, "QI failed, %#x\n", hr);
|
||||||
|
IDragSourceHelper_Release(dragsource);
|
||||||
|
|
||||||
|
IDropTargetHelper_Release(target);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(shellole)
|
START_TEST(shellole)
|
||||||
{
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
hr = CoInitialize(NULL);
|
||||||
|
ok(hr == S_OK, "CoInitialize failed (0x%08x)\n", hr);
|
||||||
|
if (hr != S_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
test_SHPropStg_functions();
|
test_SHPropStg_functions();
|
||||||
test_SHCreateQueryCancelAutoPlayMoniker();
|
test_SHCreateQueryCancelAutoPlayMoniker();
|
||||||
test_DragQueryFile();
|
test_DragQueryFile();
|
||||||
test_SHCreateSessionKey();
|
test_SHCreateSessionKey();
|
||||||
|
test_dragdrophelper();
|
||||||
|
|
||||||
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -808,7 +808,7 @@ static void test_NonExistentPath(void)
|
||||||
memset(&startup, 0, sizeof(startup));
|
memset(&startup, 0, sizeof(startup));
|
||||||
startup.cb = sizeof(startup);
|
startup.cb = sizeof(startup);
|
||||||
startup.dwFlags = STARTF_USESHOWWINDOW;
|
startup.dwFlags = STARTF_USESHOWWINDOW;
|
||||||
startup.dwFlags = SW_SHOWNORMAL;
|
startup.wShowWindow = SW_SHOWNORMAL;
|
||||||
CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL,
|
CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL,
|
||||||
&startup, &info);
|
&startup, &info);
|
||||||
winetest_wait_child_process( info.hProcess );
|
winetest_wait_child_process( info.hProcess );
|
||||||
|
@ -823,7 +823,7 @@ static void test_NonExistentPath(void)
|
||||||
memset(&startup, 0, sizeof(startup));
|
memset(&startup, 0, sizeof(startup));
|
||||||
startup.cb = sizeof(startup);
|
startup.cb = sizeof(startup);
|
||||||
startup.dwFlags = STARTF_USESHOWWINDOW;
|
startup.dwFlags = STARTF_USESHOWWINDOW;
|
||||||
startup.dwFlags = SW_SHOWNORMAL;
|
startup.wShowWindow = SW_SHOWNORMAL;
|
||||||
CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL,
|
CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL,
|
||||||
&startup, &info);
|
&startup, &info);
|
||||||
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0,
|
ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0,
|
||||||
|
@ -860,12 +860,13 @@ if (0) { /* crashes */
|
||||||
ok(path == NULL, "got %p\n", path);
|
ok(path == NULL, "got %p\n", path);
|
||||||
|
|
||||||
path = NULL;
|
path = NULL;
|
||||||
hr = pSHGetKnownFolderPath(&FOLDERID_Desktop, 0, NULL, &path);
|
hr = pSHGetKnownFolderPath(&FOLDERID_Desktop, KF_FLAG_DEFAULT_PATH, NULL, &path);
|
||||||
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
|
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
|
||||||
ok(path != NULL, "expected path != NULL\n");
|
ok(path != NULL, "expected path != NULL\n");
|
||||||
|
CoTaskMemFree(path);
|
||||||
|
|
||||||
path = NULL;
|
path = NULL;
|
||||||
hr = pSHGetKnownFolderPath(&FOLDERID_Desktop, KF_FLAG_DEFAULT_PATH, NULL, &path);
|
hr = pSHGetKnownFolderPath(&FOLDERID_Desktop, 0, NULL, &path);
|
||||||
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
|
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
|
||||||
ok(path != NULL, "expected path != NULL\n");
|
ok(path != NULL, "expected path != NULL\n");
|
||||||
|
|
||||||
|
@ -2038,9 +2039,11 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId
|
||||||
static void test_knownFolders(void)
|
static void test_knownFolders(void)
|
||||||
{
|
{
|
||||||
static const WCHAR sWindows[] = {'W','i','n','d','o','w','s',0};
|
static const WCHAR sWindows[] = {'W','i','n','d','o','w','s',0};
|
||||||
|
static const WCHAR sWindows2[] = {'w','i','n','d','o','w','s',0};
|
||||||
static const WCHAR sExample[] = {'E','x','a','m','p','l','e',0};
|
static const WCHAR sExample[] = {'E','x','a','m','p','l','e',0};
|
||||||
static const WCHAR sExample2[] = {'E','x','a','m','p','l','e','2',0};
|
static const WCHAR sExample2[] = {'E','x','a','m','p','l','e','2',0};
|
||||||
static const WCHAR sSubFolder[] = {'S','u','b','F','o','l','d','e','r',0};
|
static const WCHAR sSubFolder[] = {'S','u','b','F','o','l','d','e','r',0};
|
||||||
|
static const WCHAR sNoSuch[] = {'N','o','S','u','c','h',0};
|
||||||
static const WCHAR sBackslash[] = {'\\',0};
|
static const WCHAR sBackslash[] = {'\\',0};
|
||||||
static const KNOWNFOLDERID newFolderId = {0x01234567, 0x89AB, 0xCDEF, {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x01} };
|
static const KNOWNFOLDERID newFolderId = {0x01234567, 0x89AB, 0xCDEF, {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x01} };
|
||||||
static const KNOWNFOLDERID subFolderId = {0xFEDCBA98, 0x7654, 0x3210, {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF} };
|
static const KNOWNFOLDERID subFolderId = {0xFEDCBA98, 0x7654, 0x3210, {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF} };
|
||||||
|
@ -2142,7 +2145,6 @@ static void test_knownFolders(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = IKnownFolderManager_GetFolderByName(mgr, sWindows, &folder);
|
hr = IKnownFolderManager_GetFolderByName(mgr, sWindows, &folder);
|
||||||
todo_wine
|
|
||||||
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
|
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
|
||||||
if(SUCCEEDED(hr))
|
if(SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
|
@ -2154,6 +2156,23 @@ static void test_knownFolders(void)
|
||||||
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
|
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hr = IKnownFolderManager_GetFolderByName(mgr, sWindows2, &folder);
|
||||||
|
ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr);
|
||||||
|
if(SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
hr = IKnownFolder_GetId(folder, &folderId);
|
||||||
|
ok(hr == S_OK, "failed to get folder id: 0x%08x\n", hr);
|
||||||
|
ok(IsEqualGUID(&folderId, &FOLDERID_Windows)==TRUE, "invalid KNOWNFOLDERID returned\n");
|
||||||
|
|
||||||
|
hr = IKnownFolder_Release(folder);
|
||||||
|
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
|
||||||
|
}
|
||||||
|
|
||||||
|
folder = (IKnownFolder *)0xdeadbeef;
|
||||||
|
hr = IKnownFolderManager_GetFolderByName(mgr, sNoSuch, &folder);
|
||||||
|
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08x\n", hr);
|
||||||
|
ok(folder == NULL, "got %p\n", folder);
|
||||||
|
|
||||||
for(i=0; i<sizeof(known_folder_found)/sizeof(known_folder_found[0]); ++i)
|
for(i=0; i<sizeof(known_folder_found)/sizeof(known_folder_found[0]); ++i)
|
||||||
known_folder_found[i] = FALSE;
|
known_folder_found[i] = FALSE;
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@ if (0)
|
||||||
|
|
||||||
details.str.u.pOleStr = NULL;
|
details.str.u.pOleStr = NULL;
|
||||||
hr = IShellFolder2_GetDetailsOf(folder, NULL, 0, &details);
|
hr = IShellFolder2_GetDetailsOf(folder, NULL, 0, &details);
|
||||||
ok(hr == S_OK || broken(E_NOTIMPL) /* W2K */, "got 0x%08x\n", hr);
|
ok(hr == S_OK || broken(hr == E_NOTIMPL) /* W2K */, "got 0x%08x\n", hr);
|
||||||
if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr);
|
if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr);
|
||||||
|
|
||||||
/* test every column if method is implemented */
|
/* test every column if method is implemented */
|
||||||
|
|
|
@ -21,13 +21,17 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
#define WINE_NOWINSOCK
|
#define WINE_NOWINSOCK
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "shellapi.h"
|
#include "shellapi.h"
|
||||||
#include "shlobj.h"
|
#include "shlobj.h"
|
||||||
|
#include "commoncontrols.h"
|
||||||
|
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
#include <reactos/undocshell.h>
|
||||||
|
|
||||||
#ifndef FOF_NORECURSION
|
#ifndef FOF_NORECURSION
|
||||||
#define FOF_NORECURSION 0x1000
|
#define FOF_NORECURSION 0x1000
|
||||||
#endif
|
#endif
|
||||||
|
@ -315,6 +319,37 @@ static void test_get_file_info(void)
|
||||||
ok(shfi.iIcon != 0xdeadbeef, "iIcon was expected to change\n");
|
ok(shfi.iIcon != 0xdeadbeef, "iIcon was expected to change\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void check_icon_size( HICON icon, DWORD flags )
|
||||||
|
{
|
||||||
|
ICONINFO info;
|
||||||
|
BITMAP bm;
|
||||||
|
SIZE list_size, metrics_size;
|
||||||
|
IImageList *list;
|
||||||
|
|
||||||
|
GetIconInfo( icon, &info );
|
||||||
|
GetObjectW( info.hbmColor, sizeof(bm), &bm );
|
||||||
|
|
||||||
|
SHGetImageList( (flags & SHGFI_SMALLICON) ? SHIL_SMALL : SHIL_LARGE,
|
||||||
|
&IID_IImageList, (void **)&list );
|
||||||
|
IImageList_GetIconSize( list, &list_size.cx, &list_size.cy );
|
||||||
|
IImageList_Release( list );
|
||||||
|
|
||||||
|
metrics_size.cx = GetSystemMetrics( (flags & SHGFI_SMALLICON) ? SM_CXSMICON : SM_CXICON );
|
||||||
|
metrics_size.cy = GetSystemMetrics( (flags & SHGFI_SMALLICON) ? SM_CYSMICON : SM_CYICON );
|
||||||
|
|
||||||
|
|
||||||
|
if (flags & SHGFI_SHELLICONSIZE)
|
||||||
|
{
|
||||||
|
ok( bm.bmWidth == list_size.cx, "got %d expected %d\n", bm.bmWidth, list_size.cx );
|
||||||
|
ok( bm.bmHeight == list_size.cy, "got %d expected %d\n", bm.bmHeight, list_size.cy );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok( bm.bmWidth == metrics_size.cx, "got %d expected %d\n", bm.bmWidth, metrics_size.cx );
|
||||||
|
ok( bm.bmHeight == metrics_size.cy, "got %d expected %d\n", bm.bmHeight, metrics_size.cy );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void test_get_file_info_iconlist(void)
|
static void test_get_file_info_iconlist(void)
|
||||||
{
|
{
|
||||||
/* Test retrieving a handle to the system image list, and
|
/* Test retrieving a handle to the system image list, and
|
||||||
|
@ -325,6 +360,8 @@ static void test_get_file_info_iconlist(void)
|
||||||
LPITEMIDLIST pidList;
|
LPITEMIDLIST pidList;
|
||||||
SHFILEINFOA shInfoa;
|
SHFILEINFOA shInfoa;
|
||||||
SHFILEINFOW shInfow;
|
SHFILEINFOW shInfow;
|
||||||
|
IImageList *small_list, *large_list;
|
||||||
|
ULONG start_refs, refs;
|
||||||
|
|
||||||
hr = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidList);
|
hr = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidList);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
|
@ -332,11 +369,22 @@ static void test_get_file_info_iconlist(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SHGetImageList( SHIL_LARGE, &IID_IImageList, (void **)&large_list );
|
||||||
|
SHGetImageList( SHIL_SMALL, &IID_IImageList, (void **)&small_list );
|
||||||
|
|
||||||
|
start_refs = IImageList_AddRef( small_list );
|
||||||
|
IImageList_Release( small_list );
|
||||||
|
|
||||||
memset(&shInfoa, 0xcf, sizeof(shInfoa));
|
memset(&shInfoa, 0xcf, sizeof(shInfoa));
|
||||||
hSysImageList = (HIMAGELIST) SHGetFileInfoA((const char *)pidList, 0,
|
hSysImageList = (HIMAGELIST) SHGetFileInfoA((const char *)pidList, 0,
|
||||||
&shInfoa, sizeof(shInfoa),
|
&shInfoa, sizeof(shInfoa),
|
||||||
SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_PIDL);
|
SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_PIDL);
|
||||||
ok((hSysImageList != INVALID_HANDLE_VALUE) && (hSysImageList > (HIMAGELIST) 0xffff), "Can't get handle for CSIDL_DESKTOP imagelist\n");
|
ok(hSysImageList == (HIMAGELIST)small_list, "got %p expect %p\n", hSysImageList, small_list);
|
||||||
|
refs = IImageList_AddRef( small_list );
|
||||||
|
IImageList_Release( small_list );
|
||||||
|
ok( refs == start_refs + 1 ||
|
||||||
|
broken( refs == start_refs ), /* XP and 2003 */
|
||||||
|
"got %d, start_refs %d\n", refs, start_refs );
|
||||||
todo_wine ok(shInfoa.hIcon == 0, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n");
|
todo_wine ok(shInfoa.hIcon == 0, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n");
|
||||||
todo_wine ok(shInfoa.szTypeName[0] == 0, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n");
|
todo_wine ok(shInfoa.szTypeName[0] == 0, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n");
|
||||||
ok(shInfoa.iIcon != 0xcfcfcfcf, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n");
|
ok(shInfoa.iIcon != 0xcfcfcfcf, "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n");
|
||||||
|
@ -344,7 +392,7 @@ static void test_get_file_info_iconlist(void)
|
||||||
shInfoa.dwAttributes == 0 || /* Vista */
|
shInfoa.dwAttributes == 0 || /* Vista */
|
||||||
broken(shInfoa.dwAttributes != 0xcfcfcfcf), /* NT4 doesn't clear but sets this field */
|
broken(shInfoa.dwAttributes != 0xcfcfcfcf), /* NT4 doesn't clear but sets this field */
|
||||||
"SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL), unexpected dwAttributes\n");
|
"SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL), unexpected dwAttributes\n");
|
||||||
CloseHandle(hSysImageList);
|
/* Don't release hSysImageList here (and in similar places below) because of the broken reference behaviour of XP and 2003. */
|
||||||
|
|
||||||
if (!pSHGetFileInfoW)
|
if (!pSHGetFileInfoW)
|
||||||
{
|
{
|
||||||
|
@ -362,20 +410,19 @@ static void test_get_file_info_iconlist(void)
|
||||||
win_skip("SHGetFileInfoW is not implemented\n");
|
win_skip("SHGetFileInfoW is not implemented\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ok((hSysImageList != INVALID_HANDLE_VALUE) && (hSysImageList > (HIMAGELIST) 0xffff), "Can't get handle for CSIDL_DESKTOP imagelist\n");
|
ok(hSysImageList == (HIMAGELIST)small_list, "got %p expect %p\n", hSysImageList, small_list);
|
||||||
todo_wine ok(shInfow.hIcon == 0, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n");
|
todo_wine ok(shInfow.hIcon == 0, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n");
|
||||||
ok(shInfow.szTypeName[0] == 0, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n");
|
ok(shInfow.szTypeName[0] == 0, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n");
|
||||||
ok(shInfow.iIcon != 0xcfcfcfcf, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n");
|
ok(shInfow.iIcon != 0xcfcfcfcf, "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n");
|
||||||
ok(shInfow.dwAttributes == 0xcfcfcfcf ||
|
ok(shInfow.dwAttributes == 0xcfcfcfcf ||
|
||||||
shInfoa.dwAttributes == 0, /* Vista */
|
shInfoa.dwAttributes == 0, /* Vista */
|
||||||
"SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) unexpected dwAttributes\n");
|
"SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) unexpected dwAttributes\n");
|
||||||
CloseHandle(hSysImageList);
|
|
||||||
|
|
||||||
/* Various suposidly invalid flag testing */
|
/* Various suposidly invalid flag testing */
|
||||||
memset(&shInfow, 0xcf, sizeof(shInfow));
|
memset(&shInfow, 0xcf, sizeof(shInfow));
|
||||||
hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
hSysImageList = (HIMAGELIST)pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
||||||
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON);
|
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON);
|
||||||
ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed\n");
|
ok(hSysImageList == (HIMAGELIST)small_list, "got %p expect %p\n", hSysImageList, small_list);
|
||||||
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
ok(shInfow.dwAttributes==0xcfcfcfcf ||
|
ok(shInfow.dwAttributes==0xcfcfcfcf ||
|
||||||
shInfoa.dwAttributes==0, /* Vista */
|
shInfoa.dwAttributes==0, /* Vista */
|
||||||
|
@ -386,8 +433,8 @@ static void test_get_file_info_iconlist(void)
|
||||||
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON);
|
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON);
|
||||||
ok(hr != 0, " SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed\n");
|
ok(hr != 0, " SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed\n");
|
||||||
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
ok(shInfow.hIcon!=(HICON)0xcfcfcfcf && shInfow.hIcon!=0,"hIcon invalid\n");
|
check_icon_size( shInfow.hIcon, SHGFI_SMALLICON );
|
||||||
if (shInfow.hIcon!=(HICON)0xcfcfcfcf) DestroyIcon(shInfow.hIcon);
|
DestroyIcon(shInfow.hIcon);
|
||||||
todo_wine ok(shInfow.dwAttributes==0,"dwAttributes not set\n");
|
todo_wine ok(shInfow.dwAttributes==0,"dwAttributes not set\n");
|
||||||
|
|
||||||
memset(&shInfow, 0xcf, sizeof(shInfow));
|
memset(&shInfow, 0xcf, sizeof(shInfow));
|
||||||
|
@ -395,14 +442,14 @@ static void test_get_file_info_iconlist(void)
|
||||||
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON);
|
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON);
|
||||||
ok(hr != 0, "SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON Failed\n");
|
ok(hr != 0, "SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON Failed\n");
|
||||||
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
ok(shInfow.hIcon!=(HICON)0xcfcfcfcf && shInfow.hIcon!=0,"hIcon invalid\n");
|
check_icon_size( shInfow.hIcon, SHGFI_LARGEICON );
|
||||||
if (shInfow.hIcon != (HICON)0xcfcfcfcf) DestroyIcon(shInfow.hIcon);
|
DestroyIcon( shInfow.hIcon );
|
||||||
todo_wine ok(shInfow.dwAttributes==0,"dwAttributes not set\n");
|
todo_wine ok(shInfow.dwAttributes==0,"dwAttributes not set\n");
|
||||||
|
|
||||||
memset(&shInfow, 0xcf, sizeof(shInfow));
|
memset(&shInfow, 0xcf, sizeof(shInfow));
|
||||||
hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
hSysImageList = (HIMAGELIST)pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
||||||
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON);
|
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON);
|
||||||
ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON Failed\n");
|
ok(hSysImageList == (HIMAGELIST)large_list, "got %p expect %p\n", hSysImageList, small_list);
|
||||||
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
ok(shInfow.dwAttributes==0xcfcfcfcf ||
|
ok(shInfow.dwAttributes==0xcfcfcfcf ||
|
||||||
shInfoa.dwAttributes==0, /* Vista */
|
shInfoa.dwAttributes==0, /* Vista */
|
||||||
|
@ -430,18 +477,18 @@ static void test_get_file_info_iconlist(void)
|
||||||
ok(shInfow.dwAttributes==0xcfcfcfcf,"dwAttributes modified\n");
|
ok(shInfow.dwAttributes==0xcfcfcfcf,"dwAttributes modified\n");
|
||||||
|
|
||||||
memset(&shInfow, 0xcf, sizeof(shInfow));
|
memset(&shInfow, 0xcf, sizeof(shInfow));
|
||||||
hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
hSysImageList = (HIMAGELIST)pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
||||||
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON|
|
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON|
|
||||||
SHGFI_ATTRIBUTES);
|
SHGFI_ATTRIBUTES);
|
||||||
ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON|SHGFI_ATTRIBUTES Failed\n");
|
ok(hSysImageList == (HIMAGELIST)small_list, "got %p expect %p\n", hSysImageList, small_list);
|
||||||
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
ok(shInfow.dwAttributes!=0xcfcfcfcf,"dwAttributes not set\n");
|
ok(shInfow.dwAttributes!=0xcfcfcfcf,"dwAttributes not set\n");
|
||||||
|
|
||||||
memset(&shInfow, 0xcf, sizeof(shInfow));
|
memset(&shInfow, 0xcf, sizeof(shInfow));
|
||||||
hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
hSysImageList = (HIMAGELIST)pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
||||||
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON|
|
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON|
|
||||||
SHGFI_EXETYPE);
|
SHGFI_EXETYPE);
|
||||||
todo_wine ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON|SHGFI_EXETYPE Failed\n");
|
todo_wine ok(hSysImageList == (HIMAGELIST)small_list, "got %p expect %p\n", hSysImageList, small_list);
|
||||||
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
ok(shInfow.dwAttributes==0xcfcfcfcf ||
|
ok(shInfow.dwAttributes==0xcfcfcfcf ||
|
||||||
shInfoa.dwAttributes==0, /* Vista */
|
shInfoa.dwAttributes==0, /* Vista */
|
||||||
|
@ -462,17 +509,18 @@ static void test_get_file_info_iconlist(void)
|
||||||
ok(shInfow.dwAttributes!=0xcfcfcfcf,"dwAttributes not set\n");
|
ok(shInfow.dwAttributes!=0xcfcfcfcf,"dwAttributes not set\n");
|
||||||
|
|
||||||
memset(&shInfow, 0xcf, sizeof(shInfow));
|
memset(&shInfow, 0xcf, sizeof(shInfow));
|
||||||
hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
hSysImageList = (HIMAGELIST)pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
||||||
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|
|
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|
|
||||||
SHGFI_ATTRIBUTES);
|
SHGFI_ATTRIBUTES);
|
||||||
|
ok(hSysImageList == (HIMAGELIST)large_list, "got %p expect %p\n", hSysImageList, large_list);
|
||||||
ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_ATTRIBUTES Failed\n");
|
ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_ATTRIBUTES Failed\n");
|
||||||
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
ok(shInfow.dwAttributes!=0xcfcfcfcf,"dwAttributes not set\n");
|
ok(shInfow.dwAttributes!=0xcfcfcfcf,"dwAttributes not set\n");
|
||||||
|
|
||||||
memset(&shInfow, 0xcf, sizeof(shInfow));
|
memset(&shInfow, 0xcf, sizeof(shInfow));
|
||||||
hr = pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
hSysImageList = (HIMAGELIST)pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
||||||
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_EXETYPE);
|
SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_EXETYPE);
|
||||||
todo_wine ok(hr != 0, "SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_EXETYPE Failed\n");
|
todo_wine ok(hSysImageList == (HIMAGELIST)large_list, "got %p expect %p\n", hSysImageList, large_list);
|
||||||
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
ok(shInfow.dwAttributes==0xcfcfcfcf ||
|
ok(shInfow.dwAttributes==0xcfcfcfcf ||
|
||||||
shInfoa.dwAttributes==0, /* Vista */
|
shInfoa.dwAttributes==0, /* Vista */
|
||||||
|
@ -492,7 +540,25 @@ static void test_get_file_info_iconlist(void)
|
||||||
todo_wine ok(shInfow.iIcon==0xcfcfcfcf, "Icon Index Modified\n");
|
todo_wine ok(shInfow.iIcon==0xcfcfcfcf, "Icon Index Modified\n");
|
||||||
ok(shInfow.dwAttributes!=0xcfcfcfcf,"dwAttributes not set\n");
|
ok(shInfow.dwAttributes!=0xcfcfcfcf,"dwAttributes not set\n");
|
||||||
|
|
||||||
|
memset(&shInfow, 0xcf, sizeof(shInfow));
|
||||||
|
hSysImageList = (HIMAGELIST)pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
||||||
|
SHGFI_SYSICONINDEX|SHGFI_PIDL|SHGFI_SMALLICON|SHGFI_SHELLICONSIZE|SHGFI_ICON);
|
||||||
|
ok(hSysImageList == (HIMAGELIST)small_list, "got %p expect %p\n", hSysImageList, small_list);
|
||||||
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
|
check_icon_size( shInfow.hIcon, SHGFI_SMALLICON | SHGFI_SHELLICONSIZE );
|
||||||
|
DestroyIcon( shInfow.hIcon );
|
||||||
|
|
||||||
|
memset(&shInfow, 0xcf, sizeof(shInfow));
|
||||||
|
hSysImageList = (HIMAGELIST)pSHGetFileInfoW((const WCHAR *)pidList, 0, &shInfow, sizeof(shInfow),
|
||||||
|
SHGFI_SYSICONINDEX|SHGFI_PIDL|SHGFI_SHELLICONSIZE|SHGFI_ICON);
|
||||||
|
ok(hSysImageList == (HIMAGELIST)large_list, "got %p expect %p\n", hSysImageList, small_list);
|
||||||
|
ok(shInfow.iIcon!=0xcfcfcfcf, "Icon Index Missing\n");
|
||||||
|
check_icon_size( shInfow.hIcon, SHGFI_LARGEICON | SHGFI_SHELLICONSIZE );
|
||||||
|
DestroyIcon( shInfow.hIcon );
|
||||||
|
|
||||||
ILFree(pidList);
|
ILFree(pidList);
|
||||||
|
IImageList_Release( small_list );
|
||||||
|
IImageList_Release( large_list );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -817,9 +883,10 @@ static void test_rename(void)
|
||||||
retval = SHFileOperationA(&shfo);
|
retval = SHFileOperationA(&shfo);
|
||||||
ok(retval == ERROR_CANCELLED ||
|
ok(retval == ERROR_CANCELLED ||
|
||||||
retval == DE_DIFFDIR || /* Vista */
|
retval == DE_DIFFDIR || /* Vista */
|
||||||
|
retval == DE_FILEDESTISFLD || /* Vista, running from c: */
|
||||||
broken(retval == DE_OPCANCELLED) || /* Win9x */
|
broken(retval == DE_OPCANCELLED) || /* Win9x */
|
||||||
broken(retval == 65652), /* NT4 */
|
broken(retval == 65652), /* NT4 */
|
||||||
"Expected ERROR_CANCELLED or DE_DIFFDIR\n");
|
"Expected ERROR_CANCELLED or DE_DIFFDIR, got %u\n", retval);
|
||||||
ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
|
ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
|
||||||
|
|
||||||
/* pFrom is empty */
|
/* pFrom is empty */
|
||||||
|
@ -2516,6 +2583,11 @@ static void test_unicode(void)
|
||||||
skip("Unicode tests skipped on non-unicode system\n");
|
skip("Unicode tests skipped on non-unicode system\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (GetLastError()==ERROR_ACCESS_DENIED)
|
||||||
|
{
|
||||||
|
skip("test needs admin rights\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
CloseHandle(file);
|
CloseHandle(file);
|
||||||
|
|
||||||
/* Try to delete a file with unicode filename */
|
/* Try to delete a file with unicode filename */
|
||||||
|
@ -2574,6 +2646,7 @@ static void test_unicode(void)
|
||||||
ok(GetLastError() == ERROR_SUCCESS ||
|
ok(GetLastError() == ERROR_SUCCESS ||
|
||||||
broken(GetLastError() == ERROR_INVALID_HANDLE), /* WinXp, win2k3 */
|
broken(GetLastError() == ERROR_INVALID_HANDLE), /* WinXp, win2k3 */
|
||||||
"Expected ERROR_SUCCESS, got %d\n", GetLastError());
|
"Expected ERROR_SUCCESS, got %d\n", GetLastError());
|
||||||
|
DeleteFileW(UNICODE_PATH_TO);
|
||||||
|
|
||||||
/* Check last error after a failed file operation. */
|
/* Check last error after a failed file operation. */
|
||||||
DeleteFileW(UNICODE_PATH);
|
DeleteFileW(UNICODE_PATH);
|
||||||
|
|
|
@ -73,9 +73,8 @@ static HRESULT (WINAPI *pSHGetItemFromObject)(IUnknown*,REFIID,void**);
|
||||||
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
|
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
|
||||||
static UINT (WINAPI *pGetSystemWow64DirectoryW)(LPWSTR, UINT);
|
static UINT (WINAPI *pGetSystemWow64DirectoryW)(LPWSTR, UINT);
|
||||||
static HRESULT (WINAPI *pSHCreateDefaultContextMenu)(const DEFCONTEXTMENU*,REFIID,void**);
|
static HRESULT (WINAPI *pSHCreateDefaultContextMenu)(const DEFCONTEXTMENU*,REFIID,void**);
|
||||||
static HRESULT (WINAPI *pSHCreateShellFolderView)(const SFV_CREATE *pcsfv, IShellView **ppsv);
|
|
||||||
static HRESULT (WINAPI *pSHCreateShellFolderViewEx)(LPCSFV psvcbi, IShellView **ppv);
|
|
||||||
static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*);
|
static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*);
|
||||||
|
static BOOL (WINAPI *pSHGetPathFromIDListEx)(PCIDLIST_ABSOLUTE,WCHAR*,DWORD,GPFIDL_FLAGS);
|
||||||
|
|
||||||
static WCHAR *make_wstr(const char *str)
|
static WCHAR *make_wstr(const char *str)
|
||||||
{
|
{
|
||||||
|
@ -133,8 +132,7 @@ static void init_function_pointers(void)
|
||||||
MAKEFUNC(SHGetIDListFromObject);
|
MAKEFUNC(SHGetIDListFromObject);
|
||||||
MAKEFUNC(SHGetItemFromObject);
|
MAKEFUNC(SHGetItemFromObject);
|
||||||
MAKEFUNC(SHCreateDefaultContextMenu);
|
MAKEFUNC(SHCreateDefaultContextMenu);
|
||||||
MAKEFUNC(SHCreateShellFolderView);
|
MAKEFUNC(SHGetPathFromIDListEx);
|
||||||
MAKEFUNC(SHCreateShellFolderViewEx);
|
|
||||||
#undef MAKEFUNC
|
#undef MAKEFUNC
|
||||||
|
|
||||||
#define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))
|
#define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))
|
||||||
|
@ -452,7 +450,7 @@ static void test_EnumObjects(IShellFolder *iFolder)
|
||||||
flags = ~0u;
|
flags = ~0u;
|
||||||
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
|
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
|
||||||
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
|
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
|
||||||
ok((flags & ~SFGAO_HASSUBFOLDER) == full_attrs[i], "%d: got %08x expected %08x\n", i, flags, full_attrs[i]);
|
ok((flags & ~(SFGAO_HASSUBFOLDER|SFGAO_COMPRESSED)) == full_attrs[i], "%d: got %08x expected %08x\n", i, flags, full_attrs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0;i<5;i++)
|
for (i=0;i<5;i++)
|
||||||
|
@ -1347,10 +1345,34 @@ static void test_SHGetPathFromIDList(void)
|
||||||
|
|
||||||
result = pSHGetPathFromIDListW(pidlTestFile, wszPath);
|
result = pSHGetPathFromIDListW(pidlTestFile, wszPath);
|
||||||
ok(result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
|
ok(result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
|
||||||
IMalloc_Free(ppM, pidlTestFile);
|
|
||||||
if (!result) return;
|
|
||||||
ok(0 == lstrcmpW(wszFileName, wszPath), "SHGetPathFromIDListW returned incorrect path for file placed on desktop\n");
|
ok(0 == lstrcmpW(wszFileName, wszPath), "SHGetPathFromIDListW returned incorrect path for file placed on desktop\n");
|
||||||
|
|
||||||
|
if (pSHGetPathFromIDListEx)
|
||||||
|
{
|
||||||
|
result = pSHGetPathFromIDListEx(pidlEmpty, wszPath, MAX_PATH, SFGAO_FILESYSTEM);
|
||||||
|
ok(result, "SHGetPathFromIDListEx failed: %u\n", GetLastError());
|
||||||
|
ok(!lstrcmpiW(wszDesktop, wszPath), "Unexpected SHGetPathFromIDListEx result %s, expected %s\n",
|
||||||
|
wine_dbgstr_w(wszPath), wine_dbgstr_w(wszDesktop));
|
||||||
|
|
||||||
|
result = pSHGetPathFromIDListEx(pidlTestFile, wszPath, MAX_PATH, SFGAO_FILESYSTEM);
|
||||||
|
ok(result, "SHGetPathFromIDListEx failed: %u\n", GetLastError());
|
||||||
|
ok(!lstrcmpiW(wszFileName, wszPath), "Unexpected SHGetPathFromIDListEx result %s, expected %s\n",
|
||||||
|
wine_dbgstr_w(wszPath), wine_dbgstr_w(wszFileName));
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
memset(wszPath, 0x55, sizeof(wszPath));
|
||||||
|
result = pSHGetPathFromIDListEx(pidlTestFile, wszPath, 5, SFGAO_FILESYSTEM);
|
||||||
|
ok(!result, "SHGetPathFromIDListEx returned: %x(%u)\n", result, GetLastError());
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
memset(wszPath, 0x55, sizeof(wszPath));
|
||||||
|
result = pSHGetPathFromIDListEx(pidlEmpty, wszPath, 5, SFGAO_FILESYSTEM);
|
||||||
|
ok(!result, "SHGetPathFromIDListEx returned: %x(%u)\n", result, GetLastError());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
win_skip("SHGetPathFromIDListEx not available\n");
|
||||||
|
|
||||||
|
IMalloc_Free(ppM, pidlTestFile);
|
||||||
|
|
||||||
/* Test if we can get the path from the start menu "program files" PIDL. */
|
/* Test if we can get the path from the start menu "program files" PIDL. */
|
||||||
hr = pSHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms);
|
hr = pSHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms);
|
||||||
|
@ -1588,7 +1610,8 @@ static void test_FolderShortcut(void) {
|
||||||
if (hr != S_OK) return;
|
if (hr != S_OK) return;
|
||||||
|
|
||||||
hr = IShellFolder_GetDisplayNameOf(pShellFolder, NULL, SHGDN_FORPARSING, &strret);
|
hr = IShellFolder_GetDisplayNameOf(pShellFolder, NULL, SHGDN_FORPARSING, &strret);
|
||||||
ok(hr == S_OK, "IShellFolder_GetDisplayNameOf(NULL) failed! hr = %08x\n", hr);
|
ok(hr == S_OK || broken(hr == E_INVALIDARG) /* win10 */,
|
||||||
|
"IShellFolder_GetDisplayNameOf(NULL) failed! hr = %08x\n", hr);
|
||||||
if (hr != S_OK) {
|
if (hr != S_OK) {
|
||||||
IShellFolder_Release(pShellFolder);
|
IShellFolder_Release(pShellFolder);
|
||||||
return;
|
return;
|
||||||
|
@ -3773,10 +3796,10 @@ static void test_ShellItemArrayEnumItems(void)
|
||||||
hr = IShellFolder_BindToObject(pdesktopsf, pidl_testdir, NULL, (REFIID)&IID_IShellFolder,
|
hr = IShellFolder_BindToObject(pdesktopsf, pidl_testdir, NULL, (REFIID)&IID_IShellFolder,
|
||||||
(void**)&psf);
|
(void**)&psf);
|
||||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
if(SUCCEEDED(hr))
|
|
||||||
pILFree(pidl_testdir);
|
pILFree(pidl_testdir);
|
||||||
}
|
}
|
||||||
IShellFolder_Release(pdesktopsf);
|
IShellFolder_Release(pdesktopsf);
|
||||||
|
if (FAILED(hr)) return;
|
||||||
|
|
||||||
hr = IShellFolder_EnumObjects(psf, NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &peidl);
|
hr = IShellFolder_EnumObjects(psf, NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &peidl);
|
||||||
ok(hr == S_OK, "Got %08x\n", hr);
|
ok(hr == S_OK, "Got %08x\n", hr);
|
||||||
|
@ -5152,123 +5175,6 @@ static void test_SHCreateDefaultContextMenu(void)
|
||||||
Cleanup();
|
Cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_SHCreateShellFolderView(void)
|
|
||||||
{
|
|
||||||
HRESULT hr;
|
|
||||||
IShellView *psv;
|
|
||||||
SFV_CREATE sfvc;
|
|
||||||
IShellFolder *desktop;
|
|
||||||
ULONG refCount;
|
|
||||||
|
|
||||||
if (!pSHCreateShellFolderView)
|
|
||||||
{
|
|
||||||
win_skip("SHCreateShellFolderView missing.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = SHGetDesktopFolder(&desktop);
|
|
||||||
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
|
||||||
|
|
||||||
if (0)
|
|
||||||
{
|
|
||||||
/* crash on win7 */
|
|
||||||
pSHCreateShellFolderView(NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
psv = (void *)0xdeadbeef;
|
|
||||||
hr = pSHCreateShellFolderView(NULL, &psv);
|
|
||||||
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
|
|
||||||
ok(psv == NULL, "psv = %p\n", psv);
|
|
||||||
|
|
||||||
memset(&sfvc, 0, sizeof(sfvc));
|
|
||||||
psv = (void *)0xdeadbeef;
|
|
||||||
hr = pSHCreateShellFolderView(&sfvc, &psv);
|
|
||||||
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
|
|
||||||
ok(psv == NULL, "psv = %p\n", psv);
|
|
||||||
|
|
||||||
memset(&sfvc, 0, sizeof(sfvc));
|
|
||||||
sfvc.cbSize = sizeof(sfvc) - 1;
|
|
||||||
psv = (void *)0xdeadbeef;
|
|
||||||
hr = pSHCreateShellFolderView(&sfvc, &psv);
|
|
||||||
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
|
|
||||||
ok(psv == NULL, "psv = %p\n", psv);
|
|
||||||
|
|
||||||
memset(&sfvc, 0, sizeof(sfvc));
|
|
||||||
sfvc.cbSize = sizeof(sfvc) + 1;
|
|
||||||
psv = (void *)0xdeadbeef;
|
|
||||||
hr = pSHCreateShellFolderView(&sfvc, &psv);
|
|
||||||
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
|
|
||||||
ok(psv == NULL, "psv = %p\n", psv);
|
|
||||||
|
|
||||||
memset(&sfvc, 0, sizeof(sfvc));
|
|
||||||
sfvc.cbSize = sizeof(sfvc);
|
|
||||||
sfvc.pshf = desktop;
|
|
||||||
psv = NULL;
|
|
||||||
hr = pSHCreateShellFolderView(&sfvc, &psv);
|
|
||||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
|
||||||
ok(psv != NULL, "psv = %p\n", psv);
|
|
||||||
if (psv)
|
|
||||||
{
|
|
||||||
refCount = IShellView_Release(psv);
|
|
||||||
ok(refCount == 0, "refCount = %u\n", refCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
IShellFolder_Release(desktop);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_SHCreateShellFolderViewEx(void)
|
|
||||||
{
|
|
||||||
HRESULT hr;
|
|
||||||
IShellView *psv;
|
|
||||||
CSFV csfv;
|
|
||||||
IShellFolder *desktop;
|
|
||||||
ULONG refCount;
|
|
||||||
|
|
||||||
if (!pSHCreateShellFolderViewEx)
|
|
||||||
{
|
|
||||||
win_skip("SHCreateShellFolderViewEx missing.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = SHGetDesktopFolder(&desktop);
|
|
||||||
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
|
||||||
|
|
||||||
if (0)
|
|
||||||
{
|
|
||||||
/* crash on win7 */
|
|
||||||
pSHCreateShellFolderViewEx(NULL, NULL);
|
|
||||||
pSHCreateShellFolderViewEx(NULL, &psv);
|
|
||||||
pSHCreateShellFolderViewEx(&csfv, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&csfv, 0, sizeof(csfv));
|
|
||||||
csfv.pshf = desktop;
|
|
||||||
psv = NULL;
|
|
||||||
hr = pSHCreateShellFolderViewEx(&csfv, &psv);
|
|
||||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
|
||||||
ok(psv != NULL, "psv = %p\n", psv);
|
|
||||||
if (psv)
|
|
||||||
{
|
|
||||||
refCount = IShellView_Release(psv);
|
|
||||||
ok(refCount == 0, "refCount = %u\n", refCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&csfv, 0, sizeof(csfv));
|
|
||||||
csfv.cbSize = sizeof(csfv);
|
|
||||||
csfv.pshf = desktop;
|
|
||||||
psv = NULL;
|
|
||||||
hr = pSHCreateShellFolderViewEx(&csfv, &psv);
|
|
||||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
|
||||||
ok(psv != NULL, "psv = %p\n", psv);
|
|
||||||
if (psv)
|
|
||||||
{
|
|
||||||
refCount = IShellView_Release(psv);
|
|
||||||
ok(refCount == 0, "refCount = %u\n", refCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
IShellFolder_Release(desktop);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_DataObject(void)
|
static void test_DataObject(void)
|
||||||
{
|
{
|
||||||
IShellFolder *desktop;
|
IShellFolder *desktop;
|
||||||
|
@ -5364,8 +5270,6 @@ START_TEST(shlfolder)
|
||||||
test_ShellItemGetAttributes();
|
test_ShellItemGetAttributes();
|
||||||
test_ShellItemArrayGetAttributes();
|
test_ShellItemArrayGetAttributes();
|
||||||
test_SHCreateDefaultContextMenu();
|
test_SHCreateDefaultContextMenu();
|
||||||
test_SHCreateShellFolderView();
|
|
||||||
test_SHCreateShellFolderViewEx();
|
|
||||||
test_DataObject();
|
test_DataObject();
|
||||||
|
|
||||||
OleUninitialize();
|
OleUninitialize();
|
||||||
|
|
|
@ -53,10 +53,8 @@ static LRESULT WINAPI listview_subclass_proc(HWND hwnd, UINT message, WPARAM wPa
|
||||||
{
|
{
|
||||||
WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
|
WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
|
||||||
static LONG defwndproc_counter = 0;
|
static LONG defwndproc_counter = 0;
|
||||||
|
struct message msg = { 0 };
|
||||||
LRESULT ret;
|
LRESULT ret;
|
||||||
struct message msg;
|
|
||||||
|
|
||||||
trace("listview: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
|
|
||||||
|
|
||||||
msg.message = message;
|
msg.message = message;
|
||||||
msg.flags = sent|wparam|lparam;
|
msg.flags = sent|wparam|lparam;
|
||||||
|
@ -635,6 +633,7 @@ static void test_CreateViewWindow(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
RECT r = {0};
|
RECT r = {0};
|
||||||
ULONG ref1, ref2;
|
ULONG ref1, ref2;
|
||||||
|
IUnknown *unk;
|
||||||
|
|
||||||
hr = SHGetDesktopFolder(&desktop);
|
hr = SHGetDesktopFolder(&desktop);
|
||||||
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
||||||
|
@ -642,6 +641,11 @@ static void test_CreateViewWindow(void)
|
||||||
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
|
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
|
||||||
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
||||||
|
|
||||||
|
hr = IShellView_QueryInterface(view, &IID_CDefView, (void **)&unk);
|
||||||
|
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
||||||
|
ok(unk == (IUnknown *)view, "got %p\n", unk);
|
||||||
|
IUnknown_Release(unk);
|
||||||
|
|
||||||
if (0)
|
if (0)
|
||||||
{
|
{
|
||||||
/* crashes on native */
|
/* crashes on native */
|
||||||
|
@ -1331,6 +1335,147 @@ static void test_IOleCommandTarget(void)
|
||||||
IShellFolder_Release(psf_desktop);
|
IShellFolder_Release(psf_desktop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_SHCreateShellFolderView(void)
|
||||||
|
{
|
||||||
|
IShellFolder *desktop;
|
||||||
|
IShellView *psv;
|
||||||
|
SFV_CREATE sfvc;
|
||||||
|
ULONG refCount;
|
||||||
|
IUnknown *unk;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
hr = SHGetDesktopFolder(&desktop);
|
||||||
|
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
||||||
|
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
/* crash on win7 */
|
||||||
|
SHCreateShellFolderView(NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
psv = (void *)0xdeadbeef;
|
||||||
|
hr = SHCreateShellFolderView(NULL, &psv);
|
||||||
|
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv == NULL, "psv = %p\n", psv);
|
||||||
|
|
||||||
|
memset(&sfvc, 0, sizeof(sfvc));
|
||||||
|
psv = (void *)0xdeadbeef;
|
||||||
|
hr = SHCreateShellFolderView(&sfvc, &psv);
|
||||||
|
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv == NULL, "psv = %p\n", psv);
|
||||||
|
|
||||||
|
memset(&sfvc, 0, sizeof(sfvc));
|
||||||
|
sfvc.cbSize = sizeof(sfvc) - 1;
|
||||||
|
psv = (void *)0xdeadbeef;
|
||||||
|
hr = SHCreateShellFolderView(&sfvc, &psv);
|
||||||
|
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv == NULL, "psv = %p\n", psv);
|
||||||
|
|
||||||
|
memset(&sfvc, 0, sizeof(sfvc));
|
||||||
|
sfvc.cbSize = sizeof(sfvc) + 1;
|
||||||
|
psv = (void *)0xdeadbeef;
|
||||||
|
hr = SHCreateShellFolderView(&sfvc, &psv);
|
||||||
|
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv == NULL, "psv = %p\n", psv);
|
||||||
|
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
/* Crashes on NULL 'pshf' on XP/2k3 */
|
||||||
|
memset(&sfvc, 0, sizeof(sfvc));
|
||||||
|
sfvc.cbSize = sizeof(sfvc);
|
||||||
|
psv = (void *)0xdeadbeef;
|
||||||
|
hr = SHCreateShellFolderView(&sfvc, &psv);
|
||||||
|
ok(hr == E_UNEXPECTED, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv == NULL, "psv = %p\n", psv);
|
||||||
|
}
|
||||||
|
memset(&sfvc, 0, sizeof(sfvc));
|
||||||
|
sfvc.cbSize = sizeof(sfvc) - 1;
|
||||||
|
sfvc.pshf = desktop;
|
||||||
|
psv = (void *)0xdeadbeef;
|
||||||
|
hr = SHCreateShellFolderView(&sfvc, &psv);
|
||||||
|
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv == NULL, "psv = %p\n", psv);
|
||||||
|
|
||||||
|
memset(&sfvc, 0, sizeof(sfvc));
|
||||||
|
sfvc.cbSize = sizeof(sfvc);
|
||||||
|
sfvc.pshf = desktop;
|
||||||
|
psv = NULL;
|
||||||
|
hr = SHCreateShellFolderView(&sfvc, &psv);
|
||||||
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv != NULL, "psv = %p\n", psv);
|
||||||
|
|
||||||
|
hr = IShellView_QueryInterface(psv, &IID_CDefView, (void **)&unk);
|
||||||
|
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
||||||
|
ok(unk == (IUnknown *)psv, "got %p\n", unk);
|
||||||
|
IUnknown_Release(unk);
|
||||||
|
|
||||||
|
refCount = IShellView_Release(psv);
|
||||||
|
ok(refCount == 0, "refCount = %u\n", refCount);
|
||||||
|
|
||||||
|
IShellFolder_Release(desktop);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_SHCreateShellFolderViewEx(void)
|
||||||
|
{
|
||||||
|
IShellFolder *desktop;
|
||||||
|
IShellView *psv;
|
||||||
|
ULONG refCount;
|
||||||
|
IUnknown *unk;
|
||||||
|
HRESULT hr;
|
||||||
|
CSFV csfv;
|
||||||
|
|
||||||
|
hr = SHGetDesktopFolder(&desktop);
|
||||||
|
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
||||||
|
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
/* crash on win7 */
|
||||||
|
SHCreateShellFolderViewEx(NULL, NULL);
|
||||||
|
SHCreateShellFolderViewEx(NULL, &psv);
|
||||||
|
SHCreateShellFolderViewEx(&csfv, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&csfv, 0, sizeof(csfv));
|
||||||
|
csfv.pshf = desktop;
|
||||||
|
psv = NULL;
|
||||||
|
hr = SHCreateShellFolderViewEx(&csfv, &psv);
|
||||||
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv != NULL, "psv = %p\n", psv);
|
||||||
|
|
||||||
|
hr = IShellView_QueryInterface(psv, &IID_CDefView, (void **)&unk);
|
||||||
|
ok(hr == S_OK, "got (0x%08x)\n", hr);
|
||||||
|
ok(unk == (IUnknown *)psv, "got %p\n", unk);
|
||||||
|
IUnknown_Release(unk);
|
||||||
|
|
||||||
|
refCount = IShellView_Release(psv);
|
||||||
|
ok(refCount == 0, "refCount = %u\n", refCount);
|
||||||
|
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
/* Crashes on null shellfolder, on XP/2k3 */
|
||||||
|
memset(&csfv, 0, sizeof(csfv));
|
||||||
|
csfv.pshf = NULL;
|
||||||
|
psv = (void *)0xdeadbeef;
|
||||||
|
hr = SHCreateShellFolderViewEx(&csfv, &psv);
|
||||||
|
ok(hr == E_UNEXPECTED, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv == NULL, "psv = %p\n", psv);
|
||||||
|
}
|
||||||
|
memset(&csfv, 0, sizeof(csfv));
|
||||||
|
csfv.cbSize = sizeof(csfv);
|
||||||
|
csfv.pshf = desktop;
|
||||||
|
psv = NULL;
|
||||||
|
hr = SHCreateShellFolderViewEx(&csfv, &psv);
|
||||||
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv != NULL, "psv = %p\n", psv);
|
||||||
|
if (psv)
|
||||||
|
{
|
||||||
|
refCount = IShellView_Release(psv);
|
||||||
|
ok(refCount == 0, "refCount = %u\n", refCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
IShellFolder_Release(desktop);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(shlview)
|
START_TEST(shlview)
|
||||||
{
|
{
|
||||||
OleInitialize(NULL);
|
OleInitialize(NULL);
|
||||||
|
@ -1344,6 +1489,8 @@ START_TEST(shlview)
|
||||||
test_IOleWindow();
|
test_IOleWindow();
|
||||||
test_GetSetCurrentViewMode();
|
test_GetSetCurrentViewMode();
|
||||||
test_IOleCommandTarget();
|
test_IOleCommandTarget();
|
||||||
|
test_SHCreateShellFolderView();
|
||||||
|
test_SHCreateShellFolderViewEx();
|
||||||
|
|
||||||
OleUninitialize();
|
OleUninitialize();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue