ReactOS  0.4.12-dev-919-gfc3b8d5
ole2.h File Reference
#include <winerror.h>
#include <objbase.h>
#include <oleauto.h>
#include <oleidl.h>
Include dependency graph for ole2.h:

Go to the source code of this file.

Classes

struct  _OLESTREAMVTBL
 
struct  _OLESTREAM
 

Macros

#define E_DRAW   VIEW_E_DRAW
 
#define DATA_E_FORMATETC   DV_E_FORMATETC
 
#define OLEIVERB_PRIMARY   (0L)
 
#define OLEIVERB_SHOW   (-1L)
 
#define OLEIVERB_OPEN   (-2L)
 
#define OLEIVERB_HIDE   (-3L)
 
#define OLEIVERB_UIACTIVATE   (-4L)
 
#define OLEIVERB_INPLACEACTIVATE   (-5L)
 
#define OLEIVERB_DISCARDUNDOSTATE   (-6L)
 
#define OLEIVERB_PROPERTIES   (-7L)
 
#define EMBDHLP_INPROC_HANDLER   0x00000000
 
#define EMBDHLP_INPROC_SERVER   0x00000001
 
#define EMBDHLP_CREATENOW   0x00000000
 
#define EMBDHLP_DELAYCREATE   0x00010000
 

Typedefs

typedef struct _OLESTREAMLPOLESTREAM
 
typedef struct _OLESTREAMVTBL OLESTREAMVTBL
 
typedef OLESTREAMVTBLLPOLESTREAMVTBL
 
typedef struct _OLESTREAM OLESTREAM
 

Functions

HRESULT WINAPI RegisterDragDrop (HWND, LPDROPTARGET)
 
HRESULT WINAPI RevokeDragDrop (HWND)
 
HRESULT WINAPI DoDragDrop (LPDATAOBJECT, LPDROPSOURCE, DWORD, DWORD *)
 
HRESULT WINAPI OleLoadFromStream (IStream *pStm, REFIID iidInterface, void **ppvObj)
 
HRESULT WINAPI OleSaveToStream (IPersistStream *pPStm, IStream *pStm)
 
HOLEMENU WINAPI OleCreateMenuDescriptor (HMENU hmenuCombined, LPOLEMENUGROUPWIDTHS lpMenuWidths)
 
HRESULT WINAPI OleDestroyMenuDescriptor (HOLEMENU hmenuDescriptor)
 
HRESULT WINAPI OleSetMenuDescriptor (HOLEMENU hmenuDescriptor, HWND hwndFrame, HWND hwndActiveObject, LPOLEINPLACEFRAME lpFrame, LPOLEINPLACEACTIVEOBJECT lpActiveObject)
 
HRESULT WINAPI WriteClassStg (IStorage *pstg, REFCLSID rclsid)
 
HRESULT WINAPI ReadClassStg (IStorage *pstg, CLSID *pclsid)
 
HRESULT WINAPI WriteClassStm (IStream *pStm, REFCLSID rclsid)
 
HRESULT WINAPI ReadClassStm (IStream *pStm, CLSID *pclsid)
 
HRESULT WINAPI OleSave (LPPERSISTSTORAGE pPS, LPSTORAGE pStg, BOOL fSameAsLoad)
 
HRESULT WINAPI OleRegGetUserType (REFCLSID clsid, DWORD dwFormOfType, LPOLESTR *pszUserType)
 
HRESULT WINAPI OleRegGetMiscStatus (REFCLSID clsid, DWORD dwAspect, DWORD *pdwStatus)
 
HRESULT WINAPI OleRegEnumFormatEtc (REFCLSID clsid, DWORD dwDirection, LPENUMFORMATETC *ppenumFormatetc)
 
