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
28 #include "wine/test.h"
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
[] = {
42 &test_Microsoft_Browser_Architecture
,
46 &CLSID_InternetSecurityManager
,
50 static void test_ApphelpCheckShellObject(void)
56 if (!pApphelpCheckShellObject
)
58 win_skip("ApphelpCheckShellObject not available\n");
62 for (i
= 0; objects
[i
]; i
++)
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());
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 */
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());
96 hdll
= LoadLibraryA("apphelp.dll");
98 win_skip("apphelp.dll not available\n");
101 pApphelpCheckShellObject
= (void *) GetProcAddress(hdll
, "ApphelpCheckShellObject");
103 test_ApphelpCheckShellObject();