ReactOS  0.4.15-dev-1397-g19779b3
progressdlg.c File Reference
#include <stdarg.h>
#include <shlobj.h>
#include "wine/test.h"
Include dependency graph for progressdlg.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

static void test_IProgressDialog_QueryInterface (void)
 
 START_TEST (progressdlg)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 20 of file progressdlg.c.

Function Documentation

◆ START_TEST()

START_TEST ( progressdlg  )

Definition at line 65 of file progressdlg.c.

66 {
68 
70 
72 }
static void test_IProgressDialog_QueryInterface(void)
Definition: progressdlg.c:28
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define NULL
Definition: types.h:112
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964

◆ test_IProgressDialog_QueryInterface()

static void test_IProgressDialog_QueryInterface ( void  )
static

Definition at line 28 of file progressdlg.c.

29 {
30  IProgressDialog *dlg;
31  IProgressDialog *dlg2;
32  IOleWindow *olewindow;
33  IUnknown *unk;
34  HRESULT hr;
35 
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;
40  }
41 
43  ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr);
44 
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);
49  }
50 
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)) {
58  }
59  IOleWindow_Release(olewindow);
60  }
62 }
#define IProgressDialog_QueryInterface(p, a, b)
Definition: shlobj.h:927
HRESULT hr
Definition: shlfolder.c:183
if SUCCEEDED(hr)
LONG HRESULT
Definition: typedefs.h:79
#define IProgressDialog_Release(p)
Definition: shlobj.h:929
const GUID IID_IUnknown
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:51
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
const GUID IID_IOleWindow
#define E_POINTER
Definition: winerror.h:2365
#define win_skip
Definition: test.h:149

Referenced by START_TEST().