Commit f92caf5b authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comdlg32: Store client GUID with SetClientGuid().

parent ed673ff9
......@@ -125,6 +125,8 @@ typedef struct FileDialogImpl {
HWND cctrls_hwnd;
struct list cctrls;
UINT_PTR cctrl_next_dlgid;
GUID client_guid;
} FileDialogImpl;
/**************************************************************************
......@@ -2032,8 +2034,9 @@ static HRESULT WINAPI IFileDialog2_fnClose(IFileDialog2 *iface, HRESULT hr)
static HRESULT WINAPI IFileDialog2_fnSetClientGuid(IFileDialog2 *iface, REFGUID guid)
{
FileDialogImpl *This = impl_from_IFileDialog2(iface);
FIXME("stub - %p (%s)\n", This, debugstr_guid(guid));
return E_NOTIMPL;
TRACE("%p (%s)\n", This, debugstr_guid(guid));
This->client_guid = *guid;
return S_OK;
}
static HRESULT WINAPI IFileDialog2_fnClearClientData(IFileDialog2 *iface)
......@@ -3627,6 +3630,8 @@ static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID riid, void **p
fdimpl->default_ext = NULL;
fdimpl->custom_cancelbutton = fdimpl->custom_filenamelabel = NULL;
fdimpl->client_guid = GUID_NULL;
/* FIXME: The default folder setting should be restored for the
* application if it was previously set. */
SHGetDesktopFolder(&psf);
......
......@@ -1392,6 +1392,7 @@ static void test_customize(void)
if(FAILED(hr))
{
skip("Skipping IFileDialogCustomize tests.\n");
IFileDialog_Release(pfod);
return;
}
......@@ -1897,6 +1898,30 @@ static void test_customize(void)
ok(!ref, "Refcount not zero (%d).\n", ref);
}
static void test_persistent_state(void)
{
IFileDialog *fd;
HRESULT hr;
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&fd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
if (0)
{
/* crashes at least on Win8 */
hr = IFileDialog_SetClientGuid(fd, NULL);
}
hr = IFileDialog_SetClientGuid(fd, &IID_IUnknown);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IFileDialog_SetClientGuid(fd, &IID_NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
IFileDialog_Release(fd);
}
START_TEST(itemdlg)
{
OleInitialize(NULL);
......@@ -1908,6 +1933,7 @@ START_TEST(itemdlg)
test_advise();
test_filename();
test_customize();
test_persistent_state();
}
else
skip("Skipping all Item Dialog tests.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment