Commit 0eeb0420 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Make OleSetClipboard affected by previous OleInitialize() calls.

parent c983cd64
......@@ -78,6 +78,8 @@
#include "storage32.h"
#include "compobj_private.h"
#define HANDLE_ERROR(err) { hr = err; TRACE("(HRESULT=%x)\n", (HRESULT)err); goto CLEANUP; }
WINE_DEFAULT_DEBUG_CHANNEL(ole);
......@@ -313,6 +315,7 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj)
IEnumFORMATETC* penumFormatetc = NULL;
FORMATETC rgelt;
BOOL bClipboardOpen = FALSE;
struct oletls *info = COM_CurrentInfo();
/*
HGLOBAL hDataObject = 0;
OLEClipbrd **ppDataObject;
......@@ -320,6 +323,12 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj)
TRACE("(%p)\n", pDataObj);
if(!info)
WARN("Could not allocate tls\n");
else
if(!info->ole_inits)
return CO_E_NOTINITIALIZED;
/*
* Make sure we have a clipboard object
*/
......
......@@ -439,12 +439,10 @@ static void test_set_clipboard(void)
return;
hr = OleSetClipboard(data1);
todo_wine
ok(hr == CO_E_NOTINITIALIZED, "OleSetClipboard should have failed with CO_E_NOTINITIALIZED instead of 0x%08x\n", hr);
CoInitialize(NULL);
hr = OleSetClipboard(data1);
todo_wine
ok(hr == CO_E_NOTINITIALIZED ||
hr == CLIPBRD_E_CANT_SET, /* win9x */
"OleSetClipboard should have failed with "
......
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