HRESULT WINAPI CreateStreamOnHGlobal (HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
 
HRESULT WINAPI GetHGlobalFromStream (LPSTREAM pstm, HGLOBAL *phglobal)
 
HRESULT WINAPI OleRegEnumVerbs (REFCLSID clsid, LPENUMOLEVERB *ppenum)
 
BOOL WINAPI OleIsRunning (LPOLEOBJECT pObject)
 
HRESULT WINAPI OleCreateLinkFromData (LPDATAOBJECT pSrcDataObj, REFIID riid, DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
 
HRESULT WINAPI OleSetContainedObject (LPUNKNOWN pUnknown, BOOL fContained)
 
HRESULT WINAPI OleNoteObjectVisible (LPUNKNOWN pUnknown, BOOL fVisible)
 
HRESULT WINAPI OleQueryLinkFromData (IDataObject *pSrcDataObject)
 
HRESULT WINAPI OleQueryCreateFromData (LPDATAOBJECT pSrcDataObject)
 
HRESULT WINAPI OleRun (LPUNKNOWN pUnknown)
 
HRESULT WINAPI OleDraw (LPUNKNOWN pUnknown, DWORD dwAspect, HDC hdcDraw, LPCRECT lprcBounds)
 
VOID WINAPI ReleaseStgMedium (LPSTGMEDIUM)
 
HRESULT WINAPI OleGetClipboard (IDataObject **ppDataObj)
 
HRESULT WINAPI OleIsCurrentClipboard (LPDATAOBJECT)
 
HRESULT WINAPI OleSetClipboard (LPDATAOBJECT)
 
HRESULT WINAPI OleCreateStaticFromData (LPDATAOBJECT pSrcDataObj, REFIID iid, DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
 
HRESULT WINAPI ReadFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT *pcf, LPOLESTR *lplpszUserType)
 
HRESULT WINAPI OleLoad (LPSTORAGE pStg, REFIID riid, LPOLECLIENTSITE pClientSite, LPVOID *ppvObj)
 
HRESULT WINAPI GetHGlobalFromILockBytes (LPLOCKBYTES plkbyt, HGLOBAL *phglobal)
 
HRESULT WINAPI CreateILockBytesOnHGlobal (HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPLOCKBYTES *pplkbyt)
 
HRESULT WINAPI CreateDataAdviseHolder (LPDATAADVISEHOLDER *ppDAHolder)
 
HGLOBAL WINAPI OleGetIconOfClass (REFCLSID rclsid, LPOLESTR lpszLabel, BOOL fUseTypeAsLabel)
 
HGLOBAL WINAPI OleGetIconOfFile (LPOLESTR lpszPath, BOOL fUseFileAsLabel)
 
HGLOBAL WINAPI OleMetafilePictFromIconAndLabel (HICON hIcon, LPOLESTR lpszLabel, LPOLESTR lpszSourceFile, UINT iIconIndex)
 
HRESULT WINAPI OleLockRunning (LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCloses)
 
HRESULT WINAPI OleCreateFromFile (REFCLSID rclsid, LPCOLESTR lpszFileName, REFIID riid, DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
 
HRESULT WINAPI OleCreateLink (LPMONIKER pmkLinkSrc, REFIID riid, DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
 
HRESULT WINAPI OleCreate (REFCLSID rclsid, REFIID riid, DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
 
HRESULT WINAPI OleFlushClipboard (void)
 
HRESULT WINAPI GetConvertStg (LPSTORAGE pStg)
 
HRESULT WINAPI SetConvertStg (LPSTORAGE pStg, BOOL fConvert)
 
BOOL WINAPI IsAccelerator (HACCEL hAccel, int cAccelEntries, struct tagMSG *lpMsg, WORD *lpwCmd)
 
HRESULT WINAPI OleCreateLinkToFile (LPCOLESTR lpszFileName, REFIID riid, DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
 
HANDLE WINAPI OleDuplicateData (HANDLE hSrc, CLIPFORMAT cfFormat, UINT uiFlags)
 
HRESULT WINAPI WriteFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT cf, LPOLESTR lpszUserType)
 
HRESULT WINAPI OleTranslateAccelerator (LPOLEINPLACEFRAME lpFrame, LPOLEINPLACEFRAMEINFO lpFrameInfo, struct tagMSG *lpmsg)
 
HRESULT WINAPI OleCreateFromData (LPDATAOBJECT pSrcDataObj, REFIID riid, DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
 
HRESULT WINAPI OleCreateFromDataEx (LPDATAOBJECT pSrcDataObj, REFIID riid, DWORD dwFlags, DWORD renderopt, ULONG num_formats, DWORD *adv_flags, LPFORMATETC fmts, IAdviseSink *sink, DWORD *conns, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
 
HRESULT WINAPI OleCreateDefaultHandler (REFCLSID clsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
 
HRESULT WINAPI OleCreateEmbeddingHelper (REFCLSID clsid, LPUNKNOWN pUnkOuter, DWORD flags, IClassFactory *pCF, REFIID riid, LPVOID *ppvObj)
 
HRESULT WINAPI CreateOleAdviseHolder (LPOLEADVISEHOLDER *ppOAHolder)
 
HRESULT WINAPI OleInitialize (LPVOID pvReserved)
 
void WINAPI OleUninitialize (void)
 
BOOL WINAPI IsValidInterface (LPUNKNOWN punk)
 
DWORD WINAPI OleBuildVersion (VOID)
 
HRESULT WINAPI OleConvertOLESTREAMToIStorage (LPOLESTREAM lpolestream, LPSTORAGE pstg, const DVTARGETDEVICE *ptd)
 
HRESULT WINAPI OleConvertIStorageToOLESTREAM (LPSTORAGE pstg, LPOLESTREAM lpolestream)
 
HRESULT WINAPI OleDoAutoConvert (LPSTORAGE pStg, LPCLSID pClsidNew)
 
HRESULT WINAPI OleGetAutoConvert (REFCLSID clsidOld, LPCLSID pClsidNew)
 
HRESULT WINAPI OleSetAutoConvert (REFCLSID clsidOld, REFCLSID clsidNew)
 

Macro Definition Documentation

◆ DATA_E_FORMATETC

#define DATA_E_FORMATETC   DV_E_FORMATETC

Definition at line 36 of file ole2.h.

◆ E_DRAW

#define E_DRAW   VIEW_E_DRAW

Definition at line 35 of file ole2.h.

◆ EMBDHLP_CREATENOW

#define EMBDHLP_CREATENOW   0x00000000

Definition at line 49 of file ole2.h.

◆ EMBDHLP_DELAYCREATE

#define EMBDHLP_DELAYCREATE   0x00010000

Definition at line 50 of file ole2.h.

◆ EMBDHLP_INPROC_HANDLER

#define EMBDHLP_INPROC_HANDLER   0x00000000

Definition at line 47 of file ole2.h.

◆ EMBDHLP_INPROC_SERVER

#define EMBDHLP_INPROC_SERVER   0x00000001

Definition at line 48 of file ole2.h.

◆ OLEIVERB_DISCARDUNDOSTATE

#define OLEIVERB_DISCARDUNDOSTATE   (-6L)

Definition at line 44 of file ole2.h.

◆ OLEIVERB_HIDE

#define OLEIVERB_HIDE   (-3L)

Definition at line 41 of file ole2.h.

◆ OLEIVERB_INPLACEACTIVATE

#define OLEIVERB_INPLACEACTIVATE   (-5L)

Definition at line 43 of file ole2.h.

◆ OLEIVERB_OPEN

#define OLEIVERB_OPEN   (-2L)

Definition at line 40 of file ole2.h.

◆ OLEIVERB_PRIMARY

#define OLEIVERB_PRIMARY   (0L)

Definition at line 38 of file ole2.h.

◆ OLEIVERB_PROPERTIES

#define OLEIVERB_PROPERTIES   (-7L)

Definition at line 45 of file ole2.h.

◆ OLEIVERB_SHOW

#define OLEIVERB_SHOW   (-1L)

Definition at line 39 of file ole2.h.

◆ OLEIVERB_UIACTIVATE

#define OLEIVERB_UIACTIVATE   (-4L)

Definition at line 42 of file ole2.h.

Typedef Documentation

◆ LPOLESTREAM

Definition at line 149 of file ole2.h.

◆ LPOLESTREAMVTBL

Definition at line 154 of file ole2.h.

◆ OLESTREAM

◆ OLESTREAMVTBL

Function Documentation

◆ CreateDataAdviseHolder()

HRESULT WINAPI CreateDataAdviseHolder ( LPDATAADVISEHOLDER ppDAHolder)

◆ CreateILockBytesOnHGlobal()

HRESULT WINAPI CreateILockBytesOnHGlobal ( HGLOBAL  hGlobal,
BOOL  fDeleteOnRelease,
LPLOCKBYTES pplkbyt 
)

◆ CreateOleAdviseHolder()

HRESULT WINAPI CreateOleAdviseHolder ( LPOLEADVISEHOLDER *  ppOAHolder)

◆ CreateStreamOnHGlobal()

HRESULT WINAPI CreateStreamOnHGlobal ( HGLOBAL  hGlobal,
BOOL  fDeleteOnRelease,
LPSTREAM ppstm 
)

Definition at line 625 of file hglobalstream.c.

629 {
631 
632  if (!ppstm)
633  return E_INVALIDARG;
634 
636  if (!This) return E_OUTOFMEMORY;
637 
638  /* allocate a handle if one is not supplied */
639  if (!hGlobal)
641 
642  This->handle = handle_create(hGlobal, fDeleteOnRelease);
643 
644  /* start at the beginning */
645  This->currentPosition.u.HighPart = 0;
646  This->currentPosition.u.LowPart = 0;
647 
648  *ppstm = &This->IStream_iface;
649 
650  return S_OK;
651 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define GMEM_NODISCARD
Definition: winbase.h:299
#define GMEM_SHARE
Definition: winbase.h:302
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
static HGLOBALStreamImpl * HGLOBALStreamImpl_Create(void)
#define S_OK
Definition: intsafe.h:59
static struct handle_wrapper * handle_create(HGLOBAL hglobal, BOOL delete_on_release)
#define GMEM_MOVEABLE
Definition: winbase.h:291

Referenced by apartment_hostobject_in_hostapt(), BindStatusCallback_OnStartBinding(), bsc_OnStartBinding(), CoMarshalInterThreadInterfaceInStream(), crash_couninitialize_proc(), create_decoder(), create_doc_with_string(), create_stream(), create_stream_from_map(), create_stream_from_string(), create_stream_on_data(), create_stream_on_file(), create_stream_on_mip_ro(), create_test_stream(), D3DXSaveSurfaceToFileInMemory(), DataObjectImpl_CreateComplex(), decode_base64(), decode_qp(), doc_load_string(), get_current_dataobject(), get_data_from_stream(), get_local_server_stream(), get_stgmed_for_stream(), get_travellog_stream(), HlinkClone(), init_memstream(), CTravelEntry::Invoke(), load_image(), load_string(), LresultFromObject(), marshal_stgmed(), marshal_WdtpInterfacePointer(), METAFILE_CreateCompressedImageStream(), MimeOleCreateVirtualStream(), BrowserNavigator::navigated(), ObjectFromLresult(), OLEClipbrd_Initialize(), RECORD_StreamFromFile(), RegisterDragDrop(), RPC_GetLocalClassObject(), RunningObjectTableImpl_Register(), StdGlobalInterfaceTable_RegisterInterfaceInGlobal(), test_apm(), test_bad_marshal_stream(), test_bom(), test_bsc_marshaling(), test_bufferrawformat(), test_call_from_message(), test_channel_hook(), test_client_security(), test_CoGetStandardMarshal(), test_CoMarshalInterface(), test_componentinfo(), test_copyto(), test_CoRegisterPSClsid(), test_CoUnmarshalInterface(), test_CoWaitForMultipleHandles_thread(), test_createfromstream(), test_data_cache_save(), test_decode_1bpp(), test_decode_24bpp(), test_decode_4bpp(), test_decode_adobe_cmyk(), test_decode_rle4(), test_decode_rle8(), test_DfMarshal_custom_marshaling(), test_disconnect_stub(), test_empty_image(), test_empty_image_2(), test_enhmetafile(), test_external_connection(), test_file_moniker(), test_freed_hglobal(), test_freethreadedmarshaler(), test_GdipLoadImageFromStream(), test_getdatahere(), test_GetDataHere_Proxy(), test_handler_marshaling(), test_hresult_marshaling(), test_implicit_mta(), test_InternetSecurityMarshalling(), test_interthread_marshal_and_unmarshal(), test_Invoke(), test_IPersistStream(), test_IStream_Clone(), test_load_save_bmp(), test_load_save_emf(), test_load_save_empty_picture(), test_load_save_icon(), test_loadwmf(), test_lock_object_external(), test_marshal(), test_marshal_and_unmarshal_invalid(), test_marshal_channel_buffer(), test_marshal_proxy_apartment_shutdown(), test_marshal_proxy_mta_apartment_shutdown(), test_marshal_stub_apartment_shutdown(), test_message_filter(), test_metafile(), test_moniker(), test_multi_encoder(), test_multiframegif(), test_mxwriter_encoding(), test_mxwriter_flush(), test_mxwriter_stream(), test_no_couninitialize_client(), test_no_couninitialize_server(), test_no_marshaler(), test_normal_marshal_and_release(), test_normal_marshal_and_unmarshal(), test_normal_marshal_and_unmarshal_twice(), test_OleDoAutoConvert(), test_persist_save_data(), test_persiststreaminit(), test_pic(), test_pointer_moniker(), test_proxy_interfaces(), test_proxy_marshal_and_unmarshal(), test_proxy_marshal_and_unmarshal2(), test_proxy_marshal_and_unmarshal_strong(), test_proxy_marshal_and_unmarshal_weak(), test_proxy_used_in_wrong_thread(), test_ReadClassStm(), test_readerinput(), test_same_apartment_unmarshal_failure(), test_save(), test_save_history(), test_save_load_filemoniker(), test_StdMarshal_custom_marshaling(), test_streamonhglobal(), test_StreamOnIStream(), test_StreamOnStreamRange(), test_supported_encoders(), test_tablestrong_marshal_and_unmarshal_twice(), test_tableweak_and_normal_marshal_and_releasedata(), test_tableweak_and_normal_marshal_and_unmarshal(), test_tableweak_marshal_and_unmarshal_twice(), test_tableweak_marshal_releasedata1(), test_tableweak_marshal_releasedata2(), test_two_tableweak_marshal_and_releasedata(), test_typelibmarshal(), test_writeroutput(), test_writestartdocument(), test_xsltemplate(), union_tests(), unmarshal_stgmed(), CTravelEntry::Update(), WdtpInterfacePointer_UserMarshal(), WdtpInterfacePointer_UserUnmarshal(), window_proc(), writer_set_output(), and xslprocessor_transform().

◆ DoDragDrop()

HRESULT WINAPI DoDragDrop ( LPDATAOBJECT  ,
LPDROPSOURCE  ,
DWORD  ,
DWORD  
)

◆ GetConvertStg()

HRESULT WINAPI GetConvertStg ( LPSTORAGE  pStg)

◆ GetHGlobalFromILockBytes()

HRESULT WINAPI GetHGlobalFromILockBytes ( LPLOCKBYTES  plkbyt,
HGLOBAL phglobal 
)

◆ GetHGlobalFromStream()

HRESULT WINAPI GetHGlobalFromStream ( LPSTREAM  pstm,
HGLOBAL phglobal 
)

◆ IsAccelerator()

BOOL WINAPI IsAccelerator ( HACCEL  hAccel,
int  cAccelEntries,
struct tagMSG lpMsg,
WORD lpwCmd 
)

◆ IsValidInterface()

BOOL WINAPI IsValidInterface ( LPUNKNOWN  punk)

Definition at line 535 of file ifs.c.

536 {
537  return !(
538  IsBadReadPtr(punk,4) ||
539  IsBadReadPtr(punk->lpVtbl,4) ||
540  IsBadReadPtr(punk->lpVtbl->QueryInterface,9) ||
541  IsBadCodePtr((FARPROC)punk->lpVtbl->QueryInterface)
542  );
543 }
BOOL NTAPI IsBadCodePtr(FARPROC lpfn)
Definition: except.c:874
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
Definition: except.c:807
int(* FARPROC)()
Definition: compat.h:28

Referenced by MkParseDisplayName().

◆ OleBuildVersion()

DWORD WINAPI OleBuildVersion ( VOID  )

Definition at line 163 of file ole2.c.

164 {
165  TRACE("Returning version %d, build %d.\n", rmm, rup);
166  return (rmm<<16)+rup;
167 }
#define rmm
Definition: ole2ver.h:41
#define rup
Definition: ole2ver.h:42
#define TRACE(s)
Definition: solgame.cpp:4

◆ OleConvertIStorageToOLESTREAM()

HRESULT WINAPI OleConvertIStorageToOLESTREAM ( LPSTORAGE  pstg,
LPOLESTREAM  lpolestream 
)

Definition at line 10552 of file storage32.c.

10555 {
10556  int i;
10557  HRESULT hRes = S_OK;
10558  IStream *pStream;
10559  OLECONVERT_OLESTREAM_DATA pOleStreamData[2];
10560  static const WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0};
10561 
10562  TRACE("%p %p\n", pstg, pOleStream);
10563 
10564  memset(pOleStreamData, 0, sizeof(pOleStreamData));
10565 
10566  if(pstg == NULL || pOleStream == NULL)
10567  {
10568  hRes = E_INVALIDARG;
10569  }
10570  if(hRes == S_OK)
10571  {
10572  /* Get the ProgID */
10573  pOleStreamData[0].dwOleTypeNameLength = OLESTREAM_MAX_STR_LEN;
10574  hRes = OLECONVERT_GetOLE10ProgID(pstg, pOleStreamData[0].strOleTypeName, &(pOleStreamData[0].dwOleTypeNameLength));
10575  }
10576  if(hRes == S_OK)
10577  {
10578  /* Was it originally Ole10 */
10579  hRes = IStorage_OpenStream(pstg, wstrStreamName, 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream);
10580  if(hRes == S_OK)
10581  {
10582  IStream_Release(pStream);
10583  /* Get Presentation Data for Ole10Native */
10584  OLECONVERT_GetOle10PresData(pstg, pOleStreamData);
10585  }
10586  else
10587  {
10588  /* Get Presentation Data (OLE20) */
10589  OLECONVERT_GetOle20PresData(pstg, pOleStreamData);
10590  }
10591 
10592  /* Save OLESTREAM */
10593  hRes = OLECONVERT_SaveOLE10(&(pOleStreamData[0]), pOleStream);
10594  if(hRes == S_OK)
10595  {
10596  hRes = OLECONVERT_SaveOLE10(&(pOleStreamData[1]), pOleStream);
10597  }
10598 
10599  }
10600 
10601  /* Free allocated memory */
10602  for(i=0; i < 2; i++)
10603  {
10604  HeapFree(GetProcessHeap(),0,pOleStreamData[i].pData);
10605  }
10606 
10607  return hRes;
10608 }
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
static void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData)
Definition: storage32.c:10325
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define OLESTREAM_MAX_STR_LEN
Definition: storage32.c:9579
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define STGM_READ
Definition: objbase.h:916
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dwSize)
Definition: storage32.c:10254
static void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData)
Definition: storage32.c:10378
#define S_OK
Definition: intsafe.h:59
static HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREAM pOleStream)
Definition: storage32.c:9809
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ OleConvertOLESTREAMToIStorage()

HRESULT WINAPI OleConvertOLESTREAMToIStorage ( LPOLESTREAM  lpolestream,
LPSTORAGE  pstg,
const DVTARGETDEVICE *  ptd 
)

Definition at line 10461 of file storage32.c.

10465 {
10466  int i;
10467  HRESULT hRes=S_OK;
10468  OLECONVERT_OLESTREAM_DATA pOleStreamData[2];
10469 
10470  TRACE("%p %p %p\n", pOleStream, pstg, ptd);
10471 
10472  memset(pOleStreamData, 0, sizeof(pOleStreamData));
10473 
10474  if(ptd != NULL)
10475  {
10476  FIXME("DVTARGETDEVICE is not NULL, unhandled parameter\n");
10477  }
10478 
10479  if(pstg == NULL || pOleStream == NULL)
10480  {
10481  hRes = E_INVALIDARG;
10482  }
10483 
10484  if(hRes == S_OK)
10485  {
10486  /* Load the OLESTREAM to Memory */
10487  hRes = OLECONVERT_LoadOLE10(pOleStream, &pOleStreamData[0], TRUE);
10488  }
10489 
10490  if(hRes == S_OK)
10491  {
10492  /* Load the OLESTREAM to Memory (part 2)*/
10493  hRes = OLECONVERT_LoadOLE10(pOleStream, &pOleStreamData[1], FALSE);
10494  }
10495 
10496  if(hRes == S_OK)
10497  {
10498 
10499  if(pOleStreamData[0].dwDataLength > sizeof(STORAGE_magic))
10500  {
10501  /* Do we have the IStorage Data in the OLESTREAM */
10502  if(memcmp(pOleStreamData[0].pData, STORAGE_magic, sizeof(STORAGE_magic)) ==0)
10503  {
10504  OLECONVERT_GetOLE20FromOLE10(pstg, pOleStreamData[0].pData, pOleStreamData[0].dwDataLength);
10505  OLECONVERT_CreateOlePresStream(pstg, pOleStreamData[1].dwMetaFileWidth, pOleStreamData[1].dwMetaFileHeight, pOleStreamData[1].pData, pOleStreamData[1].dwDataLength);
10506  }
10507  else
10508  {
10509  /* It must be an original OLE 1.0 source */
10510  OLECONVERT_CreateOle10NativeStream(pstg, pOleStreamData[0].pData, pOleStreamData[0].dwDataLength);
10511  }
10512  }
10513  else
10514  {
10515  /* It must be an original OLE 1.0 source */
10516  OLECONVERT_CreateOle10NativeStream(pstg, pOleStreamData[0].pData, pOleStreamData[0].dwDataLength);
10517  }
10518 
10519  /* Create CompObj Stream if necessary */
10520  hRes = OLECONVERT_CreateCompObjStream(pstg, pOleStreamData[0].strOleTypeName);
10521  if(hRes == S_OK)
10522  {
10523  /*Create the Ole Stream if necessary */
10524  STORAGE_CreateOleStream(pstg, 0);
10525  }
10526  }
10527 
10528 
10529  /* Free allocated memory */
10530  for(i=0; i < 2; i++)
10531  {
10532  HeapFree(GetProcessHeap(),0,pOleStreamData[i].pData);
10533  HeapFree(GetProcessHeap(),0,pOleStreamData[i].pstrOleObjFileName);
10534  pOleStreamData[i].pstrOleObjFileName = NULL;
10535  }
10536  return hRes;
10537 }
#define TRUE
Definition: types.h:120
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static const BYTE STORAGE_magic[8]
Definition: storage32.c:62
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
HRESULT STORAGE_CreateOleStream(IStorage *storage, DWORD flags)
Definition: storage32.c:9208
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, const BYTE *pData, DWORD dwDataLength)
Definition: storage32.c:10215
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
static void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, const BYTE *pBuffer, DWORD nBufferLength)
Definition: storage32.c:9920
LONG HRESULT
Definition: typedefs.h:77
static HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA *pData, BOOL bStrem1)
Definition: storage32.c:9641
HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName)
Definition: storage32.c:10029
#define S_OK
Definition: intsafe.h:59
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:394
static void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD dwExtentY, BYTE *pData, DWORD dwDataLength)
Definition: storage32.c:10131

◆ OleCreate()

