[COMCTL32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
[reactos.git] / rostests / winetests / comctl32 / taskdialog.c
1 /* Unit tests for the task dialog control.
2 *
3 * Copyright 2017 Fabian Maurer for the Wine project
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20 #include <stdarg.h>
21
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winuser.h"
25 #include "commctrl.h"
26
27 #include "wine/test.h"
28 #include "v6util.h"
29
30 static HRESULT (WINAPI *pTaskDialogIndirect)(const TASKDIALOGCONFIG *, int *, int *, BOOL *);
31
32 START_TEST(taskdialog)
33 {
34 ULONG_PTR ctx_cookie;
35 void *ptr_ordinal;
36 HINSTANCE hinst;
37 HANDLE hCtx;
38
39 if (!load_v6_module(&ctx_cookie, &hCtx))
40 return;
41
42 /* Check if task dialogs are available */
43 hinst = LoadLibraryA("comctl32.dll");
44
45 pTaskDialogIndirect = (void *)GetProcAddress(hinst, "TaskDialogIndirect");
46 if (!pTaskDialogIndirect)
47 {
48 win_skip("TaskDialogIndirect not exported by name\n");
49 unload_v6_module(ctx_cookie, hCtx);
50 return;
51 }
52
53 ptr_ordinal = GetProcAddress(hinst, (const char *)345);
54 ok(pTaskDialogIndirect == ptr_ordinal, "got wrong pointer for ordinal 345, %p expected %p\n",
55 ptr_ordinal, pTaskDialogIndirect);
56
57 unload_v6_module(ctx_cookie, hCtx);
58 }