1 /*
2  * PROJECT:     ReactOS API tests
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     COM interface test for zipfldr classes
5  * COPYRIGHT:   Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
6  */
7 
8 #include "com_apitest.h"
9 
10 #define NDEBUG
11 #include <debug.h>
12 
13 /*
14 This is only tested on w10 & 2k3, so the defines might be wrong for the other versions.
15 CLSID_ZipFolderStorageHandler and CLSID_ZipFolderContextMenu seem to be the same.
16 */
17 
18 
19 static const CLASS_AND_INTERFACES ExpectedInterfaces[] =
20 {
21     {
22         ID_NAME(CLSID_ZipFolderStorageHandler),
23         {
24             {    0x0,   &IID_IShellFolder2 },
25             {    0x0,       &IID_IShellFolder },
26             {    0x0,           &IID_IUnknown },
27             {    0x4,   &IID_IStorage },
28             {    0x8,   &IID_IContextMenu },
29             {    0xc,   &IID_IShellExtInit },
30 #if _WIN32_WINNT < 0x0a00
31             {   0x10,   &IID_IPersistFile },
32             {   0x14,   &IID_IPersistFolder2 },
33             {   0x14,       &IID_IPersistFolder },
34             {   0x14,           &IID_IPersist },
35 #else
36             {   0x10,   &IID_IPersistFolder2 },
37             {   0x10,       &IID_IPersistFolder },
38             {   0x10,           &IID_IPersist },
39             {   0x14,   &IID_IFolderType },
40 #endif
41         },
42         L"Apartment"
43     },
44     {
45         ID_NAME(CLSID_ZipFolderSendTo),
46         {
47 #if _WIN32_WINNT >= 0x0a00
48             {   -0x8,   &IID_IObjectWithSite },
49 #endif
50             {    0x0,   &IID_IDropTarget },
51             {    0x0,       &IID_IUnknown },
52             {    0x4,   &IID_IPersistFile },
53             {    0x4,       &IID_IPersist },
54         },
55         L"Apartment"
56     },
57     {
58         ID_NAME(CLSID_ZipFolderContextMenu),
59         {
60             {    0x0,   &IID_IShellFolder2 },
61             {    0x0,       &IID_IShellFolder },
62             {    0x0,           &IID_IUnknown },
63             {    0x4,   &IID_IStorage },
64             {    0x8,   &IID_IContextMenu },
65             {    0xc,   &IID_IShellExtInit },
66 #if _WIN32_WINNT < 0x0a00
67             {   0x10,   &IID_IPersistFile },
68             {   0x14,   &IID_IPersistFolder2 },
69             {   0x14,       &IID_IPersistFolder },
70             {   0x14,           &IID_IPersist },
71 #else
72             {   0x10,   &IID_IPersistFolder2 },
73             {   0x10,       &IID_IPersistFolder },
74             {   0x10,           &IID_IPersist },
75             {   0x14,   &IID_IFolderType },
76 #endif
77         },
78         L"Apartment"
79     },
80     {
81         ID_NAME(CLSID_ZipFolderRightDragHandler),
82         {
83             {   -0x4,   &IID_IContextMenu },
84             {    0x0,   &IID_IShellExtInit },
85             {    0x0,       &IID_IUnknown },
86         },
87         L"Apartment"
88     },
89     {
90         ID_NAME(CLSID_ZipFolderDropHandler),
91         {
92 #if _WIN32_WINNT < 0x0a00
93             {    0x0,   &IID_IDropTarget },
94             {    0x0,       &IID_IUnknown },
95             {    0x4,   &IID_IPersistFile },
96             {    0x4,       &IID_IPersist },
97 #else
98             {   -0x4,   &IID_IDropTarget },
99             {    0x0,   &IID_IUnknown },
100 #endif
101         },
102         L"Apartment"
103     },
104 };
105 static const INT ExpectedInterfaceCount = RTL_NUMBER_OF(ExpectedInterfaces);
106 
107 START_TEST(zipfldr)
108 {
109     TestClasses(L"zipfldr", ExpectedInterfaces, ExpectedInterfaceCount);
110 }
111