[shell32_apitest]
[reactos.git] / rostests / apitests / com / shell32.c
1 /*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: COM interface test for shell32 classes
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8 #include "com_apitest.h"
9
10 #define NDEBUG
11 #include <debug.h>
12
13 static const CLASS_AND_INTERFACES ExpectedInterfaces[] =
14 {
15 {
16 ID_NAME(CLSID_CopyToMenu),
17 {
18 { 0x0, &IID_IContextMenu3 },
19 { 0x0, &IID_IContextMenu2 },
20 { 0x0, &IID_IContextMenu },
21 { 0x0, &IID_IUnknown },
22 { 0x4, &IID_IShellExtInit },
23 { 0x8, &IID_IObjectWithSite },
24 { 0x10, &IID_IFolderFilter },
25 }
26 },
27 {
28 ID_NAME(CLSID_DeskMovr),
29 {
30 { 0x0, &IID_IUnknown },
31 { 0x70, &IID_IDeskMovr },
32 { 0x74, &IID_IOleObject },
33 { 0x78, &IID_IPersistPropertyBag },
34 { 0x80, &IID_IOleInPlaceActiveObject },
35 { 0x84, &IID_IViewObjectEx },
36 { 0x84, &IID_IViewObject2 },
37 { 0x84, &IID_IViewObject },
38 { 0x88, &IID_IOleWindow },
39 { 0x88, &IID_IOleInPlaceObject },
40 { 0x88, &IID_IOleInPlaceObjectWindowless },
41 }
42 },
43 {
44 ID_NAME(CLSID_DragDropHelper),
45 {
46 { 0x0, &IID_IDragSourceHelper },
47 { 0x0, &IID_IUnknown },
48 { 0x4, &IID_IDropTargetHelper },
49 }
50 },
51 {
52 ID_NAME(CLSID_FadeTask),
53 {
54 { 0x0, &IID_IUnknown },
55 }
56 },
57 {
58 ID_NAME(CLSID_FileSearchBand),
59 {
60 { 0x0, &IID_IFileSearchBand },
61 { 0x0, &IID_IDispatch },
62 { 0x0, &IID_IUnknown },
63 { 0x4, &IID_IObjectWithSite },
64 { 0x8, &IID_IPersistStream },
65 { 0x8, &IID_IPersist },
66 { 0xc, &IID_IDeskBand },
67 { 0xc, &IID_IDockingWindow },
68 { 0xc, &IID_IOleWindow },
69 { 0x10, &IID_IInputObject },
70 { 0x18, &IID_IOleInPlaceSite },
71 }
72 },
73 {
74 ID_NAME(CLSID_FolderItem),
75 {
76 //{ 0x0, &CLSID_ShellFolderItem }, // broken QueryInterface that doesn't add a reference
77 { 0x0, &IID_FolderItem2 },
78 { 0x0, &IID_FolderItem },
79 { 0x0, &IID_IDispatch },
80 { 0x0, &IID_IUnknown },
81 { 0x4, &IID_IPersistFolder2 },
82 { 0x4, &IID_IPersistFolder },
83 { 0x4, &IID_IPersist },
84 { 0x8, &IID_IObjectSafety },
85 }
86 },
87 {
88 ID_NAME(CLSID_FolderItemsFDF),
89 {
90 { 0x0, &IID_FolderItems3 },
91 //{ 0x0, &IID_FolderItems2 }, ????
92 { 0x0, &IID_FolderItems },
93 { 0x0, &IID_IDispatch },
94 { 0x0, &IID_IUnknown },
95 { 0x4, &IID_IPersistFolder },
96 { 0x8, &IID_IObjectSafety },
97 }
98 },
99 {
100 ID_NAME(CLSID_FolderShortcut),
101 {
102 { 0x0, &IID_IShellFolder2 },
103 { 0x0, &IID_IShellFolder },
104 { 0x0, &IID_IUnknown },
105 { 0x4, &IID_IPersistFolder3 },
106 { 0x4, &IID_IPersistFolder2 },
107 { 0x4, &IID_IPersistFolder },
108 { 0x4, &IID_IPersist },
109 { 0x8, &IID_IShellLinkA },
110 { 0xc, &IID_IShellLinkW },
111 { 0x10, &IID_IPersistFile },
112 { 0x14, &IID_IExtractIconW },
113 { 0x18, &IID_IQueryInfo },
114 { 0x20, &IID_IPersistStream },
115 { 0x20, &IID_IPersistStreamInit },
116 { 0x24, &IID_IPersistPropertyBag },
117 { 0x28, &IID_IBrowserFrameOptions },
118 }
119 },
120 {
121 ID_NAME(CLSID_FolderViewHost),
122 {
123 { 0x0, &IID_IUnknown },
124 { 0x4, &IID_IServiceProvider },
125 { 0x8, &IID_IOleWindow },
126 { 0xc, &IID_IFolderView },
127 { 0x10, &IID_IObjectWithSite },
128 }
129 },
130 {
131 ID_NAME(CLSID_ISFBand),
132 {
133 { -0xac, &IID_IDeskBand },
134 { -0xac, &IID_IDockingWindow },
135 { -0xac, &IID_IOleWindow },
136 { -0xa8, &IID_IObjectWithSite },
137 { -0xa0, &IID_IInputObject },
138 { -0x9c, &IID_IPersistStream },
139 { -0x9c, &IID_IPersist },
140 { -0x98, &IID_IOleCommandTarget },
141 { -0x94, &IID_IServiceProvider },
142 { -0x78, &IID_IWinEventHandler },
143 { -0x74, &IID_IShellChangeNotify },
144 { -0x70, &IID_IDropTarget },
145 { -0x4, &IID_IContextMenu },
146 { 0x0, &IID_IShellFolderBand },
147 { 0x0, &IID_IUnknown },
148 { 0x94, &IID_IFolderBandPriv },
149 }
150 },
151 {
152 ID_NAME(CLSID_MenuBand),
153 {
154 { -0x30, &IID_IDeskBand },
155 { -0x30, &IID_IDockingWindow },
156 { -0x30, &IID_IOleWindow },
157 { -0x2c, &IID_IObjectWithSite },
158 { -0x24, &IID_IInputObject },
159 { -0x20, &IID_IPersistStream },
160 { -0x20, &IID_IPersist },
161 { -0x1c, &IID_IOleCommandTarget },
162 { -0x18, &IID_IServiceProvider },
163 { 0x0, &IID_IMenuPopup },
164 { 0x0, &IID_IDeskBar },
165 { 0x0, &IID_IUnknown },
166 { 0x4, &IID_IMenuBand },
167 { 0x8, &IID_IShellMenu2 },
168 { 0x8, &IID_IShellMenu },
169 { 0xc, &IID_IWinEventHandler },
170 { 0x10, &IID_IShellMenuAcc },
171 }
172 },
173 {
174 ID_NAME(CLSID_MenuBandSite),
175 {
176 { 0x0, &IID_IBandSite },
177 { 0x0, &IID_IUnknown },
178 { 0x4, &IID_IDeskBarClient },
179 { 0x4, &IID_IOleWindow },
180 { 0x8, &IID_IOleCommandTarget },
181 { 0xc, &IID_IInputObject },
182 { 0x10, &IID_IInputObjectSite },
183 { 0x14, &IID_IWinEventHandler },
184 { 0x18, &IID_IServiceProvider },
185 }
186 },
187 {
188 ID_NAME(CLSID_MenuDeskBar),
189 {
190 { -0x48, &IID_IOleCommandTarget },
191 { -0x44, &IID_IServiceProvider },
192 { -0x40, &IID_IDeskBar },
193 { -0x40, &IID_IOleWindow },
194 { -0x3c, &IID_IInputObjectSite },
195 { -0x38, &IID_IInputObject },
196 { 0x0, &IID_IMenuPopup },
197 { 0x0, &IID_IUnknown },
198 { 0x4, &IID_IObjectWithSite },
199 { 0x8, &IID_IBanneredBar },
200 { 0xc, &IID_IInitializeObject },
201 }
202 },
203 #if 0 // This is registered to shell32, but can't be instanciated
204 {
205 ID_NAME(CLSID_MenuToolbarBase),
206 {
207 { 0x0, &IID_IUnknown },
208 }
209 },
210 #endif
211 {
212 ID_NAME(CLSID_MoveToMenu),
213 {
214 { 0x0, &IID_IContextMenu3 },
215 { 0x0, &IID_IContextMenu2 },
216 { 0x0, &IID_IContextMenu },
217 { 0x0, &IID_IUnknown },
218 { 0x4, &IID_IShellExtInit },
219 { 0x8, &IID_IObjectWithSite },
220 { 0x10, &IID_IFolderFilter },
221 }
222 },
223 {
224 ID_NAME(CLSID_NewMenu),
225 {
226 { -0xc, &IID_IObjectWithSite },
227 { -0x4, &IID_IContextMenu3 },
228 { -0x4, &IID_IContextMenu2 },
229 { -0x4, &IID_IContextMenu },
230 { 0x0, &IID_IShellExtInit },
231 { 0x0, &IID_IUnknown },
232 }
233 },
234 {
235 ID_NAME(CLSID_PersonalStartMenu),
236 {
237 { -0x30, &IID_IDeskBand },
238 { -0x30, &IID_IDockingWindow },
239 { -0x30, &IID_IOleWindow },
240 { -0x2c, &IID_IObjectWithSite },
241 { -0x24, &IID_IInputObject },
242 { -0x20, &IID_IPersistStream },
243 { -0x20, &IID_IPersist },
244 { -0x1c, &IID_IOleCommandTarget },
245 { -0x18, &IID_IServiceProvider },
246 { 0x0, &IID_IMenuPopup },
247 { 0x0, &IID_IDeskBar },
248 { 0x0, &IID_IUnknown },
249 { 0x4, &IID_IMenuBand },
250 { 0x8, &IID_IShellMenu2 },
251 { 0x8, &IID_IShellMenu },
252 { 0xc, &IID_IWinEventHandler },
253 { 0x10, &IID_IShellMenuAcc },
254 }
255 },
256 {
257 ID_NAME(CLSID_QuickLinks),
258 {
259 { -0xac, &IID_IDeskBand },
260 { -0xac, &IID_IDockingWindow },
261 { -0xac, &IID_IOleWindow },
262 { -0xa8, &IID_IObjectWithSite },
263 { -0xa0, &IID_IInputObject },
264 { -0x9c, &IID_IPersistStream },
265 { -0x9c, &IID_IPersist },
266 { -0x98, &IID_IOleCommandTarget },
267 { -0x94, &IID_IServiceProvider },
268 { -0x78, &IID_IWinEventHandler },
269 { -0x74, &IID_IShellChangeNotify },
270 { -0x70, &IID_IDropTarget },
271 { -0x4, &IID_IContextMenu },
272 { 0x0, &IID_IShellFolderBand },
273 { 0x0, &IID_IUnknown },
274 { 0x94, &IID_IFolderBandPriv },
275 }
276 },
277 {
278 ID_NAME(CLSID_SendToMenu),
279 {
280 { -0x4, &IID_IContextMenu3 },
281 { -0x4, &IID_IContextMenu2 },
282 { -0x4, &IID_IContextMenu },
283 { 0x0, &IID_IShellExtInit },
284 { 0x0, &IID_IUnknown },
285 { 0x4, &IID_IOleWindow },
286 }
287 },
288 {
289 ID_NAME(CLSID_Shell),
290 {
291 { 0x0, &IID_IShellDispatch4 },
292 { 0x0, &IID_IShellDispatch3 },
293 { 0x0, &IID_IShellDispatch2 },
294 { 0x0, &IID_IShellDispatch },
295 { 0x0, &IID_IDispatch },
296 { 0x0, &IID_IUnknown },
297 { 0x4, &IID_IObjectSafety },
298 { 0x20, &IID_IObjectWithSite },
299 }
300 },
301 {
302 ID_NAME(CLSID_ShellDesktop),
303 {
304 { -0x8, &CLSID_ShellDesktop },
305 { -0x8, &IID_IObjectWithSite },
306 { 0x0, &IID_IUnknown },
307 { 0x4, &IID_IStorage },
308 { 0x8, &IID_IPersistFolder2 },
309 { 0x8, &IID_IPersistFolder },
310 { 0x8, &IID_IPersist },
311 { 0xc, &IID_IShellIcon },
312 { 0x14, &IID_IContextMenuCB },
313 { 0x20, &IID_IOleCommandTarget },
314 { FARAWY, &IID_IShellFolder2 },
315 { FARAWY, &IID_IShellFolder },
316 }
317 },
318 {
319 ID_NAME(CLSID_ShellFSFolder),
320 {
321 { 0x0, &IID_IUnknown },
322 { 0xc, &IID_IShellFolder2 },
323 { 0xc, &IID_IShellFolder },
324 { 0x10, &IID_IShellIcon },
325 { 0x18, &IID_IPersistFolder3 },
326 { 0x18, &IID_IPersistFolder2 },
327 { 0x18, &IID_IPersistFolder },
328 { 0x18, &IID_IPersist },
329 { 0x1c, &IID_IStorage },
330 { 0x2c, &IID_IContextMenuCB },
331 { 0x34, &IID_IOleCommandTarget },
332 }
333 },
334 {
335 ID_NAME(CLSID_ShellFldSetExt),
336 {
337 { 0x0, &IID_IShellPropSheetExt },
338 { 0x0, &IID_IUnknown },
339 { 0x4, &IID_IShellExtInit },
340 { 0x8, &IID_IObjectWithSite },
341 }
342 },
343 {
344 ID_NAME(CLSID_ShellFolderView),
345 {
346 { 0x0, &IID_IShellFolderViewDual2 },
347 { 0x0, &IID_IShellFolderViewDual },
348 { 0x0, &IID_IDispatch },
349 { 0x0, &IID_IUnknown },
350 { 0x4, &IID_IShellService },
351 { 0x8, &IID_IServiceProvider },
352 { 0xc, &IID_IObjectSafety },
353 { 0x14, &IID_IObjectWithSite },
354 }
355 },
356 {
357 ID_NAME(CLSID_ShellFolderViewOC),
358 {
359 { 0x0, &IID_IFolderViewOC },
360 { 0x0, &IID_IDispatch },
361 { 0x0, &IID_IUnknown },
362 { 0x8, &IID_IObjectSafety },
363 { 0x88, &IID_IPersistStreamInit },
364 { 0x88, &IID_IPersist },
365 { 0x90, &IID_IOleObject },
366 { 0x94, &IID_IOleInPlaceActiveObject },
367 { 0x98, &IID_IOleInPlaceObjectWindowless },
368 { 0x98, &IID_IOleInPlaceObject },
369 { 0x98, &IID_IOleWindow },
370 }
371 },
372 {
373 ID_NAME(CLSID_ShellItem),
374 {
375 { 0x0, &IID_IShellItem },
376 { 0x0, &IID_IUnknown },
377 { 0x4, &IID_IPersistIDList },
378 }
379 },
380 {
381 ID_NAME(CLSID_ShellLink),
382 {
383 { 0x0, &IID_IShellLinkA },
384 { 0x0, &IID_IUnknown },
385 { 0x4, &IID_IShellLinkW },
386 { 0x8, &IID_IPersistStream },
387 { 0xc, &IID_IPersistFile },
388 { 0x10, &IID_IShellExtInit },
389 { 0x14, &IID_IContextMenu3 },
390 { 0x14, &IID_IContextMenu2 },
391 { 0x14, &IID_IContextMenu },
392 { 0x18, &IID_IDropTarget },
393 { 0x1c, &IID_IQueryInfo },
394 { 0x24, &IID_IExtractIconA },
395 { 0x28, &IID_IExtractIconW },
396 { 0x2c, &IID_IExtractImage2 },
397 { 0x2c, &IID_IExtractImage },
398 { 0x30, &IID_IPersistPropertyBag },
399 { 0x34, &IID_IServiceProvider },
400 { 0x3c, &IID_IObjectWithSite },
401 }
402 },
403 #if 0 // Apparently we can only get this through Folder.Items().GetLink
404 {
405 ID_NAME(CLSID_ShellLinkObject),
406 {
407 { 0x0, &IID_IUnknown },
408 }
409 },
410 #endif
411 {
412 ID_NAME(CLSID_StartMenu),
413 {
414 { -0x48, &IID_IOleCommandTarget },
415 { -0x44, &IID_IServiceProvider },
416 { -0x40, &IID_IDeskBar },
417 { -0x40, &IID_IOleWindow },
418 { -0x3c, &IID_IInputObjectSite },
419 { -0x38, &IID_IInputObject },
420 { 0x0, &IID_IMenuPopup },
421 { 0x0, &IID_IUnknown },
422 { 0x4, &IID_IObjectWithSite },
423 { 0x8, &IID_IBanneredBar },
424 { 0xc, &IID_IInitializeObject },
425 }
426 },
427 {
428 ID_NAME(CLSID_StartMenuPin),
429 {
430 { 0x0, &IID_IShellExtInit },
431 { 0x0, &IID_IUnknown },
432 { 0x4, &IID_IContextMenu },
433 { 0xc, &IID_IObjectWithSite },
434 }
435 },
436 {
437 ID_NAME(CLSID_TrackShellMenu),
438 {
439 { 0x0, &IID_ITrackShellMenu },
440 { 0x0, &IID_IShellMenu },
441 { 0x0, &IID_IUnknown },
442 { 0x4, &IID_IShellMenu2 },
443 { 0x8, &IID_IObjectWithSite },
444 { 0xc, &IID_IServiceProvider },
445 }
446 },
447 };
448 static const INT ExpectedInterfaceCount = RTL_NUMBER_OF(ExpectedInterfaces);
449
450 START_TEST(shell32)
451 {
452 TestClasses(L"shell32", ExpectedInterfaces, ExpectedInterfaceCount);
453 }