2013-07-07 09:10:31 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS api tests
|
|
|
|
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
|
|
|
* PURPOSE: COM interface test
|
2013-10-12 16:05:54 +00:00
|
|
|
* PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
|
2013-07-07 09:10:31 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "com_apitest.h"
|
|
|
|
|
2017-12-18 12:21:47 +00:00
|
|
|
#include <winreg.h>
|
2017-12-12 12:01:03 +00:00
|
|
|
#include <mshtmhst.h>
|
|
|
|
#include <shlwapi.h>
|
|
|
|
#include <commoncontrols.h>
|
|
|
|
#include <activscp.h>
|
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
|
2013-07-07 09:10:31 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
#define myskip(c, ...) ((c) ? 0 : (skip(__VA_ARGS__), 1))
|
|
|
|
#define mytrace(...) do { \
|
|
|
|
int debug = winetest_debug; \
|
|
|
|
winetest_debug = 1; \
|
|
|
|
trace(__VA_ARGS__); \
|
|
|
|
winetest_debug = debug; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
typedef struct _KNOWN_INTERFACE
|
|
|
|
{
|
|
|
|
const IID *iid;
|
|
|
|
PCSTR name;
|
2014-03-21 11:45:30 +00:00
|
|
|
PCWSTR wname;
|
|
|
|
BOOLEAN noreg;
|
2013-07-07 09:10:31 +00:00
|
|
|
} KNOWN_INTERFACE;
|
|
|
|
typedef const KNOWN_INTERFACE *PCKNOWN_INTERFACE;
|
|
|
|
|
|
|
|
#undef ID_NAME
|
2014-03-21 11:45:30 +00:00
|
|
|
#define ID_NAME(c) &c, #c, L ## #c
|
2013-07-07 09:10:31 +00:00
|
|
|
static KNOWN_INTERFACE KnownInterfaces[] =
|
|
|
|
{
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IACList), TRUE },
|
|
|
|
{ ID_NAME(IID_IACList2), TRUE },
|
|
|
|
{ ID_NAME(IID_IADesktopP2), TRUE },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IAccIdentity) },
|
|
|
|
{ ID_NAME(IID_IAccPropServer) },
|
|
|
|
{ ID_NAME(IID_IAccPropServices) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IAccessible) },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IAccessibleHandler) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IAccessControl), TRUE },
|
|
|
|
{ ID_NAME(IID_IAccessor) },
|
2018-03-02 13:14:53 +00:00
|
|
|
{ ID_NAME(IID_IACLCustomMRU), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IActiveDesktop), TRUE },
|
|
|
|
{ ID_NAME(IID_IActiveDesktopP), TRUE },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_IActionProgress) },
|
|
|
|
{ ID_NAME(IID_IActionProgressDialog) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IAddressBarParser), TRUE },
|
|
|
|
{ ID_NAME(IID_IAddressBand), TRUE },
|
|
|
|
{ ID_NAME(IID_IAddressEditBox), TRUE },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_IAsyncMoniker), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IAugmentedShellFolder), TRUE },
|
|
|
|
{ ID_NAME(IID_IAugmentedShellFolder2), TRUE },
|
|
|
|
{ ID_NAME(IID_IAutoComplete), TRUE },
|
|
|
|
{ ID_NAME(IID_IAutoComplete2), TRUE },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_IAutoCompleteDropDown) },
|
|
|
|
{ ID_NAME(IID_IBandHost) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IBandNavigate), },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IBandProxy), TRUE },
|
|
|
|
{ ID_NAME(IID_IBandSite) },
|
|
|
|
{ ID_NAME(IID_IBandSiteHelper), TRUE },
|
|
|
|
{ ID_NAME(IID_IBanneredBar), TRUE },
|
|
|
|
{ ID_NAME(IID_IBindCtx) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IBindEventHandler) },
|
|
|
|
{ ID_NAME(IID_IBindHost) },
|
|
|
|
{ ID_NAME(IID_IBinding) },
|
|
|
|
{ ID_NAME(IID_IBindProtocol), TRUE },
|
|
|
|
{ ID_NAME(IID_IBindResource) },
|
|
|
|
{ ID_NAME(IID_IBindStatusCallback) },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_IBlockingLock) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IBrowserFrameOptions), TRUE },
|
|
|
|
{ ID_NAME(IID_IBrowserService) },
|
|
|
|
{ ID_NAME(IID_IBrowserService2), TRUE },
|
|
|
|
{ ID_NAME(IID_IBrowserService3), TRUE },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IBrowserService4), TRUE },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_ICDBurn) },
|
|
|
|
{ ID_NAME(IID_ICDBurnExt) },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_ICDBurnPriv) },
|
2016-04-09 09:18:57 +00:00
|
|
|
{ ID_NAME(IID_ICallFactory), TRUE },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_ICancelMethodCalls), TRUE },
|
2016-04-10 09:40:16 +00:00
|
|
|
{ ID_NAME(IID_ICatInformation) },
|
|
|
|
{ ID_NAME(IID_ICatRegister) },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_IClassActivator), },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IClassFactory) },
|
|
|
|
{ ID_NAME(IID_IClassFactory2) },
|
|
|
|
{ ID_NAME(IID_IClassFactory3), TRUE },
|
|
|
|
{ ID_NAME(IID_IClientSecurity), TRUE },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_ICommDlgBrowser) },
|
|
|
|
{ ID_NAME(IID_ICommDlgBrowser2) },
|
|
|
|
{ ID_NAME(IID_ICommDlgBrowser3) },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_ICompositeFolder) },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_IComputerInfoChangeNotify), },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IComThreadingInfo), TRUE },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_IConnectionPoint) },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IConnectionPointContainer) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IContext), TRUE },
|
|
|
|
{ ID_NAME(IID_IContextMenu), TRUE },
|
|
|
|
{ ID_NAME(IID_IContextMenu2), TRUE },
|
|
|
|
{ ID_NAME(IID_IContextMenu3), TRUE },
|
|
|
|
{ ID_NAME(IID_IContextMenuCB), TRUE },
|
|
|
|
{ ID_NAME(IID_IContextMenuSite) },
|
|
|
|
{ ID_NAME(IID_IContinue) },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_IContinueCallback) },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_ICopyHookA), TRUE },
|
|
|
|
{ ID_NAME(IID_ICopyHookW), TRUE },
|
2016-05-15 14:45:01 +00:00
|
|
|
{ ID_NAME(IID_ICurrentWorkingDirectory), TRUE },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_ICustomizeInfoTip) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IDVGetEnum), TRUE },
|
|
|
|
{ ID_NAME(IID_IDataObject) },
|
|
|
|
//{ ID_NAME(IID_IDefViewID) }, == DefViewFrame3
|
|
|
|
{ ID_NAME(IID_IDefViewFrame), TRUE },
|
|
|
|
{ ID_NAME(IID_IDefViewFrame3) },
|
|
|
|
{ ID_NAME(IID_IDefViewFrameGroup) },
|
|
|
|
{ ID_NAME(IID_IDefViewSafety), },
|
|
|
|
{ ID_NAME(IID_IDefViewScript), TRUE },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IDelayedRelease), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IDeskBand) },
|
|
|
|
{ ID_NAME(IID_IDeskBandEx) },
|
|
|
|
{ ID_NAME(IID_IDeskBar), TRUE },
|
|
|
|
{ ID_NAME(IID_IDeskBarClient), TRUE },
|
|
|
|
{ ID_NAME(IID_IDeskMovr), TRUE },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_IDiscMasterProgressEvents) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IDispatch) },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IDispatchEx) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IDockingWindow) },
|
|
|
|
{ ID_NAME(IID_IDockingWindowFrame), TRUE },
|
|
|
|
{ ID_NAME(IID_IDockingWindowSite), TRUE },
|
|
|
|
{ ID_NAME(IID_IDocViewSite), TRUE },
|
|
|
|
{ ID_NAME(IID_IDragSourceHelper), TRUE },
|
2018-03-02 13:14:53 +00:00
|
|
|
{ ID_NAME(IID_IDriveFolderExt), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IDropSource) },
|
|
|
|
{ ID_NAME(IID_IDropTarget) },
|
|
|
|
{ ID_NAME(IID_IDropTargetHelper), TRUE },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_IEFrameAuto) },
|
2018-03-02 13:15:08 +00:00
|
|
|
//{ ID_NAME(IID_IEnumCATID) }, == EnumGUID
|
|
|
|
//{ ID_NAME(IID_IEnumCLSID) }, == EnumGUID
|
|
|
|
{ ID_NAME(IID_IEnumCATEGORYINFO) },
|
|
|
|
{ ID_NAME(IID_IEnumConnectionPoints) },
|
|
|
|
{ ID_NAME(IID_IEnumConnections) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IEnumExtraSearch) },
|
|
|
|
{ ID_NAME(IID_IEnumGUID) },
|
|
|
|
{ ID_NAME(IID_IEnumIDList) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IEnumMoniker) },
|
2015-04-19 22:50:25 +00:00
|
|
|
//{ ID_NAME(IID_IEnumNetCfgBindingInterface) },
|
|
|
|
//{ ID_NAME(IID_IEnumNetCfgBindingPath) },
|
|
|
|
{ ID_NAME(IID_IEnumNetCfgComponent), TRUE },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IEnumNetConnection) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IEnumShellItems) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IEnumSTATSTG) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IEnumString) },
|
|
|
|
{ ID_NAME(IID_IEnumUnknown) },
|
|
|
|
{ ID_NAME(IID_IEnumVARIANT) },
|
|
|
|
{ ID_NAME(IID_IErrorLog) },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_IExplorerBrowser) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IExplorerToolbar), TRUE },
|
|
|
|
{ ID_NAME(IID_IExtractIconA), TRUE },
|
|
|
|
{ ID_NAME(IID_IExtractIconW), TRUE },
|
|
|
|
{ ID_NAME(IID_IExtractImage) },
|
|
|
|
{ ID_NAME(IID_IExtractImage2) },
|
|
|
|
{ ID_NAME(IID_IFileDialog) },
|
|
|
|
{ ID_NAME(IID_IFileDialog2), TRUE },
|
2015-02-24 12:52:18 +00:00
|
|
|
{ ID_NAME(IID_IFileOpenDialog) },
|
|
|
|
{ ID_NAME(IID_IFileSaveDialog) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IFileSearchBand) },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_IFileViewerA), TRUE },
|
|
|
|
{ ID_NAME(IID_IFileViewerSite), TRUE },
|
|
|
|
{ ID_NAME(IID_IFileViewerW), TRUE },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IFilter) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IFolderBandPriv) },
|
|
|
|
{ ID_NAME(IID_IFolderFilter) },
|
|
|
|
{ ID_NAME(IID_IFolderFilterSite) },
|
|
|
|
{ ID_NAME(IID_IFolderView) },
|
|
|
|
{ ID_NAME(IID_IFolderView2) },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_IFolderViewHost), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IFolderViewOC) },
|
|
|
|
{ ID_NAME(IID_IFolderViewSettings) },
|
2016-04-09 09:18:57 +00:00
|
|
|
{ ID_NAME(IID_IForegroundTransfer), TRUE },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IGetNameSpaceExtensionPointer),TRUE},
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IGlobalFolderSettings), TRUE },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_IHWEventHandler) },
|
|
|
|
{ ID_NAME(IID_IHWEventHandler2) },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_IHlinkFrame) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IImageList), TRUE },
|
|
|
|
{ ID_NAME(IID_IImageList2), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IInitializeObject), TRUE },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_IInitializeWithBindCtx) },
|
|
|
|
{ ID_NAME(IID_IInitializeWithFile) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IInputObject) },
|
|
|
|
{ ID_NAME(IID_IInputObjectSite) },
|
|
|
|
{ ID_NAME(IID_IInternalUnknown), TRUE },
|
2016-04-12 13:18:32 +00:00
|
|
|
{ ID_NAME(IID_IInternetSecurityManager) },
|
|
|
|
{ ID_NAME(IID_IInternetZoneManager), TRUE },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IItemNameLimits) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IMarshal) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IMarshal2), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IMenuBand), TRUE },
|
|
|
|
{ ID_NAME(IID_IMenuPopup), TRUE },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_IModalWindow) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IMoniker) },
|
|
|
|
{ ID_NAME(IID_IMultiMonitorDockingSite), TRUE },
|
|
|
|
{ ID_NAME(IID_IMultiQI), TRUE },
|
|
|
|
{ ID_NAME(IID_INameSpaceTreeControl), TRUE },
|
2016-04-09 09:18:57 +00:00
|
|
|
{ ID_NAME(IID_INamespaceProxy), TRUE },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_INamespaceWalk) },
|
|
|
|
{ ID_NAME(IID_INamespaceWalkCB) },
|
|
|
|
{ ID_NAME(IID_INamespaceWalkCB2) },
|
2015-04-19 22:50:25 +00:00
|
|
|
{ ID_NAME(IID_INetCfg), TRUE },
|
|
|
|
//{ ID_NAME(IID_INetCfgBindingInterface) },
|
|
|
|
//{ ID_NAME(IID_INetCfgBindingPath) },
|
|
|
|
{ ID_NAME(IID_INetCfgComponent), TRUE },
|
|
|
|
{ ID_NAME(IID_INetCfgComponentBindings), TRUE },
|
|
|
|
{ ID_NAME(IID_INetCfgComponentControl), TRUE },
|
|
|
|
{ ID_NAME(IID_INetCfgComponentPropertyUi), TRUE },
|
|
|
|
{ ID_NAME(IID_INetCfgLock), TRUE },
|
|
|
|
{ ID_NAME(IID_INetCfgPnpReconfigCallback), TRUE },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_INetConnectionConnectUi), TRUE },
|
|
|
|
{ ID_NAME(IID_INetConnectionPropertyUi), TRUE },
|
|
|
|
{ ID_NAME(IID_INetConnectionPropertyUi2), TRUE },
|
|
|
|
{ ID_NAME(IID_INetConnectionManager) },
|
2015-04-19 22:50:25 +00:00
|
|
|
{ ID_NAME(IID_INetLanConnectionUiInfo), TRUE },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_INewMenuClient) },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_INewShortcutHookA), TRUE },
|
|
|
|
{ ID_NAME(IID_INewShortcutHookW), TRUE },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_INewWindowManager) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_INSCTree), TRUE },
|
|
|
|
{ ID_NAME(IID_INSCTree2), TRUE },
|
|
|
|
{ ID_NAME(IID_IObjMgr), TRUE },
|
|
|
|
{ ID_NAME(IID_IObjectSafety) },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IObjectWithBackReferences) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IObjectWithSite) },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IOleClientSite) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IOleCommandTarget) },
|
2016-04-10 09:40:16 +00:00
|
|
|
{ ID_NAME(IID_IOleContainer) },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IOleControl) },
|
|
|
|
{ ID_NAME(IID_IOleControlSite) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IOleInPlaceActiveObject) },
|
|
|
|
{ ID_NAME(IID_IOleInPlaceFrame) },
|
|
|
|
{ ID_NAME(IID_IOleInPlaceObject) },
|
|
|
|
{ ID_NAME(IID_IOleInPlaceObjectWindowless), TRUE },
|
|
|
|
{ ID_NAME(IID_IOleInPlaceSite) },
|
|
|
|
{ ID_NAME(IID_IOleInPlaceSiteEx) },
|
|
|
|
{ ID_NAME(IID_IOleInPlaceSiteWindowless), TRUE },
|
|
|
|
{ ID_NAME(IID_IOleInPlaceUIWindow) },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_IOleItemContainer), },
|
|
|
|
{ ID_NAME(IID_IOleLink), },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IOleObject) },
|
|
|
|
{ ID_NAME(IID_IOleWindow) },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IParentAndItem) },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_IParseDisplayName), },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IPersist) },
|
|
|
|
{ ID_NAME(IID_IPersistFile) },
|
|
|
|
{ ID_NAME(IID_IPersistFolder) },
|
|
|
|
{ ID_NAME(IID_IPersistFolder2) },
|
|
|
|
{ ID_NAME(IID_IPersistFolder3) },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IPersistFreeThreadedObject), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IPersistHistory) },
|
|
|
|
{ ID_NAME(IID_IPersistIDList) },
|
|
|
|
{ ID_NAME(IID_IPersistMemory) },
|
|
|
|
{ ID_NAME(IID_IPersistPropertyBag) },
|
|
|
|
{ ID_NAME(IID_IPersistPropertyBag2) },
|
|
|
|
{ ID_NAME(IID_IPersistStorage) },
|
|
|
|
{ ID_NAME(IID_IPersistStream) },
|
|
|
|
{ ID_NAME(IID_IPersistStreamInit) },
|
2015-02-25 15:00:24 +00:00
|
|
|
{ ID_NAME(IID_IPreviewHandler) },
|
|
|
|
{ ID_NAME(IID_IPreviewHandlerFrame) },
|
|
|
|
{ ID_NAME(IID_IPreviewHandlerVisuals) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IProgressDialog), TRUE },
|
|
|
|
{ ID_NAME(IID_IPropertyBag) },
|
|
|
|
{ ID_NAME(IID_IPropertyBag2) },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IPropertySetStorage) },
|
|
|
|
{ ID_NAME(IID_IPropertyStore) },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IPropSheetPage), TRUE },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IProvideClassInfo) },
|
|
|
|
{ ID_NAME(IID_IProvideClassInfo2) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IQueryAssociations), TRUE },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_IQueryCancelAutoPlay) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IQueryInfo), TRUE },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_IQuickActivate) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IRegTreeOptions), TRUE },
|
2015-02-25 16:22:26 +00:00
|
|
|
{ ID_NAME(IID_IRemoteComputer) },
|
|
|
|
{ ID_NAME(IID_IResolveShellLink) },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_IROTData), },
|
2016-04-09 09:18:57 +00:00
|
|
|
{ ID_NAME(IID_IRpcOptions), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IRunnableObject) },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_IRunningObjectTable), },
|
2016-11-06 18:04:58 +00:00
|
|
|
{ ID_NAME(IID_ISLTracker), TRUE },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IScriptErrorList) },
|
|
|
|
{ ID_NAME(IID_ISearch) },
|
|
|
|
{ ID_NAME(IID_ISearchAssistantOC) },
|
|
|
|
{ ID_NAME(IID_ISearchAssistantOC2) },
|
|
|
|
{ ID_NAME(IID_ISearchAssistantOC3) },
|
2016-04-10 09:40:16 +00:00
|
|
|
{ ID_NAME(IID_ISearchBar) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_ISearches) },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_ISecMgrCacheSeedTarget) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IServerSecurity), TRUE },
|
|
|
|
{ ID_NAME(IID_IServiceProvider) },
|
2015-02-25 16:22:26 +00:00
|
|
|
{ ID_NAME(IID_IShellApp), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellBrowser) },
|
|
|
|
{ ID_NAME(IID_IShellBrowserService), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellChangeNotify), TRUE },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IShellCopyHookA), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellCopyHookW), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellDesktopTray), TRUE },
|
2015-02-25 16:22:26 +00:00
|
|
|
{ ID_NAME(IID_IShellDetails), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellDispatch) },
|
|
|
|
{ ID_NAME(IID_IShellDispatch2) },
|
|
|
|
{ ID_NAME(IID_IShellDispatch3) },
|
|
|
|
{ ID_NAME(IID_IShellDispatch4) },
|
|
|
|
{ ID_NAME(IID_IShellDispatch5), TRUE },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IShellDispatch6), TRUE },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IShellExecuteHookA), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellExecuteHookW), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellExtInit), TRUE },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IShellFavoritesNameSpace) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellFolder) },
|
|
|
|
{ ID_NAME(IID_IShellFolder2) },
|
|
|
|
{ ID_NAME(IID_IShellFolderBand), TRUE },
|
2015-02-25 16:22:26 +00:00
|
|
|
{ ID_NAME(IID_IShellFolderSearchable), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellFolderSearchableCallback), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellFolderView), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellFolderViewCB), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellFolderViewDual) },
|
|
|
|
{ ID_NAME(IID_IShellFolderViewDual2) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IShellFolderViewDual3), TRUE },
|
2015-02-25 16:22:26 +00:00
|
|
|
{ ID_NAME(IID_IShellFolderViewType), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellIcon) },
|
2015-02-25 16:22:26 +00:00
|
|
|
{ ID_NAME(IID_IShellIconOverlay), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellIconOverlayIdentifier), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellImageData), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellImageDataAbort), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellImageDataFactory), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellItem) },
|
|
|
|
{ ID_NAME(IID_IShellItem2) },
|
|
|
|
{ ID_NAME(IID_IShellItemArray) },
|
|
|
|
{ ID_NAME(IID_IShellItemFilter) },
|
|
|
|
{ ID_NAME(IID_IShellLinkA) },
|
2015-02-25 16:22:26 +00:00
|
|
|
{ ID_NAME(IID_IShellLinkDataList), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellLinkDual) },
|
|
|
|
{ ID_NAME(IID_IShellLinkDual2) },
|
|
|
|
{ ID_NAME(IID_IShellLinkW) },
|
|
|
|
{ ID_NAME(IID_IShellMenu), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellMenu2), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellMenuAcc), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellMenuCallback), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellNameSpace) },
|
2015-02-25 16:22:26 +00:00
|
|
|
{ ID_NAME(IID_IShellPropSheetExt), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellService), TRUE },
|
2015-02-24 12:52:18 +00:00
|
|
|
{ ID_NAME(IID_IShellTaskScheduler), TRUE },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IShellUIHelper) },
|
|
|
|
{ ID_NAME(IID_IShellUIHelper2), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IShellView) },
|
|
|
|
{ ID_NAME(IID_IShellView2) },
|
|
|
|
{ ID_NAME(IID_IShellView3) },
|
|
|
|
{ ID_NAME(IID_IShellWindows) },
|
2016-04-09 14:05:08 +00:00
|
|
|
{ ID_NAME(IID_ISpecifyPropertyPages) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IStorage) },
|
|
|
|
{ ID_NAME(IID_IStream) },
|
|
|
|
{ ID_NAME(IID_ISurrogate) },
|
|
|
|
{ ID_NAME(IID_ISynchronize) },
|
|
|
|
{ ID_NAME(IID_ISynchronizeContainer), TRUE },
|
|
|
|
{ ID_NAME(IID_ISynchronizeEvent), TRUE },
|
|
|
|
{ ID_NAME(IID_ISynchronizeHandle), TRUE },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_ITargetEmbedding) },
|
|
|
|
{ ID_NAME(IID_ITargetFrame) },
|
|
|
|
{ ID_NAME(IID_ITargetFrame2) },
|
|
|
|
{ ID_NAME(IID_ITargetFramePriv) },
|
|
|
|
{ ID_NAME(IID_ITargetFramePriv2) },
|
|
|
|
{ ID_NAME(IID_ITargetNotify) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_ITaskbarList) },
|
|
|
|
{ ID_NAME(IID_ITaskbarList2) },
|
2018-03-02 13:15:08 +00:00
|
|
|
{ ID_NAME(IID_ITaskbarList3), TRUE },
|
|
|
|
{ ID_NAME(IID_ITaskbarList4), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_ITrackShellMenu), TRUE },
|
2016-04-09 15:13:01 +00:00
|
|
|
/* This interface is completely different between PSDK and registry/shell32 */
|
|
|
|
{ ID_NAME(IID_ITransferAdviseSink), TRUE },
|
|
|
|
#define IID_ITransferAdviseSink IID_ITransferAdviseSinkPriv
|
|
|
|
{ ID_NAME(IID_ITransferAdviseSink) },
|
|
|
|
#undef IID_ITransferAdviseSink
|
|
|
|
{ ID_NAME(IID_ITransferDestination), TRUE },
|
|
|
|
{ ID_NAME(IID_ITransferSource), TRUE },
|
2015-02-24 12:52:18 +00:00
|
|
|
{ ID_NAME(IID_ITranslateShellChangeNotify), TRUE },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_ITrayPriv), TRUE },
|
|
|
|
{ ID_NAME(IID_ITrayPriv2), TRUE },
|
|
|
|
{ ID_NAME(IID_IUnknown) },
|
2015-04-19 21:28:09 +00:00
|
|
|
{ ID_NAME(IID_IURLSearchHook), TRUE },
|
|
|
|
{ ID_NAME(IID_IURLSearchHook2), TRUE },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_IUrlHistoryNotify) },
|
|
|
|
{ ID_NAME(IID_IUrlHistoryStg) },
|
|
|
|
{ ID_NAME(IID_IUrlHistoryStg2) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IViewObject) },
|
|
|
|
{ ID_NAME(IID_IViewObject2) },
|
|
|
|
{ ID_NAME(IID_IViewObjectEx), TRUE },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_IVisualProperties) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(IID_IWebBrowser) },
|
|
|
|
{ ID_NAME(IID_IWebBrowser2) },
|
|
|
|
{ ID_NAME(IID_IWebBrowserApp) },
|
2016-04-09 15:13:01 +00:00
|
|
|
{ ID_NAME(IID_IWebBrowserPriv) },
|
|
|
|
{ ID_NAME(IID_IWebBrowserPriv2) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(IID_IWinEventHandler), TRUE },
|
|
|
|
|
|
|
|
{ ID_NAME(IID_DFConstraint), TRUE },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(DIID__SearchAssistantEvents) },
|
2014-03-21 11:45:30 +00:00
|
|
|
{ ID_NAME(DIID_DShellFolderViewEvents) },
|
2016-04-09 09:00:44 +00:00
|
|
|
{ ID_NAME(DIID_DShellNameSpaceEvents) },
|
|
|
|
{ ID_NAME(DIID_DShellWindowsEvents) },
|
|
|
|
{ ID_NAME(DIID_DWebBrowserEvents) },
|
|
|
|
{ ID_NAME(DIID_DWebBrowserEvents2) },
|
|
|
|
{ ID_NAME(DIID_XMLDOMDocumentEvents ) },
|
2014-03-21 11:45:30 +00:00
|
|
|
|
|
|
|
{ ID_NAME(IID_CDefView), TRUE },
|
|
|
|
{ ID_NAME(IID_Folder) },
|
|
|
|
{ ID_NAME(IID_Folder2) },
|
|
|
|
{ ID_NAME(IID_Folder3) },
|
|
|
|
{ ID_NAME(IID_FolderItem) },
|
|
|
|
{ ID_NAME(IID_FolderItem2) },
|
|
|
|
{ ID_NAME(IID_FolderItems) },
|
|
|
|
{ ID_NAME(IID_FolderItems2) },
|
|
|
|
{ ID_NAME(IID_FolderItems3) },
|
|
|
|
{ ID_NAME(IID_FolderItemVerb) },
|
|
|
|
{ ID_NAME(IID_FolderItemVerbs) },
|
|
|
|
|
2016-11-06 17:17:57 +00:00
|
|
|
{ ID_NAME(CLSID_ShellDesktop), TRUE },
|
|
|
|
|
2018-02-07 01:14:07 +00:00
|
|
|
{ ID_NAME(IID_IQueryContinue) },
|
|
|
|
{ ID_NAME(IID_IUserNotification) },
|
2018-02-15 23:15:41 +00:00
|
|
|
{ ID_NAME(IID_IUserNotificationCallback) }, // On Vista+
|
|
|
|
{ ID_NAME(IID_IUserNotification2) }, // On Vista+
|
2018-02-07 01:14:07 +00:00
|
|
|
|
2018-03-02 13:14:53 +00:00
|
|
|
{ ID_NAME(IID_IAggregateFilterCondition) },
|
2016-11-06 18:04:58 +00:00
|
|
|
{ ID_NAME(IID_IAliasRegistrationCallback), TRUE },
|
|
|
|
{ ID_NAME(IID_IAssociationArrayInitialize), TRUE },
|
|
|
|
{ ID_NAME(IID_IAssociationList), TRUE },
|
|
|
|
{ ID_NAME(IID_IBackReferencedObject), TRUE },
|
|
|
|
{ ID_NAME(IID_IBasePropPage), TRUE },
|
|
|
|
{ ID_NAME(IID_ICommonLayoutDefinition), TRUE },
|
|
|
|
{ ID_NAME(IID_IControlPanelEnumerator), TRUE },
|
|
|
|
{ ID_NAME(IID_IDelegateHostItemContainer), TRUE },
|
|
|
|
{ ID_NAME(IID_IDrawPropertyControl), TRUE },
|
|
|
|
{ ID_NAME(IID_IEnumAssociationElements), TRUE },
|
|
|
|
{ ID_NAME(IID_IEnumerateAssociationElements),TRUE },
|
|
|
|
{ ID_NAME(IID_IExecuteCommand), TRUE },
|
2018-03-02 13:14:53 +00:00
|
|
|
{ ID_NAME(IID_IFilterCondition) },
|
2016-11-06 18:04:58 +00:00
|
|
|
{ ID_NAME(IID_IFolderNotify), TRUE },
|
|
|
|
{ ID_NAME(IID_IFolderProperties), TRUE },
|
|
|
|
{ ID_NAME(IID_IFolderType), TRUE },
|
|
|
|
{ ID_NAME(IID_IFolderWithSearchRoot), TRUE },
|
|
|
|
{ ID_NAME(IID_IFrameLayoutDefinition), TRUE },
|
|
|
|
{ ID_NAME(IID_IItemFilter), TRUE },
|
|
|
|
{ ID_NAME(IID_IItemFilterOwner), TRUE },
|
|
|
|
{ ID_NAME(IID_ILocalizableItemParent), TRUE },
|
|
|
|
{ ID_NAME(IID_INewItemAdvisor), TRUE },
|
|
|
|
{ ID_NAME(IID_IObjectWithAssociationElement),TRUE },
|
|
|
|
{ ID_NAME(IID_IObjectWithAssociationList), TRUE },
|
|
|
|
{ ID_NAME(IID_IObjectWithQuerySource), TRUE },
|
|
|
|
{ ID_NAME(IID_IObjectWithSelection), TRUE },
|
|
|
|
{ ID_NAME(IID_IPersistString2), TRUE },
|
|
|
|
{ ID_NAME(IID_IPrinterFolder), TRUE },
|
|
|
|
{ ID_NAME(IID_IPropertyControl), TRUE },
|
|
|
|
{ ID_NAME(IID_IPropertyControlBase), TRUE },
|
|
|
|
{ ID_NAME(IID_IPropertyControlSite), TRUE },
|
|
|
|
{ ID_NAME(IID_IRegItemCustomAttributes), TRUE },
|
|
|
|
{ ID_NAME(IID_IRegItemCustomEnumerator), TRUE },
|
|
|
|
{ ID_NAME(IID_IRegItemFolder), TRUE },
|
|
|
|
{ ID_NAME(IID_IRootAndRelativeParsingFolder),TRUE },
|
|
|
|
{ ID_NAME(IID_IScope), TRUE },
|
|
|
|
{ ID_NAME(IID_IScopeItem), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellBrowserServce), TRUE },
|
|
|
|
{ ID_NAME(IID_IShellFolder3), TRUE },
|
|
|
|
{ ID_NAME(IID_ITaskCondition), TRUE },
|
|
|
|
{ ID_NAME(IID_ITaskConditionCombiner), TRUE },
|
|
|
|
{ ID_NAME(IID_ITaskConditionInit), TRUE },
|
|
|
|
{ ID_NAME(IID_ITransferProvider), TRUE },
|
2018-03-02 13:14:53 +00:00
|
|
|
{ ID_NAME(IID_IUserEventTimer) },
|
|
|
|
{ ID_NAME(IID_IUserEventTimerCallback) },
|
2016-11-06 18:04:58 +00:00
|
|
|
{ ID_NAME(IID_IAssociationArrayOld), TRUE },
|
|
|
|
{ ID_NAME(IID_IAssociationArray), TRUE },
|
2018-03-02 13:14:53 +00:00
|
|
|
#define IID_IDriveFolderExt IID_IDriveFolderExtOld
|
|
|
|
{ ID_NAME(IID_IDriveFolderExt) },
|
|
|
|
#undef IID_IDriveFolderExt
|
2016-11-06 18:04:58 +00:00
|
|
|
{ ID_NAME(IID_IPinnedListOld), TRUE },
|
2017-08-17 16:01:29 +00:00
|
|
|
{ ID_NAME(IID_IPinnedList), TRUE },
|
2018-03-02 13:14:53 +00:00
|
|
|
{ ID_NAME(IID_IAttachmentExecute), TRUE },
|
2013-07-07 09:10:31 +00:00
|
|
|
};
|
|
|
|
static const INT KnownInterfaceCount = RTL_NUMBER_OF(KnownInterfaces);
|
|
|
|
|
|
|
|
static
|
|
|
|
PCKNOWN_INTERFACE
|
|
|
|
FindInterface(
|
|
|
|
_In_ const IID *iid)
|
|
|
|
{
|
|
|
|
INT i;
|
|
|
|
|
|
|
|
for (i = 0; i < KnownInterfaceCount; i++)
|
|
|
|
if (IsEqualIID(KnownInterfaces[i].iid, iid))
|
|
|
|
return &KnownInterfaces[i];
|
|
|
|
ASSERT(i != KnownInterfaceCount);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOLEAN
|
|
|
|
IsInterfaceExpected(
|
|
|
|
_In_ PCCLASS_AND_INTERFACES class,
|
|
|
|
_In_ const IID *iid)
|
|
|
|
{
|
|
|
|
INT i;
|
|
|
|
|
|
|
|
for (i = 0; class->ifaces[i].iid; i++)
|
|
|
|
if (IsEqualIID(class->ifaces[i].iid, iid))
|
|
|
|
return TRUE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define INTF_NOT_EXPOSED LONG_MAX
|
|
|
|
static
|
|
|
|
LONG
|
|
|
|
GetInterfaceOffset(
|
|
|
|
_In_ PUNKNOWN pUnk,
|
|
|
|
_In_ const IID *iid)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
PVOID pObj;
|
|
|
|
PUNKNOWN pUnk2;
|
|
|
|
LONG offset;
|
|
|
|
|
|
|
|
hr = IUnknown_QueryInterface(pUnk, iid, &pObj);
|
|
|
|
ok(hr == S_OK || hr == E_NOINTERFACE, "IUnknown::QueryInterface returned 0x%lx\n", hr);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return INTF_NOT_EXPOSED;
|
|
|
|
|
|
|
|
pUnk2 = pObj;
|
|
|
|
offset = (LONG_PTR)pObj - (LONG_PTR)pUnk;
|
|
|
|
IUnknown_Release(pUnk2);
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
VOID
|
|
|
|
TestModuleInterfaces(
|
|
|
|
_In_ PCCLASS_AND_INTERFACES ExpectedInterfaces,
|
|
|
|
_In_ INT ExpectedInterfaceCount)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
PVOID pObj;
|
|
|
|
PUNKNOWN pUnk;
|
|
|
|
INT iClass, iIntf;
|
|
|
|
PCCLASS_AND_INTERFACES class;
|
|
|
|
|
|
|
|
for (iClass = 0; iClass < ExpectedInterfaceCount; iClass++)
|
|
|
|
{
|
|
|
|
class = &ExpectedInterfaces[iClass];
|
|
|
|
hr = CoCreateInstance(class->clsid,
|
|
|
|
NULL,
|
|
|
|
CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IUnknown,
|
|
|
|
&pObj);
|
|
|
|
ok(hr == S_OK, "CoCreateInstance failed. hr=0x%lx\n", hr);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
skip("Failed to instantiate %s.\n", class->name);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
pUnk = pObj;
|
|
|
|
|
|
|
|
/* Check that all expected interfaces are present and have the right offset */
|
|
|
|
for (iIntf = 0; class->ifaces[iIntf].iid; iIntf++)
|
|
|
|
{
|
|
|
|
PCKNOWN_INTERFACE iface = FindInterface(class->ifaces[iIntf].iid);
|
|
|
|
LONG offset = GetInterfaceOffset(pUnk, iface->iid);
|
|
|
|
if (offset == INTF_NOT_EXPOSED)
|
|
|
|
ok(0, "%s is missing %s (offset %ld)\n", class->name, iface->name, class->ifaces[iIntf].offset);
|
|
|
|
else if (class->ifaces[iIntf].offset != FARAWY)
|
|
|
|
{
|
|
|
|
#ifdef FAIL_WRONG_OFFSET
|
|
|
|
ok(offset == class->ifaces[iIntf].offset, "%s, %s offset is %ld, expected %ld\n", class->name, iface->name, offset, class->ifaces[iIntf].offset);
|
|
|
|
#else
|
|
|
|
if (offset != class->ifaces[iIntf].offset)
|
|
|
|
mytrace("%s, %s offset is %ld, expected %ld\n", class->name, iface->name, offset, class->ifaces[iIntf].offset);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check that none other than the expected interfaces are present */
|
|
|
|
for (iIntf = 0; iIntf < KnownInterfaceCount; iIntf++)
|
|
|
|
{
|
|
|
|
PCKNOWN_INTERFACE iface = &KnownInterfaces[iIntf];
|
|
|
|
LONG offset;
|
|
|
|
if (IsInterfaceExpected(class, iface->iid))
|
|
|
|
continue;
|
|
|
|
offset = GetInterfaceOffset(pUnk, iface->iid);
|
|
|
|
#ifdef GENERATE_TABLE_ENTRIES
|
2016-04-09 09:18:57 +00:00
|
|
|
ok(offset == INTF_NOT_EXPOSED, "%s: { %s0x%lx, &%s },\n", class->name, offset < 0 ? "-" : "", offset < 0 ? -offset : offset, iface->name);
|
2013-07-07 09:10:31 +00:00
|
|
|
#else
|
|
|
|
ok(offset == INTF_NOT_EXPOSED, "%s exposes %s (offset %ld), but shouldn't\n", class->name, iface->name, offset);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: do some aggregation
|
|
|
|
|
|
|
|
IUnknown_Release(pUnk);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
VOID
|
|
|
|
TestModuleRegistry(
|
|
|
|
_In_ PCWSTR ModuleName,
|
|
|
|
_In_ PCCLASS_AND_INTERFACES ExpectedInterfaces,
|
|
|
|
_In_ INT ExpectedInterfaceCount)
|
|
|
|
{
|
|
|
|
INT iClass;
|
|
|
|
PCCLASS_AND_INTERFACES class;
|
|
|
|
HKEY hKeyClasses;
|
|
|
|
LONG result;
|
|
|
|
|
2015-11-07 11:59:23 +00:00
|
|
|
result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\CLSID", 0, KEY_ENUMERATE_SUB_KEYS, &hKeyClasses);
|
2013-07-07 09:10:31 +00:00
|
|
|
ok(result == NO_ERROR, "Failed to open classes key, error %lu\n", result);
|
|
|
|
if (!myskip(result == NO_ERROR, "No classes key\n"))
|
|
|
|
{
|
|
|
|
for (iClass = 0; iClass < ExpectedInterfaceCount; iClass++)
|
|
|
|
{
|
|
|
|
HKEY hKey;
|
|
|
|
HKEY hKeyServer;
|
|
|
|
NTSTATUS status;
|
|
|
|
UNICODE_STRING clsid;
|
|
|
|
DWORD type;
|
2013-07-13 08:01:51 +00:00
|
|
|
WCHAR data[100];
|
|
|
|
DWORD dataSize;
|
|
|
|
PCWSTR expectedThreadingModel;
|
2013-07-07 09:10:31 +00:00
|
|
|
|
|
|
|
class = &ExpectedInterfaces[iClass];
|
|
|
|
status = RtlStringFromGUID(class->clsid, &clsid);
|
|
|
|
ok(status == STATUS_SUCCESS, "Failed to convert guid to string for %s, status %lx\n", class->name, status);
|
|
|
|
if (myskip(NT_SUCCESS(status), "No guid string\n"))
|
|
|
|
continue;
|
|
|
|
|
2015-11-07 11:59:23 +00:00
|
|
|
result = RegOpenKeyExW(hKeyClasses, clsid.Buffer, 0, KEY_ENUMERATE_SUB_KEYS, &hKey);
|
2013-07-07 09:10:31 +00:00
|
|
|
ok(result == NO_ERROR, "Failed to open key for %s, error %lu\n", class->name, result);
|
|
|
|
RtlFreeUnicodeString(&clsid);
|
|
|
|
if (myskip(result == NO_ERROR, "No key\n"))
|
|
|
|
continue;
|
|
|
|
|
2015-11-07 11:59:23 +00:00
|
|
|
result = RegOpenKeyExW(hKey, L"InProcServer32", 0, KEY_QUERY_VALUE, &hKeyServer);
|
2013-07-07 09:10:31 +00:00
|
|
|
ok(result == NO_ERROR, "Failed to open key for %s, error %lu\n", class->name, result);
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
if (myskip(result == NO_ERROR, "No key\n"))
|
|
|
|
continue;
|
|
|
|
|
2013-07-13 08:01:51 +00:00
|
|
|
dataSize = sizeof(data);
|
2015-11-07 11:59:23 +00:00
|
|
|
result = RegQueryValueExW(hKeyServer, NULL, NULL, &type, (PBYTE)data, &dataSize);
|
2013-07-07 09:10:31 +00:00
|
|
|
ok(result == NO_ERROR, "Failed to query value for %s, error %lu\n", class->name, result);
|
|
|
|
if (!myskip(result == NO_ERROR, "No module name\n"))
|
|
|
|
{
|
|
|
|
ok(type == REG_SZ || type == REG_EXPAND_SZ, "type %lu for %s\n", type, class->name);
|
2013-07-13 08:01:51 +00:00
|
|
|
ok(dataSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dataSize, class->name);
|
|
|
|
ok(dataSize <= sizeof(data), "size %lu for %s\n", dataSize, class->name);
|
|
|
|
ok(data[dataSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", class->name);
|
2013-07-07 09:10:31 +00:00
|
|
|
// TODO: Use SearchPath (or assume everything's in system32) and do a proper full path compare
|
2013-07-13 08:01:51 +00:00
|
|
|
PathStripPathW(data);
|
|
|
|
PathRemoveExtensionW(data);
|
|
|
|
ok(!wcsicmp(data, ModuleName), "Server is %ls, expected %ls for %s\n", data, ModuleName, class->name);
|
2013-07-07 09:10:31 +00:00
|
|
|
}
|
|
|
|
|
2013-07-13 08:01:51 +00:00
|
|
|
dataSize = sizeof(data);
|
2015-11-07 11:59:23 +00:00
|
|
|
result = RegQueryValueExW(hKeyServer, L"ThreadingModel", NULL, &type, (PBYTE)data, &dataSize);
|
2013-07-07 09:10:31 +00:00
|
|
|
ok(result == NO_ERROR, "Failed to query value for %s, error %lu\n", class->name, result);
|
|
|
|
if (!myskip(result == NO_ERROR, "No ThreadingModel\n"))
|
|
|
|
{
|
|
|
|
ok(type == REG_SZ || type == REG_EXPAND_SZ, "type %lu for %s\n", type, class->name);
|
2013-07-13 08:01:51 +00:00
|
|
|
ok(dataSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dataSize, class->name);
|
|
|
|
ok(dataSize <= sizeof(data), "size %lu for %s\n", dataSize, class->name);
|
|
|
|
ok(data[dataSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", class->name);
|
|
|
|
expectedThreadingModel = class->ThreadingModel;
|
|
|
|
if (!expectedThreadingModel)
|
|
|
|
expectedThreadingModel = L"Apartment";
|
|
|
|
ok(!wcsicmp(data, expectedThreadingModel), "Server is %ls, expected %ls for %s\n", data, expectedThreadingModel, class->name);
|
2013-07-07 09:10:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RegCloseKey(hKeyServer);
|
|
|
|
}
|
|
|
|
RegCloseKey(hKeyClasses);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
VOID
|
|
|
|
TestManualInstantiation(
|
|
|
|
_In_ PCWSTR ModuleName,
|
|
|
|
_In_ PCCLASS_AND_INTERFACES ExpectedInterfaces,
|
|
|
|
_In_ INT ExpectedInterfaceCount)
|
|
|
|
{
|
|
|
|
INT iClass;
|
|
|
|
PCCLASS_AND_INTERFACES class;
|
|
|
|
HRESULT (__stdcall *DllGetClassObject)(REFCLSID, REFIID, PVOID *);
|
|
|
|
|
2015-11-07 11:59:23 +00:00
|
|
|
DllGetClassObject = (PVOID)GetProcAddress(GetModuleHandleW(ModuleName), "DllGetClassObject");
|
2013-07-07 09:10:31 +00:00
|
|
|
ok(DllGetClassObject != NULL, "DllGetClassObject not found in %ls, error %lu\n", ModuleName, GetLastError());
|
|
|
|
if (myskip(DllGetClassObject != NULL, "No DllGetClassObject\n"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (iClass = 0; iClass < ExpectedInterfaceCount; iClass++)
|
|
|
|
{
|
|
|
|
PVOID pv;
|
|
|
|
HRESULT hr;
|
|
|
|
class = &ExpectedInterfaces[iClass];
|
|
|
|
hr = DllGetClassObject(class->clsid, &IID_IClassFactory, &pv);
|
|
|
|
ok(hr == S_OK, "DllGetClassObject failed for %s, hr = 0x%lx\n", class->name, hr);
|
|
|
|
if (!myskip(SUCCEEDED(hr), "No class factory\n"))
|
|
|
|
{
|
|
|
|
IClassFactory *pCF = pv;
|
|
|
|
hr = IClassFactory_CreateInstance(pCF, NULL, &IID_IUnknown, &pv);
|
|
|
|
ok(hr == S_OK, "IClassFactory::CreateInstance failed for %s, hr = 0x%lx\n", class->name, hr);
|
2013-07-13 08:01:51 +00:00
|
|
|
if (!myskip(SUCCEEDED(hr), "No instance\n"))
|
2013-07-07 09:10:31 +00:00
|
|
|
{
|
|
|
|
IUnknown *pUnk = pv;
|
|
|
|
IUnknown_Release(pUnk);
|
|
|
|
}
|
|
|
|
IClassFactory_Release(pCF);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
TestClasses(
|
|
|
|
_In_ PCWSTR ModuleName,
|
|
|
|
_In_ PCCLASS_AND_INTERFACES ExpectedInterfaces,
|
|
|
|
_In_ INT ExpectedInterfaceCount)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
|
|
|
ok(hr == S_OK, "CoInitializeEx failed. hr=0x%lx\n", hr);
|
|
|
|
if (myskip(SUCCEEDED(hr), "Failed to initialize COM. Cannot perform tests\n"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
TestModuleInterfaces(ExpectedInterfaces, ExpectedInterfaceCount);
|
|
|
|
TestModuleRegistry(ModuleName, ExpectedInterfaces, ExpectedInterfaceCount);
|
|
|
|
TestManualInstantiation(ModuleName, ExpectedInterfaces, ExpectedInterfaceCount);
|
|
|
|
|
|
|
|
CoUninitialize();
|
|
|
|
}
|
2014-03-21 11:45:30 +00:00
|
|
|
|
|
|
|
static
|
|
|
|
VOID
|
|
|
|
TestInterfaceRegistry(
|
|
|
|
_In_ PCKNOWN_INTERFACE Interfaces,
|
|
|
|
_In_ INT InterfaceCount)
|
|
|
|
{
|
|
|
|
INT i;
|
|
|
|
HKEY hKeyInterface;
|
|
|
|
LONG result;
|
|
|
|
|
2015-11-07 11:59:23 +00:00
|
|
|
result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Interface", 0, KEY_ENUMERATE_SUB_KEYS, &hKeyInterface);
|
2014-03-21 11:45:30 +00:00
|
|
|
ok(result == NO_ERROR, "Failed to open interface key, error %lu\n", result);
|
|
|
|
if (!myskip(result == NO_ERROR, "No interface key\n"))
|
|
|
|
{
|
|
|
|
for (i = 0; i < InterfaceCount; i++)
|
|
|
|
{
|
|
|
|
HKEY hKey;
|
|
|
|
NTSTATUS status;
|
|
|
|
UNICODE_STRING iid;
|
|
|
|
DWORD type;
|
|
|
|
WCHAR data[100];
|
|
|
|
DWORD dataSize;
|
|
|
|
PCKNOWN_INTERFACE iface;
|
|
|
|
PCWSTR expectedName;
|
|
|
|
|
|
|
|
iface = &Interfaces[i];
|
|
|
|
status = RtlStringFromGUID(iface->iid, &iid);
|
|
|
|
ok(status == STATUS_SUCCESS, "Failed to convert guid to string for %s, status %lx\n", iface->name, status);
|
|
|
|
if (myskip(NT_SUCCESS(status), "No guid string\n"))
|
|
|
|
continue;
|
|
|
|
|
2015-11-07 11:59:23 +00:00
|
|
|
result = RegOpenKeyExW(hKeyInterface, iid.Buffer, 0, KEY_QUERY_VALUE, &hKey);
|
2014-03-21 11:45:30 +00:00
|
|
|
if (iface->noreg)
|
|
|
|
{
|
|
|
|
ok(result == ERROR_FILE_NOT_FOUND, "RegOpenKeyEx returned %lu for %s\n", result, iface->name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ok(result == NO_ERROR, "Failed to open key for %s, error %lu\n", iface->name, result);
|
|
|
|
(void)myskip(result == NO_ERROR, "No key\n");
|
|
|
|
}
|
|
|
|
RtlFreeUnicodeString(&iid);
|
|
|
|
if (result != NO_ERROR)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
dataSize = sizeof(data);
|
2015-11-07 11:59:23 +00:00
|
|
|
result = RegQueryValueExW(hKey, NULL, NULL, &type, (PBYTE)data, &dataSize);
|
2014-03-21 11:45:30 +00:00
|
|
|
ok(result == NO_ERROR, "Failed to query value for %s, error %lu\n", iface->name, result);
|
|
|
|
if (!myskip(result == NO_ERROR, "No module name\n"))
|
|
|
|
{
|
|
|
|
ok(type == REG_SZ, "type %lu for %s\n", type, iface->name);
|
|
|
|
ok(dataSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dataSize, iface->name);
|
|
|
|
ok(dataSize <= sizeof(data), "size %lu for %s\n", dataSize, iface->name);
|
|
|
|
ok(data[dataSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", iface->name);
|
|
|
|
expectedName = wcschr(iface->wname, L'_');
|
|
|
|
if (expectedName)
|
|
|
|
expectedName++;
|
|
|
|
else
|
|
|
|
expectedName = iface->wname;
|
|
|
|
ok(!wcsicmp(data, expectedName), "Name is %ls, expected %ls\n", data, expectedName);
|
|
|
|
}
|
|
|
|
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
}
|
|
|
|
RegCloseKey(hKeyInterface);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
START_TEST(interfaces)
|
|
|
|
{
|
|
|
|
TestInterfaceRegistry(KnownInterfaces, KnownInterfaceCount);
|
|
|
|
}
|