HRESULT WINAPI OleCreate ( REFCLSID  rclsid,
REFIID  riid,
DWORD  renderopt,
LPFORMATETC  pFormatEtc,
LPOLECLIENTSITE  pClientSite,
LPSTORAGE  pStg,
LPVOID ppvObj 
)

Definition at line 2612 of file ole2.c.

2620 {
2621  HRESULT hres;
2622  IUnknown * pUnk = NULL;
2623  IOleObject *pOleObject = NULL;
2624 
2625  TRACE("(%s, %s, %d, %p, %p, %p, %p)\n", debugstr_guid(rclsid),
2626  debugstr_guid(riid), renderopt, pFormatEtc, pClientSite, pStg, ppvObj);
2627 
2628  hres = CoCreateInstance(rclsid, 0, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, riid, (LPVOID*)&pUnk);
2629 
2630  if (SUCCEEDED(hres))
2631  hres = IStorage_SetClass(pStg, rclsid);
2632 
2633  if (pClientSite && SUCCEEDED(hres))
2634  {
2635  hres = IUnknown_QueryInterface(pUnk, &IID_IOleObject, (LPVOID*)&pOleObject);
2636  if (SUCCEEDED(hres))
2637  {
2638  DWORD dwStatus;
2639  IOleObject_GetMiscStatus(pOleObject, DVASPECT_CONTENT, &dwStatus);
2640  }
2641  }
2642 
2643  if (SUCCEEDED(hres))
2644  {
2645  IPersistStorage * pPS;
2646  if (SUCCEEDED((hres = IUnknown_QueryInterface(pUnk, &IID_IPersistStorage, (LPVOID*)&pPS))))
2647  {
2648  TRACE("trying to set stg %p\n", pStg);
2649  hres = IPersistStorage_InitNew(pPS, pStg);
2650  TRACE("-- result 0x%08x\n", hres);
2651  IPersistStorage_Release(pPS);
2652  }
2653  }
2654 
2655  if (pClientSite && SUCCEEDED(hres))
2656  {
2657  TRACE("trying to set clientsite %p\n", pClientSite);
2658  hres = IOleObject_SetClientSite(pOleObject, pClientSite);
2659  TRACE("-- result 0x%08x\n", hres);
2660  }
2661 
2662  if (pOleObject)
2663  IOleObject_Release(pOleObject);
2664 
2665  if (((renderopt == OLERENDER_DRAW) || (renderopt == OLERENDER_FORMAT)) &&
2666  SUCCEEDED(hres))
2667  {
2668  hres = OleRun(pUnk);
2669  if (SUCCEEDED(hres))
2670  {
2671  IOleCache *pOleCache;
2672 
2673  if (SUCCEEDED(IUnknown_QueryInterface(pUnk, &IID_IOleCache, (void **)&pOleCache)))
2674  {
2675  DWORD dwConnection;
2676  if (renderopt == OLERENDER_DRAW && !pFormatEtc) {
2677  FORMATETC pfe;
2678  pfe.cfFormat = 0;
2679  pfe.ptd = NULL;
2680  pfe.dwAspect = DVASPECT_CONTENT;
2681  pfe.lindex = -1;
2682  pfe.tymed = TYMED_NULL;
2683  hres = IOleCache_Cache(pOleCache, &pfe, ADVF_PRIMEFIRST, &dwConnection);
2684  }
2685  else
2686  hres = IOleCache_Cache(pOleCache, pFormatEtc, ADVF_PRIMEFIRST, &dwConnection);
2687  IOleCache_Release(pOleCache);
2688  }
2689  }
2690  }
2691 
2692  if (FAILED(hres) && pUnk)
2693  {
2694  IUnknown_Release(pUnk);
2695  pUnk = NULL;
2696  }
2697 
2698  *ppvObj = pUnk;
2699 
2700  TRACE("-- %p\n", pUnk);
2701  return hres;
2702 }
REFIID riid
Definition: precomp.h:44
HRESULT WINAPI DECLSPEC_HOTPATCH OleRun(LPUNKNOWN pUnknown)
Definition: ole2.c:1208
const GUID IID_IPersistStorage
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IOleObject
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
DWORD dwStatus
Definition: mediaobj.idl:95
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
const GUID IID_IOleCache
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by InitWebBrowser(), test_OleCreate(), and UIINSERTOBJECTDLG_OnOpen().

◆ OleCreateDefaultHandler()

HRESULT WINAPI OleCreateDefaultHandler ( REFCLSID  clsid,
LPUNKNOWN  pUnkOuter,
REFIID  riid,
LPVOID ppvObj 
)

Definition at line 2288 of file defaulthandler.c.

2290 {
2291  TRACE("(%s, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter,debugstr_guid(riid), ppvObj);
2293  NULL, riid, ppvObj);
2294 }
HRESULT WINAPI OleCreateEmbeddingHelper(REFCLSID clsid, LPUNKNOWN pUnkOuter, DWORD flags, IClassFactory *pCF, REFIID riid, LPVOID *ppvObj)
REFIID riid
Definition: precomp.h:44
#define EMBDHLP_CREATENOW
Definition: ole2.h:49
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define EMBDHLP_INPROC_HANDLER
Definition: ole2.h:47
REFCLSID clsid
Definition: msctf.c:84

Referenced by add_icon_to_control(), HandlerCF_CreateInstance(), insert_static_object(), OleCreateStaticFromData(), OleLoad(), test_default_handler(), test_default_handler_run(), and test_olestream().

◆ OleCreateEmbeddingHelper()

HRESULT WINAPI OleCreateEmbeddingHelper ( REFCLSID  clsid,
LPUNKNOWN  pUnkOuter,
DWORD  flags,
IClassFactory pCF,
REFIID  riid,
LPVOID ppvObj 
)

Definition at line 2235 of file defaulthandler.c.

2242 {
2243  DefaultHandler* newHandler = NULL;
2244  HRESULT hr = S_OK;
2245 
2246  TRACE("(%s, %p, %08x, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter, flags, pCF, debugstr_guid(riid), ppvObj);
2247 
2248  if (!ppvObj)
2249  return E_POINTER;
2250 
2251  *ppvObj = NULL;
2252 
2253  /*
2254  * If This handler is constructed for aggregation, make sure
2255  * the caller is requesting the IUnknown interface.
2256  * This is necessary because it's the only time the non-delegating
2257  * IUnknown pointer can be returned to the outside.
2258  */
2259  if (pUnkOuter && !IsEqualIID(&IID_IUnknown, riid))
2260  return CLASS_E_NOAGGREGATION;
2261 
2262  /*
2263  * Try to construct a new instance of the class.
2264  */
2265  newHandler = DefaultHandler_Construct(clsid, pUnkOuter, flags, pCF);
2266 
2267  if (!newHandler)
2268  return E_OUTOFMEMORY;
2269 
2270  /*
2271  * Make sure it supports the interface required by the caller.
2272  */
2273  hr = IUnknown_QueryInterface(&newHandler->IUnknown_iface, riid, ppvObj);
2274 
2275  /*
2276  * Release the reference obtained in the constructor. If
2277  * the QueryInterface was unsuccessful, it will free the class.
2278  */
2279  IUnknown_Release(&newHandler->IUnknown_iface);
2280 
2281  return hr;
2282 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
GLbitfield flags
Definition: glext.h:7161
REFCLSID clsid
Definition: msctf.c:84
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
IUnknown IUnknown_iface
#define S_OK
Definition: intsafe.h:59
static DefaultHandler * DefaultHandler_Construct(REFCLSID clsid, LPUNKNOWN pUnkOuter, DWORD flags, IClassFactory *pCF)
#define E_POINTER
Definition: winerror.h:2365
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

Referenced by OleCreateDefaultHandler(), and test_default_handler().

◆ OleCreateFromData()

HRESULT WINAPI OleCreateFromData ( LPDATAOBJECT  pSrcDataObj,
REFIID  riid,
DWORD  renderopt,
LPFORMATETC  pFormatEtc,
LPOLECLIENTSITE  pClientSite,
LPSTORAGE  pStg,
LPVOID ppvObj 
)

Definition at line 203 of file ole2impl.c.

207 {
208  DWORD advf = ADVF_PRIMEFIRST;
209 
210  return OleCreateFromDataEx(data, iid, 0, renderopt, fmt ? 1 : 0, fmt ? &advf : NULL,
211  fmt, NULL, NULL, client_site, stg, obj);
212 }
static IOleClientSite * client_site
Definition: activex.c:198
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HRESULT WINAPI OleCreateFromDataEx(IDataObject *data, REFIID iid, DWORD flags, DWORD renderopt, ULONG num_cache_fmts, DWORD *adv_flags, FORMATETC *cache_fmts, IAdviseSink *sink, DWORD *conns, IOleClientSite *client_site, IStorage *stg, void **obj)
Definition: ole2impl.c:177
Definition: dsound.c:943

Referenced by OleCreateLinkFromData(), OleCreateStaticFromData(), and test_OleCreateStaticFromData().

◆ OleCreateFromDataEx()

HRESULT WINAPI OleCreateFromDataEx ( LPDATAOBJECT  pSrcDataObj,
REFIID  riid,
DWORD  dwFlags,
DWORD  renderopt,
ULONG  num_formats,
DWORD adv_flags,
LPFORMATETC  fmts,
IAdviseSink sink,
DWORD conns,
LPOLECLIENTSITE  pClientSite,
LPSTORAGE  pStg,
LPVOID ppvObj 
)

◆ OleCreateFromFile()

HRESULT WINAPI OleCreateFromFile ( REFCLSID  rclsid,
LPCOLESTR  lpszFileName,
REFIID  riid,
DWORD  renderopt,
LPFORMATETC  lpFormatEtc,
LPOLECLIENTSITE  pClientSite,
LPSTORAGE  pStg,
LPVOID ppvObj 
)

◆ OleCreateLink()

HRESULT WINAPI OleCreateLink ( LPMONIKER  pmkLinkSrc,
REFIID  riid,
DWORD  renderopt,
LPFORMATETC  lpFormatEtc,
LPOLECLIENTSITE  pClientSite,
LPSTORAGE  pStg,
LPVOID ppvObj 
)

Definition at line 49 of file ole2stubs.c.

51 {
52  FIXME("(not shown), stub!\n");
53  return E_NOTIMPL;
54 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ OleCreateLinkFromData()

HRESULT WINAPI OleCreateLinkFromData ( LPDATAOBJECT  pSrcDataObj,
REFIID  riid,
DWORD  renderopt,
LPFORMATETC  pFormatEtc,
LPOLECLIENTSITE  pClientSite,
LPSTORAGE  pStg,
LPVOID ppvObj 
)

◆ OleCreateLinkToFile()

HRESULT WINAPI OleCreateLinkToFile ( LPCOLESTR  lpszFileName,
REFIID  riid,
DWORD  renderopt,
LPFORMATETC  lpFormatEtc,
LPOLECLIENTSITE  pClientSite,
LPSTORAGE  pStg,
LPVOID ppvObj 
)

Definition at line 38 of file ole2stubs.c.

41 {
42  FIXME("(%p,%p,%i,%p,%p,%p,%p), stub!\n",lpszFileName, riid, renderopt, lpFormatEtc, pClientSite, pStg, ppvObj);
43  return E_NOTIMPL;
44 }
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ OleCreateMenuDescriptor()

HOLEMENU WINAPI OleCreateMenuDescriptor ( HMENU  hmenuCombined,
LPOLEMENUGROUPWIDTHS  lpMenuWidths 
)

Definition at line 1815 of file ole2.c.

1818 {
1819  HOLEMENU hOleMenu;
1820  OleMenuDescriptor *pOleMenuDescriptor;
1821  int i;
1822 
1823  if ( !hmenuCombined || !lpMenuWidths )
1824  return 0;
1825 
1826  /* Create an OLE menu descriptor */
1827  if ( !(hOleMenu = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT,
1828  sizeof(OleMenuDescriptor) ) ) )
1829  return 0;
1830 
1831  pOleMenuDescriptor = GlobalLock( hOleMenu );
1832  if ( !pOleMenuDescriptor )
1833  return 0;
1834 
1835  /* Initialize menu group widths and hmenu */
1836  for ( i = 0; i < 6; i++ )
1837  pOleMenuDescriptor->mgw.width[i] = lpMenuWidths->width[i];
1838 
1839  pOleMenuDescriptor->hmenuCombined = hmenuCombined;
1840  pOleMenuDescriptor->bIsServerItem = FALSE;
1841  GlobalUnlock( hOleMenu );
1842 
1843  return hOleMenu;
1844 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
HMENU hmenuCombined
Definition: ole2.c:85
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
OLEMENUGROUPWIDTHS mgw
Definition: ole2.c:84
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
BOOL bIsServerItem
Definition: ole2.c:86
#define GMEM_MOVEABLE
Definition: winbase.h:291
#define GMEM_ZEROINIT
Definition: winbase.h:303

◆ OleCreateStaticFromData()

HRESULT WINAPI OleCreateStaticFromData ( LPDATAOBJECT  pSrcDataObj,
REFIID  iid,
DWORD  renderopt,
LPFORMATETC  pFormatEtc,
LPOLECLIENTSITE  pClientSite,
LPSTORAGE  pStg,
LPVOID ppvObj 
)

◆ OleDestroyMenuDescriptor()

HRESULT WINAPI OleDestroyMenuDescriptor ( HOLEMENU  hmenuDescriptor)

Definition at line 1850 of file ole2.c.

1852 {
1853  if ( hmenuDescriptor )
1854  GlobalFree( hmenuDescriptor );
1855  return S_OK;
1856 }
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
#define S_OK
Definition: intsafe.h:59

◆ OleDoAutoConvert()

HRESULT WINAPI OleDoAutoConvert ( LPSTORAGE  pStg,
LPCLSID  pClsidNew 
)

Definition at line 2761 of file ole2.c.

2762 {
2763  WCHAR *user_type_old, *user_type_new;
2764  CLIPFORMAT cf;
2765  STATSTG stat;
2766  CLSID clsid;
2767  HRESULT hr;
2768 
2769  TRACE("(%p, %p)\n", pStg, pClsidNew);
2770 
2771  *pClsidNew = CLSID_NULL;
2772  if(!pStg)
2773  return E_INVALIDARG;
2774  hr = IStorage_Stat(pStg, &stat, STATFLAG_NONAME);
2775  if(FAILED(hr))
2776  return hr;
2777 
2778  *pClsidNew = stat.clsid;
2779  hr = OleGetAutoConvert(&stat.clsid, &clsid);
2780  if(FAILED(hr))
2781  return hr;
2782 
2783  hr = IStorage_SetClass(pStg, &clsid);
2784  if(FAILED(hr))
2785  return hr;
2786 
2787  hr = ReadFmtUserTypeStg(pStg, &cf, &user_type_old);
2788  if(FAILED(hr)) {
2789  cf = 0;
2790  user_type_new = NULL;
2791  }
2792 
2793  hr = OleRegGetUserType(&clsid, USERCLASSTYPE_FULL, &user_type_new);
2794  if(FAILED(hr))
2795  user_type_new = NULL;
2796 
2797  hr = WriteFmtUserTypeStg(pStg, cf, user_type_new);
2798  CoTaskMemFree(user_type_new);
2799  if(FAILED(hr))
2800  {
2801  CoTaskMemFree(user_type_old);
2802  IStorage_SetClass(pStg, &stat.clsid);
2803  return hr;
2804  }
2805 
2806  hr = SetConvertStg(pStg, TRUE);
2807  if(FAILED(hr))
2808  {
2809  WriteFmtUserTypeStg(pStg, cf, user_type_old);
2810  IStorage_SetClass(pStg, &stat.clsid);
2811  }
2812  else
2813  *pClsidNew = clsid;
2814  CoTaskMemFree(user_type_old);
2815  return hr;
2816 }
static IClassFactory * cf
static LPCLSID pClsidNew
Definition: compobj.c:71
#define TRUE
Definition: types.h:120
HRESULT WINAPI WriteFmtUserTypeStg(LPSTORAGE pstg, CLIPFORMAT cf, LPOLESTR lpszUserType)
Definition: storage32.c:9357
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT WINAPI SetConvertStg(IStorage *storage, BOOL convert)
Definition: storage32.c:10649
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI OleGetAutoConvert(REFCLSID clsidOld, LPCLSID pClsidNew)
Definition: ole2.c:2707
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CLSID_NULL
Definition: guiddef.h:94
LONG HRESULT
Definition: typedefs.h:77
REFCLSID clsid
Definition: msctf.c:84
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype)
Definition: ole2.c:681
HRESULT WINAPI ReadFmtUserTypeStg(LPSTORAGE pstg, CLIPFORMAT *pcf, LPOLESTR *lplpszUserType)
Definition: storage32.c:9400

Referenced by test_OleDoAutoConvert().

◆ OleDraw()

HRESULT WINAPI OleDraw ( LPUNKNOWN  pUnknown,
DWORD  dwAspect,
HDC  hdcDraw,
LPCRECT  lprcBounds 
)

◆ OleDuplicateData()

HANDLE WINAPI OleDuplicateData ( HANDLE  hSrc,
CLIPFORMAT  cfFormat,
UINT  uiFlags 
)

Definition at line 425 of file ole2impl.c.

427 {
428  HANDLE hDst = NULL;
429 
430  TRACE("(%p,%x,%x)\n", hSrc, cfFormat, uiFlags);
431 
432  if (!uiFlags) uiFlags = GMEM_MOVEABLE;
433 
434  switch (cfFormat)
435  {
436  case CF_ENHMETAFILE:
437  hDst = CopyEnhMetaFileW(hSrc, NULL);
438  break;
439  case CF_METAFILEPICT:
440  hDst = CopyMetaFileW(hSrc, NULL);
441  break;
442  case CF_PALETTE:
443  {
445  UINT nEntries = GetPaletteEntries(hSrc, 0, 0, NULL);
446  if (!nEntries) return NULL;
448  FIELD_OFFSET(LOGPALETTE, palPalEntry[nEntries]));
449  if (!logpalette) return NULL;
450  if (!GetPaletteEntries(hSrc, 0, nEntries, logpalette->palPalEntry))
451  {
453  return NULL;
454  }
455  logpalette->palVersion = 0x300;
456  logpalette->palNumEntries = (WORD)nEntries;
457 
458  hDst = CreatePalette(logpalette);
459 
461  break;
462  }
463  case CF_BITMAP:
464  {
465  LONG size;
466  BITMAP bm;
467  if (!GetObjectW(hSrc, sizeof(bm), &bm))
468  return NULL;
469  size = GetBitmapBits(hSrc, 0, NULL);
470  if (!size) return NULL;
471  bm.bmBits = HeapAlloc(GetProcessHeap(), 0, size);
472  if (!bm.bmBits) return NULL;
473  if (GetBitmapBits(hSrc, size, bm.bmBits))
474  hDst = CreateBitmapIndirect(&bm);
475  HeapFree(GetProcessHeap(), 0, bm.bmBits);
476  break;
477  }
478  default:
479  {
480  SIZE_T size = GlobalSize(hSrc);
481  LPVOID pvSrc = NULL;
482  LPVOID pvDst = NULL;
483 
484  /* allocate space for object */
485  if (!size) return NULL;
486  hDst = GlobalAlloc(uiFlags, size);
487  if (!hDst) return NULL;
488 
489  /* lock pointers */
490  pvSrc = GlobalLock(hSrc);
491  if (!pvSrc)
492  {
493  GlobalFree(hDst);
494  return NULL;
495  }
496  pvDst = GlobalLock(hDst);
497  if (!pvDst)
498  {
499  GlobalUnlock(hSrc);
500  GlobalFree(hDst);
501  return NULL;
502  }
503  /* copy data */
504  memcpy(pvDst, pvSrc, size);
505 
506  /* cleanup */
507  GlobalUnlock(hDst);
508  GlobalUnlock(hSrc);
509  }
510  }
511 
512  TRACE("returning %p\n", hDst);
513  return hDst;
514 }
static const LOGPALETTE logpalette
Definition: clipboard.c:1346
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
Definition: palette.c:64
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
HBITMAP WINAPI CreateBitmapIndirect(_In_ const BITMAP *pbm)
#define CF_ENHMETAFILE
Definition: constants.h:409
#define CF_METAFILEPICT
Definition: constants.h:398
WORD palVersion
Definition: wingdi.h:1811
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
long LONG
Definition: pedump.c:60
#define CF_BITMAP
Definition: constants.h:397
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)
LONG WINAPI GetBitmapBits(_In_ HBITMAP hbit, _In_ LONG cb, _Out_writes_bytes_(cb) LPVOID lpvBits)
unsigned short WORD
Definition: ntddk_ex.h:93
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
HENHMETAFILE WINAPI CopyEnhMetaFileW(_In_ HENHMETAFILE hemfSrc, _In_opt_ LPCWSTR pszFile)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define CF_PALETTE
Definition: constants.h:404
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ULONG_PTR SIZE_T
Definition: typedefs.h:78
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
Definition: bl.h:1331
HMETAFILE WINAPI CopyMetaFileW(_In_ HMETAFILE hmfSrc, _In_opt_ LPCWSTR pszFile)
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
WORD palNumEntries
Definition: wingdi.h:1812
#define HeapFree(x, y, z)
Definition: compat.h:394
#define GMEM_MOVEABLE
Definition: winbase.h:291

