Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2018
- 62 participants
- 503 discussions
Hello,
After putting this project down for a little while I've finally picked
it back up and have it working and passing its tests. This is still a
proof-of-concept and needs a lot more cleanup before it's ready for
staging or any serious review. I would be most interested to discover
additional programs whos performance improves with this patch set (the
Star Wars Battlefronts I and II by Pandemic were the original impetus of
this). You must start your program with STAGING_SHARED_MEMORY=1
STAGING_SHM_SYNC=1 to enable it and I have hosted the patches on my
github to anyone interested in trying it out:
git clone https://github.com/daniel-santos/wine
git checkout hybrid-sync
Although somewhat complex, this implements a fast synchronization
framework that:
* Can support semaphores, mutexes and events (only semaphores
implemented right now)
* Is scaleable,
* Can share objects with other processes,
* Can perform most operations without a server call, and
* Provides reasonably strong shared memory integrity guarantees with
well-defined behaviour when shared memory is corrupted or altered
incorrectly.
I have called them "Hybrid" objects because they have a private and
shared memory portion. When another process opens one, the shared
memory portion is migrated to a new memory region shared only by the
processes that have access to the object. This migration works even
when multiple threads and processes are performing operations on the
object. Scaleability is achieved through the use of memfd-backed shared
memory slab caches on the server, from which all shared memory is allocated.
Since it uses memfd and futexes it's only supported on Linux. Initial
support is for x86 systems, but ARM, PPC, can be added without too much
effort. I have not yet closely examined a BSD implementation.
How It Works
Every struct process in the server can have one or more struct
process_group objects associated with it. These represent unique sets
of processes that are sharing objects. When a client requests a new
synchronization object, the server looks for a process_group that only
contains the calling process and creates one if none exists -- this also
creates a new slab cache, which allocates a block of shared memory.
When another process later requests to open the object, the server finds
or creates a process_group with exactly the two processes in it and then
migrates the shared portion of the object to the new shared memory
slab. The migration is transparent to the client -- if a process is
waiting (natively) on the object it awakens its threads when the
migration is done so that one of them can request the new shared memory
data, map it into memory and continue its operation. Similarly, when a
process closes such an object, it is again migrated back to a
process_group that only contains the remaining processes who have access
to it (or destroys it).
Sometimes traditional server-side synchronization objects are needed
(e.g., for a critical section) and these are created by adding a new
SYNC_OBJECT_ACCESS_SERVER_ONLY access flag to the request.
The shared portion of the object is 64-bits:
* 32-bits of data,
* 4-bits of flags, and
* a 28-bit FNV1a hash
The 28 bits of hash are verified with every operation to detect if the
shared memory portion of the object has been incorrectly modified.
Although not infallible, the chances are somewhere around one in a
million that an incorrect modification would not be detected.
Other Solutions
I should note that the addition of SGX extensions, although intended for
cryptography and sensitive data, might provide a superior solution to
optimizing synchronization objects as well as many other operations that
require a server call. An SGX enclave provides a mechanism to share
memory in userspace while restricting, at the CPU level, what code is
allowed to read or alter that memory. This could be exploited to write
a sort-of Wine Demi-Kernel that lives in the process space of each
client process, reading and manipulating memory shared from wineserver
with exceptional integrity guarantees.
Thanks,
Daniel
1
0
Folks,
I think that at this point, we have fixed most of the bugs that could be
fixed during code freeze, so it looks like rc6 is going to be the last
rc. Please test it to confirm that there are no last minute issues.
Unless something major comes up, I'm planning to release the final 3.0
in a few days (as soon as I'm done writing the release notes...)
Thank you all for your work!
--
Alexandre Julliard
julliard(a)winehq.org
2
1
[PATCH vkd3d 01/12] libs/vkd3d: Validate miplevel count while creating resources.
by Józef Kucia 12 Jan '18
by Józef Kucia 12 Jan '18
12 Jan '18
From: Józef Kucia <jkucia(a)codeweavers.com>
vkd3d_log2i() is imported from wined3d.
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
configure.ac | 1 +
include/private/vkd3d_common.h | 32 ++++++++++++++++++++++++++++++++
libs/vkd3d/resource.c | 40 +++++++++++++++++++++++++++++++++++-----
m4/check-builtin-functions.m4 | 10 ++++++++++
tests/d3d12.c | 25 +++++++++++++++++++++++++
5 files changed, 103 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 27c03a6c9400..d13b440755cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,7 @@ AS_IF([test "x$with_spirv_tools" = "xyes"],
PKG_CHECK_MODULES([XCB], [xcb xcb-keysyms])
dnl Check for functions
+VKD3D_CHECK_BUILTIN_CLZ
VKD3D_CHECK_BUILTIN_POPCOUNT
VKD3D_CHECK_SYNC_ADD_AND_FETCH_FUNC
VKD3D_CHECK_SYNC_SUB_AND_FETCH_FUNC
diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h
index ce8f32e1b1aa..2e3873b82440 100644
--- a/include/private/vkd3d_common.h
+++ b/include/private/vkd3d_common.h
@@ -50,6 +50,38 @@ static inline unsigned int vkd3d_popcount(unsigned int v)
#endif
}
+/* Undefined for x == 0. */
+static inline unsigned int vkd3d_log2i(unsigned int x)
+{
+#ifdef HAVE_BUILTIN_CLZ
+ return __builtin_clz(x) ^ 0x1f;
+#else
+ static const unsigned int l[] =
+ {
+ ~0u, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ };
+ unsigned int i;
+
+ return (i = x >> 16) ? (x = i >> 8) ? l[x] + 24
+ : l[i] + 16 : (i = x >> 8) ? l[i] + 8 : l[x];
+#endif
+}
+
#ifndef _WIN32
# if HAVE_SYNC_ADD_AND_FETCH
static inline LONG InterlockedIncrement(LONG volatile *x)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index 72848a4457b7..264578bd31a8 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -103,14 +103,16 @@ HRESULT vkd3d_create_buffer(struct d3d12_device *device,
}
static HRESULT vkd3d_create_image(struct d3d12_resource *resource, struct d3d12_device *device,
- const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
- const D3D12_RESOURCE_DESC *desc)
+ const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags)
{
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
const struct vkd3d_format *format;
+ const D3D12_RESOURCE_DESC *desc;
VkImageCreateInfo image_info;
VkResult vr;
+ desc = &resource->desc;
+
if (!(format = vkd3d_format_from_d3d12_resource_desc(desc, 0)))
{
WARN("Invalid DXGI format %#x.\n", desc->Format);
@@ -606,6 +608,30 @@ struct d3d12_resource *unsafe_impl_from_ID3D12Resource(ID3D12Resource *iface)
return impl_from_ID3D12Resource(iface);
}
+static HRESULT validate_buffer_desc(const D3D12_RESOURCE_DESC *desc)
+{
+ if (desc->MipLevels != 1)
+ {
+ WARN("Invalid miplevel count %u for buffer.\n", desc->MipLevels);
+ return E_INVALIDARG;
+ }
+
+ return S_OK;
+}
+
+static HRESULT validate_texture_desc(D3D12_RESOURCE_DESC *desc)
+{
+ if (!desc->MipLevels)
+ {
+ unsigned int size = max(desc->Width, desc->Height);
+ if (desc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D)
+ size = max(size, desc->DepthOrArraySize);
+ desc->MipLevels = vkd3d_log2i(size) + 1;
+ }
+
+ return S_OK;
+}
+
static HRESULT d3d12_committed_resource_init(struct d3d12_resource *resource, struct d3d12_device *device,
const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
@@ -658,8 +684,10 @@ static HRESULT d3d12_committed_resource_init(struct d3d12_resource *resource, st
switch (desc->Dimension)
{
case D3D12_RESOURCE_DIMENSION_BUFFER:
- if (FAILED(hr = vkd3d_create_buffer(device, heap_properties, heap_flags, desc,
- &resource->u.vk_buffer)))
+ if (FAILED(hr = validate_buffer_desc(&resource->desc)))
+ return hr;
+ if (FAILED(hr = vkd3d_create_buffer(device, heap_properties, heap_flags,
+ &resource->desc, &resource->u.vk_buffer)))
return hr;
if (!(resource->gpu_address = vkd3d_gpu_va_allocator_allocate(&device->gpu_va_allocator,
desc->Width, resource)))
@@ -679,8 +707,10 @@ static HRESULT d3d12_committed_resource_init(struct d3d12_resource *resource, st
case D3D12_RESOURCE_DIMENSION_TEXTURE1D:
case D3D12_RESOURCE_DIMENSION_TEXTURE2D:
case D3D12_RESOURCE_DIMENSION_TEXTURE3D:
+ if (FAILED(hr = validate_texture_desc(&resource->desc)))
+ return hr;
resource->flags |= VKD3D_RESOURCE_INITIAL_STATE_TRANSITION;
- if (FAILED(hr = vkd3d_create_image(resource, device, heap_properties, heap_flags, desc)))
+ if (FAILED(hr = vkd3d_create_image(resource, device, heap_properties, heap_flags)))
return hr;
if (FAILED(hr = vkd3d_allocate_image_memory(resource, device, heap_properties, heap_flags)))
{
diff --git a/m4/check-builtin-functions.m4 b/m4/check-builtin-functions.m4
index c09eb4748a3a..2b24a802a3e3 100644
--- a/m4/check-builtin-functions.m4
+++ b/m4/check-builtin-functions.m4
@@ -18,6 +18,16 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __sync_sub_and_fetch((in
[Define to 1 if you have __sync_sub_and_fetch.])],
[AC_MSG_RESULT([no])])])
+dnl VKD3D_CHECK_BUILTIN_CLZ
+AC_DEFUN([VKD3D_CHECK_BUILTIN_CLZ],
+[AC_MSG_CHECKING([for __builtin_clz])
+AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_clz(0); }])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_BUILTIN_CLZ],
+ [1],
+ [Define to 1 if you have __builtin_clz.])],
+ [AC_MSG_RESULT([no])])])
+
dnl VKD3D_CHECK_BUILTIN_POPCOUNT
AC_DEFUN([VKD3D_CHECK_BUILTIN_POPCOUNT],
[AC_MSG_CHECKING([for __builtin_popcount])
diff --git a/tests/d3d12.c b/tests/d3d12.c
index dfc9257bff61..55116204a209 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -2213,6 +2213,24 @@ static void test_create_committed_resource(void)
refcount = ID3D12Resource_Release(resource);
ok(!refcount, "ID3D12Resource has %u references left.\n", (unsigned int)refcount);
+ resource_desc.MipLevels = 0;
+ hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
+ &resource_desc, D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value,
+ &IID_ID3D12Resource, (void **)&resource);
+ ok(SUCCEEDED(hr), "Failed to create committed resource, hr %#x.\n", hr);
+ resource_desc = ID3D12Resource_GetDesc(resource);
+ ok(resource_desc.MipLevels == 6, "Got unexpected miplevels %u.\n", resource_desc.MipLevels);
+ ID3D12Resource_Release(resource);
+ resource_desc.MipLevels = 10;
+ hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
+ &resource_desc, D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value,
+ &IID_ID3D12Resource, (void **)&resource);
+ ok(SUCCEEDED(hr), "Failed to create committed resource, hr %#x.\n", hr);
+ resource_desc = ID3D12Resource_GetDesc(resource);
+ ok(resource_desc.MipLevels == 10, "Got unexpected miplevels %u.\n", resource_desc.MipLevels);
+ ID3D12Resource_Release(resource);
+ resource_desc.MipLevels = 1;
+
hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
&resource_desc, D3D12_RESOURCE_STATE_RENDER_TARGET | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE,
&clear_value, &IID_ID3D12Resource, (void **)&resource);
@@ -2291,6 +2309,13 @@ static void test_create_committed_resource(void)
refcount = ID3D12Resource_Release(resource);
ok(!refcount, "ID3D12Resource has %u references left.\n", (unsigned int)refcount);
+ resource_desc.MipLevels = 0;
+ hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
+ &resource_desc, D3D12_RESOURCE_STATE_GENERIC_READ, &clear_value,
+ &IID_ID3D12Resource, (void **)&resource);
+ ok(hr == E_INVALIDARG, "Failed to create committed resource, hr %#x.\n", hr);
+ resource_desc.MipLevels = 1;
+
/* The clear value must be NULL for buffers. */
hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
&resource_desc, D3D12_RESOURCE_STATE_GENERIC_READ, &clear_value,
--
2.13.6
3
25
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/comctl32/tests/edit.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c
index 9feb9b42bc..77116837df 100644
--- a/dlls/comctl32/tests/edit.c
+++ b/dlls/comctl32/tests/edit.c
@@ -558,6 +558,17 @@ static HWND create_editcontrol (DWORD style, DWORD exstyle)
return handle;
}
+static HWND create_editcontrolW(DWORD style, DWORD exstyle)
+{
+ static const WCHAR testtextW[] = {'T','e','s','t',' ','t','e','x','t',0};
+ HWND handle;
+
+ handle = CreateWindowExW(exstyle, WC_EDITW, testtextW, style, 10, 10, 300, 300,
+ NULL, NULL, hinst, NULL);
+ ok(handle != NULL, "Failed to create Edit control.\n");
+ return handle;
+}
+
static HWND create_child_editcontrol (DWORD style, DWORD exstyle)
{
HWND parentWnd;
@@ -2922,6 +2933,55 @@ static void test_paste(void)
DestroyWindow(hMultilineEdit);
}
+static void test_EM_GETLINE(void)
+{
+ HWND hwnd[2];
+ int i;
+
+ hwnd[0] = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
+ hwnd[1] = create_editcontrolW(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
+
+ for (i = 0; i < sizeof(hwnd)/sizeof(hwnd[0]); i++)
+ {
+ static const WCHAR strW[] = {'t','e','x','t',0};
+ static const char *str = "text";
+ WCHAR buffW[16];
+ char buff[16];
+ int r;
+
+ todo_wine_if(i == 0)
+ ok(IsWindowUnicode(hwnd[i]), "Expected unicode window.\n");
+
+ SendMessageA(hwnd[i], WM_SETTEXT, 0, (LPARAM)str);
+
+ memset(buff, 0, sizeof(buff));
+ *(WORD *)buff = sizeof(buff);
+ r = SendMessageA(hwnd[i], EM_GETLINE, 0, (LPARAM)buff);
+ ok(r == strlen(str), "Failed to get a line %d.\n", r);
+ ok(!strcmp(buff, str), "Unexpected line data %s.\n", buff);
+
+ memset(buff, 0, sizeof(buff));
+ *(WORD *)buff = sizeof(buff);
+ r = SendMessageA(hwnd[i], EM_GETLINE, 1, (LPARAM)buff);
+ ok(r == strlen(str), "Failed to get a line %d.\n", r);
+ ok(!strcmp(buff, str), "Unexpected line data %s.\n", buff);
+
+ memset(buffW, 0, sizeof(buffW));
+ *(WORD *)buffW = sizeof(buffW)/sizeof(buffW[0]);
+ r = SendMessageW(hwnd[i], EM_GETLINE, 0, (LPARAM)buffW);
+ ok(r == lstrlenW(strW), "Failed to get a line %d.\n", r);
+ ok(!lstrcmpW(buffW, strW), "Unexpected line data %s.\n", wine_dbgstr_w(buffW));
+
+ memset(buffW, 0, sizeof(buffW));
+ *(WORD *)buffW = sizeof(buffW)/sizeof(buffW[0]);
+ r = SendMessageW(hwnd[i], EM_GETLINE, 1, (LPARAM)buffW);
+ ok(r == lstrlenW(strW), "Failed to get a line %d.\n", r);
+ ok(!lstrcmpW(buffW, strW), "Unexpected line data %s.\n", wine_dbgstr_w(buffW));
+
+ DestroyWindow(hwnd[i]);
+ }
+}
+
START_TEST(edit)
{
ULONG_PTR ctx_cookie;
@@ -2961,6 +3021,7 @@ START_TEST(edit)
test_contextmenu();
test_EM_GETHANDLE();
test_paste();
+ test_EM_GETLINE();
UnregisterWindowClasses();
--
2.15.1
1
0
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/user32/tests/edit.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c
index e334be1ddd..de8a349e13 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -557,6 +557,18 @@ static HWND create_editcontrol (DWORD style, DWORD exstyle)
return handle;
}
+static HWND create_editcontrolW(DWORD style, DWORD exstyle)
+{
+ static const WCHAR testtextW[] = {'T','e','s','t',' ','t','e','x','t',0};
+ static const WCHAR editW[] = {'E','d','i','t',0};
+ HWND handle;
+
+ handle = CreateWindowExW(exstyle, editW, testtextW, style, 10, 10, 300, 300,
+ NULL, NULL, hinst, NULL);
+ ok(handle != NULL, "Failed to create Edit control.\n");
+ return handle;
+}
+
static HWND create_child_editcontrol (DWORD style, DWORD exstyle)
{
HWND parentWnd;
@@ -2936,6 +2948,57 @@ static void test_paste(void)
DestroyWindow(hMultilineEdit);
}
+static void test_EM_GETLINE(void)
+{
+ HWND hwnd[2];
+ int i;
+
+ hwnd[0] = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
+ hwnd[1] = create_editcontrolW(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
+
+ for (i = 0; i < sizeof(hwnd)/sizeof(hwnd[0]); i++)
+ {
+ static const WCHAR strW[] = {'t','e','x','t',0};
+ static const char *str = "text";
+ WCHAR buffW[16];
+ char buff[16];
+ int r;
+
+ if (i == 0)
+ ok(!IsWindowUnicode(hwnd[i]), "Expected ansi window.\n");
+ else
+ ok(IsWindowUnicode(hwnd[i]), "Expected unicode window.\n");
+
+ SendMessageA(hwnd[i], WM_SETTEXT, 0, (LPARAM)str);
+
+ memset(buff, 0, sizeof(buff));
+ *(WORD *)buff = sizeof(buff);
+ r = SendMessageA(hwnd[i], EM_GETLINE, 0, (LPARAM)buff);
+ ok(r == strlen(str), "Failed to get a line %d.\n", r);
+ ok(!strcmp(buff, str), "Unexpected line data %s.\n", buff);
+
+ memset(buff, 0, sizeof(buff));
+ *(WORD *)buff = sizeof(buff);
+ r = SendMessageA(hwnd[i], EM_GETLINE, 1, (LPARAM)buff);
+ ok(r == strlen(str), "Failed to get a line %d.\n", r);
+ ok(!strcmp(buff, str), "Unexpected line data %s.\n", buff);
+
+ memset(buffW, 0, sizeof(buffW));
+ *(WORD *)buffW = sizeof(buffW)/sizeof(buffW[0]);
+ r = SendMessageW(hwnd[i], EM_GETLINE, 0, (LPARAM)buffW);
+ ok(r == lstrlenW(strW), "Failed to get a line %d.\n", r);
+ ok(!lstrcmpW(buffW, strW), "Unexpected line data %s.\n", wine_dbgstr_w(buffW));
+
+ memset(buffW, 0, sizeof(buffW));
+ *(WORD *)buffW = sizeof(buffW)/sizeof(buffW[0]);
+ r = SendMessageW(hwnd[i], EM_GETLINE, 1, (LPARAM)buffW);
+ ok(r == lstrlenW(strW), "Failed to get a line %d.\n", r);
+ ok(!lstrcmpW(buffW, strW), "Unexpected line data %s.\n", wine_dbgstr_w(buffW));
+
+ DestroyWindow(hwnd[i]);
+ }
+}
+
START_TEST(edit)
{
BOOL b;
@@ -2970,6 +3033,7 @@ START_TEST(edit)
test_contextmenu();
test_EM_GETHANDLE();
test_paste();
+ test_EM_GETLINE();
UnregisterWindowClasses();
}
--
2.15.1
1
0
12 Jan '18
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/msxml3/tests/domdoc.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 1306590894..7c56015235 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -10155,16 +10155,20 @@ static void write_to_file(const char *name, const char *data)
static void test_load(void)
{
IXMLDOMDocument *doc, *doc2;
+ BSTR pathW, bstr1, bstr2;
IXMLDOMNodeList *list;
IXMLDOMElement *elem;
+ char path[MAX_PATH];
VARIANT_BOOL b;
VARIANT src;
HRESULT hr;
- BSTR path, bstr1, bstr2;
void* ptr;
+ GetTempPathA(MAX_PATH, path);
+ strcat(path, "winetest.xml");
+
/* prepare a file */
- write_to_file("test.xml", win1252xml);
+ write_to_file(path, win1252xml);
doc = create_document(&IID_IXMLDOMDocument);
@@ -10175,11 +10179,11 @@ static void test_load(void)
EXPECT_HR(hr, E_INVALIDARG);
ok(b == VARIANT_FALSE, "got %d\n", b);
- path = _bstr_("test.xml");
+ pathW = _bstr_(path);
/* load from path: VT_BSTR */
V_VT(&src) = VT_BSTR;
- V_BSTR(&src) = path;
+ V_BSTR(&src) = pathW;
hr = IXMLDOMDocument_load(doc, src, &b);
EXPECT_HR(hr, S_OK);
ok(b == VARIANT_TRUE, "got %d\n", b);
@@ -10191,7 +10195,7 @@ static void test_load(void)
/* load from a path: VT_BSTR|VT_BYREF */
V_VT(&src) = VT_BSTR | VT_BYREF;
- V_BSTRREF(&src) = &path;
+ V_BSTRREF(&src) = &pathW;
hr = IXMLDOMDocument_load(doc, src, &b);
EXPECT_HR(hr, S_OK);
ok(b == VARIANT_TRUE, "got %d\n", b);
@@ -10229,13 +10233,13 @@ static void test_load(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(bstr1);
- DeleteFileA("test.xml");
+ DeleteFileA(path);
/* load from existing path, no xml content */
- write_to_file("test.xml", nocontent);
+ write_to_file(path, nocontent);
V_VT(&src) = VT_BSTR;
- V_BSTR(&src) = path;
+ V_BSTR(&src) = pathW;
b = VARIANT_TRUE;
hr = IXMLDOMDocument_load(doc, src, &b);
ok(hr == S_FALSE, "got 0x%08x\n", hr);
@@ -10246,7 +10250,7 @@ static void test_load(void)
ok(hr == S_FALSE, "got 0x%08x\n", hr);
ok(bstr1 == NULL, "got %p\n", bstr1);
- DeleteFileA("test.xml");
+ DeleteFileA(path);
IXMLDOMDocument_Release(doc);
doc = create_document(&IID_IXMLDOMDocument);
--
2.15.1
1
0
Some functions in sysparams.c invoke get_display_dc to get display dc and
then use it without lock mechanism. it will cause condition race in multi-thread.
PS:
I dont't kown how to make a test than can stably run into this problem, but
call GetSystemMetrics(SM_CXSCREEN) within a tight loop in different thread
will get zero finally.
4
3
[PATCH v2 1/2] shell32/tests: Drop shell folder test dynamic imports for Windows <= 2000
by Alex Henrie 12 Jan '18
by Alex Henrie 12 Jan '18
12 Jan '18
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/shell32/tests/shlfolder.c | 672 +++++++++++++++--------------------------
1 file changed, 238 insertions(+), 434 deletions(-)
diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index 1ee02743f5..c8cbfda05f 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -45,17 +45,6 @@ DEFINE_GUID(CLSID_ShellDocObjView, 0xe7e4bc40, 0xe76a, 0x11ce, 0xa9,0xbb, 0x00,0
static IMalloc *ppM;
-static HRESULT (WINAPI *pSHBindToParent)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*);
-static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
-static HRESULT (WINAPI *pSHGetFolderPathAndSubDirA)(HWND, int, HANDLE, DWORD, LPCSTR, LPSTR);
-static BOOL (WINAPI *pSHGetPathFromIDListW)(LPCITEMIDLIST,LPWSTR);
-static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *);
-static BOOL (WINAPI *pSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL);
-static BOOL (WINAPI *pSHGetSpecialFolderPathW)(HWND, LPWSTR, int, BOOL);
-static HRESULT (WINAPI *pStrRetToBufW)(STRRET*,LPCITEMIDLIST,LPWSTR,UINT);
-static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST);
-static void (WINAPI *pILFree)(LPITEMIDLIST);
-static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
static HRESULT (WINAPI *pSHCreateItemFromIDList)(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv);
static HRESULT (WINAPI *pSHCreateItemFromParsingName)(PCWSTR,IBindCtx*,REFIID,void**);
static HRESULT (WINAPI *pSHCreateItemFromRelativeName)(IShellItem*,PCWSTR,IBindCtx*,REFIID,void**);
@@ -65,18 +54,13 @@ static HRESULT (WINAPI *pSHCreateShellItemArray)(LPCITEMIDLIST,IShellFolder*,UIN
static HRESULT (WINAPI *pSHCreateShellItemArrayFromIDLists)(UINT, PCIDLIST_ABSOLUTE*, IShellItemArray**);
static HRESULT (WINAPI *pSHCreateShellItemArrayFromDataObject)(IDataObject*, REFIID, void **);
static HRESULT (WINAPI *pSHCreateShellItemArrayFromShellItem)(IShellItem*, REFIID, void **);
-static LPITEMIDLIST (WINAPI *pILCombine)(LPCITEMIDLIST,LPCITEMIDLIST);
-static HRESULT (WINAPI *pSHParseDisplayName)(LPCWSTR,IBindCtx*,LPITEMIDLIST*,SFGAOF,SFGAOF*);
-static LPITEMIDLIST (WINAPI *pSHSimpleIDListFromPathAW)(LPCVOID);
static HRESULT (WINAPI *pSHGetKnownFolderPath)(REFKNOWNFOLDERID,DWORD,HANDLE,PWSTR*);
static HRESULT (WINAPI *pSHGetNameFromIDList)(PCIDLIST_ABSOLUTE,SIGDN,PWSTR*);
static HRESULT (WINAPI *pSHGetItemFromDataObject)(IDataObject*,DATAOBJ_GET_ITEM_FLAGS,REFIID,void**);
static HRESULT (WINAPI *pSHGetIDListFromObject)(IUnknown*, PIDLIST_ABSOLUTE*);
static HRESULT (WINAPI *pSHGetItemFromObject)(IUnknown*,REFIID,void**);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-static UINT (WINAPI *pGetSystemWow64DirectoryW)(LPWSTR, UINT);
static HRESULT (WINAPI *pSHCreateDefaultContextMenu)(const DEFCONTEXTMENU*,REFIID,void**);
-static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*);
static BOOL (WINAPI *pSHGetPathFromIDListEx)(PCIDLIST_ABSOLUTE,WCHAR*,DWORD,GPFIDL_FLAGS);
static WCHAR *make_wstr(const char *str)
@@ -115,7 +99,6 @@ static void init_function_pointers(void)
hmod = GetModuleHandleA("shell32.dll");
#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f))
- MAKEFUNC(SHBindToParent);
MAKEFUNC(SHCreateItemFromIDList);
MAKEFUNC(SHCreateItemFromParsingName);
MAKEFUNC(SHCreateItemFromRelativeName);
@@ -125,13 +108,6 @@ static void init_function_pointers(void)
MAKEFUNC(SHCreateShellItemArrayFromIDLists);
MAKEFUNC(SHCreateShellItemArrayFromDataObject);
MAKEFUNC(SHCreateShellItemArrayFromShellItem);
- MAKEFUNC(SHGetFolderPathA);
- MAKEFUNC(SHGetFolderPathAndSubDirA);
- MAKEFUNC(SHGetPathFromIDListW);
- MAKEFUNC(SHGetSpecialFolderPathA);
- MAKEFUNC(SHGetSpecialFolderPathW);
- MAKEFUNC(SHGetSpecialFolderLocation);
- MAKEFUNC(SHParseDisplayName);
MAKEFUNC(SHGetKnownFolderPath);
MAKEFUNC(SHGetNameFromIDList);
MAKEFUNC(SHGetItemFromDataObject);
@@ -141,15 +117,6 @@ static void init_function_pointers(void)
MAKEFUNC(SHGetPathFromIDListEx);
#undef MAKEFUNC
-#define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))
- MAKEFUNC_ORD(ILFindLastID, 16);
- MAKEFUNC_ORD(ILIsEqual, 21);
- MAKEFUNC_ORD(ILCombine, 25);
- MAKEFUNC_ORD(SHILCreateFromPath, 28);
- MAKEFUNC_ORD(ILFree, 155);
- MAKEFUNC_ORD(SHSimpleIDListFromPathAW, 162);
-#undef MAKEFUNC_ORD
-
/* test named exports */
ptr = GetProcAddress(hmod, "ILFree");
ok(broken(ptr == 0) || ptr != 0, "expected named export for ILFree\n");
@@ -177,12 +144,8 @@ static void init_function_pointers(void)
#undef TESTNAMED
}
- hmod = GetModuleHandleA("shlwapi.dll");
- pStrRetToBufW = (void*)GetProcAddress(hmod, "StrRetToBufW");
-
hmod = GetModuleHandleA("kernel32.dll");
pIsWow64Process = (void*)GetProcAddress(hmod, "IsWow64Process");
- pGetSystemWow64DirectoryW = (void*)GetProcAddress(hmod, "GetSystemWow64DirectoryW");
hr = SHGetMalloc(&ppM);
ok(hr == S_OK, "SHGetMalloc failed %08x\n", hr);
@@ -225,12 +188,11 @@ static void test_ParseDisplayName(void)
ok(hr == S_OK, "Expected SHGetDesktopFolder to return S_OK, got 0x%08x\n", hr);
if(hr != S_OK) return;
- /* Tests crash on W2K and below (SHCreateShellItem available as of XP) */
if (pSHCreateShellItem)
{
if (0)
{
- /* null name and pidl, also crashes on Windows 8 */
+ /* null name and pidl, crashes on Windows 8 */
hr = IShellFolder_ParseDisplayName(IDesktopFolder, NULL, NULL,
NULL, NULL, NULL, 0);
ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
@@ -244,7 +206,7 @@ static void test_ParseDisplayName(void)
ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
}
else
- win_skip("Tests would crash on W2K and below\n");
+ win_skip("SHCreateShellItem requires XP SP1 or later\n");
MultiByteToWideChar(CP_ACP, 0, cInetTestA, -1, cTestDirW, MAX_PATH);
hr = IShellFolder_ParseDisplayName(IDesktopFolder,
@@ -253,8 +215,8 @@ static void test_ParseDisplayName(void)
"ParseDisplayName returned %08x, expected SUCCESS or E_FAIL\n", hr);
if (hr == S_OK)
{
- ok(pILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
- "PT_IESPECIAL1, but is: %02x\n", pILFindLastID(newPIDL)->mkid.abID[0]);
+ ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
+ "PT_IESPECIAL1, but is: %02x\n", ILFindLastID(newPIDL)->mkid.abID[0]);
IMalloc_Free(ppM, newPIDL);
}
@@ -265,8 +227,8 @@ static void test_ParseDisplayName(void)
"ParseDisplayName returned %08x, expected SUCCESS or E_FAIL\n", hr);
if (hr == S_OK)
{
- ok(pILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
- "PT_IESPECIAL1, but is: %02x\n", pILFindLastID(newPIDL)->mkid.abID[0]);
+ ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
+ "PT_IESPECIAL1, but is: %02x\n", ILFindLastID(newPIDL)->mkid.abID[0]);
IMalloc_Free(ppM, newPIDL);
}
@@ -299,13 +261,8 @@ static void test_ParseDisplayName(void)
/* I thought that perhaps the DesktopFolder's ParseDisplayName would recognize the
* path corresponding to CSIDL_PERSONAL and return a CLSID_MyDocuments PIDL. Turns
* out it doesn't. The magic seems to happen in the file dialogs, then. */
- if (!pSHGetSpecialFolderPathW || !pILFindLastID)
- {
- win_skip("SHGetSpecialFolderPathW and/or ILFindLastID are not available\n");
- goto finished;
- }
- bRes = pSHGetSpecialFolderPathW(NULL, cTestDirW, CSIDL_PERSONAL, FALSE);
+ bRes = SHGetSpecialFolderPathW(NULL, cTestDirW, CSIDL_PERSONAL, FALSE);
ok(bRes, "SHGetSpecialFolderPath(CSIDL_PERSONAL) failed! %u\n", GetLastError());
if (!bRes) goto finished;
@@ -313,12 +270,11 @@ static void test_ParseDisplayName(void)
ok(hr == S_OK, "DesktopFolder->ParseDisplayName failed. hr = %08x.\n", hr);
if (hr != S_OK) goto finished;
- ok(pILFindLastID(newPIDL)->mkid.abID[0] == 0x31 ||
- pILFindLastID(newPIDL)->mkid.abID[0] == 0xb1, /* Win98 */
- "Last pidl should be of type PT_FOLDER or PT_IESPECIAL2, but is: %02x\n",
- pILFindLastID(newPIDL)->mkid.abID[0]);
+ ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x31,
+ "Last pidl should be of type PT_FOLDER, but is: %02x\n",
+ ILFindLastID(newPIDL)->mkid.abID[0]);
IMalloc_Free(ppM, newPIDL);
-
+
finished:
IShellFolder_Release(IDesktopFolder);
}
@@ -602,7 +558,7 @@ if (0)
IShellFolder_Release(psfChild);
}
- pILFree(pidl);
+ ILFree(pidl);
}
DeleteFileA(pathA);
}
@@ -628,7 +584,7 @@ if (0)
broken(hr == S_OK), /* Win9x, NT4, W2K */
"Got 0x%08x\n", hr);
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
- pILFree(pidl);
+ ILFree(pidl);
}
DeleteFileA(pathA);
}
@@ -654,7 +610,7 @@ if (0)
broken(hr == S_OK), /* Win9x, NT4, W2K */
"Got 0x%08x\n", hr);
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
- pILFree(pidl);
+ ILFree(pidl);
}
DeleteFileA(pathA);
}
@@ -662,59 +618,42 @@ if (0)
win_skip("Failed to create .foo testfile.\n");
/* And on the desktop */
- if(pSHGetSpecialFolderPathA)
- {
- pSHGetSpecialFolderPathA(NULL, pathA, CSIDL_DESKTOP, FALSE);
- lstrcatA(pathA, "\\");
- lstrcatA(pathA, filename_html);
- hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- if(hfile != INVALID_HANDLE_VALUE)
- {
- CloseHandle(hfile);
- MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH);
- hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, path, NULL, &pidl, NULL);
- ok(hr == S_OK, "Got 0x%08x\n", hr);
- if(SUCCEEDED(hr))
- {
- hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
- ok(hr == S_OK ||
- hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
- "Got 0x%08x\n", hr);
- if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
- pILFree(pidl);
- }
- if(!DeleteFileA(pathA))
- trace("Failed to delete: %d\n", GetLastError());
+ SHGetSpecialFolderPathA(NULL, pathA, CSIDL_DESKTOP, FALSE);
+ lstrcatA(pathA, "\\");
+ lstrcatA(pathA, filename_html);
+ hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- }
- else
- win_skip("Failed to create .html testfile.\n");
+ CloseHandle(hfile);
+ MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH);
+ hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, path, NULL, &pidl, NULL);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
- pSHGetSpecialFolderPathA(NULL, pathA, CSIDL_DESKTOP, FALSE);
- lstrcatA(pathA, "\\");
- lstrcatA(pathA, filename_foo);
- hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- if(hfile != INVALID_HANDLE_VALUE)
- {
- CloseHandle(hfile);
- MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH);
- hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, path, NULL, &pidl, NULL);
- ok(hr == S_OK, "Got 0x%08x\n", hr);
- if(SUCCEEDED(hr))
- {
- hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
- ok(hr == E_FAIL || /* Vista+ */
- hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */
- broken(hr == S_OK), /* Win9x, NT4, W2K */
- "Got 0x%08x\n", hr);
- if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
- pILFree(pidl);
- }
- DeleteFileA(pathA);
- }
- else
- win_skip("Failed to create .foo testfile.\n");
- }
+ hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void **)&psfChild);
+ ok(hr == S_OK ||
+ hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
+ "Got 0x%08x\n", hr);
+ if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
+ ILFree(pidl);
+ if(!DeleteFileA(pathA))
+ trace("Failed to delete: %d\n", GetLastError());
+
+ SHGetSpecialFolderPathA(NULL, pathA, CSIDL_DESKTOP, FALSE);
+ lstrcatA(pathA, "\\");
+ lstrcatA(pathA, filename_foo);
+ hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
+
+ CloseHandle(hfile);
+ MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH);
+ hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, path, NULL, &pidl, NULL);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
+
+ hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void **)&psfChild);
+ ok(hr == E_FAIL || /* Vista+ */
+ hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
+ "Got 0x%08x\n", hr);
+ if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
+ ILFree(pidl);
+ DeleteFileA(pathA);
IShellFolder_Release(psfDesktop);
}
@@ -737,6 +676,10 @@ static void test_GetDisplayName(void)
static const WCHAR wszFileName[] = { 'w','i','n','e','t','e','s','t','.','f','o','o',0 };
static const WCHAR wszDirName[] = { 'w','i','n','e','t','e','s','t',0 };
+ /* It's ok to use this fixed path. Call will fail anyway. */
+ WCHAR wszAbsoluteFilename[] = { 'C',':','\\','w','i','n','e','t','e','s','t', 0 };
+ LPITEMIDLIST pidlNew;
+
/* I'm trying to figure if there is a functional difference between calling
* SHGetPathFromIDListW and calling GetDisplayNameOf(SHGDN_FORPARSING) after
* binding to the shellfolder. One thing I thought of was that perhaps
@@ -745,13 +688,8 @@ static void test_GetDisplayName(void)
* no functional difference in this respect.
*/
- if(!pSHGetSpecialFolderPathA) {
- win_skip("SHGetSpecialFolderPathA is not available\n");
- return;
- }
-
/* First creating a directory in MyDocuments and a file in this directory. */
- result = pSHGetSpecialFolderPathA(NULL, szTestDir, CSIDL_PERSONAL, FALSE);
+ result = SHGetSpecialFolderPathA(NULL, szTestDir, CSIDL_PERSONAL, FALSE);
ok(result, "SHGetSpecialFolderPathA failed! Last error: %u\n", GetLastError());
if (!result) return;
@@ -787,7 +725,7 @@ static void test_GetDisplayName(void)
return;
}
- pidlLast = pILFindLastID(pidlTestFile);
+ pidlLast = ILFindLastID(pidlTestFile);
ok(pidlLast->mkid.cb >=76 ||
broken(pidlLast->mkid.cb == 28) || /* W2K */
broken(pidlLast->mkid.cb == 40), /* Win9x, WinME */
@@ -816,77 +754,52 @@ static void test_GetDisplayName(void)
IUnknown_Release(psfFile);
}
- if (!pSHBindToParent)
- {
- win_skip("SHBindToParent is missing\n");
- DeleteFileA(szTestFile);
- RemoveDirectoryA(szTestDir);
- return;
- }
-
/* Some tests for IShellFolder::SetNameOf */
- if (pSHGetFolderPathAndSubDirA)
- {
- hr = pSHBindToParent(pidlTestFile, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
- ok(hr == S_OK, "SHBindToParent failed! hr = %08x\n", hr);
- if (hr == S_OK) {
- /* It's ok to use this fixed path. Call will fail anyway. */
- WCHAR wszAbsoluteFilename[] = { 'C',':','\\','w','i','n','e','t','e','s','t', 0 };
- LPITEMIDLIST pidlNew;
-
- /* The pidl returned through the last parameter of SetNameOf is a simple one. */
- hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew);
- ok (hr == S_OK, "SetNameOf failed! hr = %08x\n", hr);
- if (hr == S_OK)
- {
- ok (((LPITEMIDLIST)((LPBYTE)pidlNew+pidlNew->mkid.cb))->mkid.cb == 0,
- "pidl returned from SetNameOf should be simple!\n");
+ hr = SHBindToParent(pidlTestFile, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast);
+ ok(hr == S_OK, "SHBindToParent failed! hr = %08x\n", hr);
- /* Passing an absolute path to SetNameOf fails. The HRESULT code indicates that SetNameOf
- * is implemented on top of SHFileOperation in WinXP. */
- hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszAbsoluteFilename,
- SHGDN_FORPARSING, NULL);
- ok (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "SetNameOf succeeded! hr = %08x\n", hr);
+ /* The pidl returned through the last parameter of SetNameOf is a simple one. */
+ hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew);
+ ok (hr == S_OK, "SetNameOf failed! hr = %08x\n", hr);
- /* Rename the file back to its original name. SetNameOf ignores the fact, that the
- * SHGDN flags specify an absolute path. */
- hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL);
- ok (hr == S_OK, "SetNameOf failed! hr = %08x\n", hr);
+ ok (((ITEMIDLIST *)((BYTE *)pidlNew + pidlNew->mkid.cb))->mkid.cb == 0,
+ "pidl returned from SetNameOf should be simple!\n");
- pILFree(pidlNew);
- }
+ /* Passing an absolute path to SetNameOf fails. The HRESULT code indicates that SetNameOf
+ * is implemented on top of SHFileOperation in WinXP. */
+ hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszAbsoluteFilename, SHGDN_FORPARSING, NULL);
+ ok (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "SetNameOf succeeded! hr = %08x\n", hr);
- IShellFolder_Release(psfPersonal);
- }
- }
- else
- win_skip("Avoid needs of interaction on Win2k\n");
+ /* Rename the file back to its original name. SetNameOf ignores the fact, that the
+ * SHGDN flags specify an absolute path. */
+ hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL);
+ ok (hr == S_OK, "SetNameOf failed! hr = %08x\n", hr);
+
+ ILFree(pidlNew);
+ IShellFolder_Release(psfPersonal);
/* Deleting the file and the directory */
DeleteFileA(szTestFile);
RemoveDirectoryA(szTestDir);
/* SHGetPathFromIDListW still works, although the file is not present anymore. */
- if (pSHGetPathFromIDListW)
- {
- result = pSHGetPathFromIDListW(pidlTestFile, wszTestFile2);
- ok (result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
- ok (!lstrcmpiW(wszTestFile, wszTestFile2), "SHGetPathFromIDListW returns incorrect path!\n");
- }
+ result = SHGetPathFromIDListW(pidlTestFile, wszTestFile2);
+ ok (result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
+ ok (!lstrcmpiW(wszTestFile, wszTestFile2), "SHGetPathFromIDListW returns incorrect path!\n");
/* SHBindToParent fails, if called with a NULL PIDL. */
- hr = pSHBindToParent(NULL, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
+ hr = SHBindToParent(NULL, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast);
ok (hr != S_OK, "SHBindToParent(NULL) should fail!\n");
/* But it succeeds with an empty PIDL. */
- hr = pSHBindToParent(pidlEmpty, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
+ hr = SHBindToParent(pidlEmpty, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast);
ok (hr == S_OK, "SHBindToParent(empty PIDL) should succeed! hr = %08x\n", hr);
ok (pidlLast == pidlEmpty, "The last element of an empty PIDL should be the PIDL itself!\n");
if (hr == S_OK)
IShellFolder_Release(psfPersonal);
-
+
/* Binding to the folder and querying the display name of the file also works. */
- hr = pSHBindToParent(pidlTestFile, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
+ hr = SHBindToParent(pidlTestFile, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast);
ok (hr == S_OK, "SHBindToParent failed! hr = %08x\n", hr);
if (hr != S_OK) {
IShellFolder_Release(psfDesktop);
@@ -895,9 +808,9 @@ static void test_GetDisplayName(void)
/* This test shows that Windows doesn't allocate a new pidlLast, but returns a pointer into
* pidlTestFile (In accordance with MSDN). */
- ok (pILFindLastID(pidlTestFile) == pidlLast,
+ ok (ILFindLastID(pidlTestFile) == pidlLast,
"SHBindToParent doesn't return the last id of the pidl param!\n");
-
+
hr = IShellFolder_GetDisplayNameOf(psfPersonal, pidlLast, SHGDN_FORPARSING, &strret);
ok (hr == S_OK, "Personal->GetDisplayNameOf failed! hr = %08x\n", hr);
if (hr != S_OK) {
@@ -906,13 +819,10 @@ static void test_GetDisplayName(void)
return;
}
- if (pStrRetToBufW)
- {
- hr = pStrRetToBufW(&strret, pidlLast, wszTestFile2, MAX_PATH);
- ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
- ok (!lstrcmpiW(wszTestFile, wszTestFile2), "GetDisplayNameOf returns incorrect path!\n");
- }
-
+ hr = StrRetToBufW(&strret, pidlLast, wszTestFile2, MAX_PATH);
+ ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
+ ok (!lstrcmpiW(wszTestFile, wszTestFile2), "GetDisplayNameOf returns incorrect path!\n");
+
ILFree(pidlTestFile);
IShellFolder_Release(psfDesktop);
IShellFolder_Release(psfPersonal);
@@ -1246,21 +1156,15 @@ static void test_SHGetPathFromIDList(void)
'w','i','n','e','t','e','s','t','.','f','o','o',0 };
LPITEMIDLIST pidlPrograms;
- if(!pSHGetPathFromIDListW || !pSHGetSpecialFolderPathW)
- {
- win_skip("SHGetPathFromIDListW() or SHGetSpecialFolderPathW() is missing\n");
- return;
- }
-
/* Calling SHGetPathFromIDListW with no pidl should return the empty string */
wszPath[0] = 'a';
wszPath[1] = '\0';
- result = pSHGetPathFromIDListW(NULL, wszPath);
+ result = SHGetPathFromIDListW(NULL, wszPath);
ok(!result, "Expected failure\n");
ok(!wszPath[0], "Expected empty string\n");
/* Calling SHGetPathFromIDListW with an empty pidl should return the desktop folder's path. */
- result = pSHGetSpecialFolderPathW(NULL, wszDesktop, CSIDL_DESKTOP, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, wszDesktop, CSIDL_DESKTOP, FALSE);
ok(result, "SHGetSpecialFolderPathW(CSIDL_DESKTOP) failed! Last error: %u\n", GetLastError());
if (!result) return;
@@ -1273,7 +1177,7 @@ static void test_SHGetPathFromIDList(void)
return;
}
- result = pSHGetPathFromIDListW(pidlEmpty, wszPath);
+ result = SHGetPathFromIDListW(pidlEmpty, wszPath);
ok(result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
if (!result) return;
ok(!lstrcmpiW(wszDesktop, wszPath), "SHGetPathFromIDListW didn't return desktop path for empty pidl!\n");
@@ -1293,7 +1197,7 @@ static void test_SHGetPathFromIDList(void)
SetLastError(0xdeadbeef);
wszPath[0] = 'a';
wszPath[1] = '\0';
- result = pSHGetPathFromIDListW(pidlMyComputer, wszPath);
+ result = SHGetPathFromIDListW(pidlMyComputer, wszPath);
ok (!result, "SHGetPathFromIDListW succeeded where it shouldn't!\n");
ok (GetLastError()==0xdeadbeef ||
GetLastError()==ERROR_SUCCESS, /* Vista and higher */
@@ -1306,7 +1210,7 @@ static void test_SHGetPathFromIDList(void)
IMalloc_Free(ppM, pidlMyComputer);
- result = pSHGetSpecialFolderPathW(NULL, wszFileName, CSIDL_DESKTOPDIRECTORY, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, wszFileName, CSIDL_DESKTOPDIRECTORY, FALSE);
ok(result, "SHGetSpecialFolderPathW failed! Last error: %u\n", GetLastError());
if (!result) {
IShellFolder_Release(psfDesktop);
@@ -1341,15 +1245,12 @@ static void test_SHGetPathFromIDList(void)
IMalloc_Free(ppM, pidlTestFile);
return;
}
- if (pStrRetToBufW)
- {
- pStrRetToBufW(&strret, pidlTestFile, wszPath, MAX_PATH);
- ok(0 == lstrcmpW(wszFileName, wszPath),
- "Desktop->GetDisplayNameOf(pidlTestFile, SHGDN_FORPARSING) "
- "returned incorrect path for file placed on desktop\n");
- }
+ StrRetToBufW(&strret, pidlTestFile, wszPath, MAX_PATH);
+ ok(0 == lstrcmpW(wszFileName, wszPath),
+ "Desktop->GetDisplayNameOf(pidlTestFile, SHGDN_FORPARSING) "
+ "returned incorrect path for file placed on desktop\n");
- result = pSHGetPathFromIDListW(pidlTestFile, wszPath);
+ result = SHGetPathFromIDListW(pidlTestFile, wszPath);
ok(result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
ok(0 == lstrcmpW(wszFileName, wszPath), "SHGetPathFromIDListW returned incorrect path for file placed on desktop\n");
@@ -1381,11 +1282,11 @@ static void test_SHGetPathFromIDList(void)
IMalloc_Free(ppM, pidlTestFile);
/* Test if we can get the path from the start menu "program files" PIDL. */
- hr = pSHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms);
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms);
ok(hr == S_OK, "SHGetFolderLocation failed: 0x%08x\n", hr);
SetLastError(0xdeadbeef);
- result = pSHGetPathFromIDListW(pidlPrograms, wszPath);
+ result = SHGetPathFromIDListW(pidlPrograms, wszPath);
IMalloc_Free(ppM, pidlPrograms);
ok(result, "SHGetPathFromIDListW failed\n");
}
@@ -1501,7 +1402,7 @@ static HRESULT WINAPI InitPropertyBag_IPropertyBag_Read(IPropertyBag *iface, LPC
"Wrong variant type for 'Target' property!\n");
if (V_VT(pVar) != VT_BSTR) return E_INVALIDARG;
- result = pSHGetSpecialFolderPathW(NULL, wszPath, CSIDL_DESKTOPDIRECTORY, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, wszPath, CSIDL_DESKTOPDIRECTORY, FALSE);
ok(result, "SHGetSpecialFolderPathW(DESKTOPDIRECTORY) failed! %u\n", GetLastError());
if (!result) return E_INVALIDARG;
@@ -1578,17 +1479,6 @@ static void test_FolderShortcut(void) {
static const GUID CLSID_UnixDosFolder =
{0x9d20aae8, 0x0625, 0x44b0, {0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9}};
- if (!pSHGetSpecialFolderPathW || !pStrRetToBufW) {
- win_skip("SHGetSpecialFolderPathW and/or StrRetToBufW are not available\n");
- return;
- }
-
- if (!pSHGetFolderPathAndSubDirA)
- {
- win_skip("FolderShortcut test doesn't work on Win2k\n");
- return;
- }
-
/* These tests basically show, that CLSID_FolderShortcuts are initialized
* via their IPersistPropertyBag interface. And that the target folder
* is taken from the IPropertyBag's 'Target' property.
@@ -1623,11 +1513,11 @@ static void test_FolderShortcut(void) {
return;
}
- result = pSHGetSpecialFolderPathW(NULL, wszDesktopPath, CSIDL_DESKTOPDIRECTORY, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, wszDesktopPath, CSIDL_DESKTOPDIRECTORY, FALSE);
ok(result, "SHGetSpecialFolderPathW(CSIDL_DESKTOPDIRECTORY) failed! %u\n", GetLastError());
if (!result) return;
- pStrRetToBufW(&strret, NULL, wszBuffer, MAX_PATH);
+ StrRetToBufW(&strret, NULL, wszBuffer, MAX_PATH);
ok(!lstrcmpiW(wszDesktopPath, wszBuffer), "FolderShortcut returned incorrect folder!\n");
hr = IShellFolder_QueryInterface(pShellFolder, &IID_IPersistFolder3, (LPVOID*)&pPersistFolder3);
@@ -1668,16 +1558,16 @@ static void test_FolderShortcut(void) {
ok (hr == S_OK, "IPersistFolder3::Initialize failed! hr = %08x\n", hr);
if (hr != S_OK) {
IPersistFolder3_Release(pPersistFolder3);
- pILFree(pidlWineTestFolder);
+ ILFree(pidlWineTestFolder);
return;
}
hr = IPersistFolder3_GetCurFolder(pPersistFolder3, &pidlCurrentFolder);
ok(hr == S_OK, "IPersistFolder3_GetCurFolder failed! hr=0x%08x\n", hr);
- ok(pILIsEqual(pidlCurrentFolder, pidlWineTestFolder),
+ ok(ILIsEqual(pidlCurrentFolder, pidlWineTestFolder),
"IPersistFolder3_GetCurFolder should return pidlWineTestFolder!\n");
- pILFree(pidlCurrentFolder);
- pILFree(pidlWineTestFolder);
+ ILFree(pidlCurrentFolder);
+ ILFree(pidlWineTestFolder);
hr = IPersistFolder3_QueryInterface(pPersistFolder3, &IID_IShellFolder, (LPVOID*)&pShellFolder);
IPersistFolder3_Release(pPersistFolder3);
@@ -1691,7 +1581,7 @@ static void test_FolderShortcut(void) {
return;
}
- pStrRetToBufW(&strret, NULL, wszBuffer, MAX_PATH);
+ StrRetToBufW(&strret, NULL, wszBuffer, MAX_PATH);
ok(!lstrcmpiW(wszDesktopPath, wszBuffer), "FolderShortcut returned incorrect folder!\n");
/* Next few lines are meant to show that children of FolderShortcuts are not FolderShortcuts,
@@ -1715,7 +1605,7 @@ static void test_FolderShortcut(void) {
hr = IShellFolder_BindToObject(pShellFolder, pidlSubFolder, NULL, &IID_IPersistFolder3,
(LPVOID*)&pPersistFolder3);
IShellFolder_Release(pShellFolder);
- pILFree(pidlSubFolder);
+ ILFree(pidlSubFolder);
ok (hr == S_OK, "IShellFolder::BindToObject failed! hr = %08x\n", hr);
if (hr != S_OK)
return;
@@ -1767,9 +1657,7 @@ static void test_ITEMIDLIST_format(void) {
{ 'l','o','n','g','e','r','_','t','h','a','n','.','8','_','3',0 } };
int i;
- if (!pSHGetSpecialFolderPathW) return;
-
- bResult = pSHGetSpecialFolderPathW(NULL, wszPersonal, CSIDL_PERSONAL, FALSE);
+ bResult = SHGetSpecialFolderPathW(NULL, wszPersonal, CSIDL_PERSONAL, FALSE);
ok(bResult, "SHGetSpecialFolderPathW failed! Last error: %u\n", GetLastError());
if (!bResult) return;
@@ -1796,7 +1684,7 @@ static void test_ITEMIDLIST_format(void) {
hr = IShellFolder_BindToObject(psfDesktop, pidlPersonal, NULL, &IID_IShellFolder,
(LPVOID*)&psfPersonal);
IShellFolder_Release(psfDesktop);
- pILFree(pidlPersonal);
+ ILFree(pidlPersonal);
ok(hr == S_OK, "psfDesktop->BindToObject failed! hr = %08x\n", hr);
if (hr != S_OK) return;
@@ -1907,7 +1795,7 @@ static void test_ITEMIDLIST_format(void) {
}
}
- pILFree(pidlFile);
+ ILFree(pidlFile);
}
IShellFolder_Release(psfPersonal);
@@ -1923,16 +1811,11 @@ static void test_SHGetFolderPathA(void)
HRESULT hr;
HKEY key;
- if (!pSHGetFolderPathA)
- {
- win_skip("SHGetFolderPathA not present\n");
- return;
- }
if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE;
- hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILES, 0, SHGFP_TYPE_CURRENT, path );
+ hr = SHGetFolderPathA( 0, CSIDL_PROGRAM_FILES, 0, SHGFP_TYPE_CURRENT, path );
ok( hr == S_OK, "SHGetFolderPathA failed %x\n", hr );
- hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILESX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
+ hr = SHGetFolderPathA( 0, CSIDL_PROGRAM_FILESX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
if (hr == E_FAIL)
{
win_skip( "Program Files (x86) not supported\n" );
@@ -1965,9 +1848,9 @@ static void test_SHGetFolderPathA(void)
RegCloseKey( key );
}
- hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMON, 0, SHGFP_TYPE_CURRENT, path );
+ hr = SHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMON, 0, SHGFP_TYPE_CURRENT, path );
ok( hr == S_OK, "SHGetFolderPathA failed %x\n", hr );
- hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMONX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
+ hr = SHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMONX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
if (hr == E_FAIL)
{
win_skip( "Common Files (x86) not supported\n" );
@@ -2012,17 +1895,7 @@ static void test_SHGetFolderPathAndSubDirA(void)
static char testpath[MAX_PATH];
static char toolongpath[MAX_PATH+1];
- if(!pSHGetFolderPathAndSubDirA)
- {
- win_skip("SHGetFolderPathAndSubDirA not present!\n");
- return;
- }
-
- if(!pSHGetFolderPathA) {
- win_skip("SHGetFolderPathA not present!\n");
- return;
- }
- if(FAILED(pSHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdata)))
+ if(FAILED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdata)))
{
win_skip("SHGetFolderPathA failed for CSIDL_LOCAL_APPDATA!\n");
return;
@@ -2043,11 +1916,11 @@ static void test_SHGetFolderPathAndSubDirA(void)
}
/* test invalid second parameter */
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | 0xff, NULL, SHGFP_TYPE_CURRENT, wine, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | 0xff, NULL, SHGFP_TYPE_CURRENT, wine, testpath);
ok(E_INVALIDARG == ret, "expected E_INVALIDARG, got %x\n", ret);
/* test fourth parameter */
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, 2, winetemp, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, 2, winetemp, testpath);
switch(ret) {
case S_OK: /* winvista */
ok(!strncmp(appdata, testpath, strlen(appdata)),
@@ -2063,40 +1936,40 @@ static void test_SHGetFolderPathAndSubDirA(void)
/* test fifth parameter */
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, NULL, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, NULL, testpath);
ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!lstrcmpA(appdata, testpath), "expected %s, got %s\n", appdata, testpath);
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, "", testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, "", testpath);
ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!lstrcmpA(appdata, testpath), "expected %s, got %s\n", appdata, testpath);
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, "\\", testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, "\\", testpath);
ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!lstrcmpA(appdata, testpath), "expected %s, got %s\n", appdata, testpath);
for(i=0; i< MAX_PATH; i++)
toolongpath[i] = '0' + i % 10;
toolongpath[MAX_PATH] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, toolongpath, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, toolongpath, testpath);
ok(HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) == ret,
"expected %x, got %x\n", HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), ret);
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, wine, NULL);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, wine, NULL);
ok((S_OK == ret) || (E_INVALIDARG == ret), "expected S_OK or E_INVALIDARG, got %x\n", ret);
/* test a not existing path */
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, winetemp, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, winetemp, testpath);
ok(HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) == ret,
"expected %x, got %x\n", HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), ret);
/* create a directory inside a not existing directory */
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_CREATE | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, winetemp, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_CREATE | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, winetemp, testpath);
ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!strncmp(appdata, testpath, strlen(appdata)),
"expected %s to start with %s\n", testpath, appdata);
@@ -2181,40 +2054,27 @@ static void test_LocalizedNames(void)
hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER, &strret);
ok(hr == S_OK, "GetDisplayNameOf failed %08x\n", hr);
- if (hr == S_OK && pStrRetToBufW)
- {
- hr = pStrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
- ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
- todo_wine
- ok (!lstrcmpiW(tempbufW, folderdisplayW) ||
- broken(!lstrcmpiW(tempbufW, foldernameW)), /* W2K */
- "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
- }
+ hr = StrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
+ ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
+ todo_wine
+ ok (!lstrcmpiW(tempbufW, folderdisplayW), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
/* editing name is also read from the resource */
hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER|SHGDN_FOREDITING, &strret);
ok(hr == S_OK, "GetDisplayNameOf failed %08x\n", hr);
- if (hr == S_OK && pStrRetToBufW)
- {
- hr = pStrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
- ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
- todo_wine
- ok (!lstrcmpiW(tempbufW, folderdisplayW) ||
- broken(!lstrcmpiW(tempbufW, foldernameW)), /* W2K */
- "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
- }
+ hr = StrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
+ ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
+ todo_wine
+ ok (!lstrcmpiW(tempbufW, folderdisplayW), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
/* parsing name is unchanged */
hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER|SHGDN_FORPARSING, &strret);
ok(hr == S_OK, "GetDisplayNameOf failed %08x\n", hr);
- if (hr == S_OK && pStrRetToBufW)
- {
- hr = pStrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
- ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
- ok (!lstrcmpiW(tempbufW, foldernameW), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
- }
+ hr = StrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
+ ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
+ ok (!lstrcmpiW(tempbufW, foldernameW), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
IShellFolder_Release(IDesktopFolder);
IShellFolder_Release(testIShellFolder);
@@ -2253,16 +2113,8 @@ static void test_SHCreateShellItem(void)
return;
}
- if(pSHGetSpecialFolderLocation)
- {
- ret = pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
- ok(ret == S_OK, "Got 0x%08x\n", ret);
- }
- else
- {
- win_skip("pSHGetSpecialFolderLocation missing.\n");
- pidl_desktop = NULL;
- }
+ ret = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
+ ok(ret == S_OK, "Got 0x%08x\n", ret);
MultiByteToWideChar(CP_ACP, 0, curdirA, -1, curdirW, MAX_PATH);
@@ -2280,7 +2132,7 @@ static void test_SHCreateShellItem(void)
ret = IShellFolder_ParseDisplayName(currentfolder, NULL, NULL, testfileW, NULL, &pidl_testfile, NULL);
ok(SUCCEEDED(ret), "ParseDisplayName returned %x\n", ret);
- pidl_abstestfile = pILCombine(pidl_cwd, pidl_testfile);
+ pidl_abstestfile = ILCombine(pidl_cwd, pidl_testfile);
shellitem = (void*)0xdeadbeef;
ret = pSHCreateShellItem(NULL, NULL, NULL, &shellitem);
@@ -2308,7 +2160,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_cwd, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2328,7 +2180,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_abstestfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2346,7 +2198,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_cwd, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2369,7 +2221,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_abstestfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2390,7 +2242,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_abstestfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2410,7 +2262,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_testfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2495,7 +2347,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_cwd, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2515,7 +2367,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_testfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2592,7 +2444,7 @@ static void test_SHCreateShellItem(void)
ret = IShellItem_Compare(shellitem, shellitem2, 0, &order);
ok(ret == S_OK, "IShellItem_Compare fail: 0x%08x.\n", ret);
ok(!order, "order got wrong value: %d.\n", order);
- pILFree(pidl_desktop_testfile);
+ ILFree(pidl_desktop_testfile);
IShellItem_Release(shellitem2);
IShellItem_Release(shellitem);
@@ -2683,7 +2535,7 @@ static void test_SHCreateShellItem(void)
ret = IShellItem_Compare(shellitem, shellitem2, 0, &order);
ok(ret == S_OK, "IShellItem_Compare failed: 0x%08x.\n", ret);
ok(!order, "order got wrong value: %d.\n", order);
- pILFree(pidl_desktop_testfile);
+ ILFree(pidl_desktop_testfile);
IShellItem_Release(shellitem2);
IShellItem_Release(shellitem);
@@ -2715,10 +2567,10 @@ static void test_SHCreateShellItem(void)
win_skip("No SHCreateItemInKnownFolder or SHGetKnownFolderPath\n");
DeleteFileA(".\\testfile");
- pILFree(pidl_abstestfile);
- pILFree(pidl_testfile);
- pILFree(pidl_desktop);
- pILFree(pidl_cwd);
+ ILFree(pidl_abstestfile);
+ ILFree(pidl_testfile);
+ ILFree(pidl_desktop);
+ ILFree(pidl_cwd);
IShellFolder_Release(currentfolder);
IShellFolder_Release(desktopfolder);
}
@@ -2742,11 +2594,8 @@ static void test_SHGetNameFromIDList(void)
return;
}
- /* These should be available on any platform that passed the above test. */
+ /* This should be available on any platform that passed the above test. */
ok(pSHCreateShellItem != NULL, "SHCreateShellItem missing.\n");
- ok(pSHBindToParent != NULL, "SHBindToParent missing.\n");
- ok(pSHGetSpecialFolderLocation != NULL, "SHGetSpecialFolderLocation missing.\n");
- ok(pStrRetToBufW != NULL, "StrRetToBufW missing.\n");
if(0)
{
@@ -2758,7 +2607,7 @@ static void test_SHGetNameFromIDList(void)
ok(hres == E_INVALIDARG, "Got 0x%08x\n", hres);
/* Test the desktop */
- hres = pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
+ hres = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
ok(hres == S_OK, "Got 0x%08x\n", hres);
hres = pSHCreateShellItem(NULL, NULL, pidl, &shellitem);
ok(hres == S_OK, "Got 0x%08x\n", hres);
@@ -2786,7 +2635,7 @@ static void test_SHGetNameFromIDList(void)
if(SUCCEEDED(hrSF))
{
- pStrRetToBufW(&strret, NULL, buf, MAX_PATH);
+ StrRetToBufW(&strret, NULL, buf, MAX_PATH);
if(SUCCEEDED(hrSI))
ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
if(SUCCEEDED(hrSF))
@@ -2797,16 +2646,13 @@ static void test_SHGetNameFromIDList(void)
}
IShellFolder_Release(psf);
- if(pSHGetPathFromIDListW){
- hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
- ok(hrSI == S_OK, "Got 0x%08x\n", hrSI);
- res = pSHGetPathFromIDListW(pidl, buf);
- ok(res == TRUE, "Got %d\n", res);
- if(SUCCEEDED(hrSI) && res)
- ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
- if(SUCCEEDED(hrSI)) CoTaskMemFree(nameSI);
- }else
- win_skip("pSHGetPathFromIDListW not available\n");
+ hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
+ ok(hrSI == S_OK, "Got 0x%08x\n", hrSI);
+ res = SHGetPathFromIDListW(pidl, buf);
+ ok(res == TRUE, "Got %d\n", res);
+ if(SUCCEEDED(hrSI) && res)
+ ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
+ if(SUCCEEDED(hrSI)) CoTaskMemFree(nameSI);
hres = pSHGetNameFromIDList(pidl, SIGDN_URL, &name_string);
todo_wine ok(hres == S_OK, "Got 0x%08x\n", hres);
@@ -2814,10 +2660,10 @@ static void test_SHGetNameFromIDList(void)
IShellItem_Release(shellitem);
}
- pILFree(pidl);
+ ILFree(pidl);
/* Test the control panel */
- hres = pSHGetSpecialFolderLocation(NULL, CSIDL_CONTROLS, &pidl);
+ hres = SHGetSpecialFolderLocation(NULL, CSIDL_CONTROLS, &pidl);
ok(hres == S_OK, "Got 0x%08x\n", hres);
hres = pSHCreateShellItem(NULL, NULL, pidl, &shellitem);
ok(hres == S_OK, "Got 0x%08x\n", hres);
@@ -2845,7 +2691,7 @@ static void test_SHGetNameFromIDList(void)
if(SUCCEEDED(hrSF))
{
- pStrRetToBufW(&strret, NULL, buf, MAX_PATH);
+ StrRetToBufW(&strret, NULL, buf, MAX_PATH);
if(SUCCEEDED(hrSI))
ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
if(SUCCEEDED(hrSF))
@@ -2856,16 +2702,13 @@ static void test_SHGetNameFromIDList(void)
}
IShellFolder_Release(psf);
- if(pSHGetPathFromIDListW){
- hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
- ok(hrSI == E_INVALIDARG, "Got 0x%08x\n", hrSI);
- res = pSHGetPathFromIDListW(pidl, buf);
- ok(res == FALSE, "Got %d\n", res);
- if(SUCCEEDED(hrSI) && res)
- ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
- if(SUCCEEDED(hrSI)) CoTaskMemFree(nameSI);
- }else
- win_skip("pSHGetPathFromIDListW not available\n");
+ hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
+ ok(hrSI == E_INVALIDARG, "Got 0x%08x\n", hrSI);
+ res = SHGetPathFromIDListW(pidl, buf);
+ ok(res == FALSE, "Got %d\n", res);
+ if(SUCCEEDED(hrSI) && res)
+ ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
+ if(SUCCEEDED(hrSI)) CoTaskMemFree(nameSI);
hres = pSHGetNameFromIDList(pidl, SIGDN_URL, &name_string);
todo_wine ok(hres == E_NOTIMPL /* Win7 */ || hres == S_OK /* Vista */,
@@ -2874,7 +2717,7 @@ static void test_SHGetNameFromIDList(void)
IShellItem_Release(shellitem);
}
- pILFree(pidl);
+ ILFree(pidl);
}
static void test_SHGetItemFromDataObject(void)
@@ -2979,7 +2822,7 @@ static void test_SHGetItemFromDataObject(void)
skip("zero or one file found - skipping multi-file test.\n");
for(i = 0; i < count; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
IEnumIDList_Release(peidl);
}
@@ -3054,7 +2897,7 @@ static void test_ShellItemCompare(void)
{
hr = pSHCreateShellItem(NULL, NULL, pidl_testfile, &psi[i]);
ok(hr == S_OK, "Got 0x%08x\n", hr);
- pILFree(pidl_testfile);
+ ILFree(pidl_testfile);
}
if(FAILED(hr)) failed = TRUE;
}
@@ -3289,8 +3132,6 @@ static void test_SHGetIDListFromObject(void)
return;
}
- ok(pSHGetSpecialFolderLocation != NULL, "SHGetSpecialFolderLocation missing.\n");
-
if(0)
{
/* Crashes native */
@@ -3321,7 +3162,7 @@ static void test_SHGetIDListFromObject(void)
HeapFree(GetProcessHeap(), 0, punkimpl);
pidl_desktop = NULL;
- pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
+ SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
ok(pidl_desktop != NULL, "Failed to get desktop pidl.\n");
SHGetDesktopFolder(&psfdesktop);
@@ -3339,7 +3180,7 @@ static void test_SHGetIDListFromObject(void)
if(SUCCEEDED(hres))
{
ok(ILIsEqual(pidl_desktop, pidl), "pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
}
IShellItem_Release(shellitem);
}
@@ -3353,7 +3194,7 @@ static void test_SHGetIDListFromObject(void)
if(SUCCEEDED(hres))
{
ok(ILIsEqual(pidl_desktop, pidl), "pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
}
hres = IShellFolder_CreateViewObject(psfdesktop, NULL, &IID_IShellView, (void**)&psv);
@@ -3370,7 +3211,7 @@ static void test_SHGetIDListFromObject(void)
if(SUCCEEDED(hres))
{
ok(ILIsEqual(pidl_desktop, pidl), "pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
}
/* Test IDataObject */
@@ -3397,7 +3238,7 @@ static void test_SHGetIDListFromObject(void)
ok(hres == S_OK, "got 0x%08x\n", hres);
ok(pidl != NULL, "pidl is NULL.\n");
ok(ILIsEqual(pidl, apidl[0]), "pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
IDataObject_Release(pdo);
}
@@ -3425,7 +3266,7 @@ static void test_SHGetIDListFromObject(void)
skip("zero or one file found - skipping multi-file test.\n");
for(i = 0; i < count; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
IEnumIDList_Release(peidl);
}
@@ -3434,7 +3275,7 @@ static void test_SHGetIDListFromObject(void)
}
IShellFolder_Release(psfdesktop);
- pILFree(pidl_desktop);
+ ILFree(pidl_desktop);
}
static void test_SHGetItemFromObject(void)
@@ -3527,8 +3368,6 @@ static void test_SHCreateShellItemArray(void)
return;
}
- ok(pSHGetSpecialFolderLocation != NULL, "SHGetSpecialFolderLocation missing.\n");
-
if(0)
{
/* Crashes under native */
@@ -3548,10 +3387,10 @@ static void test_SHCreateShellItemArray(void)
hr = pSHCreateShellItemArray(NULL, pdesktopsf, 1, NULL, &psia);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
- pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
+ SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
hr = pSHCreateShellItemArray(pidl, NULL, 0, NULL, &psia);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
- pILFree(pidl);
+ ILFree(pidl);
GetCurrentDirectoryW(MAX_PATH, cTestDirW);
myPathAddBackslashW(cTestDirW);
@@ -3572,7 +3411,7 @@ static void test_SHCreateShellItemArray(void)
if(FAILED(hr))
{
skip("Failed to set up environment for SHCreateShellItemArray tests.\n");
- pILFree(pidl_testdir);
+ ILFree(pidl_testdir);
Cleanup();
return;
}
@@ -3624,14 +3463,14 @@ static void test_SHCreateShellItemArray(void)
if(SUCCEEDED(hr))
{
ok(ILIsEqual(pidl_abs, pidl), "Pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
}
IShellItem_Release(psi);
}
- pILFree(pidl_abs);
+ ILFree(pidl_abs);
}
for(i = 0; i < done; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
IShellItemArray_Release(psia);
}
}
@@ -3676,8 +3515,8 @@ static void test_SHCreateShellItemArray(void)
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(pidl2 != NULL, "pidl2 was null.\n");
ok(ILIsEqual(pidl1, pidl2), "pidls not equal.\n");
- pILFree(pidl1);
- pILFree(pidl2);
+ ILFree(pidl1);
+ ILFree(pidl2);
IShellItem_Release(psi2);
}
hr = IShellItemArray_GetItemAt(psia, 1, &psi2);
@@ -3752,10 +3591,10 @@ static void test_SHCreateShellItemArray(void)
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(pidl != NULL, "pidl as NULL.\n");
ok(ILIsEqual(pidl, pidl_abs), "pidls differ.\n");
- pILFree(pidl);
+ ILFree(pidl);
IShellItem_Release(psi);
}
- pILFree(pidl_abs);
+ ILFree(pidl_abs);
}
IShellItemArray_Release(psia);
@@ -3764,7 +3603,7 @@ static void test_SHCreateShellItemArray(void)
IDataObject_Release(pdo);
}
for(i = 0; i < count; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
}
else
skip("No files found - skipping test.\n");
@@ -3843,7 +3682,7 @@ static void test_SHCreateShellItemArray(void)
WCHAR desktoppath[MAX_PATH];
BOOL result;
- result = pSHGetSpecialFolderPathW(NULL, desktoppath, CSIDL_DESKTOPDIRECTORY, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, desktoppath, CSIDL_DESKTOPDIRECTORY, FALSE);
ok(result, "SHGetSpecialFolderPathW(CSIDL_DESKTOPDIRECTORY) failed! %u\n", GetLastError());
hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &path);
@@ -3948,7 +3787,7 @@ static void test_SHCreateShellItemArray(void)
IShellItemArray_Release(psia);
}
- pILFree(pidltest1);
+ ILFree(pidltest1);
}
IShellFolder_Release(pdesktopsf);
@@ -3957,7 +3796,7 @@ static void test_SHCreateShellItemArray(void)
skip("No SHCreateShellItemArrayFromIDLists.\n");
IShellFolder_Release(psf);
- pILFree(pidl_testdir);
+ ILFree(pidl_testdir);
Cleanup();
}
@@ -3991,7 +3830,7 @@ static void test_ShellItemArrayEnumItems(void)
hr = IShellFolder_BindToObject(pdesktopsf, pidl_testdir, NULL, (REFIID)&IID_IShellFolder,
(void**)&psf);
ok(hr == S_OK, "Got 0x%08x\n", hr);
- pILFree(pidl_testdir);
+ ILFree(pidl_testdir);
}
IShellFolder_Release(pdesktopsf);
if (FAILED(hr)) return;
@@ -4110,7 +3949,7 @@ static void test_ShellItemArrayEnumItems(void)
}
for(i = 0; i < done; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
}
}
@@ -4127,7 +3966,7 @@ static void test_ShellItemBindToHandler(void)
return;
}
- hr = pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
@@ -4162,7 +4001,7 @@ static void test_ShellItemBindToHandler(void)
if(SUCCEEDED(hr))
{
ok(ILIsEqual(pidl_desktop, pidl_tmp), "Pidl not equal (%p, %p)\n", pidl_desktop, pidl_tmp);
- pILFree(pidl_tmp);
+ ILFree(pidl_tmp);
}
IPersistFolder2_Release(ppf2);
}
@@ -4276,7 +4115,7 @@ static void test_ShellItemBindToHandler(void)
else
skip("Failed to create ShellItem.\n");
- pILFree(pidl_desktop);
+ ILFree(pidl_desktop);
}
static void test_ShellItemGetAttributes(void)
@@ -4297,13 +4136,13 @@ static void test_ShellItemGetAttributes(void)
return;
}
- hr = pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
hr = pSHCreateShellItem(NULL, NULL, pidl_desktop, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
- pILFree(pidl_desktop);
+ ILFree(pidl_desktop);
}
if(FAILED(hr))
{
@@ -4338,7 +4177,7 @@ static void test_ShellItemGetAttributes(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pSHCreateShellItem(NULL, NULL, pidl, &psi_folder1);
ok(hr == S_OK, "Got 0x%08x\n", sfgao);
- pILFree(pidl);
+ ILFree(pidl);
lstrcpyW(buf, curdirW);
lstrcatW(buf, testfile1W);
@@ -4346,7 +4185,7 @@ static void test_ShellItemGetAttributes(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pSHCreateShellItem(NULL, NULL, pidl, &psi_file1);
ok(hr == S_OK, "Got 0x%08x\n", sfgao);
- pILFree(pidl);
+ ILFree(pidl);
IShellFolder_Release(pdesktopsf);
@@ -4421,7 +4260,7 @@ static void test_ShellItemArrayGetAttributes(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
for(i = 0; i < 5; i++)
- pILFree((LPITEMIDLIST)pidl_array[i]);
+ ILFree((LPITEMIDLIST)pidl_array[i]);
/* [testfolder/, testfolder/testfolder2] seems to break in Vista */
attr = 0xdeadbeef;
@@ -4477,71 +4316,65 @@ static void test_SHParseDisplayName(void)
HRESULT hr;
BOOL ret, is_wow64;
- if (!pSHParseDisplayName)
- {
- win_skip("SHParseDisplayName isn't available\n");
- return;
- }
-
if (0)
{
/* crashes on native */
- pSHParseDisplayName(NULL, NULL, NULL, 0, NULL);
+ SHParseDisplayName(NULL, NULL, NULL, 0, NULL);
nameW[0] = 0;
- pSHParseDisplayName(nameW, NULL, NULL, 0, NULL);
+ SHParseDisplayName(nameW, NULL, NULL, 0, NULL);
}
pidl1 = (LPITEMIDLIST)0xdeadbeef;
- hr = pSHParseDisplayName(NULL, NULL, &pidl1, 0, NULL);
+ hr = SHParseDisplayName(NULL, NULL, &pidl1, 0, NULL);
ok(broken(hr == E_OUTOFMEMORY) /* < Vista */ ||
hr == E_INVALIDARG, "failed %08x\n", hr);
ok(pidl1 == 0, "expected null ptr, got %p\n", pidl1);
/* dummy name */
nameW[0] = 0;
- hr = pSHParseDisplayName(nameW, NULL, &pidl1, 0, NULL);
+ hr = SHParseDisplayName(nameW, NULL, &pidl1, 0, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "failed %08x\n", hr);
hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, nameW, NULL, &pidl2, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
- ret = pILIsEqual(pidl1, pidl2);
+ ret = ILIsEqual(pidl1, pidl2);
ok(ret == TRUE, "expected equal idls\n");
- pILFree(pidl1);
- pILFree(pidl2);
+ ILFree(pidl1);
+ ILFree(pidl2);
/* with path */
GetWindowsDirectoryW( dirW, MAX_PATH );
- hr = pSHParseDisplayName(dirW, NULL, &pidl1, 0, NULL);
+ hr = SHParseDisplayName(dirW, NULL, &pidl1, 0, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, dirW, NULL, &pidl2, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
- ret = pILIsEqual(pidl1, pidl2);
+ ret = ILIsEqual(pidl1, pidl2);
ok(ret == TRUE, "expected equal idls\n");
- pILFree(pidl1);
- pILFree(pidl2);
+ ILFree(pidl1);
+ ILFree(pidl2);
/* system32 is not redirected to syswow64 on WOW64 */
if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE;
- if (is_wow64 && pGetSystemWow64DirectoryW)
+ if (is_wow64)
{
UINT len;
*dirW = 0;
len = GetSystemDirectoryW(dirW, MAX_PATH);
ok(len > 0, "GetSystemDirectoryW failed: %u\n", GetLastError());
- hr = pSHParseDisplayName(dirW, NULL, &pidl1, 0, NULL);
+ hr = SHParseDisplayName(dirW, NULL, &pidl1, 0, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
*dirW = 0;
- len = pGetSystemWow64DirectoryW(dirW, MAX_PATH);
+ len = GetSystemWow64DirectoryW(dirW, MAX_PATH);
ok(len > 0, "GetSystemWow64DirectoryW failed: %u\n", GetLastError());
- hr = pSHParseDisplayName(dirW, NULL, &pidl2, 0, NULL);
+ hr = SHParseDisplayName(dirW, NULL, &pidl2, 0, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
- ret = pILIsEqual(pidl1, pidl2);
+ ret = ILIsEqual(pidl1, pidl2);
ok(ret == FALSE, "expected different idls\n");
- pILFree(pidl1);
- pILFree(pidl2);
+ ILFree(pidl1);
+ ILFree(pidl2);
}
IShellFolder_Release(desktop);
@@ -4595,7 +4428,7 @@ static void test_desktop_IPersist(void)
hr = IPersistFolder2_GetCurFolder(ppf2, &pidl);
ok(hr == S_OK, "got %08x\n", hr);
ok(pidl != NULL, "pidl was NULL.\n");
- if(SUCCEEDED(hr)) pILFree(pidl);
+ if(SUCCEEDED(hr)) ILFree(pidl);
IPersistFolder2_Release(ppf2);
}
@@ -4613,12 +4446,6 @@ static void test_GetUIObject(void)
const WCHAR filename[] =
{'\\','t','e','s','t','d','i','r','\\','t','e','s','t','1','.','t','x','t',0};
- if(!pSHBindToParent)
- {
- win_skip("SHBindToParent missing.\n");
- return;
- }
-
GetCurrentDirectoryW(MAX_PATH, path);
if (!path[0])
{
@@ -4636,7 +4463,7 @@ static void test_GetUIObject(void)
{
IShellFolder *psf;
LPCITEMIDLIST pidl_child;
- hr = pSHBindToParent(pidl, &IID_IShellFolder, (void**)&psf, &pidl_child);
+ hr = SHBindToParent(pidl, &IID_IShellFolder, (void**)&psf, &pidl_child);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
@@ -4692,9 +4519,7 @@ static void test_GetUIObject(void)
(max_id_check == max_id-2), /* Win 8 */
"Not equal (or near equal), got %d and %d\n", max_id_check, max_id);
-#define is_win2k() (pSHGetFolderPathA && !pSHGetFolderPathAndSubDirA)
-
- if(count && !is_win2k()) /* Test is interactive on w2k, so skip */
+ if(count)
{
CMINVOKECOMMANDINFO cmi;
ZeroMemory(&cmi, sizeof(CMINVOKECOMMANDINFO));
@@ -4711,14 +4536,13 @@ static void test_GetUIObject(void)
(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Vista */),
"Got 0x%08x\n", hr);
}
-#undef is_win2k
DestroyMenu(hmenu);
IContextMenu_Release(pcm);
}
IShellFolder_Release(psf);
}
- if(pILFree) pILFree(pidl);
+ ILFree(pidl);
}
IShellFolder_Release(psf_desktop);
@@ -4733,22 +4557,13 @@ static void r_verify_pidl(unsigned l, LPCITEMIDLIST pidl, const WCHAR *path)
STRRET filename;
HRESULT hr;
- if(!pSHBindToParent){
- win_skip("SHBindToParent is not available, not performing full PIDL verification\n");
- if(path)
- ok_(__FILE__,l)(pidl != NULL, "Expected PIDL to be non-NULL\n");
- else
- ok_(__FILE__,l)(pidl == NULL, "Expected PIDL to be NULL\n");
- return;
- }
-
if(path){
if(!pidl){
ok_(__FILE__,l)(0, "didn't get expected path (%s), instead: NULL\n", wine_dbgstr_w(path));
return;
}
- hr = pSHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&parent, &child);
+ hr = SHBindToParent(pidl, &IID_IShellFolder, (void **)&parent, &child);
ok_(__FILE__,l)(hr == S_OK, "SHBindToParent failed: 0x%08x\n", hr);
if(FAILED(hr))
return;
@@ -4786,30 +4601,25 @@ static void test_SHSimpleIDListFromPath(void)
LPITEMIDLIST pidl = NULL;
- if(!pSHSimpleIDListFromPathAW){
- win_skip("SHSimpleIDListFromPathAW not available\n");
- return;
- }
-
br = CreateDirectoryA(adirA, NULL);
ok(br == TRUE, "CreateDirectory failed: %d\n", GetLastError());
if(is_unicode)
- pidl = pSHSimpleIDListFromPathAW(adirW);
+ pidl = SHSimpleIDListFromPath(adirW);
else
- pidl = pSHSimpleIDListFromPathAW(adirA);
+ pidl = SHSimpleIDListFromPath((const WCHAR *)adirA);
verify_pidl(pidl, adirW);
- pILFree(pidl);
+ ILFree(pidl);
br = RemoveDirectoryA(adirA);
ok(br == TRUE, "RemoveDirectory failed: %d\n", GetLastError());
if(is_unicode)
- pidl = pSHSimpleIDListFromPathAW(adirW);
+ pidl = SHSimpleIDListFromPath(adirW);
else
- pidl = pSHSimpleIDListFromPathAW(adirA);
+ pidl = SHSimpleIDListFromPath((const WCHAR *)adirA);
verify_pidl(pidl, adirW);
- pILFree(pidl);
+ ILFree(pidl);
}
/* IFileSystemBindData impl */
@@ -5207,9 +5017,9 @@ static void test_SHChangeNotify(BOOL test_new_delivery)
entries[0].pidl = NULL;
if(has_unicode)
- hr = pSHILCreateFromPath(root_dirW, (LPITEMIDLIST*)&entries[0].pidl, 0);
+ hr = SHILCreateFromPath(root_dirW, (LPITEMIDLIST*)&entries[0].pidl, 0);
else
- hr = pSHILCreateFromPath((LPCVOID)root_dirA, (LPITEMIDLIST*)&entries[0].pidl, 0);
+ hr = SHILCreateFromPath((const void *)root_dirA, (LPITEMIDLIST*)&entries[0].pidl, 0);
ok(hr == S_OK, "SHILCreateFromPath failed: 0x%08x\n", hr);
entries[0].fRecursive = TRUE;
@@ -5271,12 +5081,6 @@ static void test_SHCreateDefaultContextMenu(void)
return;
}
- if(!pSHBindToParent)
- {
- skip("SHBindToParent missing.\n");
- return;
- }
-
GetCurrentDirectoryW(MAX_PATH, path);
if (!path[0])
{
@@ -5293,7 +5097,7 @@ static void test_SHCreateDefaultContextMenu(void)
if(SUCCEEDED(hr))
{
- hr = pSHBindToParent(pidl, &IID_IShellFolder, (void**)&folder, (LPCITEMIDLIST*)&pidl_child);
+ hr = SHBindToParent(pidl, &IID_IShellFolder, (void **)&folder, (const ITEMIDLIST **)&pidl_child);
ok(hr == S_OK, "Got 0x%08x\n", hr);
IShellFolder_QueryInterface(folder,&IID_IPersistFolder2,(void**)&persist);
@@ -5366,7 +5170,7 @@ static void test_DataObject(void)
hres = IShellFolder_GetUIObjectOf(desktop, NULL, 1, (LPCITEMIDLIST*)&apidl,
&IID_IDataObject, NULL, (void**)&data_obj);
ok(hres == S_OK, "got %x\n", hres);
- pILFree(apidl);
+ ILFree(apidl);
IShellFolder_Release(desktop);
cf_shellidlist = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW);
--
2.15.1
1
1
[PATCH] shell32/tests: Drop shell folder test workarounds for Windows <= 2000
by Alex Henrie 12 Jan '18
by Alex Henrie 12 Jan '18
12 Jan '18
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
Coverity has been complaining about them. The most straightforward
solution is to remove them all.
dlls/shell32/tests/shlfolder.c | 905 ++++++++++++++---------------------------
1 file changed, 312 insertions(+), 593 deletions(-)
diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index 1ee02743f5..46ce514260 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -45,17 +45,6 @@ DEFINE_GUID(CLSID_ShellDocObjView, 0xe7e4bc40, 0xe76a, 0x11ce, 0xa9,0xbb, 0x00,0
static IMalloc *ppM;
-static HRESULT (WINAPI *pSHBindToParent)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*);
-static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
-static HRESULT (WINAPI *pSHGetFolderPathAndSubDirA)(HWND, int, HANDLE, DWORD, LPCSTR, LPSTR);
-static BOOL (WINAPI *pSHGetPathFromIDListW)(LPCITEMIDLIST,LPWSTR);
-static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *);
-static BOOL (WINAPI *pSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL);
-static BOOL (WINAPI *pSHGetSpecialFolderPathW)(HWND, LPWSTR, int, BOOL);
-static HRESULT (WINAPI *pStrRetToBufW)(STRRET*,LPCITEMIDLIST,LPWSTR,UINT);
-static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST);
-static void (WINAPI *pILFree)(LPITEMIDLIST);
-static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
static HRESULT (WINAPI *pSHCreateItemFromIDList)(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv);
static HRESULT (WINAPI *pSHCreateItemFromParsingName)(PCWSTR,IBindCtx*,REFIID,void**);
static HRESULT (WINAPI *pSHCreateItemFromRelativeName)(IShellItem*,PCWSTR,IBindCtx*,REFIID,void**);
@@ -65,18 +54,13 @@ static HRESULT (WINAPI *pSHCreateShellItemArray)(LPCITEMIDLIST,IShellFolder*,UIN
static HRESULT (WINAPI *pSHCreateShellItemArrayFromIDLists)(UINT, PCIDLIST_ABSOLUTE*, IShellItemArray**);
static HRESULT (WINAPI *pSHCreateShellItemArrayFromDataObject)(IDataObject*, REFIID, void **);
static HRESULT (WINAPI *pSHCreateShellItemArrayFromShellItem)(IShellItem*, REFIID, void **);
-static LPITEMIDLIST (WINAPI *pILCombine)(LPCITEMIDLIST,LPCITEMIDLIST);
-static HRESULT (WINAPI *pSHParseDisplayName)(LPCWSTR,IBindCtx*,LPITEMIDLIST*,SFGAOF,SFGAOF*);
-static LPITEMIDLIST (WINAPI *pSHSimpleIDListFromPathAW)(LPCVOID);
static HRESULT (WINAPI *pSHGetKnownFolderPath)(REFKNOWNFOLDERID,DWORD,HANDLE,PWSTR*);
static HRESULT (WINAPI *pSHGetNameFromIDList)(PCIDLIST_ABSOLUTE,SIGDN,PWSTR*);
static HRESULT (WINAPI *pSHGetItemFromDataObject)(IDataObject*,DATAOBJ_GET_ITEM_FLAGS,REFIID,void**);
static HRESULT (WINAPI *pSHGetIDListFromObject)(IUnknown*, PIDLIST_ABSOLUTE*);
static HRESULT (WINAPI *pSHGetItemFromObject)(IUnknown*,REFIID,void**);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-static UINT (WINAPI *pGetSystemWow64DirectoryW)(LPWSTR, UINT);
static HRESULT (WINAPI *pSHCreateDefaultContextMenu)(const DEFCONTEXTMENU*,REFIID,void**);
-static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*);
static BOOL (WINAPI *pSHGetPathFromIDListEx)(PCIDLIST_ABSOLUTE,WCHAR*,DWORD,GPFIDL_FLAGS);
static WCHAR *make_wstr(const char *str)
@@ -115,7 +99,6 @@ static void init_function_pointers(void)
hmod = GetModuleHandleA("shell32.dll");
#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f))
- MAKEFUNC(SHBindToParent);
MAKEFUNC(SHCreateItemFromIDList);
MAKEFUNC(SHCreateItemFromParsingName);
MAKEFUNC(SHCreateItemFromRelativeName);
@@ -125,13 +108,6 @@ static void init_function_pointers(void)
MAKEFUNC(SHCreateShellItemArrayFromIDLists);
MAKEFUNC(SHCreateShellItemArrayFromDataObject);
MAKEFUNC(SHCreateShellItemArrayFromShellItem);
- MAKEFUNC(SHGetFolderPathA);
- MAKEFUNC(SHGetFolderPathAndSubDirA);
- MAKEFUNC(SHGetPathFromIDListW);
- MAKEFUNC(SHGetSpecialFolderPathA);
- MAKEFUNC(SHGetSpecialFolderPathW);
- MAKEFUNC(SHGetSpecialFolderLocation);
- MAKEFUNC(SHParseDisplayName);
MAKEFUNC(SHGetKnownFolderPath);
MAKEFUNC(SHGetNameFromIDList);
MAKEFUNC(SHGetItemFromDataObject);
@@ -141,15 +117,6 @@ static void init_function_pointers(void)
MAKEFUNC(SHGetPathFromIDListEx);
#undef MAKEFUNC
-#define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))
- MAKEFUNC_ORD(ILFindLastID, 16);
- MAKEFUNC_ORD(ILIsEqual, 21);
- MAKEFUNC_ORD(ILCombine, 25);
- MAKEFUNC_ORD(SHILCreateFromPath, 28);
- MAKEFUNC_ORD(ILFree, 155);
- MAKEFUNC_ORD(SHSimpleIDListFromPathAW, 162);
-#undef MAKEFUNC_ORD
-
/* test named exports */
ptr = GetProcAddress(hmod, "ILFree");
ok(broken(ptr == 0) || ptr != 0, "expected named export for ILFree\n");
@@ -177,12 +144,8 @@ static void init_function_pointers(void)
#undef TESTNAMED
}
- hmod = GetModuleHandleA("shlwapi.dll");
- pStrRetToBufW = (void*)GetProcAddress(hmod, "StrRetToBufW");
-
hmod = GetModuleHandleA("kernel32.dll");
pIsWow64Process = (void*)GetProcAddress(hmod, "IsWow64Process");
- pGetSystemWow64DirectoryW = (void*)GetProcAddress(hmod, "GetSystemWow64DirectoryW");
hr = SHGetMalloc(&ppM);
ok(hr == S_OK, "SHGetMalloc failed %08x\n", hr);
@@ -225,12 +188,11 @@ static void test_ParseDisplayName(void)
ok(hr == S_OK, "Expected SHGetDesktopFolder to return S_OK, got 0x%08x\n", hr);
if(hr != S_OK) return;
- /* Tests crash on W2K and below (SHCreateShellItem available as of XP) */
if (pSHCreateShellItem)
{
if (0)
{
- /* null name and pidl, also crashes on Windows 8 */
+ /* null name and pidl, crashes on Windows 8 */
hr = IShellFolder_ParseDisplayName(IDesktopFolder, NULL, NULL,
NULL, NULL, NULL, 0);
ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
@@ -244,29 +206,26 @@ static void test_ParseDisplayName(void)
ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr);
}
else
- win_skip("Tests would crash on W2K and below\n");
+ win_skip("SHCreateShellItem requires XP SP1 or later\n");
MultiByteToWideChar(CP_ACP, 0, cInetTestA, -1, cTestDirW, MAX_PATH);
- hr = IShellFolder_ParseDisplayName(IDesktopFolder,
- NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
- todo_wine ok(hr == S_OK || broken(hr == E_FAIL) /* NT4 */,
- "ParseDisplayName returned %08x, expected SUCCESS or E_FAIL\n", hr);
+ hr = IShellFolder_ParseDisplayName(IDesktopFolder, NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
+ todo_wine ok(hr == S_OK, "ParseDisplayName returned %08x, expected SUCCESS\n", hr);
if (hr == S_OK)
{
- ok(pILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
- "PT_IESPECIAL1, but is: %02x\n", pILFindLastID(newPIDL)->mkid.abID[0]);
+ ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
+ "PT_IESPECIAL1, but is: %02x\n", ILFindLastID(newPIDL)->mkid.abID[0]);
IMalloc_Free(ppM, newPIDL);
}
MultiByteToWideChar(CP_ACP, 0, cInetTest2A, -1, cTestDirW, MAX_PATH);
hr = IShellFolder_ParseDisplayName(IDesktopFolder,
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
- todo_wine ok(hr == S_OK || broken(hr == E_FAIL) /* NT4 */,
- "ParseDisplayName returned %08x, expected SUCCESS or E_FAIL\n", hr);
+ todo_wine ok(hr == S_OK, "ParseDisplayName returned %08x, expected SUCCESS\n", hr);
if (hr == S_OK)
{
- ok(pILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
- "PT_IESPECIAL1, but is: %02x\n", pILFindLastID(newPIDL)->mkid.abID[0]);
+ ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
+ "PT_IESPECIAL1, but is: %02x\n", ILFindLastID(newPIDL)->mkid.abID[0]);
IMalloc_Free(ppM, newPIDL);
}
@@ -278,10 +237,10 @@ static void test_ParseDisplayName(void)
}
MultiByteToWideChar(CP_ACP, 0, cNonExistDir1A, -1, cTestDirW, MAX_PATH);
- hr = IShellFolder_ParseDisplayName(IDesktopFolder,
+ hr = IShellFolder_ParseDisplayName(IDesktopFolder,
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
- ok((hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) || (hr == E_FAIL),
- "ParseDisplayName returned %08x, expected 80070002 or E_FAIL\n", hr);
+ ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
+ "ParseDisplayName returned %08x, expected 0x80070002\n", hr);
res = GetFileAttributesA(cNonExistDir2A);
if(res != INVALID_FILE_ATTRIBUTES)
@@ -291,21 +250,15 @@ static void test_ParseDisplayName(void)
}
MultiByteToWideChar(CP_ACP, 0, cNonExistDir2A, -1, cTestDirW, MAX_PATH);
- hr = IShellFolder_ParseDisplayName(IDesktopFolder,
+ hr = IShellFolder_ParseDisplayName(IDesktopFolder,
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
- ok((hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) || (hr == E_FAIL) || (hr == E_INVALIDARG),
- "ParseDisplayName returned %08x, expected 80070002, E_FAIL or E_INVALIDARG\n", hr);
+ todo_wine ok(hr == E_INVALIDARG, "ParseDisplayName returned %08x, expected E_INVALIDARG\n", hr);
/* I thought that perhaps the DesktopFolder's ParseDisplayName would recognize the
* path corresponding to CSIDL_PERSONAL and return a CLSID_MyDocuments PIDL. Turns
* out it doesn't. The magic seems to happen in the file dialogs, then. */
- if (!pSHGetSpecialFolderPathW || !pILFindLastID)
- {
- win_skip("SHGetSpecialFolderPathW and/or ILFindLastID are not available\n");
- goto finished;
- }
- bRes = pSHGetSpecialFolderPathW(NULL, cTestDirW, CSIDL_PERSONAL, FALSE);
+ bRes = SHGetSpecialFolderPathW(NULL, cTestDirW, CSIDL_PERSONAL, FALSE);
ok(bRes, "SHGetSpecialFolderPath(CSIDL_PERSONAL) failed! %u\n", GetLastError());
if (!bRes) goto finished;
@@ -313,12 +266,11 @@ static void test_ParseDisplayName(void)
ok(hr == S_OK, "DesktopFolder->ParseDisplayName failed. hr = %08x.\n", hr);
if (hr != S_OK) goto finished;
- ok(pILFindLastID(newPIDL)->mkid.abID[0] == 0x31 ||
- pILFindLastID(newPIDL)->mkid.abID[0] == 0xb1, /* Win98 */
- "Last pidl should be of type PT_FOLDER or PT_IESPECIAL2, but is: %02x\n",
- pILFindLastID(newPIDL)->mkid.abID[0]);
+ ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x31,
+ "Last pidl should be of type PT_FOLDER, but is: %02x\n",
+ ILFindLastID(newPIDL)->mkid.abID[0]);
IMalloc_Free(ppM, newPIDL);
-
+
finished:
IShellFolder_Release(IDesktopFolder);
}
@@ -441,7 +393,6 @@ static void test_EnumObjects(IShellFolder *iFolder)
flags &= SFGAO_testfor;
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
ok(flags == (attrs[i]) ||
- flags == (attrs[i] & ~SFGAO_FILESYSANCESTOR) || /* Win9x, NT4 */
flags == ((attrs[i] & ~SFGAO_CAPABILITYMASK) | SFGAO_VISTA), /* Vista and higher */
"GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]);
@@ -449,9 +400,7 @@ static void test_EnumObjects(IShellFolder *iFolder)
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
flags &= SFGAO_testfor;
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
- ok(flags == attrs[i] ||
- flags == (attrs[i] & ~SFGAO_FILESYSANCESTOR), /* Win9x, NT4 */
- "GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]);
+ ok(flags == attrs[i], "GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]);
flags = ~0u;
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
@@ -512,12 +461,8 @@ static void test_BindToObject(void)
hr = IShellFolder_BindToObject(psfMyComputer, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
ok (hr == E_INVALIDARG, "MyComputers's BindToObject should fail, when called with empty pidl! hr = %08x\n", hr);
-if (0)
-{
- /* this call segfaults on 98SE */
hr = IShellFolder_BindToObject(psfMyComputer, NULL, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
ok (hr == E_INVALIDARG, "MyComputers's BindToObject should fail, when called with NULL pidl! hr = %08x\n", hr);
-}
cChars = GetSystemDirectoryA(szSystemDir, MAX_PATH);
ok (cChars > 0 && cChars < MAX_PATH, "GetSystemDirectoryA failed! LastError: %u\n", GetLastError());
@@ -544,13 +489,9 @@ if (0)
ok (hr == E_INVALIDARG,
"FileSystem ShellFolder's BindToObject should fail, when called with empty pidl! hr = %08x\n", hr);
-if (0)
-{
- /* this call segfaults on 98SE */
hr = IShellFolder_BindToObject(psfSystemDir, NULL, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
ok (hr == E_INVALIDARG,
"FileSystem ShellFolder's BindToObject should fail, when called with NULL pidl! hr = %08x\n", hr);
-}
IShellFolder_Release(psfSystemDir);
@@ -586,23 +527,19 @@ if (0)
{
IPersist *pp;
hr = IShellFolder_QueryInterface(psfChild, &IID_IPersist, (void**)&pp);
- ok(hr == S_OK ||
- broken(hr == E_NOINTERFACE), /* Win9x, NT4, W2K */
- "Got 0x%08x\n", hr);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
CLSID id;
hr = IPersist_GetClassID(pp, &id);
ok(hr == S_OK, "Got 0x%08x\n", hr);
- /* CLSID_ShellFSFolder on some w2k systems */
- ok(IsEqualIID(&id, &CLSID_ShellDocObjView) || broken(IsEqualIID(&id, &CLSID_ShellFSFolder)),
- "Unexpected classid %s\n", wine_dbgstr_guid(&id));
+ ok(IsEqualIID(&id, &CLSID_ShellDocObjView), "Unexpected classid %s\n", wine_dbgstr_guid(&id));
IPersist_Release(pp);
}
IShellFolder_Release(psfChild);
}
- pILFree(pidl);
+ ILFree(pidl);
}
DeleteFileA(pathA);
}
@@ -623,12 +560,10 @@ if (0)
{
hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
ok(hr == E_FAIL || /* Vista+ */
- hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */
- hr == E_INVALIDARG || /* W2K item in top dir */
- broken(hr == S_OK), /* Win9x, NT4, W2K */
+ hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
"Got 0x%08x\n", hr);
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
- pILFree(pidl);
+ ILFree(pidl);
}
DeleteFileA(pathA);
}
@@ -649,12 +584,10 @@ if (0)
{
hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
ok(hr == E_FAIL || /* Vista+ */
- hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */
- hr == E_INVALIDARG || /* W2K item in top dir */
- broken(hr == S_OK), /* Win9x, NT4, W2K */
+ hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
"Got 0x%08x\n", hr);
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
- pILFree(pidl);
+ ILFree(pidl);
}
DeleteFileA(pathA);
}
@@ -662,59 +595,55 @@ if (0)
win_skip("Failed to create .foo testfile.\n");
/* And on the desktop */
- if(pSHGetSpecialFolderPathA)
+ SHGetSpecialFolderPathA(NULL, pathA, CSIDL_DESKTOP, FALSE);
+ lstrcatA(pathA, "\\");
+ lstrcatA(pathA, filename_html);
+ hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
+ if(hfile != INVALID_HANDLE_VALUE)
{
- pSHGetSpecialFolderPathA(NULL, pathA, CSIDL_DESKTOP, FALSE);
- lstrcatA(pathA, "\\");
- lstrcatA(pathA, filename_html);
- hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- if(hfile != INVALID_HANDLE_VALUE)
+ CloseHandle(hfile);
+ MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH);
+ hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, path, NULL, &pidl, NULL);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
+ if(SUCCEEDED(hr))
{
- CloseHandle(hfile);
- MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH);
- hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, path, NULL, &pidl, NULL);
- ok(hr == S_OK, "Got 0x%08x\n", hr);
- if(SUCCEEDED(hr))
- {
- hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
- ok(hr == S_OK ||
- hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
- "Got 0x%08x\n", hr);
- if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
- pILFree(pidl);
- }
- if(!DeleteFileA(pathA))
- trace("Failed to delete: %d\n", GetLastError());
-
+ hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
+ ok(hr == S_OK ||
+ hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
+ "Got 0x%08x\n", hr);
+ if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
+ ILFree(pidl);
}
- else
- win_skip("Failed to create .html testfile.\n");
+ if(!DeleteFileA(pathA))
+ trace("Failed to delete: %d\n", GetLastError());
+
+ }
+ else
+ win_skip("Failed to create .html testfile.\n");
- pSHGetSpecialFolderPathA(NULL, pathA, CSIDL_DESKTOP, FALSE);
- lstrcatA(pathA, "\\");
- lstrcatA(pathA, filename_foo);
- hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- if(hfile != INVALID_HANDLE_VALUE)
+ SHGetSpecialFolderPathA(NULL, pathA, CSIDL_DESKTOP, FALSE);
+ lstrcatA(pathA, "\\");
+ lstrcatA(pathA, filename_foo);
+ hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
+ if(hfile != INVALID_HANDLE_VALUE)
+ {
+ CloseHandle(hfile);
+ MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH);
+ hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, path, NULL, &pidl, NULL);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
+ if(SUCCEEDED(hr))
{
- CloseHandle(hfile);
- MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH);
- hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, path, NULL, &pidl, NULL);
- ok(hr == S_OK, "Got 0x%08x\n", hr);
- if(SUCCEEDED(hr))
- {
- hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
- ok(hr == E_FAIL || /* Vista+ */
- hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */
- broken(hr == S_OK), /* Win9x, NT4, W2K */
- "Got 0x%08x\n", hr);
- if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
- pILFree(pidl);
- }
- DeleteFileA(pathA);
+ hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
+ ok(hr == E_FAIL || /* Vista+ */
+ hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
+ "Got 0x%08x\n", hr);
+ if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
+ ILFree(pidl);
}
- else
- win_skip("Failed to create .foo testfile.\n");
+ DeleteFileA(pathA);
}
+ else
+ win_skip("Failed to create .foo testfile.\n");
IShellFolder_Release(psfDesktop);
}
@@ -745,13 +674,8 @@ static void test_GetDisplayName(void)
* no functional difference in this respect.
*/
- if(!pSHGetSpecialFolderPathA) {
- win_skip("SHGetSpecialFolderPathA is not available\n");
- return;
- }
-
/* First creating a directory in MyDocuments and a file in this directory. */
- result = pSHGetSpecialFolderPathA(NULL, szTestDir, CSIDL_PERSONAL, FALSE);
+ result = SHGetSpecialFolderPathA(NULL, szTestDir, CSIDL_PERSONAL, FALSE);
ok(result, "SHGetSpecialFolderPathA failed! Last error: %u\n", GetLastError());
if (!result) return;
@@ -787,11 +711,8 @@ static void test_GetDisplayName(void)
return;
}
- pidlLast = pILFindLastID(pidlTestFile);
- ok(pidlLast->mkid.cb >=76 ||
- broken(pidlLast->mkid.cb == 28) || /* W2K */
- broken(pidlLast->mkid.cb == 40), /* Win9x, WinME */
- "Expected pidl length of at least 76, got %d.\n", pidlLast->mkid.cb);
+ pidlLast = ILFindLastID(pidlTestFile);
+ ok(pidlLast->mkid.cb >= 76, "Expected pidl length of at least 76, got %d.\n", pidlLast->mkid.cb);
if (pidlLast->mkid.cb >= 28) {
ok(!lstrcmpA((CHAR*)&pidlLast->mkid.abID[12], szFileName),
"Filename should be stored as ansi-string at this position!\n");
@@ -809,95 +730,79 @@ static void test_GetDisplayName(void)
*/
hr = IShellFolder_BindToObject(psfDesktop, pidlTestFile, NULL, &IID_IUnknown, (VOID**)&psfFile);
ok (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) ||
- hr == E_NOTIMPL || /* Vista */
- broken(hr == S_OK), /* Win9x, W2K */
+ hr == E_NOTIMPL, /* Vista */
"hr = %08x\n", hr);
if (hr == S_OK) {
IUnknown_Release(psfFile);
}
- if (!pSHBindToParent)
- {
- win_skip("SHBindToParent is missing\n");
- DeleteFileA(szTestFile);
- RemoveDirectoryA(szTestDir);
- return;
- }
-
/* Some tests for IShellFolder::SetNameOf */
- if (pSHGetFolderPathAndSubDirA)
+ hr = SHBindToParent(pidlTestFile, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
+ ok(hr == S_OK, "SHBindToParent failed! hr = %08x\n", hr);
+ if (hr == S_OK)
{
- hr = pSHBindToParent(pidlTestFile, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
- ok(hr == S_OK, "SHBindToParent failed! hr = %08x\n", hr);
- if (hr == S_OK) {
- /* It's ok to use this fixed path. Call will fail anyway. */
- WCHAR wszAbsoluteFilename[] = { 'C',':','\\','w','i','n','e','t','e','s','t', 0 };
- LPITEMIDLIST pidlNew;
-
- /* The pidl returned through the last parameter of SetNameOf is a simple one. */
- hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew);
+ /* It's ok to use this fixed path. Call will fail anyway. */
+ WCHAR wszAbsoluteFilename[] = { 'C',':','\\','w','i','n','e','t','e','s','t', 0 };
+ LPITEMIDLIST pidlNew;
+
+ /* The pidl returned through the last parameter of SetNameOf is a simple one. */
+ hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew);
+ ok (hr == S_OK, "SetNameOf failed! hr = %08x\n", hr);
+ if (hr == S_OK)
+ {
+ ok (((LPITEMIDLIST)((LPBYTE)pidlNew+pidlNew->mkid.cb))->mkid.cb == 0,
+ "pidl returned from SetNameOf should be simple!\n");
+
+ /* Passing an absolute path to SetNameOf fails. The HRESULT code indicates that SetNameOf
+ * is implemented on top of SHFileOperation in WinXP. */
+ hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszAbsoluteFilename,
+ SHGDN_FORPARSING, NULL);
+ ok (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "SetNameOf succeeded! hr = %08x\n", hr);
+
+ /* Rename the file back to its original name. SetNameOf ignores the fact, that the
+ * SHGDN flags specify an absolute path. */
+ hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL);
ok (hr == S_OK, "SetNameOf failed! hr = %08x\n", hr);
- if (hr == S_OK)
- {
- ok (((LPITEMIDLIST)((LPBYTE)pidlNew+pidlNew->mkid.cb))->mkid.cb == 0,
- "pidl returned from SetNameOf should be simple!\n");
-
- /* Passing an absolute path to SetNameOf fails. The HRESULT code indicates that SetNameOf
- * is implemented on top of SHFileOperation in WinXP. */
- hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszAbsoluteFilename,
- SHGDN_FORPARSING, NULL);
- ok (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "SetNameOf succeeded! hr = %08x\n", hr);
-
- /* Rename the file back to its original name. SetNameOf ignores the fact, that the
- * SHGDN flags specify an absolute path. */
- hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL);
- ok (hr == S_OK, "SetNameOf failed! hr = %08x\n", hr);
- pILFree(pidlNew);
- }
-
- IShellFolder_Release(psfPersonal);
+ ILFree(pidlNew);
}
+
+ IShellFolder_Release(psfPersonal);
}
- else
- win_skip("Avoid needs of interaction on Win2k\n");
/* Deleting the file and the directory */
DeleteFileA(szTestFile);
RemoveDirectoryA(szTestDir);
/* SHGetPathFromIDListW still works, although the file is not present anymore. */
- if (pSHGetPathFromIDListW)
- {
- result = pSHGetPathFromIDListW(pidlTestFile, wszTestFile2);
- ok (result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
- ok (!lstrcmpiW(wszTestFile, wszTestFile2), "SHGetPathFromIDListW returns incorrect path!\n");
- }
+ result = SHGetPathFromIDListW(pidlTestFile, wszTestFile2);
+ ok (result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
+ ok (!lstrcmpiW(wszTestFile, wszTestFile2), "SHGetPathFromIDListW returns incorrect path!\n");
/* SHBindToParent fails, if called with a NULL PIDL. */
- hr = pSHBindToParent(NULL, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
+ hr = SHBindToParent(NULL, &IID_IShellFolder, (void**)&psfPersonal, &pidlLast);
ok (hr != S_OK, "SHBindToParent(NULL) should fail!\n");
/* But it succeeds with an empty PIDL. */
- hr = pSHBindToParent(pidlEmpty, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
+ hr = SHBindToParent(pidlEmpty, &IID_IShellFolder, (void**)&psfPersonal, &pidlLast);
ok (hr == S_OK, "SHBindToParent(empty PIDL) should succeed! hr = %08x\n", hr);
ok (pidlLast == pidlEmpty, "The last element of an empty PIDL should be the PIDL itself!\n");
if (hr == S_OK)
IShellFolder_Release(psfPersonal);
-
+
/* Binding to the folder and querying the display name of the file also works. */
- hr = pSHBindToParent(pidlTestFile, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
+ hr = SHBindToParent(pidlTestFile, &IID_IShellFolder, (void**)&psfPersonal, &pidlLast);
ok (hr == S_OK, "SHBindToParent failed! hr = %08x\n", hr);
if (hr != S_OK) {
IShellFolder_Release(psfDesktop);
return;
}
- /* This test shows that Windows doesn't allocate a new pidlLast, but returns a pointer into
+ /* This test shows that Windows doesn't allocate a new pidlLast, but returns a pointer into
* pidlTestFile (In accordance with MSDN). */
- ok (pILFindLastID(pidlTestFile) == pidlLast,
+ ok (ILFindLastID(pidlTestFile) == pidlLast,
"SHBindToParent doesn't return the last id of the pidl param!\n");
-
+
hr = IShellFolder_GetDisplayNameOf(psfPersonal, pidlLast, SHGDN_FORPARSING, &strret);
ok (hr == S_OK, "Personal->GetDisplayNameOf failed! hr = %08x\n", hr);
if (hr != S_OK) {
@@ -906,13 +811,10 @@ static void test_GetDisplayName(void)
return;
}
- if (pStrRetToBufW)
- {
- hr = pStrRetToBufW(&strret, pidlLast, wszTestFile2, MAX_PATH);
- ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
- ok (!lstrcmpiW(wszTestFile, wszTestFile2), "GetDisplayNameOf returns incorrect path!\n");
- }
-
+ hr = StrRetToBufW(&strret, pidlLast, wszTestFile2, MAX_PATH);
+ ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
+ ok (!lstrcmpiW(wszTestFile, wszTestFile2), "GetDisplayNameOf returns incorrect path!\n");
+
ILFree(pidlTestFile);
IShellFolder_Release(psfDesktop);
IShellFolder_Release(psfPersonal);
@@ -950,11 +852,10 @@ static void test_CallForAttributes(void)
hr = SHGetDesktopFolder(&psfDesktop);
ok (hr == S_OK, "SHGetDesktopFolder failed! hr = %08x\n", hr);
if (hr != S_OK) return;
-
- hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, wszMyDocuments, NULL,
+
+ hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, wszMyDocuments, NULL,
&pidlMyDocuments, NULL);
- ok (hr == S_OK ||
- broken(hr == E_INVALIDARG), /* Win95, NT4 */
+ ok (hr == S_OK,
"Desktop's ParseDisplayName failed to parse MyDocuments's CLSID! hr = %08x\n", hr);
if (hr != S_OK) {
IShellFolder_Release(psfDesktop);
@@ -1049,32 +950,11 @@ static void test_GetAttributesOf(void)
LPCITEMIDLIST pidlEmpty = (LPCITEMIDLIST)&emptyitem;
LPITEMIDLIST pidlMyComputer;
DWORD dwFlags;
- static const DWORD desktopFlags[] = {
- /* WinXP */
- SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR |
- SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER,
- /* Win2k */
- SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_STREAM | SFGAO_FILESYSANCESTOR |
- SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER,
- /* WinMe, Win9x, WinNT*/
- SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSANCESTOR |
- SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER
- };
- static const DWORD myComputerFlags[] = {
- /* WinXP */
- SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
- SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER,
- /* Win2k */
- SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_STREAM |
- SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER,
- /* WinMe, Win9x, WinNT */
- SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR |
- SFGAO_FOLDER | SFGAO_HASSUBFOLDER,
- /* Win95, WinNT when queried directly */
- SFGAO_CANLINK | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR |
- SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER
- };
- WCHAR wszMyComputer[] = {
+ static const DWORD desktopFlags = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
+ SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
+ static const DWORD myComputerFlags = SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET |
+ SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
+ WCHAR wszMyComputer[] = {
':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-',
'A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}',0 };
char cCurrDirA [MAX_PATH] = {0};
@@ -1082,8 +962,7 @@ static void test_GetAttributesOf(void)
static WCHAR cTestDirW[] = {'t','e','s','t','d','i','r',0};
IShellFolder *IDesktopFolder, *testIShellFolder;
ITEMIDLIST *newPIDL;
- int len, i;
- BOOL foundFlagsMatch;
+ int len;
hr = SHGetDesktopFolder(&psfDesktop);
ok (hr == S_OK, "SHGetDesktopFolder failed! hr = %08x\n", hr);
@@ -1093,26 +972,14 @@ static void test_GetAttributesOf(void)
dwFlags = 0xffffffff;
hr = IShellFolder_GetAttributesOf(psfDesktop, 1, &pidlEmpty, &dwFlags);
ok (hr == S_OK, "Desktop->GetAttributesOf(empty pidl) failed! hr = %08x\n", hr);
- for (i = 0, foundFlagsMatch = FALSE; !foundFlagsMatch &&
- i < sizeof(desktopFlags) / sizeof(desktopFlags[0]); i++)
- {
- if (desktopFlags[i] == dwFlags)
- foundFlagsMatch = TRUE;
- }
- ok (foundFlagsMatch, "Wrong Desktop attributes: %08x\n", dwFlags);
+ ok (dwFlags == desktopFlags, "Wrong Desktop attributes: %08x\n", dwFlags);
/* .. or with no itemidlist at all. */
dwFlags = 0xffffffff;
hr = IShellFolder_GetAttributesOf(psfDesktop, 0, NULL, &dwFlags);
ok (hr == S_OK, "Desktop->GetAttributesOf(NULL) failed! hr = %08x\n", hr);
- for (i = 0, foundFlagsMatch = FALSE; !foundFlagsMatch &&
- i < sizeof(desktopFlags) / sizeof(desktopFlags[0]); i++)
- {
- if (desktopFlags[i] == dwFlags)
- foundFlagsMatch = TRUE;
- }
- ok (foundFlagsMatch, "Wrong Desktop attributes: %08x\n", dwFlags);
-
+ ok (dwFlags == desktopFlags, "Wrong Desktop attributes: %08x\n", dwFlags);
+
/* Testing the attributes of the MyComputer shellfolder */
hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, wszMyComputer, NULL, &pidlMyComputer, NULL);
ok (hr == S_OK, "Desktop's ParseDisplayName failed to parse MyComputer's CLSID! hr = %08x\n", hr);
@@ -1127,14 +994,8 @@ static void test_GetAttributesOf(void)
dwFlags = 0xffffffff;
hr = IShellFolder_GetAttributesOf(psfDesktop, 1, (LPCITEMIDLIST*)&pidlMyComputer, &dwFlags);
ok (hr == S_OK, "Desktop->GetAttributesOf(MyComputer) failed! hr = %08x\n", hr);
- for (i = 0, foundFlagsMatch = FALSE; !foundFlagsMatch &&
- i < sizeof(myComputerFlags) / sizeof(myComputerFlags[0]); i++)
- {
- if ((myComputerFlags[i] | SFGAO_CANLINK) == dwFlags)
- foundFlagsMatch = TRUE;
- }
todo_wine
- ok (foundFlagsMatch, "Wrong MyComputer attributes: %08x\n", dwFlags);
+ ok (dwFlags == (myComputerFlags | SFGAO_CANLINK), "Wrong MyComputer attributes: %08x\n", dwFlags);
hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer, NULL, &IID_IShellFolder, (LPVOID*)&psfMyComputer);
ok (hr == S_OK, "Desktop failed to bind to MyComputer object! hr = %08x\n", hr);
@@ -1144,21 +1005,13 @@ static void test_GetAttributesOf(void)
hr = IShellFolder_GetAttributesOf(psfMyComputer, 1, &pidlEmpty, &dwFlags);
todo_wine
- ok (hr == E_INVALIDARG ||
- broken(hr == S_OK), /* W2K and earlier */
- "MyComputer->GetAttributesOf(empty pidl) should fail! hr = %08x\n", hr);
+ ok (hr == E_INVALIDARG, "MyComputer->GetAttributesOf(empty pidl) should fail! hr = %08x\n", hr);
dwFlags = 0xffffffff;
hr = IShellFolder_GetAttributesOf(psfMyComputer, 0, NULL, &dwFlags);
ok (hr == S_OK, "MyComputer->GetAttributesOf(NULL) failed! hr = %08x\n", hr);
- for (i = 0, foundFlagsMatch = FALSE; !foundFlagsMatch &&
- i < sizeof(myComputerFlags) / sizeof(myComputerFlags[0]); i++)
- {
- if (myComputerFlags[i] == dwFlags)
- foundFlagsMatch = TRUE;
- }
todo_wine
- ok (foundFlagsMatch, "Wrong MyComputer attributes: %08x\n", dwFlags);
+ ok (dwFlags == myComputerFlags, "Wrong MyComputer attributes: %08x\n", dwFlags);
IShellFolder_Release(psfMyComputer);
@@ -1246,34 +1099,19 @@ static void test_SHGetPathFromIDList(void)
'w','i','n','e','t','e','s','t','.','f','o','o',0 };
LPITEMIDLIST pidlPrograms;
- if(!pSHGetPathFromIDListW || !pSHGetSpecialFolderPathW)
- {
- win_skip("SHGetPathFromIDListW() or SHGetSpecialFolderPathW() is missing\n");
- return;
- }
-
/* Calling SHGetPathFromIDListW with no pidl should return the empty string */
wszPath[0] = 'a';
wszPath[1] = '\0';
- result = pSHGetPathFromIDListW(NULL, wszPath);
+ result = SHGetPathFromIDListW(NULL, wszPath);
ok(!result, "Expected failure\n");
ok(!wszPath[0], "Expected empty string\n");
/* Calling SHGetPathFromIDListW with an empty pidl should return the desktop folder's path. */
- result = pSHGetSpecialFolderPathW(NULL, wszDesktop, CSIDL_DESKTOP, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, wszDesktop, CSIDL_DESKTOP, FALSE);
ok(result, "SHGetSpecialFolderPathW(CSIDL_DESKTOP) failed! Last error: %u\n", GetLastError());
if (!result) return;
- /* Check if we are on Win9x */
- SetLastError(0xdeadbeef);
- lstrcmpiW(wszDesktop, wszDesktop);
- if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
- {
- win_skip("Most W-calls are not implemented\n");
- return;
- }
-
- result = pSHGetPathFromIDListW(pidlEmpty, wszPath);
+ result = SHGetPathFromIDListW(pidlEmpty, wszPath);
ok(result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
if (!result) return;
ok(!lstrcmpiW(wszDesktop, wszPath), "SHGetPathFromIDListW didn't return desktop path for empty pidl!\n");
@@ -1293,7 +1131,7 @@ static void test_SHGetPathFromIDList(void)
SetLastError(0xdeadbeef);
wszPath[0] = 'a';
wszPath[1] = '\0';
- result = pSHGetPathFromIDListW(pidlMyComputer, wszPath);
+ result = SHGetPathFromIDListW(pidlMyComputer, wszPath);
ok (!result, "SHGetPathFromIDListW succeeded where it shouldn't!\n");
ok (GetLastError()==0xdeadbeef ||
GetLastError()==ERROR_SUCCESS, /* Vista and higher */
@@ -1306,7 +1144,7 @@ static void test_SHGetPathFromIDList(void)
IMalloc_Free(ppM, pidlMyComputer);
- result = pSHGetSpecialFolderPathW(NULL, wszFileName, CSIDL_DESKTOPDIRECTORY, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, wszFileName, CSIDL_DESKTOPDIRECTORY, FALSE);
ok(result, "SHGetSpecialFolderPathW failed! Last error: %u\n", GetLastError());
if (!result) {
IShellFolder_Release(psfDesktop);
@@ -1341,15 +1179,12 @@ static void test_SHGetPathFromIDList(void)
IMalloc_Free(ppM, pidlTestFile);
return;
}
- if (pStrRetToBufW)
- {
- pStrRetToBufW(&strret, pidlTestFile, wszPath, MAX_PATH);
- ok(0 == lstrcmpW(wszFileName, wszPath),
- "Desktop->GetDisplayNameOf(pidlTestFile, SHGDN_FORPARSING) "
- "returned incorrect path for file placed on desktop\n");
- }
+ StrRetToBufW(&strret, pidlTestFile, wszPath, MAX_PATH);
+ ok(0 == lstrcmpW(wszFileName, wszPath),
+ "Desktop->GetDisplayNameOf(pidlTestFile, SHGDN_FORPARSING) "
+ "returned incorrect path for file placed on desktop\n");
- result = pSHGetPathFromIDListW(pidlTestFile, wszPath);
+ result = SHGetPathFromIDListW(pidlTestFile, wszPath);
ok(result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
ok(0 == lstrcmpW(wszFileName, wszPath), "SHGetPathFromIDListW returned incorrect path for file placed on desktop\n");
@@ -1381,11 +1216,11 @@ static void test_SHGetPathFromIDList(void)
IMalloc_Free(ppM, pidlTestFile);
/* Test if we can get the path from the start menu "program files" PIDL. */
- hr = pSHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms);
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms);
ok(hr == S_OK, "SHGetFolderLocation failed: 0x%08x\n", hr);
SetLastError(0xdeadbeef);
- result = pSHGetPathFromIDListW(pidlPrograms, wszPath);
+ result = SHGetPathFromIDListW(pidlPrograms, wszPath);
IMalloc_Free(ppM, pidlPrograms);
ok(result, "SHGetPathFromIDListW failed\n");
}
@@ -1478,11 +1313,9 @@ static HRESULT WINAPI InitPropertyBag_IPropertyBag_Read(IPropertyBag *iface, LPC
'T','a','r','g','e','t','K','n','o','w','n','F','o','l','d','e','r',0 };
static const WCHAR wszCLSID[] = {
'C','L','S','I','D',0 };
-
+
if (!lstrcmpW(pszPropName, wszTargetSpecialFolder)) {
- ok(V_VT(pVar) == VT_I4 ||
- broken(V_VT(pVar) == VT_BSTR), /* Win2k */
- "Wrong variant type for 'TargetSpecialFolder' property!\n");
+ ok(V_VT(pVar) == VT_I4, "Wrong variant type for 'TargetSpecialFolder' property!\n");
return E_INVALIDARG;
}
@@ -1495,13 +1328,11 @@ static HRESULT WINAPI InitPropertyBag_IPropertyBag_Read(IPropertyBag *iface, LPC
if (!lstrcmpW(pszPropName, wszTarget)) {
WCHAR wszPath[MAX_PATH];
BOOL result;
-
- ok(V_VT(pVar) == VT_BSTR ||
- broken(V_VT(pVar) == VT_EMPTY), /* Win2k */
- "Wrong variant type for 'Target' property!\n");
+
+ ok(V_VT(pVar) == VT_BSTR, "Wrong variant type for 'Target' property!\n");
if (V_VT(pVar) != VT_BSTR) return E_INVALIDARG;
- result = pSHGetSpecialFolderPathW(NULL, wszPath, CSIDL_DESKTOPDIRECTORY, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, wszPath, CSIDL_DESKTOPDIRECTORY, FALSE);
ok(result, "SHGetSpecialFolderPathW(DESKTOPDIRECTORY) failed! %u\n", GetLastError());
if (!result) return E_INVALIDARG;
@@ -1578,17 +1409,6 @@ static void test_FolderShortcut(void) {
static const GUID CLSID_UnixDosFolder =
{0x9d20aae8, 0x0625, 0x44b0, {0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9}};
- if (!pSHGetSpecialFolderPathW || !pStrRetToBufW) {
- win_skip("SHGetSpecialFolderPathW and/or StrRetToBufW are not available\n");
- return;
- }
-
- if (!pSHGetFolderPathAndSubDirA)
- {
- win_skip("FolderShortcut test doesn't work on Win2k\n");
- return;
- }
-
/* These tests basically show, that CLSID_FolderShortcuts are initialized
* via their IPersistPropertyBag interface. And that the target folder
* is taken from the IPropertyBag's 'Target' property.
@@ -1623,11 +1443,11 @@ static void test_FolderShortcut(void) {
return;
}
- result = pSHGetSpecialFolderPathW(NULL, wszDesktopPath, CSIDL_DESKTOPDIRECTORY, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, wszDesktopPath, CSIDL_DESKTOPDIRECTORY, FALSE);
ok(result, "SHGetSpecialFolderPathW(CSIDL_DESKTOPDIRECTORY) failed! %u\n", GetLastError());
if (!result) return;
- pStrRetToBufW(&strret, NULL, wszBuffer, MAX_PATH);
+ StrRetToBufW(&strret, NULL, wszBuffer, MAX_PATH);
ok(!lstrcmpiW(wszDesktopPath, wszBuffer), "FolderShortcut returned incorrect folder!\n");
hr = IShellFolder_QueryInterface(pShellFolder, &IID_IPersistFolder3, (LPVOID*)&pPersistFolder3);
@@ -1668,16 +1488,16 @@ static void test_FolderShortcut(void) {
ok (hr == S_OK, "IPersistFolder3::Initialize failed! hr = %08x\n", hr);
if (hr != S_OK) {
IPersistFolder3_Release(pPersistFolder3);
- pILFree(pidlWineTestFolder);
+ ILFree(pidlWineTestFolder);
return;
}
hr = IPersistFolder3_GetCurFolder(pPersistFolder3, &pidlCurrentFolder);
ok(hr == S_OK, "IPersistFolder3_GetCurFolder failed! hr=0x%08x\n", hr);
- ok(pILIsEqual(pidlCurrentFolder, pidlWineTestFolder),
+ ok(ILIsEqual(pidlCurrentFolder, pidlWineTestFolder),
"IPersistFolder3_GetCurFolder should return pidlWineTestFolder!\n");
- pILFree(pidlCurrentFolder);
- pILFree(pidlWineTestFolder);
+ ILFree(pidlCurrentFolder);
+ ILFree(pidlWineTestFolder);
hr = IPersistFolder3_QueryInterface(pPersistFolder3, &IID_IShellFolder, (LPVOID*)&pShellFolder);
IPersistFolder3_Release(pPersistFolder3);
@@ -1691,7 +1511,7 @@ static void test_FolderShortcut(void) {
return;
}
- pStrRetToBufW(&strret, NULL, wszBuffer, MAX_PATH);
+ StrRetToBufW(&strret, NULL, wszBuffer, MAX_PATH);
ok(!lstrcmpiW(wszDesktopPath, wszBuffer), "FolderShortcut returned incorrect folder!\n");
/* Next few lines are meant to show that children of FolderShortcuts are not FolderShortcuts,
@@ -1715,7 +1535,7 @@ static void test_FolderShortcut(void) {
hr = IShellFolder_BindToObject(pShellFolder, pidlSubFolder, NULL, &IID_IPersistFolder3,
(LPVOID*)&pPersistFolder3);
IShellFolder_Release(pShellFolder);
- pILFree(pidlSubFolder);
+ ILFree(pidlSubFolder);
ok (hr == S_OK, "IShellFolder::BindToObject failed! hr = %08x\n", hr);
if (hr != S_OK)
return;
@@ -1767,9 +1587,7 @@ static void test_ITEMIDLIST_format(void) {
{ 'l','o','n','g','e','r','_','t','h','a','n','.','8','_','3',0 } };
int i;
- if (!pSHGetSpecialFolderPathW) return;
-
- bResult = pSHGetSpecialFolderPathW(NULL, wszPersonal, CSIDL_PERSONAL, FALSE);
+ bResult = SHGetSpecialFolderPathW(NULL, wszPersonal, CSIDL_PERSONAL, FALSE);
ok(bResult, "SHGetSpecialFolderPathW failed! Last error: %u\n", GetLastError());
if (!bResult) return;
@@ -1796,7 +1614,7 @@ static void test_ITEMIDLIST_format(void) {
hr = IShellFolder_BindToObject(psfDesktop, pidlPersonal, NULL, &IID_IShellFolder,
(LPVOID*)&psfPersonal);
IShellFolder_Release(psfDesktop);
- pILFree(pidlPersonal);
+ ILFree(pidlPersonal);
ok(hr == S_OK, "psfDesktop->BindToObject failed! hr = %08x\n", hr);
if (hr != S_OK) return;
@@ -1837,13 +1655,10 @@ static void test_ITEMIDLIST_format(void) {
* current habit of storing the long filename here, which seems to work
* just fine. */
todo_wine
- ok(pidlFile->mkid.abID[18] == '~' ||
- broken(pidlFile->mkid.abID[34] == '~'), /* Win2k */
- "Should be derived 8.3 name!\n");
+ ok(pidlFile->mkid.abID[18] == '~', "Should be derived 8.3 name!\n");
if (i == 0) /* First file name has an even number of chars. No need for alignment. */
- ok(pidlFile->mkid.abID[12 + strlen(szFile) + 1] != '\0' ||
- broken(pidlFile->mkid.cb == 2 + 12 + strlen(szFile) + 1 + 1), /* Win2k */
+ ok(pidlFile->mkid.abID[12 + strlen(szFile) + 1] != '\0',
"Alignment byte, where there shouldn't be!\n");
if (i == 1) /* Second file name has an uneven number of chars => alignment byte */
@@ -1853,9 +1668,7 @@ static void test_ITEMIDLIST_format(void) {
/* The offset of the FileStructW member is stored as a WORD at the end of the pidl. */
cbOffset = *(WORD*)(((LPBYTE)pidlFile)+pidlFile->mkid.cb-sizeof(WORD));
ok ((cbOffset >= sizeof(struct FileStructA) &&
- cbOffset <= pidlFile->mkid.cb - sizeof(struct FileStructW)) ||
- broken(pidlFile->mkid.cb == 2 + 12 + strlen(szFile) + 1 + 1) || /* Win2k on short names */
- broken(pidlFile->mkid.cb == 2 + 12 + strlen(szFile) + 1 + 12 + 1), /* Win2k on long names */
+ cbOffset <= pidlFile->mkid.cb - sizeof(struct FileStructW)),
"Wrong offset value (%d) stored at the end of the PIDL\n", cbOffset);
if (cbOffset >= sizeof(struct FileStructA) &&
@@ -1907,7 +1720,7 @@ static void test_ITEMIDLIST_format(void) {
}
}
- pILFree(pidlFile);
+ ILFree(pidlFile);
}
IShellFolder_Release(psfPersonal);
@@ -1923,16 +1736,11 @@ static void test_SHGetFolderPathA(void)
HRESULT hr;
HKEY key;
- if (!pSHGetFolderPathA)
- {
- win_skip("SHGetFolderPathA not present\n");
- return;
- }
if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE;
- hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILES, 0, SHGFP_TYPE_CURRENT, path );
+ hr = SHGetFolderPathA( 0, CSIDL_PROGRAM_FILES, 0, SHGFP_TYPE_CURRENT, path );
ok( hr == S_OK, "SHGetFolderPathA failed %x\n", hr );
- hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILESX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
+ hr = SHGetFolderPathA( 0, CSIDL_PROGRAM_FILESX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
if (hr == E_FAIL)
{
win_skip( "Program Files (x86) not supported\n" );
@@ -1965,9 +1773,9 @@ static void test_SHGetFolderPathA(void)
RegCloseKey( key );
}
- hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMON, 0, SHGFP_TYPE_CURRENT, path );
+ hr = SHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMON, 0, SHGFP_TYPE_CURRENT, path );
ok( hr == S_OK, "SHGetFolderPathA failed %x\n", hr );
- hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMONX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
+ hr = SHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMONX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
if (hr == E_FAIL)
{
win_skip( "Common Files (x86) not supported\n" );
@@ -2012,17 +1820,7 @@ static void test_SHGetFolderPathAndSubDirA(void)
static char testpath[MAX_PATH];
static char toolongpath[MAX_PATH+1];
- if(!pSHGetFolderPathAndSubDirA)
- {
- win_skip("SHGetFolderPathAndSubDirA not present!\n");
- return;
- }
-
- if(!pSHGetFolderPathA) {
- win_skip("SHGetFolderPathA not present!\n");
- return;
- }
- if(FAILED(pSHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdata)))
+ if(FAILED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdata)))
{
win_skip("SHGetFolderPathA failed for CSIDL_LOCAL_APPDATA!\n");
return;
@@ -2043,11 +1841,11 @@ static void test_SHGetFolderPathAndSubDirA(void)
}
/* test invalid second parameter */
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | 0xff, NULL, SHGFP_TYPE_CURRENT, wine, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | 0xff, NULL, SHGFP_TYPE_CURRENT, wine, testpath);
ok(E_INVALIDARG == ret, "expected E_INVALIDARG, got %x\n", ret);
/* test fourth parameter */
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, 2, winetemp, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, 2, winetemp, testpath);
switch(ret) {
case S_OK: /* winvista */
ok(!strncmp(appdata, testpath, strlen(appdata)),
@@ -2063,40 +1861,40 @@ static void test_SHGetFolderPathAndSubDirA(void)
/* test fifth parameter */
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, NULL, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, NULL, testpath);
ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!lstrcmpA(appdata, testpath), "expected %s, got %s\n", appdata, testpath);
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, "", testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, "", testpath);
ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!lstrcmpA(appdata, testpath), "expected %s, got %s\n", appdata, testpath);
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, "\\", testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, "\\", testpath);
ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!lstrcmpA(appdata, testpath), "expected %s, got %s\n", appdata, testpath);
for(i=0; i< MAX_PATH; i++)
toolongpath[i] = '0' + i % 10;
toolongpath[MAX_PATH] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, toolongpath, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, toolongpath, testpath);
ok(HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) == ret,
"expected %x, got %x\n", HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), ret);
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, wine, NULL);
- ok((S_OK == ret) || (E_INVALIDARG == ret), "expected S_OK or E_INVALIDARG, got %x\n", ret);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, wine, NULL);
+ ok((S_OK == ret) || (E_INVALIDARG == ret), "expected E_INVALIDARG, got %x\n", ret);
/* test a not existing path */
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, winetemp, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, winetemp, testpath);
ok(HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) == ret,
"expected %x, got %x\n", HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), ret);
/* create a directory inside a not existing directory */
testpath[0] = '\0';
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_CREATE | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, winetemp, testpath);
+ ret = SHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_CREATE | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, winetemp, testpath);
ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!strncmp(appdata, testpath, strlen(appdata)),
"expected %s to start with %s\n", testpath, appdata);
@@ -2181,13 +1979,12 @@ static void test_LocalizedNames(void)
hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER, &strret);
ok(hr == S_OK, "GetDisplayNameOf failed %08x\n", hr);
- if (hr == S_OK && pStrRetToBufW)
+ if (hr == S_OK)
{
- hr = pStrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
+ hr = StrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
todo_wine
- ok (!lstrcmpiW(tempbufW, folderdisplayW) ||
- broken(!lstrcmpiW(tempbufW, foldernameW)), /* W2K */
+ ok (!lstrcmpiW(tempbufW, folderdisplayW),
"GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
}
@@ -2195,13 +1992,12 @@ static void test_LocalizedNames(void)
hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER|SHGDN_FOREDITING, &strret);
ok(hr == S_OK, "GetDisplayNameOf failed %08x\n", hr);
- if (hr == S_OK && pStrRetToBufW)
+ if (hr == S_OK)
{
- hr = pStrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
+ hr = StrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
todo_wine
- ok (!lstrcmpiW(tempbufW, folderdisplayW) ||
- broken(!lstrcmpiW(tempbufW, foldernameW)), /* W2K */
+ ok (!lstrcmpiW(tempbufW, folderdisplayW),
"GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
}
@@ -2209,9 +2005,9 @@ static void test_LocalizedNames(void)
hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER|SHGDN_FORPARSING, &strret);
ok(hr == S_OK, "GetDisplayNameOf failed %08x\n", hr);
- if (hr == S_OK && pStrRetToBufW)
+ if (hr == S_OK)
{
- hr = pStrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
+ hr = StrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR));
ok (hr == S_OK, "StrRetToBufW failed! hr = %08x\n", hr);
ok (!lstrcmpiW(tempbufW, foldernameW), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
}
@@ -2253,16 +2049,8 @@ static void test_SHCreateShellItem(void)
return;
}
- if(pSHGetSpecialFolderLocation)
- {
- ret = pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
- ok(ret == S_OK, "Got 0x%08x\n", ret);
- }
- else
- {
- win_skip("pSHGetSpecialFolderLocation missing.\n");
- pidl_desktop = NULL;
- }
+ ret = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
+ ok(ret == S_OK, "Got 0x%08x\n", ret);
MultiByteToWideChar(CP_ACP, 0, curdirA, -1, curdirW, MAX_PATH);
@@ -2280,7 +2068,7 @@ static void test_SHCreateShellItem(void)
ret = IShellFolder_ParseDisplayName(currentfolder, NULL, NULL, testfileW, NULL, &pidl_testfile, NULL);
ok(SUCCEEDED(ret), "ParseDisplayName returned %x\n", ret);
- pidl_abstestfile = pILCombine(pidl_cwd, pidl_testfile);
+ pidl_abstestfile = ILCombine(pidl_cwd, pidl_testfile);
shellitem = (void*)0xdeadbeef;
ret = pSHCreateShellItem(NULL, NULL, NULL, &shellitem);
@@ -2308,7 +2096,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_cwd, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2328,7 +2116,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_abstestfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2346,7 +2134,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_cwd, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2369,7 +2157,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_abstestfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2390,7 +2178,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_abstestfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2410,7 +2198,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_testfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2495,7 +2283,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_cwd, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2515,7 +2303,7 @@ static void test_SHCreateShellItem(void)
if (SUCCEEDED(ret))
{
ok(ILIsEqual(pidl_testfile, pidl_test), "id lists are not equal\n");
- pILFree(pidl_test);
+ ILFree(pidl_test);
}
IPersistIDList_Release(persistidl);
}
@@ -2592,7 +2380,7 @@ static void test_SHCreateShellItem(void)
ret = IShellItem_Compare(shellitem, shellitem2, 0, &order);
ok(ret == S_OK, "IShellItem_Compare fail: 0x%08x.\n", ret);
ok(!order, "order got wrong value: %d.\n", order);
- pILFree(pidl_desktop_testfile);
+ ILFree(pidl_desktop_testfile);
IShellItem_Release(shellitem2);
IShellItem_Release(shellitem);
@@ -2683,7 +2471,7 @@ static void test_SHCreateShellItem(void)
ret = IShellItem_Compare(shellitem, shellitem2, 0, &order);
ok(ret == S_OK, "IShellItem_Compare failed: 0x%08x.\n", ret);
ok(!order, "order got wrong value: %d.\n", order);
- pILFree(pidl_desktop_testfile);
+ ILFree(pidl_desktop_testfile);
IShellItem_Release(shellitem2);
IShellItem_Release(shellitem);
@@ -2715,10 +2503,10 @@ static void test_SHCreateShellItem(void)
win_skip("No SHCreateItemInKnownFolder or SHGetKnownFolderPath\n");
DeleteFileA(".\\testfile");
- pILFree(pidl_abstestfile);
- pILFree(pidl_testfile);
- pILFree(pidl_desktop);
- pILFree(pidl_cwd);
+ ILFree(pidl_abstestfile);
+ ILFree(pidl_testfile);
+ ILFree(pidl_desktop);
+ ILFree(pidl_cwd);
IShellFolder_Release(currentfolder);
IShellFolder_Release(desktopfolder);
}
@@ -2742,11 +2530,8 @@ static void test_SHGetNameFromIDList(void)
return;
}
- /* These should be available on any platform that passed the above test. */
+ /* This should be available on any platform that passed the above test. */
ok(pSHCreateShellItem != NULL, "SHCreateShellItem missing.\n");
- ok(pSHBindToParent != NULL, "SHBindToParent missing.\n");
- ok(pSHGetSpecialFolderLocation != NULL, "SHGetSpecialFolderLocation missing.\n");
- ok(pStrRetToBufW != NULL, "StrRetToBufW missing.\n");
if(0)
{
@@ -2758,7 +2543,7 @@ static void test_SHGetNameFromIDList(void)
ok(hres == E_INVALIDARG, "Got 0x%08x\n", hres);
/* Test the desktop */
- hres = pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
+ hres = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
ok(hres == S_OK, "Got 0x%08x\n", hres);
hres = pSHCreateShellItem(NULL, NULL, pidl, &shellitem);
ok(hres == S_OK, "Got 0x%08x\n", hres);
@@ -2786,7 +2571,7 @@ static void test_SHGetNameFromIDList(void)
if(SUCCEEDED(hrSF))
{
- pStrRetToBufW(&strret, NULL, buf, MAX_PATH);
+ StrRetToBufW(&strret, NULL, buf, MAX_PATH);
if(SUCCEEDED(hrSI))
ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
if(SUCCEEDED(hrSF))
@@ -2797,16 +2582,13 @@ static void test_SHGetNameFromIDList(void)
}
IShellFolder_Release(psf);
- if(pSHGetPathFromIDListW){
- hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
- ok(hrSI == S_OK, "Got 0x%08x\n", hrSI);
- res = pSHGetPathFromIDListW(pidl, buf);
- ok(res == TRUE, "Got %d\n", res);
- if(SUCCEEDED(hrSI) && res)
- ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
- if(SUCCEEDED(hrSI)) CoTaskMemFree(nameSI);
- }else
- win_skip("pSHGetPathFromIDListW not available\n");
+ hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
+ ok(hrSI == S_OK, "Got 0x%08x\n", hrSI);
+ res = SHGetPathFromIDListW(pidl, buf);
+ ok(res == TRUE, "Got %d\n", res);
+ if(SUCCEEDED(hrSI) && res)
+ ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
+ if(SUCCEEDED(hrSI)) CoTaskMemFree(nameSI);
hres = pSHGetNameFromIDList(pidl, SIGDN_URL, &name_string);
todo_wine ok(hres == S_OK, "Got 0x%08x\n", hres);
@@ -2814,10 +2596,10 @@ static void test_SHGetNameFromIDList(void)
IShellItem_Release(shellitem);
}
- pILFree(pidl);
+ ILFree(pidl);
/* Test the control panel */
- hres = pSHGetSpecialFolderLocation(NULL, CSIDL_CONTROLS, &pidl);
+ hres = SHGetSpecialFolderLocation(NULL, CSIDL_CONTROLS, &pidl);
ok(hres == S_OK, "Got 0x%08x\n", hres);
hres = pSHCreateShellItem(NULL, NULL, pidl, &shellitem);
ok(hres == S_OK, "Got 0x%08x\n", hres);
@@ -2845,7 +2627,7 @@ static void test_SHGetNameFromIDList(void)
if(SUCCEEDED(hrSF))
{
- pStrRetToBufW(&strret, NULL, buf, MAX_PATH);
+ StrRetToBufW(&strret, NULL, buf, MAX_PATH);
if(SUCCEEDED(hrSI))
ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
if(SUCCEEDED(hrSF))
@@ -2856,16 +2638,13 @@ static void test_SHGetNameFromIDList(void)
}
IShellFolder_Release(psf);
- if(pSHGetPathFromIDListW){
- hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
- ok(hrSI == E_INVALIDARG, "Got 0x%08x\n", hrSI);
- res = pSHGetPathFromIDListW(pidl, buf);
- ok(res == FALSE, "Got %d\n", res);
- if(SUCCEEDED(hrSI) && res)
- ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
- if(SUCCEEDED(hrSI)) CoTaskMemFree(nameSI);
- }else
- win_skip("pSHGetPathFromIDListW not available\n");
+ hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
+ ok(hrSI == E_INVALIDARG, "Got 0x%08x\n", hrSI);
+ res = SHGetPathFromIDListW(pidl, buf);
+ ok(res == FALSE, "Got %d\n", res);
+ if(SUCCEEDED(hrSI) && res)
+ ok(!lstrcmpW(nameSI, buf), "Strings differ.\n");
+ if(SUCCEEDED(hrSI)) CoTaskMemFree(nameSI);
hres = pSHGetNameFromIDList(pidl, SIGDN_URL, &name_string);
todo_wine ok(hres == E_NOTIMPL /* Win7 */ || hres == S_OK /* Vista */,
@@ -2874,7 +2653,7 @@ static void test_SHGetNameFromIDList(void)
IShellItem_Release(shellitem);
}
- pILFree(pidl);
+ ILFree(pidl);
}
static void test_SHGetItemFromDataObject(void)
@@ -2979,7 +2758,7 @@ static void test_SHGetItemFromDataObject(void)
skip("zero or one file found - skipping multi-file test.\n");
for(i = 0; i < count; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
IEnumIDList_Release(peidl);
}
@@ -3054,7 +2833,7 @@ static void test_ShellItemCompare(void)
{
hr = pSHCreateShellItem(NULL, NULL, pidl_testfile, &psi[i]);
ok(hr == S_OK, "Got 0x%08x\n", hr);
- pILFree(pidl_testfile);
+ ILFree(pidl_testfile);
}
if(FAILED(hr)) failed = TRUE;
}
@@ -3289,8 +3068,6 @@ static void test_SHGetIDListFromObject(void)
return;
}
- ok(pSHGetSpecialFolderLocation != NULL, "SHGetSpecialFolderLocation missing.\n");
-
if(0)
{
/* Crashes native */
@@ -3321,7 +3098,7 @@ static void test_SHGetIDListFromObject(void)
HeapFree(GetProcessHeap(), 0, punkimpl);
pidl_desktop = NULL;
- pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
+ SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
ok(pidl_desktop != NULL, "Failed to get desktop pidl.\n");
SHGetDesktopFolder(&psfdesktop);
@@ -3339,7 +3116,7 @@ static void test_SHGetIDListFromObject(void)
if(SUCCEEDED(hres))
{
ok(ILIsEqual(pidl_desktop, pidl), "pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
}
IShellItem_Release(shellitem);
}
@@ -3353,7 +3130,7 @@ static void test_SHGetIDListFromObject(void)
if(SUCCEEDED(hres))
{
ok(ILIsEqual(pidl_desktop, pidl), "pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
}
hres = IShellFolder_CreateViewObject(psfdesktop, NULL, &IID_IShellView, (void**)&psv);
@@ -3370,7 +3147,7 @@ static void test_SHGetIDListFromObject(void)
if(SUCCEEDED(hres))
{
ok(ILIsEqual(pidl_desktop, pidl), "pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
}
/* Test IDataObject */
@@ -3397,7 +3174,7 @@ static void test_SHGetIDListFromObject(void)
ok(hres == S_OK, "got 0x%08x\n", hres);
ok(pidl != NULL, "pidl is NULL.\n");
ok(ILIsEqual(pidl, apidl[0]), "pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
IDataObject_Release(pdo);
}
@@ -3425,7 +3202,7 @@ static void test_SHGetIDListFromObject(void)
skip("zero or one file found - skipping multi-file test.\n");
for(i = 0; i < count; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
IEnumIDList_Release(peidl);
}
@@ -3434,7 +3211,7 @@ static void test_SHGetIDListFromObject(void)
}
IShellFolder_Release(psfdesktop);
- pILFree(pidl_desktop);
+ ILFree(pidl_desktop);
}
static void test_SHGetItemFromObject(void)
@@ -3527,8 +3304,6 @@ static void test_SHCreateShellItemArray(void)
return;
}
- ok(pSHGetSpecialFolderLocation != NULL, "SHGetSpecialFolderLocation missing.\n");
-
if(0)
{
/* Crashes under native */
@@ -3548,10 +3323,10 @@ static void test_SHCreateShellItemArray(void)
hr = pSHCreateShellItemArray(NULL, pdesktopsf, 1, NULL, &psia);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
- pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
+ SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
hr = pSHCreateShellItemArray(pidl, NULL, 0, NULL, &psia);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
- pILFree(pidl);
+ ILFree(pidl);
GetCurrentDirectoryW(MAX_PATH, cTestDirW);
myPathAddBackslashW(cTestDirW);
@@ -3572,7 +3347,7 @@ static void test_SHCreateShellItemArray(void)
if(FAILED(hr))
{
skip("Failed to set up environment for SHCreateShellItemArray tests.\n");
- pILFree(pidl_testdir);
+ ILFree(pidl_testdir);
Cleanup();
return;
}
@@ -3624,14 +3399,14 @@ static void test_SHCreateShellItemArray(void)
if(SUCCEEDED(hr))
{
ok(ILIsEqual(pidl_abs, pidl), "Pidl not equal.\n");
- pILFree(pidl);
+ ILFree(pidl);
}
IShellItem_Release(psi);
}
- pILFree(pidl_abs);
+ ILFree(pidl_abs);
}
for(i = 0; i < done; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
IShellItemArray_Release(psia);
}
}
@@ -3676,8 +3451,8 @@ static void test_SHCreateShellItemArray(void)
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(pidl2 != NULL, "pidl2 was null.\n");
ok(ILIsEqual(pidl1, pidl2), "pidls not equal.\n");
- pILFree(pidl1);
- pILFree(pidl2);
+ ILFree(pidl1);
+ ILFree(pidl2);
IShellItem_Release(psi2);
}
hr = IShellItemArray_GetItemAt(psia, 1, &psi2);
@@ -3752,10 +3527,10 @@ static void test_SHCreateShellItemArray(void)
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(pidl != NULL, "pidl as NULL.\n");
ok(ILIsEqual(pidl, pidl_abs), "pidls differ.\n");
- pILFree(pidl);
+ ILFree(pidl);
IShellItem_Release(psi);
}
- pILFree(pidl_abs);
+ ILFree(pidl_abs);
}
IShellItemArray_Release(psia);
@@ -3764,7 +3539,7 @@ static void test_SHCreateShellItemArray(void)
IDataObject_Release(pdo);
}
for(i = 0; i < count; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
}
else
skip("No files found - skipping test.\n");
@@ -3843,7 +3618,7 @@ static void test_SHCreateShellItemArray(void)
WCHAR desktoppath[MAX_PATH];
BOOL result;
- result = pSHGetSpecialFolderPathW(NULL, desktoppath, CSIDL_DESKTOPDIRECTORY, FALSE);
+ result = SHGetSpecialFolderPathW(NULL, desktoppath, CSIDL_DESKTOPDIRECTORY, FALSE);
ok(result, "SHGetSpecialFolderPathW(CSIDL_DESKTOPDIRECTORY) failed! %u\n", GetLastError());
hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &path);
@@ -3948,7 +3723,7 @@ static void test_SHCreateShellItemArray(void)
IShellItemArray_Release(psia);
}
- pILFree(pidltest1);
+ ILFree(pidltest1);
}
IShellFolder_Release(pdesktopsf);
@@ -3957,7 +3732,7 @@ static void test_SHCreateShellItemArray(void)
skip("No SHCreateShellItemArrayFromIDLists.\n");
IShellFolder_Release(psf);
- pILFree(pidl_testdir);
+ ILFree(pidl_testdir);
Cleanup();
}
@@ -3991,7 +3766,7 @@ static void test_ShellItemArrayEnumItems(void)
hr = IShellFolder_BindToObject(pdesktopsf, pidl_testdir, NULL, (REFIID)&IID_IShellFolder,
(void**)&psf);
ok(hr == S_OK, "Got 0x%08x\n", hr);
- pILFree(pidl_testdir);
+ ILFree(pidl_testdir);
}
IShellFolder_Release(pdesktopsf);
if (FAILED(hr)) return;
@@ -4110,7 +3885,7 @@ static void test_ShellItemArrayEnumItems(void)
}
for(i = 0; i < done; i++)
- pILFree(apidl[i]);
+ ILFree(apidl[i]);
}
}
@@ -4127,7 +3902,7 @@ static void test_ShellItemBindToHandler(void)
return;
}
- hr = pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
@@ -4162,7 +3937,7 @@ static void test_ShellItemBindToHandler(void)
if(SUCCEEDED(hr))
{
ok(ILIsEqual(pidl_desktop, pidl_tmp), "Pidl not equal (%p, %p)\n", pidl_desktop, pidl_tmp);
- pILFree(pidl_tmp);
+ ILFree(pidl_tmp);
}
IPersistFolder2_Release(ppf2);
}
@@ -4276,7 +4051,7 @@ static void test_ShellItemBindToHandler(void)
else
skip("Failed to create ShellItem.\n");
- pILFree(pidl_desktop);
+ ILFree(pidl_desktop);
}
static void test_ShellItemGetAttributes(void)
@@ -4297,13 +4072,13 @@ static void test_ShellItemGetAttributes(void)
return;
}
- hr = pSHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl_desktop);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
hr = pSHCreateShellItem(NULL, NULL, pidl_desktop, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
- pILFree(pidl_desktop);
+ ILFree(pidl_desktop);
}
if(FAILED(hr))
{
@@ -4338,7 +4113,7 @@ static void test_ShellItemGetAttributes(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pSHCreateShellItem(NULL, NULL, pidl, &psi_folder1);
ok(hr == S_OK, "Got 0x%08x\n", sfgao);
- pILFree(pidl);
+ ILFree(pidl);
lstrcpyW(buf, curdirW);
lstrcatW(buf, testfile1W);
@@ -4346,7 +4121,7 @@ static void test_ShellItemGetAttributes(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pSHCreateShellItem(NULL, NULL, pidl, &psi_file1);
ok(hr == S_OK, "Got 0x%08x\n", sfgao);
- pILFree(pidl);
+ ILFree(pidl);
IShellFolder_Release(pdesktopsf);
@@ -4421,7 +4196,7 @@ static void test_ShellItemArrayGetAttributes(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
for(i = 0; i < 5; i++)
- pILFree((LPITEMIDLIST)pidl_array[i]);
+ ILFree((LPITEMIDLIST)pidl_array[i]);
/* [testfolder/, testfolder/testfolder2] seems to break in Vista */
attr = 0xdeadbeef;
@@ -4477,71 +4252,65 @@ static void test_SHParseDisplayName(void)
HRESULT hr;
BOOL ret, is_wow64;
- if (!pSHParseDisplayName)
- {
- win_skip("SHParseDisplayName isn't available\n");
- return;
- }
-
if (0)
{
/* crashes on native */
- pSHParseDisplayName(NULL, NULL, NULL, 0, NULL);
+ SHParseDisplayName(NULL, NULL, NULL, 0, NULL);
nameW[0] = 0;
- pSHParseDisplayName(nameW, NULL, NULL, 0, NULL);
+ SHParseDisplayName(nameW, NULL, NULL, 0, NULL);
}
pidl1 = (LPITEMIDLIST)0xdeadbeef;
- hr = pSHParseDisplayName(NULL, NULL, &pidl1, 0, NULL);
+ hr = SHParseDisplayName(NULL, NULL, &pidl1, 0, NULL);
ok(broken(hr == E_OUTOFMEMORY) /* < Vista */ ||
hr == E_INVALIDARG, "failed %08x\n", hr);
ok(pidl1 == 0, "expected null ptr, got %p\n", pidl1);
/* dummy name */
nameW[0] = 0;
- hr = pSHParseDisplayName(nameW, NULL, &pidl1, 0, NULL);
+ hr = SHParseDisplayName(nameW, NULL, &pidl1, 0, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "failed %08x\n", hr);
hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, nameW, NULL, &pidl2, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
- ret = pILIsEqual(pidl1, pidl2);
+ ret = ILIsEqual(pidl1, pidl2);
ok(ret == TRUE, "expected equal idls\n");
- pILFree(pidl1);
- pILFree(pidl2);
+ ILFree(pidl1);
+ ILFree(pidl2);
/* with path */
GetWindowsDirectoryW( dirW, MAX_PATH );
- hr = pSHParseDisplayName(dirW, NULL, &pidl1, 0, NULL);
+ hr = SHParseDisplayName(dirW, NULL, &pidl1, 0, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, dirW, NULL, &pidl2, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
- ret = pILIsEqual(pidl1, pidl2);
+ ret = ILIsEqual(pidl1, pidl2);
ok(ret == TRUE, "expected equal idls\n");
- pILFree(pidl1);
- pILFree(pidl2);
+ ILFree(pidl1);
+ ILFree(pidl2);
/* system32 is not redirected to syswow64 on WOW64 */
if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE;
- if (is_wow64 && pGetSystemWow64DirectoryW)
+ if (is_wow64)
{
UINT len;
*dirW = 0;
len = GetSystemDirectoryW(dirW, MAX_PATH);
ok(len > 0, "GetSystemDirectoryW failed: %u\n", GetLastError());
- hr = pSHParseDisplayName(dirW, NULL, &pidl1, 0, NULL);
+ hr = SHParseDisplayName(dirW, NULL, &pidl1, 0, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
*dirW = 0;
- len = pGetSystemWow64DirectoryW(dirW, MAX_PATH);
+ len = GetSystemWow64DirectoryW(dirW, MAX_PATH);
ok(len > 0, "GetSystemWow64DirectoryW failed: %u\n", GetLastError());
- hr = pSHParseDisplayName(dirW, NULL, &pidl2, 0, NULL);
+ hr = SHParseDisplayName(dirW, NULL, &pidl2, 0, NULL);
ok(hr == S_OK, "failed %08x\n", hr);
- ret = pILIsEqual(pidl1, pidl2);
+ ret = ILIsEqual(pidl1, pidl2);
ok(ret == FALSE, "expected different idls\n");
- pILFree(pidl1);
- pILFree(pidl2);
+ ILFree(pidl1);
+ ILFree(pidl2);
}
IShellFolder_Release(desktop);
@@ -4559,7 +4328,7 @@ static void test_desktop_IPersist(void)
ok(hr == S_OK, "failed %08x\n", hr);
hr = IShellFolder_QueryInterface(desktop, &IID_IPersist, (void**)&persist);
- ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* NT4, W9X */, "failed %08x\n", hr);
+ ok(hr == S_OK, "failed %08x\n", hr);
if (hr == S_OK)
{
@@ -4595,7 +4364,7 @@ static void test_desktop_IPersist(void)
hr = IPersistFolder2_GetCurFolder(ppf2, &pidl);
ok(hr == S_OK, "got %08x\n", hr);
ok(pidl != NULL, "pidl was NULL.\n");
- if(SUCCEEDED(hr)) pILFree(pidl);
+ if(SUCCEEDED(hr)) ILFree(pidl);
IPersistFolder2_Release(ppf2);
}
@@ -4613,12 +4382,6 @@ static void test_GetUIObject(void)
const WCHAR filename[] =
{'\\','t','e','s','t','d','i','r','\\','t','e','s','t','1','.','t','x','t',0};
- if(!pSHBindToParent)
- {
- win_skip("SHBindToParent missing.\n");
- return;
- }
-
GetCurrentDirectoryW(MAX_PATH, path);
if (!path[0])
{
@@ -4631,12 +4394,12 @@ static void test_GetUIObject(void)
CreateFilesFolders();
hr = IShellFolder_ParseDisplayName(psf_desktop, NULL, NULL, path, NULL, &pidl, 0);
- ok(hr == S_OK || broken(hr == E_FAIL) /* WinME */, "Got 0x%08x\n", hr);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
IShellFolder *psf;
LPCITEMIDLIST pidl_child;
- hr = pSHBindToParent(pidl, &IID_IShellFolder, (void**)&psf, &pidl_child);
+ hr = SHBindToParent(pidl, &IID_IShellFolder, (void**)&psf, &pidl_child);
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
@@ -4692,9 +4455,7 @@ static void test_GetUIObject(void)
(max_id_check == max_id-2), /* Win 8 */
"Not equal (or near equal), got %d and %d\n", max_id_check, max_id);
-#define is_win2k() (pSHGetFolderPathA && !pSHGetFolderPathAndSubDirA)
-
- if(count && !is_win2k()) /* Test is interactive on w2k, so skip */
+ if(count)
{
CMINVOKECOMMANDINFO cmi;
ZeroMemory(&cmi, sizeof(CMINVOKECOMMANDINFO));
@@ -4711,14 +4472,13 @@ static void test_GetUIObject(void)
(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Vista */),
"Got 0x%08x\n", hr);
}
-#undef is_win2k
DestroyMenu(hmenu);
IContextMenu_Release(pcm);
}
IShellFolder_Release(psf);
}
- if(pILFree) pILFree(pidl);
+ ILFree(pidl);
}
IShellFolder_Release(psf_desktop);
@@ -4733,22 +4493,13 @@ static void r_verify_pidl(unsigned l, LPCITEMIDLIST pidl, const WCHAR *path)
STRRET filename;
HRESULT hr;
- if(!pSHBindToParent){
- win_skip("SHBindToParent is not available, not performing full PIDL verification\n");
- if(path)
- ok_(__FILE__,l)(pidl != NULL, "Expected PIDL to be non-NULL\n");
- else
- ok_(__FILE__,l)(pidl == NULL, "Expected PIDL to be NULL\n");
- return;
- }
-
if(path){
if(!pidl){
ok_(__FILE__,l)(0, "didn't get expected path (%s), instead: NULL\n", wine_dbgstr_w(path));
return;
}
- hr = pSHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&parent, &child);
+ hr = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&parent, &child);
ok_(__FILE__,l)(hr == S_OK, "SHBindToParent failed: 0x%08x\n", hr);
if(FAILED(hr))
return;
@@ -4786,30 +4537,25 @@ static void test_SHSimpleIDListFromPath(void)
LPITEMIDLIST pidl = NULL;
- if(!pSHSimpleIDListFromPathAW){
- win_skip("SHSimpleIDListFromPathAW not available\n");
- return;
- }
-
br = CreateDirectoryA(adirA, NULL);
ok(br == TRUE, "CreateDirectory failed: %d\n", GetLastError());
if(is_unicode)
- pidl = pSHSimpleIDListFromPathAW(adirW);
+ pidl = SHSimpleIDListFromPath(adirW);
else
- pidl = pSHSimpleIDListFromPathAW(adirA);
+ pidl = SHSimpleIDListFromPath((const WCHAR *)adirA);
verify_pidl(pidl, adirW);
- pILFree(pidl);
+ ILFree(pidl);
br = RemoveDirectoryA(adirA);
ok(br == TRUE, "RemoveDirectory failed: %d\n", GetLastError());
if(is_unicode)
- pidl = pSHSimpleIDListFromPathAW(adirW);
+ pidl = SHSimpleIDListFromPath(adirW);
else
- pidl = pSHSimpleIDListFromPathAW(adirA);
+ pidl = SHSimpleIDListFromPath((const WCHAR *)adirA);
verify_pidl(pidl, adirW);
- pILFree(pidl);
+ ILFree(pidl);
}
/* IFileSystemBindData impl */
@@ -4920,28 +4666,22 @@ static void test_ParseDisplayNamePBC(void)
/* fails on unknown dir with no IBindCtx */
hres = IShellFolder_ParseDisplayName(psf, NULL, NULL, adirW, NULL, &pidl, NULL);
- ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
+ ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
hres = IShellFolder_ParseDisplayName(psf, NULL, NULL, afileW, NULL, &pidl, NULL);
- ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
+ ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
hres = IShellFolder_ParseDisplayName(psf, NULL, NULL, afile2W, NULL, &pidl, NULL);
- ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
+ ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
/* fails on unknown dir with IBindCtx with no IFileSystemBindData */
hres = CreateBindCtx(0, &pbc);
ok(hres == S_OK, "CreateBindCtx failed: 0x%08x\n", hres);
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
- ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
+ ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
- ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
+ ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
- ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
+ ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
/* unknown dir with IBindCtx with IFileSystemBindData */
hres = IBindCtx_RegisterObjectParam(pbc, wFileSystemBindData, (IUnknown*)&fsbd);
@@ -4951,24 +4691,21 @@ static void test_ParseDisplayNamePBC(void)
pidl = (ITEMIDLIST*)0xdeadbeef;
fsbdVtbl.GetFindData = fsbd_GetFindData_fail;
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, adirW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afileW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afile2W);
ILFree(pidl);
@@ -4978,24 +4715,21 @@ static void test_ParseDisplayNamePBC(void)
pidl = (ITEMIDLIST*)0xdeadbeef;
fsbdVtbl.GetFindData = fsbd_GetFindData_nul;
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, adirW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afileW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afile2W);
ILFree(pidl);
@@ -5005,24 +4739,21 @@ static void test_ParseDisplayNamePBC(void)
pidl = (ITEMIDLIST*)0xdeadbeef;
fsbdVtbl.GetFindData = fsbd_GetFindData_junk;
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, adirW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afileW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afile2W);
ILFree(pidl);
@@ -5032,24 +4763,21 @@ static void test_ParseDisplayNamePBC(void)
pidl = (ITEMIDLIST*)0xdeadbeef;
fsbdVtbl.GetFindData = fsbd_GetFindData_invalid;
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, adirW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afileW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afile2W);
ILFree(pidl);
@@ -5059,24 +4787,21 @@ static void test_ParseDisplayNamePBC(void)
pidl = (ITEMIDLIST*)0xdeadbeef;
fsbdVtbl.GetFindData = fsbd_GetFindData_valid;
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, adirW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afileW);
ILFree(pidl);
}
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
- ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
- "ParseDisplayName failed: 0x%08x\n", hres);
+ ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
if(SUCCEEDED(hres)){
verify_pidl(pidl, afile2W);
ILFree(pidl);
@@ -5207,9 +4932,9 @@ static void test_SHChangeNotify(BOOL test_new_delivery)
entries[0].pidl = NULL;
if(has_unicode)
- hr = pSHILCreateFromPath(root_dirW, (LPITEMIDLIST*)&entries[0].pidl, 0);
+ hr = SHILCreateFromPath(root_dirW, (LPITEMIDLIST*)&entries[0].pidl, 0);
else
- hr = pSHILCreateFromPath((LPCVOID)root_dirA, (LPITEMIDLIST*)&entries[0].pidl, 0);
+ hr = SHILCreateFromPath((LPCVOID)root_dirA, (LPITEMIDLIST*)&entries[0].pidl, 0);
ok(hr == S_OK, "SHILCreateFromPath failed: 0x%08x\n", hr);
entries[0].fRecursive = TRUE;
@@ -5271,12 +4996,6 @@ static void test_SHCreateDefaultContextMenu(void)
return;
}
- if(!pSHBindToParent)
- {
- skip("SHBindToParent missing.\n");
- return;
- }
-
GetCurrentDirectoryW(MAX_PATH, path);
if (!path[0])
{
@@ -5289,11 +5008,11 @@ static void test_SHCreateDefaultContextMenu(void)
CreateFilesFolders();
hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, path, NULL, &pidl, 0);
- ok(hr == S_OK || broken(hr == E_FAIL) /* WinME */, "Got 0x%08x\n", hr);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
- hr = pSHBindToParent(pidl, &IID_IShellFolder, (void**)&folder, (LPCITEMIDLIST*)&pidl_child);
+ hr = SHBindToParent(pidl, &IID_IShellFolder, (void**)&folder, (LPCITEMIDLIST*)&pidl_child);
ok(hr == S_OK, "Got 0x%08x\n", hr);
IShellFolder_QueryInterface(folder,&IID_IPersistFolder2,(void**)&persist);
@@ -5366,7 +5085,7 @@ static void test_DataObject(void)
hres = IShellFolder_GetUIObjectOf(desktop, NULL, 1, (LPCITEMIDLIST*)&apidl,
&IID_IDataObject, NULL, (void**)&data_obj);
ok(hres == S_OK, "got %x\n", hres);
- pILFree(apidl);
+ ILFree(apidl);
IShellFolder_Release(desktop);
cf_shellidlist = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW);
@@ -5498,7 +5217,7 @@ START_TEST(shlfolder)
{
init_function_pointers();
/* if OleInitialize doesn't get called, ParseDisplayName returns
- CO_E_NOTINITIALIZED for malformed directory names on win2k. */
+ CO_E_NOTINITIALIZED for malformed directory names */
OleInitialize(NULL);
test_ParseDisplayName();
--
2.15.1
2
2
11 Jan '18
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
It seems to corrupt memory on Windows 10. The next test crashes.
---
dlls/ddraw/tests/ddraw7.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index d5969ab94929..c904e77849d7 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -13340,7 +13340,7 @@ static void test_clip_planes_limits(void)
trace("Max user clip planes: %u.\n", caps.wMaxUserClipPlanes);
- for (i = 0; i < D3DMAXUSERCLIPPLANES; ++i)
+ for (i = 0; i < caps.wMaxUserClipPlanes; ++i)
{
memset(plane, 0xff, sizeof(plane));
hr = IDirect3DDevice7_GetClipPlane(device, i, plane);
@@ -13353,13 +13353,13 @@ static void test_clip_planes_limits(void)
plane[0] = 2.0f;
plane[1] = 8.0f;
plane[2] = 5.0f;
- for (i = 0; i < D3DMAXUSERCLIPPLANES; ++i)
+ for (i = 0; i < caps.wMaxUserClipPlanes; ++i)
{
plane[3] = i;
hr = IDirect3DDevice7_SetClipPlane(device, i, plane);
ok(hr == D3D_OK, "Failed to set clip plane %u, hr %#x.\n", i, hr);
}
- for (i = 0; i < D3DMAXUSERCLIPPLANES; ++i)
+ for (i = 0; i < caps.wMaxUserClipPlanes; ++i)
{
memset(plane, 0xff, sizeof(plane));
hr = IDirect3DDevice7_GetClipPlane(device, i, plane);
--
2.13.6
3
8