ole32: Make OleSetClipboard affected by previous OleInitialize() calls.
This commit is contained in:
parent
c983cd6423
commit
0eeb042067
|
@ -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 "
|
||||
|
|
Loading…
Reference in New Issue