secur32/tests: Use importlib for functions available since Windows XP.
[wine.git] / dlls / browseui / tests / progressdlg.c
blob22037141d60508d35bfb27a5c24337bbe0f0caef
1 /* Unit tests for progressdialog object
3 * Copyright 2012 Detlef Riekenberg
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.
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.
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
20 #define COBJMACROS
22 #include <stdarg.h>
23 #include <shlobj.h>
25 #include "wine/test.h"
28 static void test_IProgressDialog_QueryInterface(void)
30 IProgressDialog *dlg;
31 IProgressDialog *dlg2;
32 IOleWindow *olewindow;
33 IUnknown *unk;
34 HRESULT hr;
36 hr = CoCreateInstance(&CLSID_ProgressDialog, NULL, CLSCTX_INPROC_SERVER, &IID_IProgressDialog, (void*)&dlg);
37 if (FAILED(hr)) {
38 win_skip("CoCreateInstance for IProgressDialog returned 0x%x\n", hr);
39 return;
42 hr = IProgressDialog_QueryInterface(dlg, &IID_IUnknown, NULL);
43 ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr);
45 hr = IProgressDialog_QueryInterface(dlg, &IID_IUnknown, (void**)&unk);
46 ok(hr == S_OK, "QueryInterface (IUnknown) returned 0x%x\n", hr);
47 if (SUCCEEDED(hr)) {
48 IUnknown_Release(unk);
51 hr = IProgressDialog_QueryInterface(dlg, &IID_IOleWindow, (void**)&olewindow);
52 ok(hr == S_OK, "QueryInterface (IOleWindow) returned 0x%x\n", hr);
53 if (SUCCEEDED(hr)) {
54 hr = IOleWindow_QueryInterface(olewindow, &IID_IProgressDialog, (void**)&dlg2);
55 ok(hr == S_OK, "QueryInterface (IProgressDialog) returned 0x%x\n", hr);
56 if (SUCCEEDED(hr)) {
57 IProgressDialog_Release(dlg2);
59 IOleWindow_Release(olewindow);
61 IProgressDialog_Release(dlg);
65 START_TEST(progressdlg)
67 CoInitialize(NULL);
69 test_IProgressDialog_QueryInterface();
71 CoUninitialize();