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