Referenced by copy_stg_medium(), and IDataObjectImpl::CopyMedium().

◆ OleFlushClipboard()

HRESULT WINAPI OleFlushClipboard ( void  )

Definition at line 2293 of file clipboard.c.

2294 {
2295  HRESULT hr;
2296  ole_clipbrd *clipbrd;
2297  HWND wnd;
2298 
2299  TRACE("()\n");
2300 
2301  if(FAILED(hr = get_ole_clipbrd(&clipbrd))) return hr;
2302 
2303  if(FAILED(hr = get_clipbrd_window(clipbrd, &wnd))) return hr;
2304 
2305  /*
2306  * Already flushed or no source DataObject? Nothing to do.
2307  */
2308  if (!clipbrd->src_data) return S_OK;
2309 
2310  if (!OpenClipboard(wnd)) return CLIPBRD_E_CANT_OPEN;
2311 
2312  SendMessageW(wnd, WM_RENDERALLFORMATS, 0, 0);
2313 
2315 
2317  set_src_dataobject(clipbrd, NULL);
2318 
2320 
2321  return hr;
2322 }
static HRESULT expose_marshalled_dataobject(ole_clipbrd *clipbrd, IDataObject *data)
Definition: clipboard.c:1957
HRESULT hr
Definition: shlfolder.c:183
#define WM_RENDERALLFORMATS
Definition: winuser.h:1828
IDataObject * src_data
Definition: clipboard.c:154
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI OpenClipboard(HWND hWndNewOwner)
Definition: clipboard.c:23
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
static HRESULT get_clipbrd_window(ole_clipbrd *clipbrd, HWND *wnd)
Definition: clipboard.c:1918
static HRESULT set_src_dataobject(ole_clipbrd *clipbrd, IDataObject *data)
Definition: clipboard.c:1989
#define CLIPBRD_E_CANT_CLOSE
Definition: winerror.h:2770
#define S_OK
Definition: intsafe.h:59
static HRESULT set_dataobject_format(HWND hwnd)
Definition: clipboard.c:2161
static HRESULT get_ole_clipbrd(ole_clipbrd **clipbrd)
Definition: clipboard.c:186
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CLIPBRD_E_CANT_OPEN
Definition: winerror.h:2766

Referenced by fnTextSrv_TxSetText(), CShellBrowser::OnDestroy(), SHFlushClipboard(), START_TEST(), test_consumer_refs(), test_flushed_getdata(), test_set_clipboard(), test_set_clipboard_DRAWCLIPBOARD(), and test_WM_PASTE().

◆ OleGetAutoConvert()

HRESULT WINAPI OleGetAutoConvert ( REFCLSID  clsidOld,
LPCLSID  pClsidNew 
)

Definition at line 2707 of file ole2.c.

2708 {
2709  static const WCHAR wszAutoConvertTo[] = {'A','u','t','o','C','o','n','v','e','r','t','T','o',0};
2710  HKEY hkey = NULL;
2712  LONG len;
2713  HRESULT res = S_OK;
2714 
2715  res = COM_OpenKeyForCLSID(clsidOld, wszAutoConvertTo, KEY_READ, &hkey);
2716  if (FAILED(res))
2717  goto done;
2718 
2719  len = sizeof(buf);
2720  if (RegQueryValueW(hkey, NULL, buf, &len))
2721  {
2723  goto done;
2724  }
2726 done:
2727  if (hkey) RegCloseKey(hkey);
2728  return res;
2729 }
static LPCLSID pClsidNew
Definition: compobj.c:71
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define KEY_READ
Definition: nt_native.h:1023
#define CHARS_IN_GUID
#define REGDB_E_KEYMISSING
Definition: winerror.h:2694
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey)
Definition: compobj.c:2357
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4272
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
GLuint res
Definition: glext.h:9613
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247

Referenced by OleDoAutoConvert(), and test_OleDoAutoConvert().

◆ OleGetClipboard()

HRESULT WINAPI OleGetClipboard ( IDataObject **  ppDataObj)

Definition at line 2249 of file clipboard.c.

