shell32/tests: Drop progman DDE test workarounds for Windows <= 2000.
[wine.git] / dlls / apphelp / tests / apphelp.c
blob81104d28512804070edc804039c1f68e63bdc29b
1 /*
2 * Copyright 2012 Detlef Riekenberg
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #define COBJMACROS
21 #include <stdarg.h>
22 #include <stdio.h>
23 #include <initguid.h>
24 #include <exdisp.h>
25 #include <shlobj.h>
26 #include <urlmon.h>
28 #include "wine/test.h"
30 static HMODULE hdll;
31 static BOOL (WINAPI *pApphelpCheckShellObject)(REFCLSID, BOOL, ULONGLONG *);
33 DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
35 DEFINE_GUID(test_Microsoft_Browser_Architecture, 0xa5e46e3a, 0x8849, 0x11d1, 0x9d, 0x8c, 0x00, 0xc0, 0x4f, 0xc9, 0x9d, 0x61);
36 DEFINE_GUID(CLSID_MenuBand, 0x5b4dae26, 0xb807, 0x11d0, 0x98, 0x15, 0x00, 0xc0, 0x4f, 0xd9, 0x19, 0x72);
37 DEFINE_GUID(test_UserAssist, 0xdd313e04, 0xfeff, 0x11d1, 0x8e, 0xcd, 0x00, 0x00, 0xf8, 0x7a, 0x47, 0x0c);
39 static const CLSID * objects[] = {
40 &GUID_NULL,
41 /* used by IE */
42 &test_Microsoft_Browser_Architecture,
43 &CLSID_MenuBand,
44 &CLSID_ShellLink,
45 &CLSID_ShellWindows,
46 &CLSID_InternetSecurityManager,
47 &test_UserAssist,
48 NULL,};
50 static void test_ApphelpCheckShellObject(void)
52 ULONGLONG flags;
53 BOOL res;
54 int i;
56 if (!pApphelpCheckShellObject)
58 win_skip("ApphelpCheckShellObject not available\n");
59 return;
62 for (i = 0; objects[i]; i++)
64 flags = 0xdeadbeef;
65 SetLastError(0xdeadbeef);
66 res = pApphelpCheckShellObject(objects[i], FALSE, &flags);
67 ok(res && (flags == 0), "%s 0: got %d and %s with 0x%x (expected TRUE and 0)\n",
68 wine_dbgstr_guid(objects[i]), res, wine_dbgstr_longlong(flags), GetLastError());
70 flags = 0xdeadbeef;
71 SetLastError(0xdeadbeef);
72 res = pApphelpCheckShellObject(objects[i], TRUE, &flags);
73 ok(res && (flags == 0), "%s 1: got %d and %s with 0x%x (expected TRUE and 0)\n",
74 wine_dbgstr_guid(objects[i]), res, wine_dbgstr_longlong(flags), GetLastError());
78 /* NULL as pointer to flags is checked */
79 SetLastError(0xdeadbeef);
80 res = pApphelpCheckShellObject(&GUID_NULL, FALSE, NULL);
81 ok(res, "%s 0: got %d with 0x%x (expected != FALSE)\n", wine_dbgstr_guid(&GUID_NULL), res, GetLastError());
83 /* NULL as CLSID* crash on Windows */
84 if (0)
86 flags = 0xdeadbeef;
87 SetLastError(0xdeadbeef);
88 res = pApphelpCheckShellObject(NULL, FALSE, &flags);
89 trace("NULL as CLSID*: got %d and %s with 0x%x\n", res, wine_dbgstr_longlong(flags), GetLastError());
93 START_TEST(apphelp)
96 hdll = LoadLibraryA("apphelp.dll");
97 if (!hdll) {
98 win_skip("apphelp.dll not available\n");
99 return;
101 pApphelpCheckShellObject = (void *) GetProcAddress(hdll, "ApphelpCheckShellObject");
103 test_ApphelpCheckShellObject();