21a5f4762fbdfcac52347651bd93c4f4a1d56999
[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_CDBurn),
17 {
18 { 0x0, &IID_IObjectWithSite },
19 { 0x0, &IID_IUnknown },
20 { 0x8, &IID_IShellExtInit },
21 { 0xc, &IID_IContextMenu },
22 { 0x10, &IID_IShellPropSheetExt },
23 { 0x18, &IID_IDropTarget },
24 { 0x1c, &IID_IPersistFile },
25 { 0x20, &IID_IOleCommandTarget },
26 { 0x24, &IID_ICDBurn },
27 { 0x2c, &IID_IPersistPropertyBag },
28 { 0x34, &IID_INamespaceWalkCB },
29 { 0x3c, &IID_IServiceProvider },
30 }
31 },
32 {
33 ID_NAME(CLSID_ControlPanel),
34 {
35 { 0x0, &IID_IUnknown },
36 { 0x10, &IID_IPersistFolder2 },
37 { 0x10, &IID_IPersistFolder },
38 { 0x10, &IID_IPersist },
39 { FARAWY, &IID_IShellIconOverlay },
40 { FARAWY, &IID_IShellFolder2 },
41 { FARAWY, &IID_IShellFolder },
42 }
43 },
44 {
45 ID_NAME(CLSID_CopyToMenu),
46 {
47 { 0x0, &IID_IContextMenu3 },
48 { 0x0, &IID_IContextMenu2 },
49 { 0x0, &IID_IContextMenu },
50 { 0x0, &IID_IUnknown },
51 { 0x4, &IID_IShellExtInit },
52 { 0x8, &IID_IObjectWithSite },
53 { 0x10, &IID_IFolderFilter },
54 }
55 },
56 {
57 ID_NAME(CLSID_DeskMovr),
58 {
59 { 0x0, &IID_IUnknown },
60 { 0x70, &IID_IDeskMovr },
61 { 0x74, &IID_IOleObject },
62 { 0x78, &IID_IPersistPropertyBag },
63 { 0x80, &IID_IOleInPlaceActiveObject },
64 { 0x84, &IID_IViewObjectEx },
65 { 0x84, &IID_IViewObject2 },
66 { 0x84, &IID_IViewObject },
67 { 0x88, &IID_IOleWindow },
68 { 0x88, &IID_IOleInPlaceObject },
69 { 0x88, &IID_IOleInPlaceObjectWindowless },
70 }
71 },
72 {
73 ID_NAME(CLSID_DragDropHelper),
74 {
75 { 0x0, &IID_IDragSourceHelper },
76 { 0x0, &IID_IUnknown },
77 { 0x4, &IID_IDropTargetHelper },
78 }
79 },
80 {
81 ID_NAME(CLSID_FadeTask),
82 {
83 { 0x0, &IID_IUnknown },
84 }
85 },
86 {
87 ID_NAME(CLSID_FileSearchBand),
88 {
89 { 0x0, &IID_IFileSearchBand },
90 { 0x0, &IID_IDispatch },
91 { 0x0, &IID_IUnknown },
92 { 0x4, &IID_IObjectWithSite },
93 { 0x8, &IID_IPersistStream },
94 { 0x8, &IID_IPersist },
95 { 0xc, &IID_IDeskBand },
96 { 0xc, &IID_IDockingWindow },
97 { 0xc, &IID_IOleWindow },
98 { 0x10, &IID_IInputObject },
99 { 0x18, &IID_IOleInPlaceSite },
100 }
101 },
102 {
103 ID_NAME(CLSID_FolderItem),
104 {
105 //{ 0x0, &CLSID_ShellFolderItem }, // broken QueryInterface that doesn't add a reference
106 { 0x0, &IID_FolderItem2 },
107 { 0x0, &IID_FolderItem },
108 { 0x0, &IID_IDispatch },
109 { 0x0, &IID_IUnknown },
110 { 0x4, &IID_IPersistFolder2 },
111 { 0x4, &IID_IPersistFolder },
112 { 0x4, &IID_IPersist },
113 { 0x8, &IID_IObjectSafety },
114 }
115 },
116 {
117 ID_NAME(CLSID_FolderItemsFDF),
118 {
119 { 0x0, &IID_FolderItems3 },
120 //{ 0x0, &IID_FolderItems2 }, ????
121 { 0x0, &IID_FolderItems },
122 { 0x0, &IID_IDispatch },
123 { 0x0, &IID_IUnknown },
124 { 0x4, &IID_IPersistFolder },
125 { 0x8, &IID_IObjectSafety },
126 }
127 },
128 {
129 ID_NAME(CLSID_FolderShortcut),
130 {
131 { 0x0, &IID_IShellFolder2 },
132 { 0x0, &IID_IShellFolder },
133 { 0x0, &IID_IUnknown },
134 { 0x4, &IID_IPersistFolder3 },
135 { 0x4, &IID_IPersistFolder2 },
136 { 0x4, &IID_IPersistFolder },
137 { 0x4, &IID_IPersist },
138 { 0x8, &IID_IShellLinkA },
139 { 0xc, &IID_IShellLinkW },
140 { 0x10, &IID_IPersistFile },
141 { 0x14, &IID_IExtractIconW },
142 { 0x18, &IID_IQueryInfo },
143 { 0x20, &IID_IPersistStream },
144 { 0x20, &IID_IPersistStreamInit },
145 { 0x24, &IID_IPersistPropertyBag },
146 { 0x28, &IID_IBrowserFrameOptions },
147 }
148 },
149 {
150 ID_NAME(CLSID_FolderViewHost),
151 {
152 { 0x0, &IID_IFolderViewHost },
153 { 0x0, &IID_IUnknown },
154 { 0x4, &IID_IServiceProvider },
155 { 0x8, &IID_IOleWindow },
156 { 0xc, &IID_IFolderView },
157 { 0x10, &IID_IObjectWithSite },
158 }
159 },
160 {
161 ID_NAME(CLSID_ISFBand),
162 {
163 { -0xac, &IID_IDeskBand },
164 { -0xac, &IID_IDockingWindow },
165 { -0xac, &IID_IOleWindow },
166 { -0xa8, &IID_IObjectWithSite },
167 { -0xa0, &IID_IInputObject },
168 { -0x9c, &IID_IPersistStream },
169 { -0x9c, &IID_IPersist },
170 { -0x98, &IID_IOleCommandTarget },
171 { -0x94, &IID_IServiceProvider },
172 { -0x78, &IID_IWinEventHandler },
173 { -0x74, &IID_IShellChangeNotify },
174 { -0x70, &IID_IDropTarget },
175 { -0x4, &IID_IContextMenu },
176 { 0x0, &IID_IShellFolderBand },
177 { 0x0, &IID_IUnknown },
178 { 0x94, &IID_IFolderBandPriv },
179 }
180 },
181 {
182 ID_NAME(CLSID_MenuBand),
183 {
184 { -0x30, &IID_IDeskBand },
185 { -0x30, &IID_IDockingWindow },
186 { -0x30, &IID_IOleWindow },
187 { -0x2c, &IID_IObjectWithSite },
188 { -0x24, &IID_IInputObject },
189 { -0x20, &IID_IPersistStream },
190 { -0x20, &IID_IPersist },
191 { -0x1c, &IID_IOleCommandTarget },
192 { -0x18, &IID_IServiceProvider },
193 { 0x0, &IID_IMenuPopup },
194 { 0x0, &IID_IDeskBar },
195 { 0x0, &IID_IUnknown },
196 { 0x4, &IID_IMenuBand },
197 { 0x8, &IID_IShellMenu2 },
198 { 0x8, &IID_IShellMenu },
199 { 0xc, &IID_IWinEventHandler },
200 { 0x10, &IID_IShellMenuAcc },
201 }
202 },
203 {
204 ID_NAME(CLSID_MenuBandSite),
205 {
206 { 0x0, &IID_IBandSite },
207 { 0x0, &IID_IUnknown },
208 { 0x4, &IID_IDeskBarClient },
209 { 0x4, &IID_IOleWindow },
210 { 0x8, &IID_IOleCommandTarget },
211 { 0xc, &IID_IInputObject },
212 { 0x10, &IID_IInputObjectSite },
213 { 0x14, &IID_IWinEventHandler },
214 { 0x18, &IID_IServiceProvider },
215 }
216 },
217 {
218 ID_NAME(CLSID_MenuDeskBar),
219 {
220 { -0x48, &IID_IOleCommandTarget },
221 { -0x44, &IID_IServiceProvider },
222 { -0x40, &IID_IDeskBar },
223 { -0x40, &IID_IOleWindow },
224 { -0x3c, &IID_IInputObjectSite },
225 { -0x38, &IID_IInputObject },
226 { 0x0, &IID_IMenuPopup },
227 { 0x0, &IID_IUnknown },
228 { 0x4, &IID_IObjectWithSite },
229 { 0x8, &IID_IBanneredBar },
230 { 0xc, &IID_IInitializeObject },
231 }
232 },
233 #if 0 // This is registered to shell32, but can't be instanciated
234 {
235 ID_NAME(CLSID_MenuToolbarBase),
236 {
237 { 0x0, &IID_IUnknown },
238 }
239 },
240 #endif
241 {
242 ID_NAME(CLSID_MergedFolder),
243 {
244 { -0x8, &IID_IShellFolder2 },
245 { -0x4, &IID_IStorage },
246 { 0x0, &IID_IAugmentedShellFolder2 },
247 { 0x0, &IID_IAugmentedShellFolder },
248 { 0x0, &IID_IShellFolder },
249 { 0x0, &IID_IUnknown },
250 { 0x4, &IID_IShellService },
251 { 0x8, &IID_ITranslateShellChangeNotify },
252 { 0xc, &IID_IPersistFolder2 },
253 { 0xc, &IID_IPersistFolder },
254 { 0xc, &IID_IPersist },
255 { 0x10, &IID_IPersistPropertyBag },
256 { 0x14, &IID_IShellIconOverlay },
257 }
258 },
259 {
260 ID_NAME(CLSID_MoveToMenu),
261 {
262 { 0x0, &IID_IContextMenu3 },
263 { 0x0, &IID_IContextMenu2 },
264 { 0x0, &IID_IContextMenu },
265 { 0x0, &IID_IUnknown },
266 { 0x4, &IID_IShellExtInit },
267 { 0x8, &IID_IObjectWithSite },
268 { 0x10, &IID_IFolderFilter },
269 }
270 },
271 {
272 ID_NAME(CLSID_MyComputer),
273 {
274 { 0x0, &IID_IUnknown },
275 { 0x10, &IID_IPersistFolder2 },
276 { 0x10, &IID_IPersistFolder },
277 { 0x10, &IID_IPersist },
278 { 0x10, &IID_IPersistFreeThreadedObject },
279 { FARAWY, &IID_IShellIconOverlay },
280 { FARAWY, &IID_IShellFolder2 },
281 { FARAWY, &IID_IShellFolder },
282 }
283 },
284 {
285 ID_NAME(CLSID_MyDocuments),
286 {
287 { -0x4, &IID_IPersistFolder },
288 { -0x4, &IID_IPersist },
289 { 0x0, &IID_IShellFolder2 },
290 { 0x0, &IID_IShellFolder },
291 { 0x0, &IID_IUnknown },
292 { 0x4, &IID_IShellIconOverlay },
293 { FARAWY, &IID_IShellIcon },
294 { FARAWY, &IID_IPersistFolder3 },
295 { FARAWY, &IID_IPersistFolder2 },
296 { FARAWY, &IID_IStorage },
297 { FARAWY, &IID_IContextMenuCB },
298 { FARAWY, &IID_IOleCommandTarget },
299 }
300 },
301 {
302 ID_NAME(CLSID_NetworkPlaces),
303 {
304 { 0x0, &IID_IUnknown },
305 { 0x10, &IID_IPersistFolder3 },
306 { 0x10, &IID_IPersistFolder2 },
307 { 0x10, &IID_IPersistFolder },
308 { 0x10, &IID_IPersist },
309 { 0x10, &IID_IPersistFreeThreadedObject },
310 { FARAWY, &IID_IShellIconOverlay },
311 { FARAWY, &IID_IShellFolder2 },
312 { FARAWY, &IID_IShellFolder },
313 }
314 },
315 {
316 ID_NAME(CLSID_NewMenu),
317 {
318 { -0xc, &IID_IObjectWithSite },
319 { -0x4, &IID_IContextMenu3 },
320 { -0x4, &IID_IContextMenu2 },
321 { -0x4, &IID_IContextMenu },
322 { 0x0, &IID_IShellExtInit },
323 { 0x0, &IID_IUnknown },
324 }
325 },
326 {
327 ID_NAME(CLSID_PersonalStartMenu),
328 {
329 { -0x30, &IID_IDeskBand },
330 { -0x30, &IID_IDockingWindow },
331 { -0x30, &IID_IOleWindow },
332 { -0x2c, &IID_IObjectWithSite },
333 { -0x24, &IID_IInputObject },
334 { -0x20, &IID_IPersistStream },
335 { -0x20, &IID_IPersist },
336 { -0x1c, &IID_IOleCommandTarget },
337 { -0x18, &IID_IServiceProvider },
338 { 0x0, &IID_IMenuPopup },
339 { 0x0, &IID_IDeskBar },
340 { 0x0, &IID_IUnknown },
341 { 0x4, &IID_IMenuBand },
342 { 0x8, &IID_IShellMenu2 },
343 { 0x8, &IID_IShellMenu },
344 { 0xc, &IID_IWinEventHandler },
345 { 0x10, &IID_IShellMenuAcc },
346 }
347 },
348 {
349 ID_NAME(CLSID_Printers),
350 {
351 { -0xc, &IID_IRemoteComputer },
352 { 0x0, &IID_IShellFolder2 },
353 { 0x0, &IID_IShellFolder },
354 { 0x0, &IID_IUnknown },
355 { 0x4, &IID_IPersistFolder2 },
356 { 0x4, &IID_IPersistFolder },
357 { 0x4, &IID_IPersist },
358 { 0x8, &IID_IContextMenuCB },
359 { 0xc, &IID_IShellIconOverlay },
360 }
361 },
362 {
363 ID_NAME(CLSID_QueryAssociations),
364 {
365 { 0x0, &IID_IUnknown },
366 { 0x8, &IID_IQueryAssociations },
367 }
368 },
369 {
370 ID_NAME(CLSID_QuickLinks),
371 {
372 { -0xac, &IID_IDeskBand },
373 { -0xac, &IID_IDockingWindow },
374 { -0xac, &IID_IOleWindow },
375 { -0xa8, &IID_IObjectWithSite },
376 { -0xa0, &IID_IInputObject },
377 { -0x9c, &IID_IPersistStream },
378 { -0x9c, &IID_IPersist },
379 { -0x98, &IID_IOleCommandTarget },
380 { -0x94, &IID_IServiceProvider },
381 { -0x78, &IID_IWinEventHandler },
382 { -0x74, &IID_IShellChangeNotify },
383 { -0x70, &IID_IDropTarget },
384 { -0x4, &IID_IContextMenu },
385 { 0x0, &IID_IShellFolderBand },
386 { 0x0, &IID_IUnknown },
387 { 0x94, &IID_IFolderBandPriv },
388 }
389 },
390 {
391 ID_NAME(CLSID_RecycleBin),
392 {
393 { 0x0, &IID_IPersistFolder2 },
394 { 0x0, &IID_IPersistFolder },
395 //{ 0x0, &IID_IPersist },
396 { 0x0, &IID_IUnknown },
397 { 0x4, &IID_IShellFolder2 },
398 { 0x4, &IID_IShellFolder },
399 { 0x8, &IID_IContextMenu },
400 { 0xc, &IID_IShellPropSheetExt },
401 { 0x10, &IID_IShellExtInit },
402 }
403 },
404 {
405 ID_NAME(CLSID_SendToMenu),
406 {
407 { -0x4, &IID_IContextMenu3 },
408 { -0x4, &IID_IContextMenu2 },
409 { -0x4, &IID_IContextMenu },
410 { 0x0, &IID_IShellExtInit },
411 { 0x0, &IID_IUnknown },
412 { 0x4, &IID_IOleWindow },
413 }
414 },
415 {
416 ID_NAME(CLSID_Shell),
417 {
418 { 0x0, &IID_IShellDispatch4 },
419 { 0x0, &IID_IShellDispatch3 },
420 { 0x0, &IID_IShellDispatch2 },
421 { 0x0, &IID_IShellDispatch },
422 { 0x0, &IID_IDispatch },
423 { 0x0, &IID_IUnknown },
424 { 0x4, &IID_IObjectSafety },
425 { 0x20, &IID_IObjectWithSite },
426 }
427 },
428 {
429 ID_NAME(CLSID_ShellDesktop),
430 {
431 { -0x8, &CLSID_ShellDesktop },
432 { -0x8, &IID_IObjectWithSite },
433 { 0x0, &IID_IUnknown },
434 { 0x4, &IID_IStorage },
435 { 0x8, &IID_IPersistFolder2 },
436 { 0x8, &IID_IPersistFolder },
437 { 0x8, &IID_IPersist },
438 { 0xc, &IID_IShellIcon },
439 { 0x14, &IID_IContextMenuCB },
440 { 0x18, &IID_ITranslateShellChangeNotify },
441 { 0x20, &IID_IOleCommandTarget },
442 { FARAWY, &IID_IShellIconOverlay },
443 { FARAWY, &IID_IShellFolder2 },
444 { FARAWY, &IID_IShellFolder },
445 }
446 },
447 {
448 ID_NAME(CLSID_ShellFSFolder),
449 {
450 { 0x0, &IID_IUnknown },
451 { 0xc, &IID_IShellFolder2 },
452 { 0xc, &IID_IShellFolder },
453 { 0x10, &IID_IShellIcon },
454 { 0x14, &IID_IShellIconOverlay },
455 { 0x18, &IID_IPersistFolder3 },
456 { 0x18, &IID_IPersistFolder2 },
457 { 0x18, &IID_IPersistFolder },
458 { 0x18, &IID_IPersist },
459 { 0x18, &IID_IPersistFreeThreadedObject },
460 { 0x1c, &IID_IStorage },
461 { 0x2c, &IID_IContextMenuCB },
462 { 0x34, &IID_IOleCommandTarget },
463 }
464 },
465 {
466 ID_NAME(CLSID_ShellFldSetExt),
467 {
468 { 0x0, &IID_IShellPropSheetExt },
469 { 0x0, &IID_IUnknown },
470 { 0x4, &IID_IShellExtInit },
471 { 0x8, &IID_IObjectWithSite },
472 }
473 },
474 {
475 ID_NAME(CLSID_ShellFolderView),
476 {
477 { 0x0, &IID_IShellFolderViewDual2 },
478 { 0x0, &IID_IShellFolderViewDual },
479 { 0x0, &IID_IDispatch },
480 { 0x0, &IID_IUnknown },
481 { 0x4, &IID_IShellService },
482 { 0x8, &IID_IServiceProvider },
483 { 0xc, &IID_IObjectSafety },
484 { 0x14, &IID_IObjectWithSite },
485 }
486 },
487 {
488 ID_NAME(CLSID_ShellFolderViewOC),
489 {
490 { 0x0, &IID_IFolderViewOC },
491 { 0x0, &IID_IDispatch },
492 { 0x0, &IID_IUnknown },
493 { 0x8, &IID_IObjectSafety },
494 { 0x88, &IID_IPersistStreamInit },
495 { 0x88, &IID_IPersist },
496 { 0x90, &IID_IOleObject },
497 { 0x94, &IID_IOleInPlaceActiveObject },
498 { 0x98, &IID_IOleInPlaceObjectWindowless },
499 { 0x98, &IID_IOleInPlaceObject },
500 { 0x98, &IID_IOleWindow },
501 }
502 },
503 {
504 ID_NAME(CLSID_ShellItem),
505 {
506 { 0x0, &IID_IShellItem },
507 { 0x0, &IID_IUnknown },
508 { 0x4, &IID_IPersistIDList },
509 }
510 },
511 {
512 ID_NAME(CLSID_ShellLink),
513 {
514 { 0x0, &IID_IShellLinkA },
515 { 0x0, &IID_IUnknown },
516 { 0x4, &IID_IShellLinkW },
517 { 0x8, &IID_IPersistStream },
518 { 0xc, &IID_IPersistFile },
519 { 0x10, &IID_IShellExtInit },
520 { 0x14, &IID_IContextMenu3 },
521 { 0x14, &IID_IContextMenu2 },
522 { 0x14, &IID_IContextMenu },
523 { 0x18, &IID_IDropTarget },
524 { 0x1c, &IID_IQueryInfo },
525 { 0x20, &IID_IShellLinkDataList },
526 { 0x24, &IID_IExtractIconA },
527 { 0x28, &IID_IExtractIconW },
528 { 0x2c, &IID_IExtractImage2 },
529 { 0x2c, &IID_IExtractImage },
530 { 0x30, &IID_IPersistPropertyBag },
531 { 0x34, &IID_IServiceProvider },
532 { 0x3c, &IID_IObjectWithSite },
533 }
534 },
535 #if 0 // Apparently we can only get this through Folder.Items().GetLink
536 {
537 ID_NAME(CLSID_ShellLinkObject),
538 {
539 { 0x0, &IID_IUnknown },
540 }
541 },
542 #endif
543 {
544 ID_NAME(CLSID_StartMenu),
545 {
546 { -0x48, &IID_IOleCommandTarget },
547 { -0x44, &IID_IServiceProvider },
548 { -0x40, &IID_IDeskBar },
549 { -0x40, &IID_IOleWindow },
550 { -0x3c, &IID_IInputObjectSite },
551 { -0x38, &IID_IInputObject },
552 { 0x0, &IID_IMenuPopup },
553 { 0x0, &IID_IUnknown },
554 { 0x4, &IID_IObjectWithSite },
555 { 0x8, &IID_IBanneredBar },
556 { 0xc, &IID_IInitializeObject },
557 }
558 },
559 {
560 ID_NAME(CLSID_StartMenuPin),
561 {
562 { 0x0, &IID_IShellExtInit },
563 { 0x0, &IID_IUnknown },
564 { 0x4, &IID_IContextMenu },
565 { 0xc, &IID_IObjectWithSite },
566 }
567 },
568 {
569 ID_NAME(CLSID_TrackShellMenu),
570 {
571 { 0x0, &IID_ITrackShellMenu },
572 { 0x0, &IID_IShellMenu },
573 { 0x0, &IID_IUnknown },
574 { 0x4, &IID_IShellMenu2 },
575 { 0x8, &IID_IObjectWithSite },
576 { 0xc, &IID_IServiceProvider },
577 }
578 },
579 };
580 static const INT ExpectedInterfaceCount = RTL_NUMBER_OF(ExpectedInterfaces);
581
582 START_TEST(shell32)
583 {
584 TestClasses(L"shell32", ExpectedInterfaces, ExpectedInterfaceCount);
585 }