2250 {
2251  HRESULT hr;
2252  ole_clipbrd *clipbrd;
2253  DWORD seq_no;
2254 
2255  TRACE("(%p)\n", obj);
2256 
2257  if(!obj) return E_INVALIDARG;
2258  *obj = NULL;
2259 
2260  if(FAILED(hr = get_ole_clipbrd(&clipbrd))) return hr;
2261 
2262  seq_no = GetClipboardSequenceNumber();
2264  if(clipbrd->latest_snapshot && clipbrd->latest_snapshot->seq_no != seq_no)
2265  clipbrd->latest_snapshot = NULL;
2266 
2267  if(!clipbrd->latest_snapshot)
2268  {
2269  clipbrd->latest_snapshot = snapshot_construct(seq_no);
2270  if(!clipbrd->latest_snapshot)
2271  {
2273  return E_OUTOFMEMORY;
2274  }
2275  }
2276 
2277  *obj = &clipbrd->latest_snapshot->IDataObject_iface;
2278  IDataObject_AddRef(*obj);
2280 
2281  return S_OK;
2282 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static CRITICAL_SECTION latest_snapshot_cs
Definition: clipboard.c:177
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
DWORD seq_no
Definition: clipboard.c:141
IDataObject IDataObject_iface
Definition: clipboard.c:138
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
EXTINLINE DWORD WINAPI GetClipboardSequenceNumber(VOID)
Definition: ntwrapper.h:202
snapshot * latest_snapshot
Definition: clipboard.c:151
#define S_OK
Definition: intsafe.h:59
static snapshot * snapshot_construct(DWORD seq_no)
Definition: clipboard.c:1726
static HRESULT get_ole_clipbrd(ole_clipbrd **clipbrd)
Definition: clipboard.c:186
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by CDefViewBckgrndMenu::_bCanPaste(), CDefaultContextMenu::DoPaste(), HasClipboardData(), OleUIPasteSpecialW(), paste_special(), test_complex_get_clipboard(), test_consumer_refs(), test_enum_fmtetc(), test_flushed_getdata(), test_get_clipboard(), test_get_clipboard_locked(), test_get_clipboard_uninitialized(), test_getdatahere(), test_multithreaded_clipboard(), and test_nonole_clipboard().

◆ OleGetIconOfClass()

HGLOBAL WINAPI OleGetIconOfClass ( REFCLSID  rclsid,
LPOLESTR  lpszLabel,
BOOL  fUseTypeAsLabel 
)

Definition at line 59 of file ole2stubs.c.

60 {
61  FIXME("(%p,%p,%x), stub!\n", rclsid, lpszLabel, fUseTypeAsLabel);
62  return NULL;
63 }
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416

◆ OleGetIconOfFile()

HGLOBAL WINAPI OleGetIconOfFile ( LPOLESTR  lpszPath,
BOOL  fUseFileAsLabel 
)

Definition at line 68 of file ole2stubs.c.

69 {
70  FIXME("(%s, %d), stub!\n", debugstr_w(path), use_file_as_label);
71  return NULL;
72 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
Definition: services.c:325

◆ OleInitialize()

HRESULT WINAPI OleInitialize ( LPVOID  pvReserved)

Definition at line 172 of file ole2.c.

173 {
174  HRESULT hr;
175 
176  TRACE("(%p)\n", reserved);
177 
178  /*
179  * The first duty of the OleInitialize is to initialize the COM libraries.
180  */
182 
183  /*
184  * If the CoInitializeEx call failed, the OLE libraries can't be
185  * initialized.
186  */
187  if (FAILED(hr))
188  return hr;
189 
190  if (!COM_CurrentInfo()->ole_inits)
191  hr = S_OK;
192  else
193  hr = S_FALSE;
194 
195  /*
196  * Then, it has to initialize the OLE specific modules.
197  * This includes:
198  * Clipboard
199  * Drag and Drop
200  * Object linking and Embedding
201  * In-place activation
202  */
203  if (!COM_CurrentInfo()->ole_inits++ &&
205  {
206  /*
207  * Initialize the libraries.
208  */
209  TRACE("() - Initializing the OLE libraries\n");
210 
211  /*
212  * OLE Clipboard
213  */
215 
216  /*
217  * Drag and Drop
218  */
220 
221  /*
222  * OLE shared menu
223  */
225  }
226 
227  return hr;
228 }
HRESULT hr
Definition: shlfolder.c:183
DWORD ole_inits
static struct oletls * COM_CurrentInfo(void)
void OLEClipbrd_Initialize(void)
Definition: clipboard.c:1781
r reserved
Definition: btrfs.c:2655
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static LONG OLE_moduleLockCount
Definition: ole2.c:104
LONG HRESULT
Definition: typedefs.h:77
static void OLEDD_Initialize(void)
Definition: ole2.c:2126
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:1935
static void OLEMenu_Initialize(void)
Definition: ole2.c:1414

Referenced by _tWinMain(), adv_install(), AtlAxWinInit(), AVIFileInit(), BrowserThreadProc(), CreateHelpViewer(), CDesktopThread::DesktopThreadProc(), display_cpl_sheets(), do_enum(), FileOpenDlgProc95(), hook_proc(), init_explorerbrowser(), ME_MakeEditor(), OleInit::OleInit(), SHBrowseForFolderW(), SHRegisterDragDrop(), START_TEST(), StartWithDesktop(), test_CoCreateInstance(), test_CoInitializeEx(), test_consumer_refs(), test_DoDragDrop(), test_flushed_getdata(), test_get_clipboard_locked(), test_getdatahere(), test_multithreaded_clipboard(), test_nonole_clipboard(), test_ole_init_wndproc(), test_ole_initialization(), test_OleCreateFontIndirect(), test_OleInitialize_InitCounting(), test_Register_Revoke(), test_set_clipboard(), test_set_clipboard_DRAWCLIPBOARD(), test_TreatAsClass(), and CHardErrorThread::ThreadProc().

◆ OleIsCurrentClipboard()

HRESULT WINAPI OleIsCurrentClipboard ( LPDATAOBJECT  )

◆ OleIsRunning()

BOOL WINAPI OleIsRunning ( LPOLEOBJECT  pObject)

Definition at line 2821 of file ole2.c.

2822 {
2823  IRunnableObject *pRunnable;
2824  HRESULT hr;
2825  BOOL running;
2826 
2827  TRACE("(%p)\n", object);
2828 
2829  if (!object) return FALSE;
2830 
2831  hr = IOleObject_QueryInterface(object, &IID_IRunnableObject, (void **)&pRunnable);
2832  if (FAILED(hr))
2833  return TRUE;
2834  running = IRunnableObject_IsRunning(pRunnable);
2835  IRunnableObject_Release(pRunnable);
2836  return running;
2837 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IRunnableObject

Referenced by test_runnable().

◆ OleLoad()

HRESULT WINAPI OleLoad ( LPSTORAGE  pStg,
REFIID  riid,
LPOLECLIENTSITE  pClientSite,
LPVOID ppvObj 
)

Definition at line 1227 of file ole2.c.

1232 {
1233  IPersistStorage* persistStorage = NULL;
1234  IUnknown* pUnk;
1235  IOleObject* pOleObject = NULL;
1236  STATSTG storageInfo;
1237  HRESULT hres;
1238 
1239  TRACE("(%p, %s, %p, %p)\n", pStg, debugstr_guid(riid), pClientSite, ppvObj);
1240 
1241  *ppvObj = NULL;
1242 
1243  /*
1244  * TODO, Conversion ... OleDoAutoConvert
1245  */
1246 
1247  /*
1248  * Get the class ID for the object.
1249  */
1250  hres = IStorage_Stat(pStg, &storageInfo, STATFLAG_NONAME);
1251  if (FAILED(hres))
1252  return hres;
1253 
1254  /*
1255  * Now, try and create the handler for the object
1256  */
1257  hres = CoCreateInstance(&storageInfo.clsid,
1258  NULL,
1259  CLSCTX_INPROC_HANDLER|CLSCTX_INPROC_SERVER,
1260  riid,
1261  (void**)&pUnk);
1262 
1263  /*
1264  * If that fails, as it will most times, load the default
1265  * OLE handler.
1266  */
1267  if (FAILED(hres))
1268  {
1269  hres = OleCreateDefaultHandler(&storageInfo.clsid,
1270  NULL,
1271  riid,
1272  (void**)&pUnk);
1273  }
1274 
1275  /*
1276  * If we couldn't find a handler... this is bad. Abort the whole thing.
1277  */
1278  if (FAILED(hres))
1279  return hres;
1280 
1281  if (pClientSite)
1282  {
1283  hres = IUnknown_QueryInterface(pUnk, &IID_IOleObject, (void **)&pOleObject);
1284  if (SUCCEEDED(hres))
1285  {
1286  DWORD dwStatus;
1287  hres = IOleObject_GetMiscStatus(pOleObject, DVASPECT_CONTENT, &dwStatus);
1288  }
1289  }
1290 
1291  /*
1292  * Initialize the object with its IPersistStorage interface.
1293  */
1294  hres = IUnknown_QueryInterface(pUnk, &IID_IPersistStorage, (void**)&persistStorage);
1295  if (SUCCEEDED(hres))
1296  {
1297  hres = IPersistStorage_Load(persistStorage, pStg);
1298 
1299  IPersistStorage_Release(persistStorage);
1300  persistStorage = NULL;
1301  }
1302 
1303  if (SUCCEEDED(hres) && pClientSite)
1304  /*
1305  * Inform the new object of its client site.
1306  */
1307  hres = IOleObject_SetClientSite(pOleObject, pClientSite);
1308 
1309  /*
1310  * Cleanup interfaces used internally
1311  */
1312  if (pOleObject)
1313  IOleObject_Release(pOleObject);
1314 
1315  if (SUCCEEDED(hres))
1316  {
1317  IOleLink *pOleLink;
1318  HRESULT hres1;
1319  hres1 = IUnknown_QueryInterface(pUnk, &IID_IOleLink, (void **)&pOleLink);
1320  if (SUCCEEDED(hres1))
1321  {
1322  FIXME("handle OLE link\n");
1323  IOleLink_Release(pOleLink);
1324  }
1325  }
1326 
1327  if (FAILED(hres))
1328  {
1329  IUnknown_Release(pUnk);
1330  pUnk = NULL;
1331  }
1332 
1333  *ppvObj = pUnk;
1334 
1335  return hres;
1336 }
const GUID IID_IOleLink
REFIID riid
Definition: precomp.h:44
const GUID IID_IPersistStorage
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IOleObject
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
DWORD dwStatus
Definition: mediaobj.idl:95
HRESULT WINAPI OleCreateDefaultHandler(REFCLSID clsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by OleCreateFromDataEx(), OleCreateFromFileEx(), and test_OleLoad().

◆ OleLoadFromStream()

HRESULT WINAPI OleLoadFromStream ( IStream pStm,
REFIID  iidInterface,
void **  ppvObj 
)

Definition at line 9130 of file storage32.c.

9131 {
9132  CLSID clsid;
9133  HRESULT res;
9134  LPPERSISTSTREAM xstm;
9135 
9136  TRACE("(%p,%s,%p)\n",pStm,debugstr_guid(iidInterface),ppvObj);
9137 
9138  res=ReadClassStm(pStm,&clsid);
9139  if (FAILED(res))
9140  return res;
9141  res=CoCreateInstance(&clsid,NULL,CLSCTX_INPROC_SERVER,iidInterface,ppvObj);
9142  if (FAILED(res))
9143  return res;
9144  res=IUnknown_QueryInterface((IUnknown*)*ppvObj,&IID_IPersistStream,(LPVOID*)&xstm);
9145  if (FAILED(res)) {
9146  IUnknown_Release((IUnknown*)*ppvObj);
9147  return res;
9148  }
9149  res=IPersistStream_Load(xstm,pStm);
9150  IPersistStream_Release(xstm);
9151  /* FIXME: all refcounts ok at this point? I think they should be:
9152  * pStm : unchanged
9153  * ppvObj : 1
9154  * xstm : 0 (released)
9155  */
9156  return res;
9157 }
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IPersistStream
Definition: proxy.cpp:13
REFCLSID clsid
Definition: msctf.c:84
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
HRESULT WINAPI ReadClassStm(IStream *pStm, CLSID *pclsid)
Definition: storage32.c:9549
interface IPersistStream * LPPERSISTSTREAM
Definition: objfwd.h:16
GLuint res
Definition: glext.h:9613

Referenced by CompositeMonikerImpl_Load(), HlinkClone(), IPersistStream_fnLoad(), and CTrayBandSite::OnLoad().

◆ OleLockRunning()

HRESULT WINAPI OleLockRunning ( LPUNKNOWN  pUnknown,
BOOL  fLock,
BOOL  fLastUnlockCloses 
)

Definition at line 1380 of file ole2.c.

1381 {
1383  HRESULT hres;
1384 
1385  TRACE("(%p,%x,%x)\n", pUnknown, fLock, fLastUnlockCloses);
1386 
1387  hres = IUnknown_QueryInterface(pUnknown,
1389  (void**)&runnable);
1390 
1391  if (SUCCEEDED(hres))
1392  {
1393  hres = IRunnableObject_LockRunning(runnable, fLock, fLastUnlockCloses);
1394 
1395  IRunnableObject_Release(runnable);
1396 
1397  return hres;
1398  }
1399 
1400  return S_OK;
1401 }
static IRunnableObject * runnable
Definition: ole2.c:76
smooth NULL
Definition: ftsmooth.c:416
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IRunnableObject
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by test_OleLockRunning().

◆ OleMetafilePictFromIconAndLabel()

HGLOBAL WINAPI OleMetafilePictFromIconAndLabel ( HICON  hIcon,
LPOLESTR  lpszLabel,
LPOLESTR  lpszSourceFile,
UINT  iIconIndex 
)

Definition at line 43 of file ole32_main.c.

45 {
46  METAFILEPICT mfp;
47  HDC hdc;
48  HGLOBAL hmem = NULL;
49  LPVOID mfdata;
50  static const char szIconOnly[] = "IconOnly";
51  SIZE text_size = { 0, 0 };
52  INT width;
53  INT icon_width;
54  INT icon_height;
55  INT label_offset;
56  HDC hdcScreen;
57  LOGFONTW lf;
58  HFONT font;
59 
60  TRACE("%p %p %s %d\n", hIcon, lpszLabel, debugstr_w(lpszSourceFile), iIconIndex);
61 
62  if( !hIcon )
63  return NULL;
64 
65  if (!SystemParametersInfoW(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0))
66  return NULL;
67 
69  if (!font)
70  return NULL;
71 
73  if( !hdc )
74  {
76  return NULL;
77  }
78 
80 
81  ExtEscape(hdc, MFCOMMENT, sizeof(szIconOnly), szIconOnly, 0, NULL);
82 
83  icon_width = GetSystemMetrics(SM_CXICON);
84  icon_height = GetSystemMetrics(SM_CYICON);
85  /* FIXME: should we give the label a bit of padding here? */
86  label_offset = icon_height;
87  if (lpszLabel)
88  {
89  HFONT screen_old_font;
90  /* metafile DCs don't support GetTextExtentPoint32, so size the font
91  * using the desktop window DC */
92  hdcScreen = GetDC(NULL);
93  screen_old_font = SelectObject(hdcScreen, font);
94  GetTextExtentPoint32W(hdcScreen, lpszLabel, lstrlenW(lpszLabel), &text_size);
95  SelectObject(hdcScreen, screen_old_font);
96  ReleaseDC(NULL, hdcScreen);
97 
98  width = 3 * icon_width;
99  }
100  else
101  width = icon_width;
102 
104  SetWindowOrgEx(hdc, 0, 0, NULL);
105  SetWindowExtEx(hdc, width, label_offset + text_size.cy, NULL);
106 
107  /* draw the icon centered */
108  DrawIcon(hdc, (width-icon_width) / 2, 0, hIcon);
109  if(lpszLabel)
110  /* draw the label centered too, if provided */
111  TextOutW(hdc, (width-text_size.cx) / 2, label_offset, lpszLabel, lstrlenW(lpszLabel));
112 
113  if (lpszSourceFile)
114  {
115  char szIconIndex[10];
116  int path_length = WideCharToMultiByte(CP_ACP,0,lpszSourceFile,-1,NULL,0,NULL,NULL);
117  if (path_length > 1)
118  {
119  char * szPath = CoTaskMemAlloc(path_length * sizeof(CHAR));
120  if (szPath)
121  {
122  WideCharToMultiByte(CP_ACP,0,lpszSourceFile,-1,szPath,path_length,NULL,NULL);
125  }
126  }
127  snprintf(szIconIndex, 10, "%u", iIconIndex);
128  ExtEscape(hdc, MFCOMMENT, strlen(szIconIndex)+1, szIconIndex, 0, NULL);
129  }
130 
131  mfp.mm = MM_ANISOTROPIC;
132  hdcScreen = GetDC(NULL);
134  mfp.yExt = MulDiv(label_offset + text_size.cy, HIMETRIC_INCHES, GetDeviceCaps(hdcScreen, LOGPIXELSY));
135  ReleaseDC(NULL, hdcScreen);
136  mfp.hMF = CloseMetaFile(hdc);
138  if( !mfp.hMF )
139  return NULL;
140 
141  hmem = GlobalAlloc( GMEM_MOVEABLE, sizeof(mfp) );
142  if( !hmem )
143  {
144  DeleteMetaFile(mfp.hMF);
145  return NULL;
146  }
147 
148  mfdata = GlobalLock( hmem );
149  if( !mfdata )
150  {
151  GlobalFree( hmem );
152  DeleteMetaFile(mfp.hMF);
153  return NULL;
154  }
155 
156  memcpy(mfdata,&mfp,sizeof(mfp));
157  GlobalUnlock( hmem );
158 
159  TRACE("returning %p\n",hmem);
160 
161  return hmem;
162 }
GLint GLint GLsizei width
Definition: gl.h:1546
HMETAFILE hMF
Definition: wingdi.h:2586
#define LOGPIXELSX
Definition: wingdi.h:717
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
BOOL WINAPI SetWindowExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
#define WideCharToMultiByte
Definition: compat.h:101
HDC WINAPI GetDC(_In_opt_ HWND)
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
Definition: mk_font.cpp:20
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
HDC WINAPI CreateMetaFileW(_In_opt_ LPCWSTR)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define snprintf
Definition: wintirpc.h:48
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define MFCOMMENT
Definition: wingdi.h:997
#define lstrlenW
Definition: compat.h:407
int32_t INT
Definition: typedefs.h:56
int WINAPI SetMapMode(_In_ HDC, _In_ int)
#define debugstr_w
Definition: kernel32.h:32
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define SM_CXICON
Definition: winuser.h:962
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
LONG cx
Definition: windef.h:319
HMETAFILE WINAPI CloseMetaFile(_In_ HDC hdc)
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define TRACE(s)
Definition: solgame.cpp:4
static long path_length
Definition: maze.c:116
int WINAPI GetSystemMetrics(_In_ int)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
#define SM_CYICON
Definition: winuser.h:963
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HDC hdc
Definition: main.c:9
#define MM_ANISOTROPIC
Definition: wingdi.h:866
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
BOOL WINAPI DrawIcon(_In_ HDC, _In_ int, _In_ int, _In_ HICON)
Definition: cursoricon.c:1987
#define HIMETRIC_INCHES
Definition: ole32_main.c:38
HICON hIcon
Definition: msconfig.c:44
LPCWSTR szPath
Definition: env.c:35
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1362
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
BOOL WINAPI SetWindowOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
Definition: coord.c:526
BOOL WINAPI DeleteMetaFile(_In_ HMETAFILE)
#define LOGPIXELSY
Definition: wingdi.h:718
LONG cy
Definition: windef.h:320
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
#define GMEM_MOVEABLE
Definition: winbase.h:291
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
int WINAPI ExtEscape(_In_ HDC hdc, _In_ int iEscape, _In_ int cjInput, _In_reads_bytes_opt_(cjInput) LPCSTR lpInData, _In_ int cjOutput, _Out_writes_bytes_opt_(cjOutput) LPSTR lpOutData)

Referenced by test_data_cache().

◆ OleNoteObjectVisible()

HRESULT WINAPI OleNoteObjectVisible ( LPUNKNOWN  pUnknown,
BOOL  fVisible 
)

Definition at line 2842 of file ole2.c.

2843 {
2844  TRACE("(%p, %s)\n", pUnknown, bVisible ? "TRUE" : "FALSE");
2845  return CoLockObjectExternal(pUnknown, bVisible, TRUE);
2846 }
#define TRUE
Definition: types.h:120
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI CoLockObjectExternal(LPUNKNOWN pUnk, BOOL fLock, BOOL fLastUnlockReleases)
Definition: compobj.c:3652

◆ OleQueryCreateFromData()

HRESULT WINAPI OleQueryCreateFromData ( LPDATAOBJECT  pSrcDataObject)

◆ OleQueryLinkFromData()

HRESULT WINAPI OleQueryLinkFromData ( IDataObject pSrcDataObject)

Definition at line 857 of file ole2.c.

859 {
860  FIXME("(%p),stub!\n", pSrcDataObject);
861  return S_FALSE;
862 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_FALSE
Definition: winerror.h:2357

◆ OleRegEnumFormatEtc()

HRESULT WINAPI OleRegEnumFormatEtc ( REFCLSID  clsid,
DWORD  dwDirection,
LPENUMFORMATETC ppenumFormatetc 
)

Definition at line 77 of file ole2stubs.c.

81 {
82  FIXME("(%p, %d, %p), stub!\n", clsid, dwDirection, ppenumFormatetc);
83 
84  return E_NOTIMPL;
85 }
#define FIXME(fmt,...)
Definition: debug.h:110
REFCLSID clsid
Definition: msctf.c:84
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by DefaultHandler_EnumFormatEtc().

◆ OleRegEnumVerbs()

HRESULT WINAPI OleRegEnumVerbs ( REFCLSID  clsid,
LPENUMOLEVERB *  ppenum 
)

Definition at line 1128 of file ole2.c.

1129 {
1130  LONG res;
1131  HKEY hkeyVerb;
1132  DWORD dwSubKeys;
1133  static const WCHAR wszVerb[] = {'V','e','r','b',0};
1134 
1135  TRACE("(%s, %p)\n", debugstr_guid(clsid), ppenum);
1136 
1137  res = COM_OpenKeyForCLSID(clsid, wszVerb, KEY_READ, &hkeyVerb);
1138  if (FAILED(res))
1139  {
1140  if (res == REGDB_E_CLASSNOTREG)
1141  ERR("CLSID %s not registered\n", debugstr_guid(clsid));
1142  else if (res == REGDB_E_KEYMISSING)
1143  ERR("no Verbs key for class %s\n", debugstr_guid(clsid));
1144  else
1145  ERR("failed to open Verbs key for CLSID %s with error %d\n",
1146  debugstr_guid(clsid), res);
1147  return res;
1148  }
1149 
1150  res = RegQueryInfoKeyW(hkeyVerb, NULL, NULL, NULL, &dwSubKeys, NULL,
1151  NULL, NULL, NULL, NULL, NULL, NULL);
1152  if (res != ERROR_SUCCESS)
1153  {
1154  ERR("failed to get subkey count with error %d\n", GetLastError());
1155  return REGDB_E_READREGDB;
1156  }
1157 
1158  if (!dwSubKeys)
1159  {
1160  WARN("class %s has no verbs\n", debugstr_guid(clsid));
1161  RegCloseKey(hkeyVerb);
1162  return OLEOBJ_E_NOVERBS;
1163  }
1164 
1165  return EnumOLEVERB_Construct(hkeyVerb, 0, ppenum);
1166 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
#define REGDB_E_READREGDB
Definition: winerror.h:2692
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define REGDB_E_KEYMISSING
Definition: winerror.h:2694
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey)
Definition: compobj.c:2357
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3704
REFCLSID clsid
Definition: msctf.c:84
static HRESULT EnumOLEVERB_Construct(HKEY hkeyVerb, ULONG index, IEnumOLEVERB **ppenum)
Definition: ole2.c:1096
#define ERR(fmt,...)
Definition: debug.h:109
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define OLEOBJ_E_NOVERBS
Definition: winerror.h:2722
GLuint res
Definition: glext.h:9613

Referenced by DefaultHandler_EnumVerbs(), and SEALED_::IOleObject::EnumVerbs().

◆ OleRegGetMiscStatus()

HRESULT WINAPI OleRegGetMiscStatus ( REFCLSID  clsid,
DWORD  dwAspect,
DWORD pdwStatus 
)

Definition at line 867 of file ole2.c.

871 {
872  static const WCHAR miscstatusW[] = {'M','i','s','c','S','t','a','t','u','s',0};
873  static const WCHAR dfmtW[] = {'%','d',0};
874  WCHAR keyName[16];
875  HKEY miscStatusKey;
876  HKEY aspectKey;
877  LONG result;
878  HRESULT hr;
879 
880  TRACE("(%s, %d, %p)\n", debugstr_guid(clsid), dwAspect, pdwStatus);
881 
882  if (!pdwStatus) return E_INVALIDARG;
883 
884  *pdwStatus = 0;
885 
886  if (actctx_get_miscstatus(clsid, dwAspect, pdwStatus)) return S_OK;
887 
888  hr = COM_OpenKeyForCLSID(clsid, miscstatusW, KEY_READ, &miscStatusKey);
889  if (FAILED(hr))
890  /* missing key is not a failure */
891  return hr == REGDB_E_KEYMISSING ? S_OK : hr;
892 
893  OLEUTL_ReadRegistryDWORDValue(miscStatusKey, pdwStatus);
894 
895  /*
896  * Open the key specific to the requested aspect.
897  */
898  sprintfW(keyName, dfmtW, dwAspect);
899 
900  result = open_classes_key(miscStatusKey, keyName, KEY_READ, &aspectKey);
901  if (result == ERROR_SUCCESS)
902  {
903  OLEUTL_ReadRegistryDWORDValue(aspectKey, pdwStatus);
904  RegCloseKey(aspectKey);
905  }
906 
907  RegCloseKey(miscStatusKey);
908  return S_OK;
909 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_READ
Definition: nt_native.h:1023
static void OLEUTL_ReadRegistryDWORDValue(HKEY regKey, DWORD *pdwValue)
Definition: ole2.c:2529
#define REGDB_E_KEYMISSING
Definition: winerror.h:2694
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey)
Definition: compobj.c:2357
#define debugstr_guid
Definition: kernel32.h:35
static const WCHAR miscstatusW[]
Definition: actctx.c:625
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
REFCLSID clsid
Definition: msctf.c:84
#define S_OK
Definition: intsafe.h:59
LSTATUS open_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
Definition: compobj.c:423
#define sprintfW
Definition: unicode.h:58
BOOL actctx_get_miscstatus(const CLSID *clsid, DWORD aspect, DWORD *status)
Definition: compobj.c:257
GLuint64EXT * result
Definition: glext.h:11304

Referenced by DefaultHandler_GetMiscStatus(), and test_OleRegGetMiscStatus().

◆ OleRegGetUserType()

HRESULT WINAPI OleRegGetUserType ( REFCLSID  clsid,
DWORD  dwFormOfType,
LPOLESTR pszUserType 
)

Definition at line 681 of file ole2.c.

682 {
683  static const WCHAR auxusertypeW[] = {'A','u','x','U','s','e','r','T','y','p','e','\\','%','d',0};
684  DWORD valuetype, valuelen;
685  WCHAR auxkeynameW[16];
686  HKEY usertypekey;
687  HRESULT hres;
688  LONG ret;
689 
690  TRACE("(%s, %u, %p)\n", debugstr_guid(clsid), form, usertype);
691 
692  if (!usertype)
693  return E_INVALIDARG;
694 
695  *usertype = NULL;
696 
697  /* Return immediately if it's not registered. */
698  hres = COM_OpenKeyForCLSID(clsid, NULL, KEY_READ, &usertypekey);
699  if (FAILED(hres))
700  return hres;
701 
702  valuelen = 0;
703 
704  /* Try additional types if requested. If they don't exist fall back to USERCLASSTYPE_FULL. */
705  if (form != USERCLASSTYPE_FULL)
706  {
707  HKEY auxkey;
708 
709  sprintfW(auxkeynameW, auxusertypeW, form);
710  if (COM_OpenKeyForCLSID(clsid, auxkeynameW, KEY_READ, &auxkey) == S_OK)
711  {
712  if (!RegQueryValueExW(auxkey, emptyW, NULL, &valuetype, NULL, &valuelen) && valuelen)
713  {
714  RegCloseKey(usertypekey);
715  usertypekey = auxkey;
716  }
717  else
718  RegCloseKey(auxkey);
719  }
720  }
721 
722  valuelen = 0;
723  if (RegQueryValueExW(usertypekey, emptyW, NULL, &valuetype, NULL, &valuelen))
724  {
725  RegCloseKey(usertypekey);
726  return REGDB_E_READREGDB;
727  }
728 
729  *usertype = CoTaskMemAlloc(valuelen);
730  if (!*usertype)
731  {
732  RegCloseKey(usertypekey);
733  return E_OUTOFMEMORY;
734  }
735 
736  ret = RegQueryValueExW(usertypekey,
737  emptyW,
738  NULL,
739  &valuetype,
740  (LPBYTE)*usertype,
741  &valuelen);
742  RegCloseKey(usertypekey);
743  if (ret != ERROR_SUCCESS)
744  {
745  CoTaskMemFree(*usertype);
746  *usertype = NULL;
747  return REGDB_E_READREGDB;
748  }
749 
750  return S_OK;
751 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
#define REGDB_E_READREGDB
Definition: winerror.h:2692
int form
Definition: main.c:89
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey)
Definition: compobj.c:2357
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
REFCLSID clsid
Definition: msctf.c:84
static const WCHAR emptyW[]
Definition: ole2.c:126
#define S_OK
Definition: intsafe.h:59
#define sprintfW
Definition: unicode.h:58
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

Referenced by DefaultHandler_GetUserType(), get_descriptors(), OleDoAutoConvert(), OleObject_GetUserType(), and test_OleRegGetUserType().

◆ OleRun()

HRESULT WINAPI OleRun ( LPUNKNOWN  pUnknown)

Definition at line 1208 of file ole2.c.

1209 {
1210  IRunnableObject *runable;
1211  HRESULT hres;
1212 
1213  TRACE("(%p)\n", pUnknown);
1214 
1215  hres = IUnknown_QueryInterface(pUnknown, &IID_IRunnableObject, (void**)&runable);
1216  if (FAILED(hres))
1217  return S_OK; /* Appears to return no error. */
1218 
1219  hres = IRunnableObject_Run(runable, NULL);
1220  IRunnableObject_Release(runable);
1221  return hres;
1222 }
smooth NULL
Definition: ftsmooth.c:416
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IRunnableObject
#define S_OK
Definition: intsafe.h:59

Referenced by OleCreate(), START_TEST(), and test_OleRun().

◆ OleSave()

HRESULT WINAPI OleSave ( LPPERSISTSTORAGE  pPS,
LPSTORAGE  pStg,
BOOL  fSameAsLoad 
)

Definition at line 1341 of file ole2.c.

1345 {
1346  HRESULT hres;
1347  CLSID objectClass;
1348 
1349  TRACE("(%p,%p,%x)\n", pPS, pStg, fSameAsLoad);
1350 
1351  /*
1352  * First, we transfer the class ID (if available)
1353  */
1354  hres = IPersistStorage_GetClassID(pPS, &objectClass);
1355 
1356  if (SUCCEEDED(hres))
1357  {
1358  WriteClassStg(pStg, &objectClass);
1359  }
1360 
1361  /*
1362  * Then, we ask the object to save itself to the
1363  * storage. If it is successful, we commit the storage.
1364  */
1365  hres = IPersistStorage_Save(pPS, pStg, fSameAsLoad);
1366 
1367  if (SUCCEEDED(hres))
1368  {
1369  IStorage_Commit(pStg,
1370  STGC_DEFAULT);
1371  }
1372 
1373  return hres;
1374 }
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI WriteClassStg(IStorage *pStg, REFCLSID rclsid)
Definition: storage32.c:9079
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ OleSaveToStream()

HRESULT WINAPI OleSaveToStream ( IPersistStream pPStm,
IStream pStm 
)

Definition at line 9165 of file storage32.c.

9166 {
9167 
9168  CLSID clsid;
9169  HRESULT res;
9170 
9171  TRACE("(%p,%p)\n",pPStm,pStm);
9172 
9173  res=IPersistStream_GetClassID(pPStm,&clsid);
9174 
9175  if (SUCCEEDED(res)){
9176 
9177  res=WriteClassStm(pStm,&clsid);
9178 
9179  if (SUCCEEDED(res))
9180 
9181  res=IPersistStream_Save(pPStm,pStm,TRUE);
9182  }
9183 
9184  TRACE("Finished Save\n");
9185  return res;
9186 }
#define TRUE
Definition: types.h:120
HRESULT WINAPI WriteClassStm(IStream *pStm, REFCLSID rclsid)
Definition: storage32.c:9526
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
REFCLSID clsid
Definition: msctf.c:84
GLuint res
Definition: glext.h:9613
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CompositeMonikerImpl_Save(), HlinkClone(), and IPersistStream_fnSave().

◆ OleSetAutoConvert()

HRESULT WINAPI OleSetAutoConvert ( REFCLSID  clsidOld,
REFCLSID  clsidNew 
)

Definition at line 2734 of file ole2.c.

2735 {
2736  static const WCHAR wszAutoConvertTo[] = {'A','u','t','o','C','o','n','v','e','r','t','T','o',0};
2737  HKEY hkey = NULL;
2738  WCHAR szClsidNew[CHARS_IN_GUID];
2739  HRESULT res = S_OK;
2740 
2741  TRACE("(%s,%s)\n", debugstr_guid(clsidOld), debugstr_guid(clsidNew));
2742 
2743  res = COM_OpenKeyForCLSID(clsidOld, NULL, KEY_READ | KEY_WRITE, &hkey);
2744  if (FAILED(res))
2745  goto done;
2746  StringFromGUID2(clsidNew, szClsidNew, CHARS_IN_GUID);
2747  if (RegSetValueW(hkey, wszAutoConvertTo, REG_SZ, szClsidNew, (strlenW(szClsidNew)+1) * sizeof(WCHAR)))
2748  {
2750  goto done;
2751  }
2752 
2753 done:
2754  if (hkey) RegCloseKey(hkey);
2755  return res;
2756 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define KEY_READ
Definition: nt_native.h:1023
#define CHARS_IN_GUID
LONG WINAPI RegSetValueW(HKEY hKeyOriginal, LPCWSTR lpSubKey, DWORD dwType, LPCWSTR lpData, DWORD cbData)
Definition: reg.c:5036
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey)
Definition: compobj.c:2357
#define debugstr_guid
Definition: kernel32.h:35
#define KEY_WRITE
Definition: nt_native.h:1031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
#define REGDB_E_WRITEREGDB
Definition: winerror.h:2693
#define S_OK
Definition: intsafe.h:59
GLuint res
Definition: glext.h:9613
#define REG_SZ
Definition: layer.c:22

Referenced by test_OleDoAutoConvert().

◆ OleSetClipboard()

HRESULT WINAPI OleSetClipboard ( LPDATAOBJECT  )

◆ OleSetContainedObject()

HRESULT WINAPI OleSetContainedObject ( LPUNKNOWN  pUnknown,
BOOL  fContained 
)

Definition at line 1171 of file ole2.c.

1174 {
1176  HRESULT hres;
1177 
1178  TRACE("(%p,%x)\n", pUnknown, fContained);
1179 
1180  hres = IUnknown_QueryInterface(pUnknown,
1182  (void**)&runnable);
1183 
1184  if (SUCCEEDED(hres))
1185  {
1186  hres = IRunnableObject_SetContainedObject(runnable, fContained);
1187 
1188  IRunnableObject_Release(runnable);
1189 
1190  return hres;
1191  }
1192 
1193  return S_OK;
1194 }
static IRunnableObject * runnable
Definition: ole2.c:76
smooth NULL
Definition: ftsmooth.c:416
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IRunnableObject
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by InitWebBrowser().

◆ OleSetMenuDescriptor()

HRESULT WINAPI OleSetMenuDescriptor ( HOLEMENU  hmenuDescriptor,
HWND  hwndFrame,
HWND  hwndActiveObject,
LPOLEINPLACEFRAME  lpFrame,
LPOLEINPLACEACTIVEOBJECT  lpActiveObject 
)

Definition at line 1878 of file ole2.c.

1884 {
1885  OleMenuDescriptor *pOleMenuDescriptor = NULL;
1886 
1887  /* Check args */
1888  if ( !hwndFrame || (hOleMenu && !hwndActiveObject) )
1889  return E_INVALIDARG;
1890 
1891  if ( lpFrame || lpActiveObject )
1892  {
1893  FIXME("(%p, %p, %p, %p, %p), Context sensitive help filtering not implemented!\n",
1894  hOleMenu,
1895  hwndFrame,
1896  hwndActiveObject,
1897  lpFrame,
1898  lpActiveObject);
1899  }
1900 
1901  /* Set up a message hook to intercept the containers frame window messages.
1902  * The message filter is responsible for dispatching menu messages from the
1903  * shared menu which are intended for the object.
1904  */
1905 
1906  if ( hOleMenu ) /* Want to install dispatching code */
1907  {
1908  /* If OLEMenu hooks are already installed for this thread, fail
1909  * Note: This effectively means that OleSetMenuDescriptor cannot
1910  * be called twice in succession on the same frame window
1911  * without first calling it with a null hOleMenu to uninstall
1912  */
1914  return E_FAIL;
1915 
1916  /* Get the menu descriptor */
1917  pOleMenuDescriptor = GlobalLock( hOleMenu );
1918  if ( !pOleMenuDescriptor )
1919  return E_UNEXPECTED;
1920 
1921  /* Update the menu descriptor */
1922  pOleMenuDescriptor->hwndFrame = hwndFrame;
1923  pOleMenuDescriptor->hwndActiveObject = hwndActiveObject;
1924 
1925  GlobalUnlock( hOleMenu );
1926  pOleMenuDescriptor = NULL;
1927 
1928  /* Add a menu descriptor windows property to the frame window */
1929  SetPropW( hwndFrame, prop_olemenuW, hOleMenu );
1930 
1931  /* Install thread scope message hooks for WH_GETMESSAGE and WH_CALLWNDPROC */
1933  return E_FAIL;
1934  }
1935  else /* Want to uninstall dispatching code */
1936  {
1937  /* Uninstall the hooks */
1939  return E_FAIL;
1940 
1941  /* Remove the menu descriptor property from the frame window */
1942  RemovePropW( hwndFrame, prop_olemenuW );
1943  }
1944 
1945  return S_OK;
1946 }
static const WCHAR prop_olemenuW[]
Definition: ole2.c:115
HWND hwndActiveObject
Definition: ole2.c:83
static BOOL OLEMenu_UnInstallHooks(DWORD tid)
Definition: ole2.c:1484
#define E_FAIL
Definition: ddrawi.h:102
static OleMenuHookItem * OLEMenu_IsHookInstalled(DWORD tid)
Definition: ole2.c:1526
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
static BOOL OLEMenu_InstallHooks(DWORD tid)
Definition: ole2.c:1434
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define S_OK
Definition: intsafe.h:59
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define E_UNEXPECTED
Definition: winerror.h:2456

Referenced by test_ole_menu().

◆ OleTranslateAccelerator()

HRESULT WINAPI OleTranslateAccelerator ( LPOLEINPLACEFRAME  lpFrame,
LPOLEINPLACEFRAMEINFO  lpFrameInfo,
struct tagMSG lpmsg 
)

◆ OleUninitialize()

void WINAPI OleUninitialize ( void  )

Definition at line 233 of file ole2.c.

234 {
235  TRACE("()\n");
236 
237  if (COM_CurrentInfo()->ole_inits == 0)
238  {
239  WARN("ole_inits is already 0\n");
240  return ;
241  }
242  /*
243  * If we hit the bottom of the lock stack, free the libraries.
244  */
246  {
247  /*
248  * Actually free the libraries.
249  */
250  TRACE("() - Freeing the last reference count\n");
251 
252  /*
253  * OLE Clipboard
254  */
256 
257  /*
258  * OLE shared menu
259  */
261  }
262 
263  /*
264  * Then, uninitialize the COM libraries.
265  */
266  CoUninitialize();
267 }
void OLEClipbrd_UnInitialize(void)
Definition: clipboard.c:2027
return
Definition: dirsup.c:529
#define WARN(fmt,...)
Definition: debug.h:111
static void OLEMenu_UnInitialize(void)
Definition: ole2.c:1423
DWORD ole_inits
static struct oletls * COM_CurrentInfo(void)
#define TRACE(s)
Definition: solgame.cpp:4
static LONG OLE_moduleLockCount
Definition: ole2.c:104
#define InterlockedDecrement
Definition: armddk.h:52
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991

Referenced by _tWinMain(), adv_install(), BrowserThreadProc(), display_cpl_sheets(), do_enum(), GetFileName95(), hook_proc(), ME_DestroyEditor(), ReleaseHelpViewer(), CHardErrorThread::s_HardErrorThreadProc(), SHBrowseForFolderW(), START_TEST(), StartWithDesktop(), test_CoCreateInstance(), test_CoInitializeEx(), test_consumer_refs(), test_DoDragDrop(), test_flushed_getdata(), test_get_clipboard_locked(), test_getdatahere(), test_multithreaded_clipboard(), test_nonole_clipboard(), test_ole_init_wndproc(), test_ole_initialization(), test_OleCreateFontIndirect(), test_OleInitialize_InitCounting(), test_Register_Revoke(), test_set_clipboard(), test_set_clipboard_DRAWCLIPBOARD(), test_TreatAsClass(), and OleInit::~OleInit().

◆ ReadClassStg()

HRESULT WINAPI ReadClassStg ( IStorage pstg,
CLSID pclsid 
)

Definition at line 9104 of file storage32.c.

9104  {
9105 
9106  STATSTG pstatstg;
9107  HRESULT hRes;
9108 
9109  TRACE("(%p, %p)\n", pstg, pclsid);
9110 
9111  if(!pstg || !pclsid)
9112  return E_INVALIDARG;
9113 
9114  /*
9115  * read a STATSTG structure (contains the clsid) from the storage
9116  */
9117  hRes=IStorage_Stat(pstg,&pstatstg,STATFLAG_NONAME);
9118 
9119  if(SUCCEEDED(hRes))
9120  *pclsid=pstatstg.clsid;
9121 
9122  return hRes;
9123 }
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by DataCache_InitNew(), DataCache_Load(), GetClassFile(), render_embed_source_hack(), and test_writeclassstg().

◆ ReadClassStm()

HRESULT WINAPI ReadClassStm ( IStream pStm,
CLSID pclsid 
)

Definition at line 9549 of file storage32.c.

9550 {
9551  ULONG nbByte;
9552  HRESULT res;
9553 
9554  TRACE("(%p,%p)\n",pStm,pclsid);
9555 
9556  if (!pStm || !pclsid)
9557  return E_INVALIDARG;
9558 
9559  /* clear the output args */
9560  *pclsid = CLSID_NULL;
9561 
9562  res = IStream_Read(pStm, pclsid, sizeof(CLSID), &nbByte);
9563 
9564  if (FAILED(res))
9565  return res;
9566 
9567  if (nbByte != sizeof(CLSID))
9568  return STG_E_READFAULT;
9569  else
9570  return S_OK;
9571 }
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define CLSID_NULL
Definition: guiddef.h:94
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define STG_E_READFAULT
Definition: winerror.h:2576
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1

Referenced by OleLoadFromStream(), ReadFmtUserTypeStg(), and test_ReadClassStm().

◆ ReadFmtUserTypeStg()

HRESULT WINAPI ReadFmtUserTypeStg ( LPSTORAGE  pstg,
CLIPFORMAT *  pcf,
LPOLESTR lplpszUserType 
)

Definition at line 9400 of file storage32.c.

9401 {
9402  HRESULT r;
9403  IStream *stm = 0;
9404  static const WCHAR szCompObj[] = { 1, 'C','o','m','p','O','b','j', 0 };
9405  unsigned char unknown1[12];
9406  unsigned char unknown2[16];
9407  DWORD count;
9408  LPWSTR szProgIDName = NULL, szCLSIDName = NULL, szOleTypeName = NULL;
9409  CLSID clsid;
9410 
9411  TRACE("(%p,%p,%p)\n", pstg, pcf, lplpszUserType);
9412 
9413  r = IStorage_OpenStream( pstg, szCompObj, NULL,
9414  STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm );
9415  if( FAILED ( r ) )
9416  {
9417  WARN("Failed to open stream r = %08x\n", r);
9418  return r;
9419  }
9420 
9421  /* read the various parts of the structure */
9422  r = IStream_Read( stm, unknown1, sizeof(unknown1), &count );
9423  if( FAILED( r ) || ( count != sizeof(unknown1) ) )
9424  goto end;
9425  r = ReadClassStm( stm, &clsid );
9426  if( FAILED( r ) )
9427  goto end;
9428 
9429  r = STREAM_ReadString( stm, &szCLSIDName );
9430  if( FAILED( r ) )
9431  goto end;
9432 
9433  r = STREAM_ReadString( stm, &szOleTypeName );
9434  if( FAILED( r ) )
9435  goto end;
9436 
9437  r = STREAM_ReadString( stm, &szProgIDName );
9438  if( FAILED( r ) )
9439  goto end;
9440 
9441  r = IStream_Read( stm, unknown2, sizeof(unknown2), &count );
9442  if( FAILED( r ) || ( count != sizeof(unknown2) ) )
9443  goto end;
9444 
9445  /* ok, success... now we just need to store what we found */
9446  if( pcf )
9447  *pcf = RegisterClipboardFormatW( szOleTypeName );
9448 
9449  if( lplpszUserType )
9450  {
9451  *lplpszUserType = szCLSIDName;
9452  szCLSIDName = NULL;
9453  }
9454 
9455 end:
9456  CoTaskMemFree( szCLSIDName );
9457  CoTaskMemFree( szOleTypeName );
9458  CoTaskMemFree( szProgIDName );
9459  IStream_Release( stm );
9460 
9461  return r;
9462 }
DWORD unknown2[46]
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:111
GLuint GLuint end
Definition: gl.h:1545
static HRESULT STREAM_ReadString(IStream *stm, LPWSTR *string)
Definition: storage32.c:9262
smooth NULL
Definition: ftsmooth.c:416
#define STGM_READ
Definition: objbase.h:916
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
REFCLSID clsid
Definition: msctf.c:84
HRESULT WINAPI ReadClassStm(IStream *pStm, CLSID *pclsid)
Definition: storage32.c:9549
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by OleDoAutoConvert().

◆ RegisterDragDrop()

HRESULT WINAPI RegisterDragDrop ( HWND  ,
LPDROPTARGET   
)

Definition at line 560 of file ole2.c.

561 {
562  DWORD pid = 0;
563  HRESULT hr;
564  IStream *stream;
565  HANDLE map;
566  IDropTarget *wrapper;
567 
568  TRACE("(%p,%p)\n", hwnd, pDropTarget);
569 
570  if (!COM_CurrentApt())
571  {
572  ERR("COM not initialized\n");
573  return E_OUTOFMEMORY;
574  }
575 
576  if (!pDropTarget)
577  return E_INVALIDARG;
578 
579  if (!IsWindow(hwnd))
580  {
581  ERR("invalid hwnd %p\n", hwnd);
582  return DRAGDROP_E_INVALIDHWND;
583  }
584 
585  /* block register for other processes windows */
587  if (pid != GetCurrentProcessId())
588  {
589  FIXME("register for another process windows is disabled\n");
590  return DRAGDROP_E_INVALIDHWND;
591  }
592 
593  /* check if the window is already registered */
594  if (is_droptarget(hwnd))
596 
597  /*
598  * Marshal the drop target pointer into a shared memory map and
599  * store the map's handle in a Wine specific window prop. We also
600  * store the drop target pointer itself in the
601  * "OleDropTargetInterface" prop for compatibility with Windows.
602  */
603 
605  if(FAILED(hr)) return hr;
606 
607  /* IDropTarget::QueryInterface() shouldn't be called, some (broken) apps depend on this. */
608  wrapper = WrapDropTarget( hwnd );
609  if(!wrapper)
610  {
611  IStream_Release(stream);
612  return E_OUTOFMEMORY;
613  }
614  hr = CoMarshalInterface(stream, &IID_IDropTarget, (IUnknown*)wrapper, MSHCTX_LOCAL, NULL, MSHLFLAGS_TABLESTRONG);
615  IDropTarget_Release(wrapper);
616 
617  if(SUCCEEDED(hr))
618  {
620  if(SUCCEEDED(hr))
621  {
622  IDropTarget_AddRef(pDropTarget);
623  SetPropW(hwnd, prop_oledroptarget, pDropTarget);
625  }
626  else
627  {
629  zero.QuadPart = 0;
630  IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
632  }
633  }
634  IStream_Release(stream);
635 
636  return hr;
637 }
HRESULT WINAPI CoReleaseMarshalData(IStream *pStream)
Definition: marshal.c:2056
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
BOOL WINAPI IsWindow(_In_opt_ HWND)
static HRESULT create_map_from_stream(IStream *stream, HANDLE *map)
Definition: ole2.c:340
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
static APARTMENT * COM_CurrentApt(void)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:110
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define DRAGDROP_E_INVALIDHWND
Definition: winerror.h:2654
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: _map.h:44
static const WCHAR prop_marshalleddroptarget[]
Definition: ole2.c:123
static double zero
Definition: j0_y0.c:96
static IDropTarget * WrapDropTarget(HWND hwnd)
Definition: ole2.c:521
Definition: parse.h:22
#define DRAGDROP_E_ALREADYREGISTERED
Definition: winerror.h:2653
GLuint GLuint stream
Definition: glext.h:7522
#define ERR(fmt,...)
Definition: debug.h:109
static const WCHAR prop_oledroptarget[]
Definition: ole2.c:119
HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags)
Definition: marshal.c:1877
static BOOL is_droptarget(HWND hwnd)
Definition: ole2.c:294
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1188
#define SUCCEEDED(hr)
Definition: intsafe.h:57
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum map
Definition: glfuncs.h:262

Referenced by ShellBrowser::InitDragDrop(), DesktopShellView::InitDragDrop(), CDefView::OnCreate(), CExplorerBand::SetSite(), SHRegisterDragDrop(), test_DoDragDrop(), and test_Register_Revoke().

◆ ReleaseStgMedium()

VOID WINAPI ReleaseStgMedium ( LPSTGMEDIUM  )

◆ RevokeDragDrop()

HRESULT WINAPI RevokeDragDrop ( HWND  )

Definition at line 642 of file ole2.c.

643 {
644  HANDLE map;
645  IStream *stream;
646  IDropTarget *drop_target;
647  HRESULT hr;
648 
649  TRACE("(%p)\n", hwnd);
650 
651  if (!IsWindow(hwnd))
652  {
653  ERR("invalid hwnd %p\n", hwnd);
654  return DRAGDROP_E_INVALIDHWND;
655  }
656 
657  /* no registration data */
658  if (!(map = get_droptarget_handle(hwnd)))
660 
661  drop_target = GetPropW(hwnd, prop_oledroptarget);
662  if(drop_target) IDropTarget_Release(drop_target);
663 
666 
668  if(SUCCEEDED(hr))
669  {
671  IStream_Release(stream);
672  }
673  CloseHandle(map);
674 
675  return hr;
676 }
HRESULT WINAPI CoReleaseMarshalData(IStream *pStream)
Definition: marshal.c:2056
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HRESULT create_stream_from_map(HANDLE map, IStream **stream)
Definition: ole2.c:366
#define CloseHandle
Definition: compat.h:398
HRESULT hr
Definition: shlfolder.c:183
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define DRAGDROP_E_NOTREGISTERED
Definition: winerror.h:2652
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
#define DRAGDROP_E_INVALIDHWND
Definition: winerror.h:2654
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
Definition: _map.h:44
static const WCHAR prop_marshalleddroptarget[]
Definition: ole2.c:123
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define ERR(fmt,...)
Definition: debug.h:109
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
static const WCHAR prop_oledroptarget[]
Definition: ole2.c:119
static HANDLE get_droptarget_handle(HWND hwnd)
Definition: ole2.c:284
#define SUCCEEDED(hr)
Definition: intsafe.h:57
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum map
Definition: glfuncs.h:262

Referenced by CExplorerBand::DestroyExplorerBand(), CDefView::OnDestroy(), SHRevokeDragDrop(), test_Register_Revoke(), and DesktopShellView::~DesktopShellView().

◆ SetConvertStg()

HRESULT WINAPI SetConvertStg ( LPSTORAGE  pStg,
BOOL  fConvert 
)

◆ WriteClassStg()

HRESULT WINAPI WriteClassStg ( IStorage pstg,
REFCLSID  rclsid 
)

Definition at line 9079 of file storage32.c.

9080 {
9081  if(!pStg)
9082  return E_INVALIDARG;
9083 
9084  if(!rclsid)
9085  return STG_E_INVALIDPOINTER;
9086 
9087  return IStorage_SetClass(pStg, rclsid);
9088 }
#define STG_E_INVALIDPOINTER
Definition: winerror.h:2571
#define E_INVALIDARG
Definition: ddrawi.h:101

Referenced by OleCreateStaticFromData(), OleSave(), test_hglobal_storage_stat(), test_overwrite(), test_storage_refcount(), test_streamenum(), test_transacted_shared(), and test_writeclassstg().

◆ WriteClassStm()

HRESULT WINAPI WriteClassStm ( IStream pStm,
REFCLSID  rclsid 
)

Definition at line 9526 of file storage32.c.

9527 {
9528  TRACE("(%p,%p)\n",pStm,rclsid);
9529 
9530  if (!pStm || !rclsid)
9531  return E_INVALIDARG;
9532 
9533  return IStream_Write(pStm,rclsid,sizeof(CLSID),NULL);
9534 }
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by OLECONVERT_CreateCompObjStream(), OleSaveToStream(), STORAGE_WriteCompObj(), and test_ReadClassStm().

◆ WriteFmtUserTypeStg()

HRESULT WINAPI WriteFmtUserTypeStg ( LPSTORAGE  pstg,
CLIPFORMAT  cf,
LPOLESTR  lpszUserType 
)

Definition at line 9357 of file storage32.c.

9359 {
9360  STATSTG stat;
9361  HRESULT r;
9362  WCHAR szwClipName[0x40];
9363  CLSID clsid;
9364  LPWSTR wstrProgID = NULL;
9365  DWORD n;
9366 
9367  TRACE("(%p,%x,%s)\n",pstg,cf,debugstr_w(lpszUserType));
9368 
9369  /* get the clipboard format name */
9370  if( cf )
9371  {
9372  n = GetClipboardFormatNameW(cf, szwClipName, ARRAY_SIZE(szwClipName));
9373  szwClipName[n]=0;
9374  }
9375 
9376  TRACE("Clipboard name is %s\n", debugstr_w(szwClipName));
9377 
9378  r = IStorage_Stat(pstg, &stat, STATFLAG_NONAME);
9379  if(SUCCEEDED(r))
9380  clsid = stat.clsid;
9381  else
9382  clsid = CLSID_NULL;
9383 
9384  ProgIDFromCLSID(&clsid, &wstrProgID);
9385 
9386  TRACE("progid is %s\n",debugstr_w(wstrProgID));
9387 
9388  r = STORAGE_WriteCompObj( pstg, &clsid, lpszUserType,
9389  cf ? szwClipName : NULL, wstrProgID );
9390 
9391  CoTaskMemFree(wstrProgID);
9392 
9393  return r;
9394 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble n
Definition: glext.h:7729
int WINAPI GetClipboardFormatNameW(_In_ UINT format, _Out_writes_(cchMaxCount) LPWSTR lpszFormatName, _In_ int cchMaxCount)
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
Definition: compobj.c:2439
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CLSID_NULL
Definition: guiddef.h:94
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
REFCLSID clsid
Definition: msctf.c:84
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
#define ARRAY_SIZE(a)
Definition: main.h:24
static HRESULT STORAGE_WriteCompObj(LPSTORAGE pstg, CLSID *clsid, LPCWSTR lpszUserType, LPCWSTR szClipName, LPCWSTR szProgIDName)
Definition: storage32.c:9310
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by OleCreateStaticFromData(), OleDoAutoConvert(), test_fmtusertypestg(), and test_OleDoAutoConvert().