[OLE32] Sync with Wine Staging 1.7.47. CORE-9924

svn path=/trunk/; revision=68469
This commit is contained in:
Amine Khaldi 2015-07-19 23:10:53 +00:00
parent 6108ea6bc9
commit bc504c5a3f
23 changed files with 4892 additions and 4960 deletions

View file

@ -81,7 +81,7 @@ BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject)
if (IsEqualIID(&IID_IUnknown, riid) ||
IsEqualIID(&IID_IBindCtx, riid))
{
*ppvObject = This;
*ppvObject = &This->IBindCtx_iface;
IBindCtx_AddRef(iface);
return S_OK;
}

View file

@ -63,8 +63,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
#define HANDLE_ERROR(err) do { hr = err; TRACE("(HRESULT=%x)\n", (HRESULT)err); goto CLEANUP; } while (0)
/* Structure of 'Ole Private Data' clipboard format */
typedef struct
{
@ -559,6 +557,12 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt)
hStorage = GlobalAlloc(GMEM_SHARE|GMEM_MOVEABLE, 0);
if (hStorage == NULL) return E_OUTOFMEMORY;
hr = CreateILockBytesOnHGlobal(hStorage, FALSE, &ptrILockBytes);
if (FAILED(hr))
{
GlobalFree(hStorage);
return hr;
}
hr = StgCreateDocfileOnILockBytes(ptrILockBytes, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &std.u.pstg);
ILockBytes_Release(ptrILockBytes);

View file

@ -2196,7 +2196,7 @@ HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id )
/******************************************************************************
* IIDFromString [OLE32.@]
*
* Converts a interface identifier from its string representation into
* Converts an interface identifier from its string representation to
* the IID struct.
*
* PARAMS
@ -4930,8 +4930,8 @@ HRESULT WINAPI CoGetObjectContext(REFIID riid, void **ppv)
else
context->apttype = APTTYPE_STA;
hr = IUnknown_QueryInterface((IUnknown *)&context->IComThreadingInfo_iface, riid, ppv);
IUnknown_Release((IUnknown *)&context->IComThreadingInfo_iface);
hr = IComThreadingInfo_QueryInterface(&context->IComThreadingInfo_iface, riid, ppv);
IComThreadingInfo_Release(&context->IComThreadingInfo_iface);
return hr;
}

View file

@ -707,6 +707,8 @@ CompositeMonikerImpl_GetTimeOfLastChange(IMoniker* iface, IBindCtx* pbc,
IRunningObjectTable* rot;
res = IMoniker_ComposeWith(pmkToLeft, iface, FALSE, &leftMk);
if (FAILED(res))
return res;
res = IBindCtx_GetRunningObjectTable(pbc,&rot);
if (FAILED(res))
@ -761,9 +763,16 @@ CompositeMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
/* This method returns a composite moniker that consists of the inverses of each of the components */
/* of the original composite, stored in reverse order */
*ppmk = NULL;
res=CreateAntiMoniker(&antiMk);
res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk);
if (FAILED(res))
return res;
res=IMoniker_ComposeWith(iface,antiMk,FALSE,&tempMk);
IMoniker_Release(antiMk);
if (FAILED(res))
return res;
if (tempMk==NULL)

View file

