[COM_APITEST] Add zipfldr tests.
authorMark Jansen <mark.jansen@reactos.org>
Tue, 28 Nov 2017 21:58:07 +0000 (22:58 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Sun, 31 Dec 2017 13:56:22 +0000 (14:56 +0100)
CORE-7684 #234

modules/rostests/apitests/com/CMakeLists.txt
modules/rostests/apitests/com/com_apitest.h
modules/rostests/apitests/com/testlist.c
modules/rostests/apitests/com/zipfldr.c [new file with mode: 0644]

index 76e6efe..73f0000 100644 (file)
@@ -9,6 +9,7 @@ list(APPEND SOURCE
     ole32.c
     shdocvw.c
     shell32.c
+    zipfldr.c
     com_apitest.c
     com_apitest.h)
 
index 715213a..f1f4c73 100644 (file)
@@ -200,4 +200,12 @@ DEFINE_GUID(IID_CDefView,                  0x4434ff80, 0xef4c, 0x11ce, 0xae, 0x6
 DEFINE_GUID(IID_FolderItems2,              0xc94f0ad0, 0xf363, 0x11d2, 0xa3, 0x27, 0x00, 0xc0, 0x4f, 0x8e, 0xec, 0x7f);
 DEFINE_GUID(IID_FolderItems3,              0xeaa7c309, 0xbbec, 0x49d5, 0x82, 0x1d, 0x64, 0xd9, 0x66, 0xcb, 0x66, 0x7f);
 
+// zipfldr.dll
+DEFINE_GUID(CLSID_ZipFolderStorageHandler, 0xe88dcce0, 0xb7b3, 0x11d1, 0xa9, 0xf0, 0x00, 0xaa, 0x00, 0x60, 0xfa, 0x31);
+DEFINE_GUID(CLSID_ZipFolderSendTo,         0x888dca60, 0xfc0a, 0x11cf, 0x8f, 0x0f, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62);
+DEFINE_GUID(CLSID_ZipFolderContextMenu,    0xb8cdcb65, 0xb1bf, 0x4b42, 0x94, 0x28, 0x1d, 0xfd, 0xb7, 0xee, 0x92, 0xaf);
+DEFINE_GUID(CLSID_ZipFolderRightDragHandler,0xbd472f60, 0x27fa, 0x11cf, 0xb8, 0xb4, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(CLSID_ZipFolderDropHandler,    0xed9d80b9, 0xd157, 0x457b, 0x91, 0x92, 0x0e, 0x72, 0x80, 0x31, 0x3b, 0xf0);
+
 #endif /* _COM_APITEST_H_ */
+
index 0311e25..0204404 100644 (file)
@@ -11,6 +11,7 @@ extern void func_netshell(void);
 extern void func_ole32(void);
 extern void func_shdocvw(void);
 extern void func_shell32(void);
+extern void func_zipfldr(void);
 
 const struct test winetest_testlist[] =
 {
@@ -22,6 +23,7 @@ const struct test winetest_testlist[] =
     { "ole32", func_ole32 },
     { "shdocvw", func_shdocvw },
     { "shell32", func_shell32 },
+    { "zipfldr", func_zipfldr },
 
     { 0, 0 }
 };
diff --git a/modules/rostests/apitests/com/zipfldr.c b/modules/rostests/apitests/com/zipfldr.c
new file mode 100644 (file)
index 0000000..e6bbbd5
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * PROJECT:     ReactOS API tests
+ * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
+ * PURPOSE:     COM interface test for zipfldr classes
+ * COPYRIGHT:   Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
+ */
+
+#include "com_apitest.h"
+
+#define NDEBUG
+#include <debug.h>
+
+/*
+This is only tested on w10 & 2k3, so the defines might be wrong for the other versions.
+CLSID_ZipFolderStorageHandler and CLSID_ZipFolderContextMenu seem to be the same.
+*/
+
+
+static const CLASS_AND_INTERFACES ExpectedInterfaces[] =
+{
+    {
+        ID_NAME(CLSID_ZipFolderStorageHandler),
+        {
+            {    0x0,   &IID_IShellFolder2 },
+            {    0x0,       &IID_IShellFolder },
+            {    0x0,           &IID_IUnknown },
+            {    0x4,   &IID_IStorage },
+            {    0x8,   &IID_IContextMenu },
+            {    0xc,   &IID_IShellExtInit },
+#if _WIN32_WINNT < 0x0a00
+            {   0x10,   &IID_IPersistFile },
+            {   0x14,   &IID_IPersistFolder2 },
+            {   0x14,       &IID_IPersistFolder },
+            {   0x14,           &IID_IPersist },
+#else
+            {   0x10,   &IID_IPersistFolder2 },
+            {   0x10,       &IID_IPersistFolder },
+            {   0x10,           &IID_IPersist },
+            {   0x14,   &IID_IFolderType },
+#endif
+        },
+        L"Apartment"
+    },
+    {
+        ID_NAME(CLSID_ZipFolderSendTo),
+        {
+#if _WIN32_WINNT >= 0x0a00
+            {   -0x8,   &IID_IObjectWithSite },
+#endif
+            {    0x0,   &IID_IDropTarget },
+            {    0x0,       &IID_IUnknown },
+            {    0x4,   &IID_IPersistFile },
+            {    0x4,       &IID_IPersist },
+        },
+        L"Apartment"
+    },
+    {
+        ID_NAME(CLSID_ZipFolderContextMenu),
+        {
+            {    0x0,   &IID_IShellFolder2 },
+            {    0x0,       &IID_IShellFolder },
+            {    0x0,           &IID_IUnknown },
+            {    0x4,   &IID_IStorage },
+            {    0x8,   &IID_IContextMenu },
+            {    0xc,   &IID_IShellExtInit },
+#if _WIN32_WINNT < 0x0a00
+            {   0x10,   &IID_IPersistFile },
+            {   0x14,   &IID_IPersistFolder2 },
+            {   0x14,       &IID_IPersistFolder },
+            {   0x14,           &IID_IPersist },
+#else
+            {   0x10,   &IID_IPersistFolder2 },
+            {   0x10,       &IID_IPersistFolder },
+            {   0x10,           &IID_IPersist },
+            {   0x14,   &IID_IFolderType },
+#endif
+        },
+        L"Apartment"
+    },
+    {
+        ID_NAME(CLSID_ZipFolderRightDragHandler),
+        {
+            {   -0x4,   &IID_IContextMenu },
+            {    0x0,   &IID_IShellExtInit },
+            {    0x0,       &IID_IUnknown },
+        },
+        L"Apartment"
+    },
+    {
+        ID_NAME(CLSID_ZipFolderDropHandler),
+        {
+#if _WIN32_WINNT < 0x0a00
+            {    0x0,   &IID_IDropTarget },
+            {    0x0,       &IID_IUnknown },
+            {    0x4,   &IID_IPersistFile },
+            {    0x4,       &IID_IPersist },
+#else
+            {   -0x4,   &IID_IDropTarget },
+            {    0x0,   &IID_IUnknown },
+#endif
+        },
+        L"Apartment"
+    },
+};
+static const INT ExpectedInterfaceCount = RTL_NUMBER_OF(ExpectedInterfaces);
+
+START_TEST(zipfldr)
+{
+    TestClasses(L"zipfldr", ExpectedInterfaces, ExpectedInterfaceCount);
+}