@ -74,6 +74,13 @@ typedef struct PresentationDataHeader
DWORD dwSize;
} PresentationDataHeader;
enum stream_type
{
no_stream,
pres_stream,
contents_stream
};
typedef struct DataCacheEntry
{
struct list entry;
@ -84,11 +91,12 @@ typedef struct DataCacheEntry
/* cached data */
STGMEDIUM stgmedium;
/*
* This storage pointer is set through a call to
* This stream pointer is set through a call to
* IPersistStorage_Load. This is where the visual
* representation of the object is stored.
*/
IStorage *storage;
IStream *stream;
enum stream_type stream_type;
/* connection ID */
DWORD id;
/* dirty flag */
@ -204,8 +212,8 @@ static const char * debugstr_formatetc(const FORMATETC *formatetc)
static void DataCacheEntry_Destroy(DataCache *cache, DataCacheEntry *cache_entry)
{
list_remove(&cache_entry->entry);
if (cache_entry->storage)
IStorage_Release(cache_entry->storage);
if (cache_entry->stream)
IStream_Release(cache_entry->stream);
HeapFree(GetProcessHeap(), 0, cache_entry->fmtetc.ptd);
ReleaseStgMedium(&cache_entry->stgmedium);
if(cache_entry->sink_id)
@ -300,7 +308,8 @@ static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc
(*cache_entry)->data_cf = 0;
(*cache_entry)->stgmedium.tymed = TYMED_NULL;
(*cache_entry)->stgmedium.pUnkForRelease = NULL;
(*cache_entry)->storage = NULL;
(*cache_entry)->stream = NULL;
(*cache_entry)->stream_type = no_stream;
(*cache_entry)->id = This->last_cache_id++;
(*cache_entry)->dirty = TRUE;
(*cache_entry)->stream_number = -1;
@ -463,63 +472,136 @@ static HRESULT write_clipformat(IStream *stream, CLIPFORMAT clipformat)
*/
static HRESULT DataCacheEntry_OpenPresStream(DataCacheEntry *cache_entry, IStream **ppStm)
{
STATSTG elem;
IEnumSTATSTG *pEnum;
HRESULT hr;
LARGE_INTEGER offset;
if (!ppStm) return E_POINTER;
hr = IStorage_EnumElements(cache_entry->storage, 0, NULL, 0, &pEnum);
if (FAILED(hr)) return hr;
while ((hr = IEnumSTATSTG_Next(pEnum, 1, &elem, NULL)) == S_OK)
if (cache_entry->stream)
{
if (DataCache_IsPresentationStream(&elem))
{
IStream *pStm;
/* Rewind the stream before returning it. */
offset.QuadPart = 0;
hr = IStorage_OpenStream(cache_entry->storage, elem.pwcsName,
NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0,
&pStm);
if (SUCCEEDED(hr))
{
PresentationDataHeader header;
ULONG actual_read;
CLIPFORMAT clipformat;
hr = IStream_Seek( cache_entry->stream, offset, STREAM_SEEK_SET, NULL );
if (SUCCEEDED( hr ))
{
*ppStm = cache_entry->stream;
IStream_AddRef( cache_entry->stream );
}
}
else
hr = OLE_E_BLANK;
hr = read_clipformat(pStm, &clipformat);
return hr;
}
if (hr == S_OK)
hr = IStream_Read(pStm, &header, sizeof(header), &actual_read);
/* can't use SUCCEEDED(hr): S_FALSE counts as an error */
if (hr == S_OK && actual_read == sizeof(header)
&& header.dvAspect == cache_entry->fmtetc.dwAspect)
{
/* Rewind the stream before returning it. */
LARGE_INTEGER offset;
offset.u.LowPart = 0;
offset.u.HighPart = 0;
IStream_Seek(pStm, offset, STREAM_SEEK_SET, NULL);
static HRESULT load_mf_pict( DataCacheEntry *cache_entry, IStream *stm )
{
HRESULT hr;
STATSTG stat;
ULARGE_INTEGER current_pos;
void *bits;
METAFILEPICT *mfpict;
HGLOBAL hmfpict;
PresentationDataHeader header;
CLIPFORMAT clipformat;
static const LARGE_INTEGER offset_zero;
ULONG read;
*ppStm = pStm;
CoTaskMemFree(elem.pwcsName);
IEnumSTATSTG_Release(pEnum);
return S_OK;
}
IStream_Release(pStm);
}
}
CoTaskMemFree(elem.pwcsName);
if (cache_entry->stream_type != pres_stream)
{
FIXME( "Unimplemented for stream type %d\n", cache_entry->stream_type );
return E_FAIL;
}
IEnumSTATSTG_Release(pEnum);
hr = IStream_Stat( stm, &stat, STATFLAG_NONAME );
if (FAILED( hr )) return hr;
return (hr == S_FALSE ? OLE_E_BLANK : hr);
hr = read_clipformat( stm, &clipformat );
if (FAILED( hr )) return hr;
hr = IStream_Read( stm, &header, sizeof(header), &read );
if (hr != S_OK || read != sizeof(header)) return E_FAIL;
hr = IStream_Seek( stm, offset_zero, STREAM_SEEK_CUR, &current_pos );
if (FAILED( hr )) return hr;
stat.cbSize.QuadPart -= current_pos.QuadPart;
hmfpict = GlobalAlloc( GMEM_MOVEABLE, sizeof(METAFILEPICT) );
if (!hmfpict) return E_OUTOFMEMORY;
mfpict = GlobalLock( hmfpict );
bits = HeapAlloc( GetProcessHeap(), 0, stat.cbSize.u.LowPart);
if (!bits)
{
GlobalFree( hmfpict );
return E_OUTOFMEMORY;
}
hr = IStream_Read( stm, bits, stat.cbSize.u.LowPart, &read );
if (hr != S_OK || read != stat.cbSize.u.LowPart) hr = E_FAIL;
if (SUCCEEDED( hr ))
{
/* FIXME: get this from the stream */
mfpict->mm = MM_ANISOTROPIC;
mfpict->xExt = header.dwObjectExtentX;
mfpict->yExt = header.dwObjectExtentY;
mfpict->hMF = SetMetaFileBitsEx( stat.cbSize.u.LowPart, bits );
if (!mfpict->hMF)
hr = E_FAIL;
}
GlobalUnlock( hmfpict );
if (SUCCEEDED( hr ))
{
cache_entry->data_cf = cache_entry->fmtetc.cfFormat;
cache_entry->stgmedium.tymed = TYMED_MFPICT;
cache_entry->stgmedium.u.hMetaFilePict = hmfpict;
}
else
GlobalFree( hmfpict );
HeapFree( GetProcessHeap(), 0, bits );
return hr;
}
static HRESULT load_dib( DataCacheEntry *cache_entry, IStream *stm )
{
HRESULT hr;
STATSTG stat;
void *dib;
HGLOBAL hglobal;
ULONG read;
if (cache_entry->stream_type != contents_stream)
{
FIXME( "Unimplemented for stream type %d\n", cache_entry->stream_type );
return E_FAIL;
}
hr = IStream_Stat( stm, &stat, STATFLAG_NONAME );
if (FAILED( hr )) return hr;
hglobal = GlobalAlloc( GMEM_MOVEABLE, stat.cbSize.u.LowPart );
if (!hglobal) return E_OUTOFMEMORY;
dib = GlobalLock( hglobal );
hr = IStream_Read( stm, dib, stat.cbSize.u.LowPart, &read );
GlobalUnlock( hglobal );
if (hr != S_OK || read != stat.cbSize.u.LowPart)
{
GlobalFree( hglobal );
return E_FAIL;
}
cache_entry->data_cf = cache_entry->fmtetc.cfFormat;
cache_entry->stgmedium.tymed = TYMED_HGLOBAL;
cache_entry->stgmedium.u.hGlobal = hglobal;
return S_OK;
}
/************************************************************************
@ -537,113 +619,29 @@ static HRESULT DataCacheEntry_OpenPresStream(DataCacheEntry *cache_entry, IStrea
*/
static HRESULT DataCacheEntry_LoadData(DataCacheEntry *cache_entry)
{
IStream* presStream = NULL;
HRESULT hres;
ULARGE_INTEGER current_pos;
STATSTG streamInfo;
void* metafileBits;
METAFILEPICT *mfpict;
HGLOBAL hmfpict;
PresentationDataHeader header;
CLIPFORMAT clipformat;
static const LARGE_INTEGER offset_zero;
HRESULT hr;
IStream *stm;
/*
* Open the presentation stream.
*/
hres = DataCacheEntry_OpenPresStream(cache_entry, &presStream);
hr = DataCacheEntry_OpenPresStream( cache_entry, &stm );
if (FAILED(hr)) return hr;
if (FAILED(hres))
return hres;
switch (cache_entry->fmtetc.cfFormat)
{
case CF_METAFILEPICT:
hr = load_mf_pict( cache_entry, stm );
break;
/*
* Get the size of the stream.
*/
hres = IStream_Stat(presStream,
&streamInfo,
STATFLAG_NONAME);
case CF_DIB:
hr = load_dib( cache_entry, stm );
break;
/*
* Read the header.
*/
default:
FIXME( "Unimplemented clip format %x\n", cache_entry->fmtetc.cfFormat );
hr = E_NOTIMPL;
}
hres = read_clipformat(presStream, &clipformat);
if (FAILED(hres))
{
IStream_Release(presStream);
return hres;
}
hres = IStream_Read(
presStream,
&header,
sizeof(PresentationDataHeader),
NULL);
if (hres != S_OK)
{
IStream_Release(presStream);
return E_FAIL;
}
hres = IStream_Seek(presStream, offset_zero, STREAM_SEEK_CUR, &current_pos);
streamInfo.cbSize.QuadPart -= current_pos.QuadPart;
hmfpict = GlobalAlloc(GMEM_MOVEABLE, sizeof(METAFILEPICT));
if (!hmfpict)
{
IStream_Release(presStream);
return E_OUTOFMEMORY;
}
mfpict = GlobalLock(hmfpict);
/*
* Allocate a buffer for the metafile bits.
*/
metafileBits = HeapAlloc(GetProcessHeap(),
0,
streamInfo.cbSize.u.LowPart);
/*
* Read the metafile bits.
*/
hres = IStream_Read(
presStream,
metafileBits,
streamInfo.cbSize.u.LowPart,
NULL);
/*
* Create a metafile with those bits.
*/
if (SUCCEEDED(hres))
{
/* FIXME: get this from the stream */
mfpict->mm = MM_ANISOTROPIC;
mfpict->xExt = header.dwObjectExtentX;
mfpict->yExt = header.dwObjectExtentY;
mfpict->hMF = SetMetaFileBitsEx(streamInfo.cbSize.u.LowPart, metafileBits);
if (!mfpict->hMF)
hres = E_FAIL;
}
GlobalUnlock(hmfpict);
if (SUCCEEDED(hres))
{
cache_entry->data_cf = cache_entry->fmtetc.cfFormat;
cache_entry->stgmedium.tymed = TYMED_MFPICT;
cache_entry->stgmedium.u.hMetaFilePict = hmfpict;
}
else
GlobalFree(hmfpict);
/*
* Cleanup.
*/
HeapFree(GetProcessHeap(), 0, metafileBits);
IStream_Release(presStream);
return hres;
IStream_Release( stm );
return hr;
}
static HRESULT DataCacheEntry_CreateStream(DataCacheEntry *cache_entry,
@ -822,7 +820,7 @@ static HRESULT DataCacheEntry_SetData(DataCacheEntry *cache_entry,
static HRESULT DataCacheEntry_GetData(DataCacheEntry *cache_entry, STGMEDIUM *stgmedium)
{
if (stgmedium->tymed == TYMED_NULL && cache_entry->storage)
if (stgmedium->tymed == TYMED_NULL && cache_entry->stream)
{
HRESULT hr = DataCacheEntry_LoadData(cache_entry);
if (FAILED(hr))
@ -842,10 +840,10 @@ static inline HRESULT DataCacheEntry_DiscardData(DataCacheEntry *cache_entry)
static inline void DataCacheEntry_HandsOffStorage(DataCacheEntry *cache_entry)
{
if (cache_entry->storage)
if (cache_entry->stream)
{
IStorage_Release(cache_entry->storage);
cache_entry->storage = NULL;
IStream_Release(cache_entry->stream);
cache_entry->stream = NULL;
}
}
@ -1014,12 +1012,15 @@ static HRESULT WINAPI DataCache_GetDataHere(
return E_NOTIMPL;
}
static HRESULT WINAPI DataCache_QueryGetData(
IDataObject* iface,
LPFORMATETC pformatetc)
static HRESULT WINAPI DataCache_QueryGetData( IDataObject *iface, FORMATETC *fmt )
{
FIXME("stub\n");
return E_NOTIMPL;
DataCache *This = impl_from_IDataObject( iface );
DataCacheEntry *cache_entry;
TRACE( "(%p)->(%s)\n", iface, debugstr_formatetc( fmt ) );
cache_entry = DataCache_GetEntryForFormatEtc( This, fmt );
return cache_entry ? S_OK : S_FALSE;
}
/************************************************************************
@ -1163,34 +1164,28 @@ static ULONG WINAPI DataCache_IPersistStorage_Release(
/************************************************************************
* DataCache_GetClassID (IPersistStorage)
*
* The data cache doesn't implement this method.
*/
static HRESULT WINAPI DataCache_GetClassID(
IPersistStorage* iface,
CLSID* pClassID)
static HRESULT WINAPI DataCache_GetClassID(IPersistStorage *iface, CLSID *clsid)
{
DataCache *This = impl_from_IPersistStorage(iface);
DataCacheEntry *cache_entry;
DataCache *This = impl_from_IPersistStorage( iface );
HRESULT hr;
STATSTG statstg;
TRACE("(%p, %p)\n", iface, pClassID);
TRACE( "(%p, %p)\n", iface, clsid );
LIST_FOR_EACH_ENTRY(cache_entry, &This->cache_list, DataCacheEntry, entry)
{
if (cache_entry->storage != NULL)
if (This->presentationStorage)
{
STATSTG statstg;
HRESULT hr = IStorage_Stat(cache_entry->storage, &statstg, STATFLAG_NONAME);
if (SUCCEEDED(hr))
{
*pClassID = statstg.clsid;
return S_OK;
}
hr = IStorage_Stat( This->presentationStorage, &statstg, STATFLAG_NONAME );
if (SUCCEEDED(hr))
{
*clsid = statstg.clsid;
return S_OK;
}
}
}
*pClassID = CLSID_NULL;
*clsid = CLSID_NULL;
return S_OK;
return S_OK;
}
/************************************************************************
@ -1239,6 +1234,98 @@ static HRESULT WINAPI DataCache_InitNew(
return S_OK;
}
static HRESULT add_cache_entry( DataCache *This, const FORMATETC *fmt, IStream *stm,
enum stream_type type )
{
DataCacheEntry *cache_entry;
HRESULT hr = S_OK;
TRACE( "loading entry with formatetc: %s\n", debugstr_formatetc( fmt ) );
cache_entry = DataCache_GetEntryForFormatEtc( This, fmt );
if (!cache_entry)
hr = DataCache_CreateEntry( This, fmt, &cache_entry );
if (SUCCEEDED( hr ))
{
DataCacheEntry_DiscardData( cache_entry );
if (cache_entry->stream) IStream_Release( cache_entry->stream );
cache_entry->stream = stm;
IStream_AddRef( stm );
cache_entry->stream_type = type;
cache_entry->dirty = FALSE;
}
return hr;
}
static HRESULT parse_pres_streams( DataCache *This, IStorage *stg )
{
HRESULT hr;
IEnumSTATSTG *stat_enum;
STATSTG stat;
IStream *stm;
PresentationDataHeader header;
ULONG actual_read;
CLIPFORMAT clipformat;
FORMATETC fmtetc;
hr = IStorage_EnumElements( stg, 0, NULL, 0, &stat_enum );
if (FAILED( hr )) return hr;
while ((hr = IEnumSTATSTG_Next( stat_enum, 1, &stat, NULL )) == S_OK)
{
if (DataCache_IsPresentationStream( &stat ))
{
hr = IStorage_OpenStream( stg, stat.pwcsName, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE,
0, &stm );
if (SUCCEEDED( hr ))
{
hr = read_clipformat( stm, &clipformat );
if (hr == S_OK)
hr = IStream_Read( stm, &header, sizeof(header), &actual_read );
if (hr == S_OK && actual_read == sizeof(header))
{
fmtetc.cfFormat = clipformat;
fmtetc.ptd = NULL; /* FIXME */
fmtetc.dwAspect = header.dvAspect;
fmtetc.lindex = header.lindex;
fmtetc.tymed = header.tymed;
add_cache_entry( This, &fmtetc, stm, pres_stream );
}
IStream_Release( stm );
}
}
CoTaskMemFree( stat.pwcsName );
}
IEnumSTATSTG_Release( stat_enum );
return S_OK;
}
static const FORMATETC static_dib_fmt = { CF_DIB, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
static HRESULT parse_contents_stream( DataCache *This, IStorage *stg, IStream *stm )
{
HRESULT hr;
STATSTG stat;
const FORMATETC *fmt;
hr = IStorage_Stat( stg, &stat, STATFLAG_NONAME );
if (FAILED( hr )) return hr;
if (IsEqualCLSID( &stat.clsid, &CLSID_Picture_Dib ))
fmt = &static_dib_fmt;
else
return E_FAIL;
return add_cache_entry( This, fmt, stm, contents_stream );
}
static const WCHAR CONTENTS[] = {'C','O','N','T','E','N','T','S',0};
/************************************************************************
* DataCache_Load (IPersistStorage)
*
@ -1247,86 +1334,34 @@ static HRESULT WINAPI DataCache_InitNew(
* and it will load the presentation information when the
* IDataObject_GetData or IViewObject2_Draw methods are called.
*/
static HRESULT WINAPI DataCache_Load(
IPersistStorage* iface,
IStorage* pStg)
static HRESULT WINAPI DataCache_Load( IPersistStorage *iface, IStorage *pStg )
{
DataCache *This = impl_from_IPersistStorage(iface);
STATSTG elem;
IEnumSTATSTG *pEnum;
HRESULT hr;
IStream *stm;
TRACE("(%p, %p)\n", iface, pStg);
if (This->presentationStorage != NULL)
IStorage_Release(This->presentationStorage);
IPersistStorage_HandsOffStorage( iface );
This->presentationStorage = pStg;
hr = IStorage_EnumElements(pStg, 0, NULL, 0, &pEnum);
if (FAILED(hr)) return hr;
while ((hr = IEnumSTATSTG_Next(pEnum, 1, &elem, NULL)) == S_OK)
hr = IStorage_OpenStream( pStg, CONTENTS, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE,
0, &stm );
if (SUCCEEDED( hr ))
{
if (DataCache_IsPresentationStream(&elem))
{
IStream *pStm;
hr = parse_contents_stream( This, pStg, stm );
IStream_Release( stm );
}
else
hr = parse_pres_streams( This, pStg );
hr = IStorage_OpenStream(This->presentationStorage, elem.pwcsName,
NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0,
&pStm);
if (SUCCEEDED(hr))
{
PresentationDataHeader header;
ULONG actual_read;
CLIPFORMAT clipformat;
hr = read_clipformat(pStm, &clipformat);
if (hr == S_OK)
hr = IStream_Read(pStm, &header, sizeof(header),
&actual_read);
/* can't use SUCCEEDED(hr): S_FALSE counts as an error */
if (hr == S_OK && actual_read == sizeof(header))
{
DataCacheEntry *cache_entry;
FORMATETC fmtetc;
fmtetc.cfFormat = clipformat;
fmtetc.ptd = NULL; /* FIXME */
fmtetc.dwAspect = header.dvAspect;
fmtetc.lindex = header.lindex;
fmtetc.tymed = header.tymed;
TRACE("loading entry with formatetc: %s\n", debugstr_formatetc(&fmtetc));
cache_entry = DataCache_GetEntryForFormatEtc(This, &fmtetc);
if (!cache_entry)
hr = DataCache_CreateEntry(This, &fmtetc, &cache_entry);
if (SUCCEEDED(hr))
{
DataCacheEntry_DiscardData(cache_entry);
if (cache_entry->storage) IStorage_Release(cache_entry->storage);
cache_entry->storage = pStg;
IStorage_AddRef(pStg);
cache_entry->dirty = FALSE;
}
}
IStream_Release(pStm);
}
}
CoTaskMemFree(elem.pwcsName);
if (SUCCEEDED( hr ))
{
This->dirty = FALSE;
This->presentationStorage = pStg;
IStorage_AddRef( This->presentationStorage );
}
This->dirty = FALSE;
IEnumSTATSTG_Release(pEnum);
IStorage_AddRef(This->presentationStorage);
return S_OK;
return hr;
}
/************************************************************************
@ -1529,7 +1564,7 @@ static HRESULT WINAPI DataCache_Draw(
continue;
/* if the data hasn't been loaded yet, do it now */
if ((cache_entry->stgmedium.tymed == TYMED_NULL) && cache_entry->storage)
if ((cache_entry->stgmedium.tymed == TYMED_NULL) && cache_entry->stream)
{
hres = DataCacheEntry_LoadData(cache_entry);
if (FAILED(hres))
@ -1600,6 +1635,26 @@ static HRESULT WINAPI DataCache_Draw(
return S_OK;
}
case CF_DIB:
{
BITMAPFILEHEADER *file_head;
BITMAPINFO *info;
BYTE *bits;
if ((cache_entry->stgmedium.tymed != TYMED_HGLOBAL) ||
!((file_head = GlobalLock( cache_entry->stgmedium.u.hGlobal ))))
continue;
info = (BITMAPINFO *)(file_head + 1);
bits = (BYTE *) file_head + file_head->bfOffBits;
StretchDIBits( hdcDraw, lprcBounds->left, lprcBounds->top,
lprcBounds->right - lprcBounds->left, lprcBounds->bottom - lprcBounds->top,
0, 0, info->bmiHeader.biWidth, info->bmiHeader.biHeight,
bits, info, DIB_RGB_COLORS, SRCCOPY );
GlobalUnlock( cache_entry->stgmedium.u.hGlobal );
return S_OK;
}
}
}
@ -1771,7 +1826,7 @@ static HRESULT WINAPI DataCache_GetExtent(
continue;
/* if the data hasn't been loaded yet, do it now */
if ((cache_entry->stgmedium.tymed == TYMED_NULL) && cache_entry->storage)
if ((cache_entry->stgmedium.tymed == TYMED_NULL) && cache_entry->stream)
{
hres = DataCacheEntry_LoadData(cache_entry);
if (FAILED(hres))
@ -1800,6 +1855,41 @@ static HRESULT WINAPI DataCache_GetExtent(
return S_OK;
}
case CF_DIB:
{
BITMAPFILEHEADER *file_head;
BITMAPINFOHEADER *info;
LONG x_pels_m, y_pels_m;
if ((cache_entry->stgmedium.tymed != TYMED_HGLOBAL) ||
!((file_head = GlobalLock( cache_entry->stgmedium.u.hGlobal ))))
continue;
info = (BITMAPINFOHEADER *)(file_head + 1);
x_pels_m = info->biXPelsPerMeter;
y_pels_m = info->biYPelsPerMeter;
/* Size in units of 0.01mm (ie. MM_HIMETRIC) */
if (x_pels_m != 0 && y_pels_m != 0)
{
lpsizel->cx = info->biWidth * 100000 / x_pels_m;
lpsizel->cy = info->biHeight * 100000 / y_pels_m;
}
else
{
HDC hdc = GetDC( 0 );
lpsizel->cx = info->biWidth * 2540 / GetDeviceCaps( hdc, LOGPIXELSX );
lpsizel->cy = info->biHeight * 2540 / GetDeviceCaps( hdc, LOGPIXELSY );
ReleaseDC( 0, hdc );
}
GlobalUnlock( cache_entry->stgmedium.u.hGlobal );
return S_OK;
}
}
}

View file

@ -2171,7 +2171,7 @@ HRESULT HandlerCF_Create(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
This->refs = 0;
This->clsid = *rclsid;
hr = IUnknown_QueryInterface((IUnknown *)&This->IClassFactory_iface, riid, ppv);
hr = IClassFactory_QueryInterface(&This->IClassFactory_iface, riid, ppv);
if (FAILED(hr))
HeapFree(GetProcessHeap(), 0, This);

View file

@ -45,10 +45,6 @@ static inline FileLockBytesImpl *impl_from_ILockBytes(ILockBytes *iface)
* Prototypes for private methods
*/
/* Note that this evaluates a and b multiple times, so don't
* pass expressions with side effects. */
#define ROUND_UP(a, b) ((((a) + (b) - 1)/(b))*(b))
/****************************************************************************
* GetProtectMode
*
@ -330,24 +326,6 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface,
return get_lock_error();
}
HRESULT FileLockBytesImpl_LockRegionSync(ILockBytes* iface,
ULARGE_INTEGER libOffset, ULARGE_INTEGER cb)
{
FileLockBytesImpl* This = impl_from_ILockBytes(iface);
OVERLAPPED ol;
if (iface->lpVtbl != &FileLockBytesImpl_Vtbl)
return E_NOTIMPL;
ol.hEvent = 0;
ol.u.s.Offset = libOffset.u.LowPart;
ol.u.s.OffsetHigh = libOffset.u.HighPart;
if (LockFileEx(This->hfile, LOCKFILE_EXCLUSIVE_LOCK, 0, cb.u.LowPart, cb.u.HighPart, &ol))
return S_OK;
return get_lock_error();
}
static HRESULT WINAPI FileLockBytesImpl_UnlockRegion(ILockBytes* iface,
ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
@ -388,6 +366,8 @@ static HRESULT WINAPI FileLockBytesImpl_Stat(ILockBytes* iface,
pstatstg->cbSize.u.LowPart = GetFileSize(This->hfile, &pstatstg->cbSize.u.HighPart);
/* FIXME: If the implementation is exported, we'll need to set other fields. */
pstatstg->grfLocksSupported = LOCK_EXCLUSIVE|LOCK_ONLYONCE|WINE_LOCK_READ;
return S_OK;
}

View file

@ -907,7 +907,8 @@ static HRESULT WINAPI
FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
{
LPOLESTR pathThis = NULL, pathOther = NULL,*stringTable1,*stringTable2,commonPath = NULL;
LPOLESTR pathThis = NULL, pathOther = NULL, *stringTable1 = NULL;
LPOLESTR *stringTable2 = NULL, commonPath = NULL;
IBindCtx *bindctx;
DWORD mkSys;
ULONG nb1,nb2,i,sameIdx;
@ -995,8 +996,8 @@ failed:
CoTaskMemFree(pathThis);
CoTaskMemFree(pathOther);
CoTaskMemFree(commonPath);
free_stringtable(stringTable1);
free_stringtable(stringTable2);
if (stringTable1) free_stringtable(stringTable1);
if (stringTable2) free_stringtable(stringTable2);
return ret;
}

View file

@ -70,7 +70,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_QueryInterface(
IsEqualIID(&IID_ISequentialStream, riid) ||
IsEqualIID(&IID_IStream, riid))
{
*ppvObject = This;
*ppvObject = &This->IStream_iface;
}
if ((*ppvObject)==0)

View file

@ -586,8 +586,14 @@ static HRESULT WINAPI ItemMonikerImpl_GetTimeOfLastChange(IMoniker* iface,
/* IMoniker::GetTimeOfLastChange on the pmkToLeft parameter. */
res=CreateGenericComposite(pmkToLeft,iface,&compositeMk);
if (FAILED(res))
return res;
res=IBindCtx_GetRunningObjectTable(pbc,&rot);
if (FAILED(res)) {
IMoniker_Release(compositeMk);
return res;
}
if (IRunningObjectTable_GetTimeOfLastChange(rot,compositeMk,pItemTime)!=S_OK)

View file

@ -789,11 +789,12 @@ static HRESULT proxy_manager_construct(
static inline void proxy_manager_set_context(struct proxy_manager *This, MSHCTX dest_context, void *dest_context_data)
{
MSHCTX old_dest_context = This->dest_context;
MSHCTX old_dest_context;
MSHCTX new_dest_context;
do
{
old_dest_context = This->dest_context;
new_dest_context = old_dest_context;
/* "stronger" values overwrite "weaker" values. stronger values are
* ones that disable more optimisations */
@ -837,7 +838,7 @@ static inline void proxy_manager_set_context(struct proxy_manager *This, MSHCTX
if (old_dest_context == new_dest_context) break;
old_dest_context = InterlockedCompareExchange((PLONG)&This->dest_context, new_dest_context, old_dest_context);
new_dest_context = InterlockedCompareExchange((PLONG)&This->dest_context, new_dest_context, old_dest_context);
} while (new_dest_context != old_dest_context);
if (dest_context_data)
@ -1028,8 +1029,11 @@ static HRESULT proxy_manager_get_remunknown(struct proxy_manager * This, IRemUnk
IRemUnknown_AddRef(*remunk);
}
else if (!This->parent)
{
/* disconnected - we can't create IRemUnknown */
*remunk = NULL;
hr = S_FALSE;
}
else
{
STDOBJREF stdobjref;

View file

@ -298,7 +298,7 @@ RunningObjectTableImpl_QueryInterface(IRunningObjectTable* iface,
if (IsEqualIID(&IID_IUnknown, riid) ||
IsEqualIID(&IID_IRunningObjectTable, riid))
*ppvObject = This;
*ppvObject = &This->IRunningObjectTable_iface;
if ((*ppvObject)==0)
return E_NOINTERFACE;
@ -1180,7 +1180,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
IStorage *pstg=0;
HRESULT res;
int nbElm, length, i;
LONG sizeProgId;
LONG sizeProgId, ret;
LPOLESTR *pathDec=0,absFile=0,progId=0;
LPWSTR extension;
static const WCHAR bkslashW[] = {'\\',0};
@ -1193,10 +1193,10 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
res=StgOpenStorage(filePathName,NULL,STGM_READ | STGM_SHARE_DENY_WRITE,NULL,0,&pstg);
if (SUCCEEDED(res))
if (SUCCEEDED(res)) {
res=ReadClassStg(pstg,pclsid);
IStorage_Release(pstg);
IStorage_Release(pstg);
}
return res;
}
@ -1246,26 +1246,23 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
return MK_E_INVALIDEXTENSION;
}
res=RegQueryValueW(HKEY_CLASSES_ROOT, extension, NULL, &sizeProgId);
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, NULL, &sizeProgId);
/* get the progId associated to the extension */
progId = CoTaskMemAlloc(sizeProgId);
res = RegQueryValueW(HKEY_CLASSES_ROOT, extension, progId, &sizeProgId);
if (res==ERROR_SUCCESS)
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, progId, &sizeProgId);
if (!ret)
/* return the clsid associated to the progId */
res= CLSIDFromProgID(progId,pclsid);
res = CLSIDFromProgID(progId,pclsid);
else
res = HRESULT_FROM_WIN32(ret);
for(i=0; pathDec[i]!=NULL;i++)
CoTaskMemFree(pathDec[i]);
CoTaskMemFree(pathDec);
CoTaskMemFree(progId);
if (res==ERROR_SUCCESS)
return res;
return MK_E_INVALIDEXTENSION;
return res != S_OK ? MK_E_INVALIDEXTENSION : res;
}
/***********************************************************************
@ -1283,17 +1280,12 @@ static HRESULT WINAPI EnumMonikerImpl_QueryInterface(IEnumMoniker* iface,REFIID
*ppvObject = NULL;
if (IsEqualIID(&IID_IUnknown, riid))
*ppvObject = This;
if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IEnumMoniker, riid))
*ppvObject = &This->IEnumMoniker_iface;
else
if (IsEqualIID(&IID_IEnumMoniker, riid))
*ppvObject = This;
if ((*ppvObject)==NULL)
return E_NOINTERFACE;
IEnumMoniker_AddRef(iface);
return S_OK;
}

View file

@ -1253,6 +1253,8 @@ HRESULT WINAPI OleLoad(
* Get the class ID for the object.
*/
hres = IStorage_Stat(pStg, &storageInfo, STATFLAG_NONAME);
if (FAILED(hres))
return hres;
/*
* Now, try and create the handler for the object
@ -2426,6 +2428,9 @@ static DWORD OLEDD_GetButtonState(void)
if ( (keyboardState[VK_CONTROL] & 0x80) !=0)
keyMask |= MK_CONTROL;
if ( (keyboardState[VK_MENU] & 0x80) !=0)
keyMask |= MK_ALT;
if ( (keyboardState[VK_LBUTTON] & 0x80) !=0)
keyMask |= MK_LBUTTON;

View file

@ -22,8 +22,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
#define MAX_CLIPFORMAT_NAME 80
/******************************************************************************
* OleQueryCreateFromData [OLE32.@]
*

View file

@ -156,10 +156,10 @@
@ stdcall HBITMAP_UserMarshal(ptr ptr ptr)
@ stdcall HBITMAP_UserSize(ptr long ptr)
@ stdcall HBITMAP_UserUnmarshal(ptr ptr ptr)
@ stub HBRUSH_UserFree
@ stub HBRUSH_UserMarshal
@ stub HBRUSH_UserSize
@ stub HBRUSH_UserUnmarshal
@ stdcall HBRUSH_UserFree(ptr ptr)
@ stdcall HBRUSH_UserMarshal(ptr ptr ptr)
@ stdcall HBRUSH_UserSize(ptr long ptr)
@ stdcall HBRUSH_UserUnmarshal(ptr ptr ptr)
@ stdcall HDC_UserFree(ptr ptr)
@ stdcall HDC_UserMarshal(ptr ptr ptr)
@ stdcall HDC_UserSize(ptr long ptr)

View file

@ -19,10 +19,6 @@
#if !defined( __WINE_OLESTD_H_ )
#define __WINE_OLESTD_H_
#if !defined(__cplusplus) && !defined( __TURBOC__)
#define NONAMELESSUNION /* use strict ANSI standard (for DVOBJ.H) */
#endif
/* Clipboard format strings */
#define CF_EMBEDSOURCE "Embed Source"
#define CF_EMBEDDEDOBJECT "Embedded Object"

View file

@ -95,7 +95,7 @@ PointerMonikerImpl_Release(IMoniker* iface)
ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
/* destroy the object if there are no more references on it */
if (ref == 0)
{
if (This->pObject) IUnknown_Release(This->pObject);

View file

@ -1828,6 +1828,7 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
bufferlen = 0;
if (!ReadFile(hPipe,marshalbuffer,sizeof(marshalbuffer),&bufferlen,NULL)) {
FIXME("Failed to read marshal id from classfactory of %s.\n",debugstr_guid(rclsid));
CloseHandle(hPipe);
Sleep(1000);
continue;
}

View file

@ -1023,7 +1023,7 @@ static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This,
#define __thiscall_wrapper __cdecl
#endif
static void* __thiscall_wrapper Allocate_CoTaskMemAlloc(void *userdata, ULONG size)
static void* __thiscall_wrapper Allocate_CoTaskMemAlloc(void *this, ULONG size)
{
return CoTaskMemAlloc(size);
}
@ -1032,7 +1032,7 @@ static void* __thiscall_wrapper Allocate_CoTaskMemAlloc(void *userdata, ULONG si
* end of the buffer.
*/
static HRESULT PropertyStorage_ReadProperty(PROPVARIANT *prop, const BYTE *data,
UINT codepage, void* (__thiscall_wrapper *allocate)(void *userdata, ULONG size), void *allocate_data)
UINT codepage, void* (__thiscall_wrapper *allocate)(void *this, ULONG size), void *allocate_data)
{
HRESULT hr = S_OK;

File diff suppressed because it is too large Load diff

View file

@ -150,8 +150,6 @@ struct DirEntry
HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsName, ILockBytes **pLockBytes) DECLSPEC_HIDDEN;
HRESULT FileLockBytesImpl_LockRegionSync(ILockBytes* iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb) DECLSPEC_HIDDEN;
/*************************************************************************
* Ole Convert support
*/
@ -356,9 +354,9 @@ void StorageBaseImpl_RemoveStream(StorageBaseImpl * stg, StgStreamImpl * strm) D
#define BLOCKCHAIN_CACHE_SIZE 4
/****************************************************************************
* Storage32Impl definitions.
* StorageImpl definitions.
*
* This implementation of the IStorage32 interface represents a root
* This implementation of the IStorage interface represents a root
* storage. Basically, a document file.
*/
struct StorageImpl
@ -404,44 +402,13 @@ struct StorageImpl
BlockChainStream* blockChainCache[BLOCKCHAIN_CACHE_SIZE];
UINT blockChainToEvict;
ULONG locks_supported;
ILockBytes* lockBytes;
ULONG locked_bytes[8];
};
HRESULT StorageImpl_ReadRawDirEntry(
StorageImpl *This,
ULONG index,
BYTE *buffer) DECLSPEC_HIDDEN;
void UpdateRawDirEntry(
BYTE *buffer,
const DirEntry *newData) DECLSPEC_HIDDEN;
HRESULT StorageImpl_WriteRawDirEntry(
StorageImpl *This,
ULONG index,
const BYTE *buffer) DECLSPEC_HIDDEN;
HRESULT StorageImpl_ReadDirEntry(
StorageImpl* This,
DirRef index,
DirEntry* buffer) DECLSPEC_HIDDEN;
HRESULT StorageImpl_WriteDirEntry(
StorageImpl* This,
DirRef index,
const DirEntry* buffer) DECLSPEC_HIDDEN;
BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
StorageImpl* This,
SmallBlockChainStream** ppsbChain) DECLSPEC_HIDDEN;
SmallBlockChainStream* Storage32Impl_BigBlocksToSmallBlocks(
StorageImpl* This,
BlockChainStream** ppbbChain,
ULARGE_INTEGER newSize) DECLSPEC_HIDDEN;
/****************************************************************************
* StgStreamImpl definitions.
*
@ -496,7 +463,10 @@ StgStreamImpl* StgStreamImpl_Construct(
/* Range lock constants.
*
* The storage format reserves the region from 0x7fffff00-0x7fffffff for
* locking and synchronization. Unfortunately, the spec doesn't say which bytes
* locking and synchronization. Because it reserves the entire block containing
* that range, and the minimum block size is 512 bytes, 0x7ffffe00-0x7ffffeff
* also cannot be used for any other purpose.
* Unfortunately, the spec doesn't say which bytes
* within that range are used, and for what. These are guesses based on testing.
* In particular, ends of ranges may be wrong.
@ -515,7 +485,7 @@ StgStreamImpl* StgStreamImpl_Construct(
0xe2 through 0xff: Unknown. Causes read-only exclusive opens to fail.
*/
#define RANGELOCK_UNK1_FIRST 0x7fffff00
#define RANGELOCK_UNK1_FIRST 0x7ffffe00
#define RANGELOCK_UNK1_LAST 0x7fffff57
#define RANGELOCK_PRIORITY1_FIRST 0x7fffff58
#define RANGELOCK_PRIORITY1_LAST 0x7fffff6b
@ -540,6 +510,9 @@ StgStreamImpl* StgStreamImpl_Construct(
#define RANGELOCK_FIRST RANGELOCK_UNK1_FIRST
#define RANGELOCK_LAST RANGELOCK_UNK2_LAST
/* internal value for LockRegion/UnlockRegion */
#define WINE_LOCK_READ 0x80000000
/******************************************************************************
* Endian conversion macros
@ -578,116 +551,5 @@ void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) DECLSPE
void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination,
const DirEntry* source, int statFlags) DECLSPEC_HIDDEN;
/****************************************************************************
* BlockChainStream definitions.
*
* The BlockChainStream class is a utility class that is used to create an
* abstraction of the big block chains in the storage file.
*/
struct BlockChainRun
{
/* This represents a range of blocks that happen reside in consecutive sectors. */
ULONG firstSector;
ULONG firstOffset;
ULONG lastOffset;
};
typedef struct BlockChainBlock
{
ULONG index;
ULONG sector;
BOOL read;
BOOL dirty;
BYTE data[MAX_BIG_BLOCK_SIZE];
} BlockChainBlock;
struct BlockChainStream
{
StorageImpl* parentStorage;
ULONG* headOfStreamPlaceHolder;
DirRef ownerDirEntry;
struct BlockChainRun* indexCache;
ULONG indexCacheLen;
ULONG indexCacheSize;
BlockChainBlock cachedBlocks[2];
ULONG blockToEvict;
ULONG tailIndex;
ULONG numBlocks;
};
/*
* Methods for the BlockChainStream class.
*/
BlockChainStream* BlockChainStream_Construct(
StorageImpl* parentStorage,
ULONG* headOfStreamPlaceHolder,
DirRef dirEntry) DECLSPEC_HIDDEN;
void BlockChainStream_Destroy(
BlockChainStream* This) DECLSPEC_HIDDEN;
HRESULT BlockChainStream_ReadAt(
BlockChainStream* This,
ULARGE_INTEGER offset,
ULONG size,
void* buffer,
ULONG* bytesRead) DECLSPEC_HIDDEN;
HRESULT BlockChainStream_WriteAt(
BlockChainStream* This,
ULARGE_INTEGER offset,
ULONG size,
const void* buffer,
ULONG* bytesWritten) DECLSPEC_HIDDEN;
BOOL BlockChainStream_SetSize(
BlockChainStream* This,
ULARGE_INTEGER newSize) DECLSPEC_HIDDEN;
HRESULT BlockChainStream_Flush(
BlockChainStream* This) DECLSPEC_HIDDEN;
/****************************************************************************
* SmallBlockChainStream definitions.
*
* The SmallBlockChainStream class is a utility class that is used to create an
* abstraction of the small block chains in the storage file.
*/
struct SmallBlockChainStream
{
StorageImpl* parentStorage;
DirRef ownerDirEntry;
ULONG* headOfStreamPlaceHolder;
};
/*
* Methods of the SmallBlockChainStream class.
*/
SmallBlockChainStream* SmallBlockChainStream_Construct(
StorageImpl* parentStorage,
ULONG* headOfStreamPlaceHolder,
DirRef dirEntry) DECLSPEC_HIDDEN;
void SmallBlockChainStream_Destroy(
SmallBlockChainStream* This) DECLSPEC_HIDDEN;
HRESULT SmallBlockChainStream_ReadAt(
SmallBlockChainStream* This,
ULARGE_INTEGER offset,
ULONG size,
void* buffer,
ULONG* bytesRead) DECLSPEC_HIDDEN;
HRESULT SmallBlockChainStream_WriteAt(
SmallBlockChainStream* This,
ULARGE_INTEGER offset,
ULONG size,
const void* buffer,
ULONG* bytesWritten) DECLSPEC_HIDDEN;
BOOL SmallBlockChainStream_SetSize(
SmallBlockChainStream* This,
ULARGE_INTEGER newSize) DECLSPEC_HIDDEN;
#endif /* __STORAGE32_H__ */

View file

@ -290,7 +290,7 @@ static unsigned char * handle_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffe
return pBuffer + sizeof(RemotableHandle);
}
static void handle_UserFree(ULONG *pFlags, HANDLE *phMenu)
static void handle_UserFree(ULONG *pFlags, HANDLE *handle)
{
/* nothing to do */
}
@ -323,6 +323,9 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *phMenu)
IMPL_WIREM_HANDLE(HACCEL)
IMPL_WIREM_HANDLE(HMENU)
IMPL_WIREM_HANDLE(HWND)
IMPL_WIREM_HANDLE(HDC)
IMPL_WIREM_HANDLE(HICON)
IMPL_WIREM_HANDLE(HBRUSH)
/******************************************************************************
* HGLOBAL_UserSize [OLE32.@]
@ -642,204 +645,6 @@ void __RPC_USER HBITMAP_UserFree(ULONG *pFlags, HBITMAP *phBmp)
FIXME(":stub\n");
}
/******************************************************************************
* HICON_UserSize [OLE32.@]
*
* Calculates the buffer size required to marshal an icon.
*
* PARAMS
* pFlags [I] Flags. See notes.
* StartingSize [I] Starting size of the buffer. This value is added on to
* the buffer size required for the icon.
* phIcon [I] Icon to size.
*
* RETURNS
* The buffer size required to marshal an icon plus the starting size.
*
* NOTES
* Even though the function is documented to take a pointer to a ULONG in
* pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
* the first parameter is a ULONG.
* This function is only intended to be called by the RPC runtime.
*/
ULONG __RPC_USER HICON_UserSize(ULONG *pFlags, ULONG StartingSize, HICON *phIcon)
{
FIXME(":stub\n");
return StartingSize;
}
/******************************************************************************
* HICON_UserMarshal [OLE32.@]
*
* Marshals an icon into a buffer.
*
* PARAMS
* pFlags [I] Flags. See notes.
* pBuffer [I] Buffer to marshal the icon into.
* phIcon [I] Icon to marshal.
*
* RETURNS
* The end of the marshaled data in the buffer.
*
* NOTES
* Even though the function is documented to take a pointer to a ULONG in
* pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
* the first parameter is a ULONG.
* This function is only intended to be called by the RPC runtime.
*/
unsigned char * __RPC_USER HICON_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HICON *phIcon)
{
FIXME(":stub\n");
return pBuffer;
}
/******************************************************************************
* HICON_UserUnmarshal [OLE32.@]
*
* Unmarshals an icon from a buffer.
*
* PARAMS
* pFlags [I] Flags. See notes.
* pBuffer [I] Buffer to marshal the icon from.
* phIcon [O] Address that receive the unmarshaled icon.
*
* RETURNS
* The end of the marshaled data in the buffer.
*
* NOTES
* Even though the function is documented to take a pointer to an ULONG in
* pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
* the first parameter is an ULONG.
* This function is only intended to be called by the RPC runtime.
*/
unsigned char * __RPC_USER HICON_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HICON *phIcon)
{
FIXME(":stub\n");
return pBuffer;
}
/******************************************************************************
* HICON_UserFree [OLE32.@]
*
* Frees an unmarshaled icon.
*
* PARAMS
* pFlags [I] Flags. See notes.
* phIcon [I] Icon to free.
*
* RETURNS
* The end of the marshaled data in the buffer.
*
* NOTES
* Even though the function is documented to take a pointer to a ULONG in
* pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
* which the first parameter is a ULONG.
* This function is only intended to be called by the RPC runtime.
*/
void __RPC_USER HICON_UserFree(ULONG *pFlags, HICON *phIcon)
{
FIXME(":stub\n");
}
/******************************************************************************
* HDC_UserSize [OLE32.@]
*
* Calculates the buffer size required to marshal an HDC.
*
* PARAMS
* pFlags [I] Flags. See notes.
* StartingSize [I] Starting size of the buffer. This value is added on to
* the buffer size required for the clip format.
* phGlobal [I] HDC to size.
*
* RETURNS
* The buffer size required to marshal an HDC plus the starting size.
*
* NOTES
* Even though the function is documented to take a pointer to a ULONG in
* pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
* the first parameter is a ULONG.
* This function is only intended to be called by the RPC runtime.
*/
ULONG __RPC_USER HDC_UserSize(ULONG *pFlags, ULONG StartingSize, HDC *phdc)
{
FIXME(":stub\n");
return StartingSize;
}
/******************************************************************************
* HDC_UserMarshal [OLE32.@]
*
* Marshals an HDC into a buffer.
*
* PARAMS
* pFlags [I] Flags. See notes.
* pBuffer [I] Buffer to marshal the clip format into.
* phdc [I] HDC to marshal.
*
* RETURNS
* The end of the marshaled data in the buffer.
*
* NOTES
* Even though the function is documented to take a pointer to a ULONG in
* pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
* the first parameter is a ULONG.
* This function is only intended to be called by the RPC runtime.
*/
unsigned char * __RPC_USER HDC_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HDC *phdc)
{
FIXME(":stub\n");
return pBuffer;
}
/******************************************************************************
* HDC_UserUnmarshal [OLE32.@]
*
* Unmarshals an HDC from a buffer.
*
* PARAMS
* pFlags [I] Flags. See notes.
* pBuffer [I] Buffer to marshal the clip format from.
* phdc [O] Address that receive the unmarshaled HDC.
*
* RETURNS
* The end of the marshaled data in the buffer.
*
* NOTES
* Even though the function is documented to take a pointer to an ULONG in
* pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
* the first parameter is an ULONG.
* This function is only intended to be called by the RPC runtime.
*/
unsigned char * __RPC_USER HDC_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HDC *phdc)
{
FIXME(":stub\n");
return pBuffer;
}
/******************************************************************************
* HDC_UserFree [OLE32.@]
*
* Frees an unmarshaled HDC.
*
* PARAMS
* pFlags [I] Flags. See notes.
* phdc [I] HDC to free.
*
* RETURNS
* The end of the marshaled data in the buffer.
*
* NOTES
* Even though the function is documented to take a pointer to a ULONG in
* pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
* which the first parameter is a ULONG.
* This function is only intended to be called by the RPC runtime.
*/
void __RPC_USER HDC_UserFree(ULONG *pFlags, HDC *phdc)
{
FIXME(":stub\n");
}
/******************************************************************************
* HPALETTE_UserSize [OLE32.@]
*
@ -2142,25 +1947,117 @@ void __RPC_USER FLAG_STGMEDIUM_UserFree(ULONG *pFlags, FLAG_STGMEDIUM *pStgMediu
ULONG __RPC_USER SNB_UserSize(ULONG *pFlags, ULONG StartingSize, SNB *pSnb)
{
FIXME(":stub\n");
return StartingSize;
ULONG size = StartingSize;
TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags), StartingSize, pSnb);
ALIGN_LENGTH(size, 3);
/* two counters from RemSNB header, plus one more ULONG */
size += 3*sizeof(ULONG);
/* now actual data length */
if (*pSnb)
{
WCHAR **ptrW = *pSnb;
while (*ptrW)
{
size += (strlenW(*ptrW) + 1)*sizeof(WCHAR);
ptrW++;
}
}
return size;
}
unsigned char * __RPC_USER SNB_UserMarshal( ULONG *pFlags, unsigned char *pBuffer, SNB *pSnb)
struct SNB_wire {
ULONG charcnt;
ULONG strcnt;
ULONG datalen;
WCHAR data[1];
};
unsigned char * __RPC_USER SNB_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, SNB *pSnb)
{
FIXME(":stub\n");
return pBuffer;
struct SNB_wire *wire;
ULONG size;
TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags), pBuffer, pSnb);
ALIGN_POINTER(pBuffer, 3);
wire = (struct SNB_wire*)pBuffer;
wire->charcnt = wire->strcnt = 0;
size = 3*sizeof(ULONG);
if (*pSnb)
{
WCHAR **ptrW = *pSnb;
WCHAR *dataW = wire->data;
while (*ptrW)
{
ULONG len = strlenW(*ptrW) + 1;
wire->strcnt++;
wire->charcnt += len;
memcpy(dataW, *ptrW, len*sizeof(WCHAR));
dataW += len;
size += len*sizeof(WCHAR);
ptrW++;
}
}
wire->datalen = wire->charcnt;
return pBuffer + size;
}
unsigned char * __RPC_USER SNB_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, SNB *pSnb)
{
FIXME(":stub\n");
return pBuffer;
USER_MARSHAL_CB *umcb = (USER_MARSHAL_CB*)pFlags;
struct SNB_wire *wire;
TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags), pBuffer, pSnb);
wire = (struct SNB_wire*)pBuffer;
if (*pSnb)
umcb->pStubMsg->pfnFree(*pSnb);
if (wire->datalen == 0)
*pSnb = NULL;
else
{
WCHAR *src = wire->data, *dest;
WCHAR **ptrW;
ULONG i;
ptrW = *pSnb = umcb->pStubMsg->pfnAllocate((wire->strcnt+1)*sizeof(WCHAR*) + wire->datalen*sizeof(WCHAR));
dest = (WCHAR*)(*pSnb + wire->strcnt + 1);
for (i = 0; i < wire->strcnt; i++)
{
ULONG len = strlenW(src);
memcpy(dest, src, (len + 1)*sizeof(WCHAR));
*ptrW = dest;
src += len + 1;
dest += len + 1;
ptrW++;
}
*ptrW = NULL;
}
return pBuffer + 3*sizeof(ULONG) + wire->datalen*sizeof(WCHAR);
}
void __RPC_USER SNB_UserFree(ULONG *pFlags, SNB *pSnb)
{
FIXME(":stub\n");
USER_MARSHAL_CB *umcb = (USER_MARSHAL_CB*)pFlags;
TRACE("(%p)\n", pSnb);
if (*pSnb)
umcb->pStubMsg->pfnFree(*pSnb);
}
/* call_as/local stubs for unknwn.idl */
@ -2901,15 +2798,15 @@ HRESULT CALLBACK IOleInPlaceActiveObject_TranslateAccelerator_Proxy(
IOleInPlaceActiveObject* This,
LPMSG lpmsg)
{
FIXME(":stub\n");
return E_NOTIMPL;
TRACE("(%p %p)\n", This, lpmsg);
return IOleInPlaceActiveObject_RemoteTranslateAccelerator_Proxy(This);
}
HRESULT __RPC_STUB IOleInPlaceActiveObject_TranslateAccelerator_Stub(
IOleInPlaceActiveObject* This)
{
FIXME(":stub\n");
return E_NOTIMPL;
TRACE("(%p)\n", This);
return S_FALSE;
}
HRESULT CALLBACK IOleInPlaceActiveObject_ResizeBorder_Proxy(
@ -2939,8 +2836,8 @@ HRESULT CALLBACK IOleCache2_UpdateCache_Proxy(
DWORD grfUpdf,
LPVOID pReserved)
{
FIXME(":stub\n");
return E_NOTIMPL;
TRACE("(%p, %p, 0x%08x, %p)\n", This, pDataObject, grfUpdf, pReserved);
return IOleCache2_RemoteUpdateCache_Proxy(This, pDataObject, grfUpdf, (LONG_PTR)pReserved);
}
HRESULT __RPC_STUB IOleCache2_UpdateCache_Stub(
@ -2949,8 +2846,8 @@ HRESULT __RPC_STUB IOleCache2_UpdateCache_Stub(
DWORD grfUpdf,
LONG_PTR pReserved)
{
FIXME(":stub\n");
return E_NOTIMPL;
TRACE("(%p, %p, 0x%08x, %li)\n", This, pDataObject, grfUpdf, pReserved);
return IOleCache2_UpdateCache(This, pDataObject, grfUpdf, (void*)pReserved);
}
HRESULT CALLBACK IEnumOLEVERB_Next_Proxy(

View file

@ -145,7 +145,7 @@ reactos/dll/win32/ntprint # Synced to WineStaging-1.7.37
reactos/dll/win32/objsel # Synced to WineStaging-1.7.37
reactos/dll/win32/odbc32 # Synced to WineStaging-1.7.37. Depends on port of Linux ODBC.
reactos/dll/win32/odbccp32 # Synced to WineStaging-1.7.47
reactos/dll/win32/ole32 # Synced to WineStaging-1.7.37
reactos/dll/win32/ole32 # Synced to WineStaging-1.7.47
reactos/dll/win32/oleacc # Synced to WineStaging-1.7.37
reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.37
reactos/dll/win32/olecli32 # Synced to WineStaging-1.7.37