mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 23:06:00 +00:00
[OLE32] Sync with Wine Staging 1.7.47. CORE-9924
svn path=/trunk/; revision=68469
This commit is contained in:
parent
6108ea6bc9
commit
bc504c5a3f
23 changed files with 4892 additions and 4960 deletions
|
@ -81,7 +81,7 @@ BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppvObject)
|
||||||
if (IsEqualIID(&IID_IUnknown, riid) ||
|
if (IsEqualIID(&IID_IUnknown, riid) ||
|
||||||
IsEqualIID(&IID_IBindCtx, riid))
|
IsEqualIID(&IID_IBindCtx, riid))
|
||||||
{
|
{
|
||||||
*ppvObject = This;
|
*ppvObject = &This->IBindCtx_iface;
|
||||||
IBindCtx_AddRef(iface);
|
IBindCtx_AddRef(iface);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,8 +63,6 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
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 */
|
/* Structure of 'Ole Private Data' clipboard format */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -559,6 +557,12 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt)
|
||||||
hStorage = GlobalAlloc(GMEM_SHARE|GMEM_MOVEABLE, 0);
|
hStorage = GlobalAlloc(GMEM_SHARE|GMEM_MOVEABLE, 0);
|
||||||
if (hStorage == NULL) return E_OUTOFMEMORY;
|
if (hStorage == NULL) return E_OUTOFMEMORY;
|
||||||
hr = CreateILockBytesOnHGlobal(hStorage, FALSE, &ptrILockBytes);
|
hr = CreateILockBytesOnHGlobal(hStorage, FALSE, &ptrILockBytes);
|
||||||
|
if (FAILED(hr))
|
||||||
|
{
|
||||||
|
GlobalFree(hStorage);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
hr = StgCreateDocfileOnILockBytes(ptrILockBytes, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &std.u.pstg);
|
hr = StgCreateDocfileOnILockBytes(ptrILockBytes, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &std.u.pstg);
|
||||||
ILockBytes_Release(ptrILockBytes);
|
ILockBytes_Release(ptrILockBytes);
|
||||||
|
|
||||||
|
|
|
@ -2196,7 +2196,7 @@ HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id )
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* IIDFromString [OLE32.@]
|
* IIDFromString [OLE32.@]
|
||||||
*
|
*
|
||||||
* Converts a interface identifier from its string representation into
|
* Converts an interface identifier from its string representation to
|
||||||
* the IID struct.
|
* the IID struct.
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
|
@ -4930,8 +4930,8 @@ HRESULT WINAPI CoGetObjectContext(REFIID riid, void **ppv)
|
||||||
else
|
else
|
||||||
context->apttype = APTTYPE_STA;
|
context->apttype = APTTYPE_STA;
|
||||||
|
|
||||||
hr = IUnknown_QueryInterface((IUnknown *)&context->IComThreadingInfo_iface, riid, ppv);
|
hr = IComThreadingInfo_QueryInterface(&context->IComThreadingInfo_iface, riid, ppv);
|
||||||
IUnknown_Release((IUnknown *)&context->IComThreadingInfo_iface);
|
IComThreadingInfo_Release(&context->IComThreadingInfo_iface);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -707,6 +707,8 @@ CompositeMonikerImpl_GetTimeOfLastChange(IMoniker* iface, IBindCtx* pbc,
|
||||||
IRunningObjectTable* rot;
|
IRunningObjectTable* rot;
|
||||||
|
|
||||||
res = IMoniker_ComposeWith(pmkToLeft, iface, FALSE, &leftMk);
|
res = IMoniker_ComposeWith(pmkToLeft, iface, FALSE, &leftMk);
|
||||||
|
if (FAILED(res))
|
||||||
|
return res;
|
||||||
|
|
||||||
res = IBindCtx_GetRunningObjectTable(pbc,&rot);
|
res = IBindCtx_GetRunningObjectTable(pbc,&rot);
|
||||||
if (FAILED(res))
|
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 */
|
/* This method returns a composite moniker that consists of the inverses of each of the components */
|
||||||
/* of the original composite, stored in reverse order */
|
/* of the original composite, stored in reverse order */
|
||||||
|
|
||||||
|
*ppmk = NULL;
|
||||||
|
|
||||||
res=CreateAntiMoniker(&antiMk);
|
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);
|
IMoniker_Release(antiMk);
|
||||||
|
if (FAILED(res))
|
||||||
|
return res;
|
||||||
|
|
||||||
if (tempMk==NULL)
|
if (tempMk==NULL)
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,13 @@ typedef struct PresentationDataHeader
|
||||||
DWORD dwSize;
|
DWORD dwSize;
|
||||||
} PresentationDataHeader;
|
} PresentationDataHeader;
|
||||||
|
|
||||||
|
enum stream_type
|
||||||
|
{
|
||||||
|
no_stream,
|
||||||
|
pres_stream,
|
||||||
|
contents_stream
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct DataCacheEntry
|
typedef struct DataCacheEntry
|
||||||
{
|
{
|
||||||
struct list entry;
|
struct list entry;
|
||||||
|
@ -84,11 +91,12 @@ typedef struct DataCacheEntry
|
||||||
/* cached data */
|
/* cached data */
|
||||||
STGMEDIUM stgmedium;
|
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
|
* IPersistStorage_Load. This is where the visual
|
||||||
* representation of the object is stored.
|
* representation of the object is stored.
|
||||||
*/
|
*/
|
||||||
IStorage *storage;
|
IStream *stream;
|
||||||
|
enum stream_type stream_type;
|
||||||
/* connection ID */
|
/* connection ID */
|
||||||
DWORD id;
|
DWORD id;
|
||||||
/* dirty flag */
|
/* dirty flag */
|
||||||
|
@ -204,8 +212,8 @@ static const char * debugstr_formatetc(const FORMATETC *formatetc)
|
||||||
static void DataCacheEntry_Destroy(DataCache *cache, DataCacheEntry *cache_entry)
|
static void DataCacheEntry_Destroy(DataCache *cache, DataCacheEntry *cache_entry)
|
||||||
{
|
{
|
||||||
list_remove(&cache_entry->entry);
|
list_remove(&cache_entry->entry);
|
||||||
if (cache_entry->storage)
|
if (cache_entry->stream)
|
||||||
IStorage_Release(cache_entry->storage);
|
IStream_Release(cache_entry->stream);
|
||||||
HeapFree(GetProcessHeap(), 0, cache_entry->fmtetc.ptd);
|
HeapFree(GetProcessHeap(), 0, cache_entry->fmtetc.ptd);
|
||||||
ReleaseStgMedium(&cache_entry->stgmedium);
|
ReleaseStgMedium(&cache_entry->stgmedium);
|
||||||
if(cache_entry->sink_id)
|
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)->data_cf = 0;
|
||||||
(*cache_entry)->stgmedium.tymed = TYMED_NULL;
|
(*cache_entry)->stgmedium.tymed = TYMED_NULL;
|
||||||
(*cache_entry)->stgmedium.pUnkForRelease = 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)->id = This->last_cache_id++;
|
||||||
(*cache_entry)->dirty = TRUE;
|
(*cache_entry)->dirty = TRUE;
|
||||||
(*cache_entry)->stream_number = -1;
|
(*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)
|
static HRESULT DataCacheEntry_OpenPresStream(DataCacheEntry *cache_entry, IStream **ppStm)
|
||||||
{
|
{
|
||||||
STATSTG elem;
|
|
||||||
IEnumSTATSTG *pEnum;
|
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
LARGE_INTEGER offset;
|
||||||
|
|
||||||
if (!ppStm) return E_POINTER;
|
if (cache_entry->stream)
|
||||||
|
|
||||||
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 (DataCache_IsPresentationStream(&elem))
|
/* Rewind the stream before returning it. */
|
||||||
{
|
offset.QuadPart = 0;
|
||||||
IStream *pStm;
|
|
||||||
|
|
||||||
hr = IStorage_OpenStream(cache_entry->storage, elem.pwcsName,
|
hr = IStream_Seek( cache_entry->stream, offset, STREAM_SEEK_SET, NULL );
|
||||||
NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0,
|
if (SUCCEEDED( hr ))
|
||||||
&pStm);
|
{
|
||||||
if (SUCCEEDED(hr))
|
*ppStm = cache_entry->stream;
|
||||||
{
|
IStream_AddRef( cache_entry->stream );
|
||||||
PresentationDataHeader header;
|
}
|
||||||
ULONG actual_read;
|
}
|
||||||
CLIPFORMAT clipformat;
|
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 */
|
static HRESULT load_mf_pict( DataCacheEntry *cache_entry, IStream *stm )
|
||||||
if (hr == S_OK && actual_read == sizeof(header)
|
{
|
||||||
&& header.dvAspect == cache_entry->fmtetc.dwAspect)
|
HRESULT hr;
|
||||||
{
|
STATSTG stat;
|
||||||
/* Rewind the stream before returning it. */
|
ULARGE_INTEGER current_pos;
|
||||||
LARGE_INTEGER offset;
|
void *bits;
|
||||||
offset.u.LowPart = 0;
|
METAFILEPICT *mfpict;
|
||||||
offset.u.HighPart = 0;
|
HGLOBAL hmfpict;
|
||||||
IStream_Seek(pStm, offset, STREAM_SEEK_SET, NULL);
|
PresentationDataHeader header;
|
||||||
|
CLIPFORMAT clipformat;
|
||||||
|
static const LARGE_INTEGER offset_zero;
|
||||||
|
ULONG read;
|
||||||
|
|
||||||
*ppStm = pStm;
|
if (cache_entry->stream_type != pres_stream)
|
||||||
|
{
|
||||||
CoTaskMemFree(elem.pwcsName);
|
FIXME( "Unimplemented for stream type %d\n", cache_entry->stream_type );
|
||||||
IEnumSTATSTG_Release(pEnum);
|
return E_FAIL;
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
IStream_Release(pStm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CoTaskMemFree(elem.pwcsName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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, ¤t_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)
|
static HRESULT DataCacheEntry_LoadData(DataCacheEntry *cache_entry)
|
||||||
{
|
{
|
||||||
IStream* presStream = NULL;
|
HRESULT hr;
|
||||||
HRESULT hres;
|
IStream *stm;
|
||||||
ULARGE_INTEGER current_pos;
|
|
||||||
STATSTG streamInfo;
|
|
||||||
void* metafileBits;
|
|
||||||
METAFILEPICT *mfpict;
|
|
||||||
HGLOBAL hmfpict;
|
|
||||||
PresentationDataHeader header;
|
|
||||||
CLIPFORMAT clipformat;
|
|
||||||
static const LARGE_INTEGER offset_zero;
|
|
||||||
|
|
||||||
/*
|
hr = DataCacheEntry_OpenPresStream( cache_entry, &stm );
|
||||||
* Open the presentation stream.
|
if (FAILED(hr)) return hr;
|
||||||
*/
|
|
||||||
hres = DataCacheEntry_OpenPresStream(cache_entry, &presStream);
|
|
||||||
|
|
||||||
if (FAILED(hres))
|
switch (cache_entry->fmtetc.cfFormat)
|
||||||
return hres;
|
{
|
||||||
|
case CF_METAFILEPICT:
|
||||||
|
hr = load_mf_pict( cache_entry, stm );
|
||||||
|
break;
|
||||||
|
|
||||||
/*
|
case CF_DIB:
|
||||||
* Get the size of the stream.
|
hr = load_dib( cache_entry, stm );
|
||||||
*/
|
break;
|
||||||
hres = IStream_Stat(presStream,
|
|
||||||
&streamInfo,
|
|
||||||
STATFLAG_NONAME);
|
|
||||||
|
|
||||||
/*
|
default:
|
||||||
* Read the header.
|
FIXME( "Unimplemented clip format %x\n", cache_entry->fmtetc.cfFormat );
|
||||||
*/
|
hr = E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
hres = read_clipformat(presStream, &clipformat);
|
IStream_Release( stm );
|
||||||
if (FAILED(hres))
|
return hr;
|
||||||
{
|
|
||||||
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, ¤t_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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT DataCacheEntry_CreateStream(DataCacheEntry *cache_entry,
|
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)
|
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);
|
HRESULT hr = DataCacheEntry_LoadData(cache_entry);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
|
@ -842,10 +840,10 @@ static inline HRESULT DataCacheEntry_DiscardData(DataCacheEntry *cache_entry)
|
||||||
|
|
||||||
static inline void DataCacheEntry_HandsOffStorage(DataCacheEntry *cache_entry)
|
static inline void DataCacheEntry_HandsOffStorage(DataCacheEntry *cache_entry)
|
||||||
{
|
{
|
||||||
if (cache_entry->storage)
|
if (cache_entry->stream)
|
||||||
{
|
{
|
||||||
IStorage_Release(cache_entry->storage);
|
IStream_Release(cache_entry->stream);
|
||||||
cache_entry->storage = NULL;
|
cache_entry->stream = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1014,12 +1012,15 @@ static HRESULT WINAPI DataCache_GetDataHere(
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI DataCache_QueryGetData(
|
static HRESULT WINAPI DataCache_QueryGetData( IDataObject *iface, FORMATETC *fmt )
|
||||||
IDataObject* iface,
|
|
||||||
LPFORMATETC pformatetc)
|
|
||||||
{
|
{
|
||||||
FIXME("stub\n");
|
DataCache *This = impl_from_IDataObject( iface );
|
||||||
return E_NOTIMPL;
|
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)
|
* DataCache_GetClassID (IPersistStorage)
|
||||||
*
|
*
|
||||||
* The data cache doesn't implement this method.
|
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI DataCache_GetClassID(
|
static HRESULT WINAPI DataCache_GetClassID(IPersistStorage *iface, CLSID *clsid)
|
||||||
IPersistStorage* iface,
|
|
||||||
CLSID* pClassID)
|
|
||||||
{
|
{
|
||||||
DataCache *This = impl_from_IPersistStorage(iface);
|
DataCache *This = impl_from_IPersistStorage( iface );
|
||||||
DataCacheEntry *cache_entry;
|
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 (This->presentationStorage)
|
||||||
{
|
|
||||||
if (cache_entry->storage != NULL)
|
|
||||||
{
|
{
|
||||||
STATSTG statstg;
|
hr = IStorage_Stat( This->presentationStorage, &statstg, STATFLAG_NONAME );
|
||||||
HRESULT hr = IStorage_Stat(cache_entry->storage, &statstg, STATFLAG_NONAME);
|
if (SUCCEEDED(hr))
|
||||||
if (SUCCEEDED(hr))
|
{
|
||||||
{
|
*clsid = statstg.clsid;
|
||||||
*pClassID = statstg.clsid;
|
return S_OK;
|
||||||
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;
|
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)
|
* DataCache_Load (IPersistStorage)
|
||||||
*
|
*
|
||||||
|
@ -1247,86 +1334,34 @@ static HRESULT WINAPI DataCache_InitNew(
|
||||||
* and it will load the presentation information when the
|
* and it will load the presentation information when the
|
||||||
* IDataObject_GetData or IViewObject2_Draw methods are called.
|
* IDataObject_GetData or IViewObject2_Draw methods are called.
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI DataCache_Load(
|
static HRESULT WINAPI DataCache_Load( IPersistStorage *iface, IStorage *pStg )
|
||||||
IPersistStorage* iface,
|
|
||||||
IStorage* pStg)
|
|
||||||
{
|
{
|
||||||
DataCache *This = impl_from_IPersistStorage(iface);
|
DataCache *This = impl_from_IPersistStorage(iface);
|
||||||
STATSTG elem;
|
|
||||||
IEnumSTATSTG *pEnum;
|
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
IStream *stm;
|
||||||
|
|
||||||
TRACE("(%p, %p)\n", iface, pStg);
|
TRACE("(%p, %p)\n", iface, pStg);
|
||||||
|
|
||||||
if (This->presentationStorage != NULL)
|
IPersistStorage_HandsOffStorage( iface );
|
||||||
IStorage_Release(This->presentationStorage);
|
|
||||||
|
|
||||||
This->presentationStorage = pStg;
|
hr = IStorage_OpenStream( pStg, CONTENTS, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE,
|
||||||
|
0, &stm );
|
||||||
hr = IStorage_EnumElements(pStg, 0, NULL, 0, &pEnum);
|
if (SUCCEEDED( hr ))
|
||||||
if (FAILED(hr)) return hr;
|
|
||||||
|
|
||||||
while ((hr = IEnumSTATSTG_Next(pEnum, 1, &elem, NULL)) == S_OK)
|
|
||||||
{
|
{
|
||||||
if (DataCache_IsPresentationStream(&elem))
|
hr = parse_contents_stream( This, pStg, stm );
|
||||||
{
|
IStream_Release( stm );
|
||||||
IStream *pStm;
|
}
|
||||||
|
else
|
||||||
|
hr = parse_pres_streams( This, pStg );
|
||||||
|
|
||||||
hr = IStorage_OpenStream(This->presentationStorage, elem.pwcsName,
|
if (SUCCEEDED( hr ))
|
||||||
NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0,
|
{
|
||||||
&pStm);
|
This->dirty = FALSE;
|
||||||
if (SUCCEEDED(hr))
|
This->presentationStorage = pStg;
|
||||||
{
|
IStorage_AddRef( This->presentationStorage );
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
This->dirty = FALSE;
|
return hr;
|
||||||
|
|
||||||
IEnumSTATSTG_Release(pEnum);
|
|
||||||
|
|
||||||
IStorage_AddRef(This->presentationStorage);
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
@ -1529,7 +1564,7 @@ static HRESULT WINAPI DataCache_Draw(
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* if the data hasn't been loaded yet, do it now */
|
/* 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);
|
hres = DataCacheEntry_LoadData(cache_entry);
|
||||||
if (FAILED(hres))
|
if (FAILED(hres))
|
||||||
|
@ -1600,6 +1635,26 @@ static HRESULT WINAPI DataCache_Draw(
|
||||||
|
|
||||||
return S_OK;
|
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;
|
continue;
|
||||||
|
|
||||||
/* if the data hasn't been loaded yet, do it now */
|
/* 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);
|
hres = DataCacheEntry_LoadData(cache_entry);
|
||||||
if (FAILED(hres))
|
if (FAILED(hres))
|
||||||
|
@ -1800,6 +1855,41 @@ static HRESULT WINAPI DataCache_GetExtent(
|
||||||
|
|
||||||
return S_OK;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2171,7 +2171,7 @@ HRESULT HandlerCF_Create(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||||
This->refs = 0;
|
This->refs = 0;
|
||||||
This->clsid = *rclsid;
|
This->clsid = *rclsid;
|
||||||
|
|
||||||
hr = IUnknown_QueryInterface((IUnknown *)&This->IClassFactory_iface, riid, ppv);
|
hr = IClassFactory_QueryInterface(&This->IClassFactory_iface, riid, ppv);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,6 @@ static inline FileLockBytesImpl *impl_from_ILockBytes(ILockBytes *iface)
|
||||||
* Prototypes for private methods
|
* 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
|
* GetProtectMode
|
||||||
*
|
*
|
||||||
|
@ -330,24 +326,6 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface,
|
||||||
return get_lock_error();
|
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,
|
static HRESULT WINAPI FileLockBytesImpl_UnlockRegion(ILockBytes* iface,
|
||||||
ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
|
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);
|
pstatstg->cbSize.u.LowPart = GetFileSize(This->hfile, &pstatstg->cbSize.u.HighPart);
|
||||||
/* FIXME: If the implementation is exported, we'll need to set other fields. */
|
/* 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;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -907,7 +907,8 @@ static HRESULT WINAPI
|
||||||
FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
|
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;
|
IBindCtx *bindctx;
|
||||||
DWORD mkSys;
|
DWORD mkSys;
|
||||||
ULONG nb1,nb2,i,sameIdx;
|
ULONG nb1,nb2,i,sameIdx;
|
||||||
|
@ -995,8 +996,8 @@ failed:
|
||||||
CoTaskMemFree(pathThis);
|
CoTaskMemFree(pathThis);
|
||||||
CoTaskMemFree(pathOther);
|
CoTaskMemFree(pathOther);
|
||||||
CoTaskMemFree(commonPath);
|
CoTaskMemFree(commonPath);
|
||||||
free_stringtable(stringTable1);
|
if (stringTable1) free_stringtable(stringTable1);
|
||||||
free_stringtable(stringTable2);
|
if (stringTable2) free_stringtable(stringTable2);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_QueryInterface(
|
||||||
IsEqualIID(&IID_ISequentialStream, riid) ||
|
IsEqualIID(&IID_ISequentialStream, riid) ||
|
||||||
IsEqualIID(&IID_IStream, riid))
|
IsEqualIID(&IID_IStream, riid))
|
||||||
{
|
{
|
||||||
*ppvObject = This;
|
*ppvObject = &This->IStream_iface;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*ppvObject)==0)
|
if ((*ppvObject)==0)
|
||||||
|
|
|
@ -586,8 +586,14 @@ static HRESULT WINAPI ItemMonikerImpl_GetTimeOfLastChange(IMoniker* iface,
|
||||||
/* IMoniker::GetTimeOfLastChange on the pmkToLeft parameter. */
|
/* IMoniker::GetTimeOfLastChange on the pmkToLeft parameter. */
|
||||||
|
|
||||||
res=CreateGenericComposite(pmkToLeft,iface,&compositeMk);
|
res=CreateGenericComposite(pmkToLeft,iface,&compositeMk);
|
||||||
|
if (FAILED(res))
|
||||||
|
return res;
|
||||||
|
|
||||||
res=IBindCtx_GetRunningObjectTable(pbc,&rot);
|
res=IBindCtx_GetRunningObjectTable(pbc,&rot);
|
||||||
|
if (FAILED(res)) {
|
||||||
|
IMoniker_Release(compositeMk);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
if (IRunningObjectTable_GetTimeOfLastChange(rot,compositeMk,pItemTime)!=S_OK)
|
if (IRunningObjectTable_GetTimeOfLastChange(rot,compositeMk,pItemTime)!=S_OK)
|
||||||
|
|
||||||
|
|
|
@ -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)
|
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;
|
MSHCTX new_dest_context;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
old_dest_context = This->dest_context;
|
||||||
new_dest_context = old_dest_context;
|
new_dest_context = old_dest_context;
|
||||||
/* "stronger" values overwrite "weaker" values. stronger values are
|
/* "stronger" values overwrite "weaker" values. stronger values are
|
||||||
* ones that disable more optimisations */
|
* 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;
|
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);
|
} while (new_dest_context != old_dest_context);
|
||||||
|
|
||||||
if (dest_context_data)
|
if (dest_context_data)
|
||||||
|
@ -1028,8 +1029,11 @@ static HRESULT proxy_manager_get_remunknown(struct proxy_manager * This, IRemUnk
|
||||||
IRemUnknown_AddRef(*remunk);
|
IRemUnknown_AddRef(*remunk);
|
||||||
}
|
}
|
||||||
else if (!This->parent)
|
else if (!This->parent)
|
||||||
|
{
|
||||||
/* disconnected - we can't create IRemUnknown */
|
/* disconnected - we can't create IRemUnknown */
|
||||||
|
*remunk = NULL;
|
||||||
hr = S_FALSE;
|
hr = S_FALSE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
STDOBJREF stdobjref;
|
STDOBJREF stdobjref;
|
||||||
|
|
|
@ -298,7 +298,7 @@ RunningObjectTableImpl_QueryInterface(IRunningObjectTable* iface,
|
||||||
|
|
||||||
if (IsEqualIID(&IID_IUnknown, riid) ||
|
if (IsEqualIID(&IID_IUnknown, riid) ||
|
||||||
IsEqualIID(&IID_IRunningObjectTable, riid))
|
IsEqualIID(&IID_IRunningObjectTable, riid))
|
||||||
*ppvObject = This;
|
*ppvObject = &This->IRunningObjectTable_iface;
|
||||||
|
|
||||||
if ((*ppvObject)==0)
|
if ((*ppvObject)==0)
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
@ -1180,7 +1180,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
|
||||||
IStorage *pstg=0;
|
IStorage *pstg=0;
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
int nbElm, length, i;
|
int nbElm, length, i;
|
||||||
LONG sizeProgId;
|
LONG sizeProgId, ret;
|
||||||
LPOLESTR *pathDec=0,absFile=0,progId=0;
|
LPOLESTR *pathDec=0,absFile=0,progId=0;
|
||||||
LPWSTR extension;
|
LPWSTR extension;
|
||||||
static const WCHAR bkslashW[] = {'\\',0};
|
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);
|
res=StgOpenStorage(filePathName,NULL,STGM_READ | STGM_SHARE_DENY_WRITE,NULL,0,&pstg);
|
||||||
|
|
||||||
if (SUCCEEDED(res))
|
if (SUCCEEDED(res)) {
|
||||||
res=ReadClassStg(pstg,pclsid);
|
res=ReadClassStg(pstg,pclsid);
|
||||||
|
IStorage_Release(pstg);
|
||||||
IStorage_Release(pstg);
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -1246,26 +1246,23 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
|
||||||
return MK_E_INVALIDEXTENSION;
|
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 */
|
/* get the progId associated to the extension */
|
||||||
progId = CoTaskMemAlloc(sizeProgId);
|
progId = CoTaskMemAlloc(sizeProgId);
|
||||||
res = RegQueryValueW(HKEY_CLASSES_ROOT, extension, progId, &sizeProgId);
|
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, progId, &sizeProgId);
|
||||||
|
if (!ret)
|
||||||
if (res==ERROR_SUCCESS)
|
|
||||||
/* return the clsid associated to the progId */
|
/* 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++)
|
for(i=0; pathDec[i]!=NULL;i++)
|
||||||
CoTaskMemFree(pathDec[i]);
|
CoTaskMemFree(pathDec[i]);
|
||||||
CoTaskMemFree(pathDec);
|
CoTaskMemFree(pathDec);
|
||||||
|
|
||||||
CoTaskMemFree(progId);
|
CoTaskMemFree(progId);
|
||||||
|
return res != S_OK ? MK_E_INVALIDEXTENSION : res;
|
||||||
if (res==ERROR_SUCCESS)
|
|
||||||
return res;
|
|
||||||
|
|
||||||
return MK_E_INVALIDEXTENSION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -1283,17 +1280,12 @@ static HRESULT WINAPI EnumMonikerImpl_QueryInterface(IEnumMoniker* iface,REFIID
|
||||||
|
|
||||||
*ppvObject = NULL;
|
*ppvObject = NULL;
|
||||||
|
|
||||||
if (IsEqualIID(&IID_IUnknown, riid))
|
if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IEnumMoniker, riid))
|
||||||
*ppvObject = This;
|
*ppvObject = &This->IEnumMoniker_iface;
|
||||||
else
|
else
|
||||||
if (IsEqualIID(&IID_IEnumMoniker, riid))
|
|
||||||
*ppvObject = This;
|
|
||||||
|
|
||||||
if ((*ppvObject)==NULL)
|
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
|
||||||
IEnumMoniker_AddRef(iface);
|
IEnumMoniker_AddRef(iface);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1253,6 +1253,8 @@ HRESULT WINAPI OleLoad(
|
||||||
* Get the class ID for the object.
|
* Get the class ID for the object.
|
||||||
*/
|
*/
|
||||||
hres = IStorage_Stat(pStg, &storageInfo, STATFLAG_NONAME);
|
hres = IStorage_Stat(pStg, &storageInfo, STATFLAG_NONAME);
|
||||||
|
if (FAILED(hres))
|
||||||
|
return hres;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now, try and create the handler for the object
|
* Now, try and create the handler for the object
|
||||||
|
@ -2426,6 +2428,9 @@ static DWORD OLEDD_GetButtonState(void)
|
||||||
if ( (keyboardState[VK_CONTROL] & 0x80) !=0)
|
if ( (keyboardState[VK_CONTROL] & 0x80) !=0)
|
||||||
keyMask |= MK_CONTROL;
|
keyMask |= MK_CONTROL;
|
||||||
|
|
||||||
|
if ( (keyboardState[VK_MENU] & 0x80) !=0)
|
||||||
|
keyMask |= MK_ALT;
|
||||||
|
|
||||||
if ( (keyboardState[VK_LBUTTON] & 0x80) !=0)
|
if ( (keyboardState[VK_LBUTTON] & 0x80) !=0)
|
||||||
keyMask |= MK_LBUTTON;
|
keyMask |= MK_LBUTTON;
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
||||||
|
|
||||||
#define MAX_CLIPFORMAT_NAME 80
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* OleQueryCreateFromData [OLE32.@]
|
* OleQueryCreateFromData [OLE32.@]
|
||||||
*
|
*
|
||||||
|
|
|
@ -156,10 +156,10 @@
|
||||||
@ stdcall HBITMAP_UserMarshal(ptr ptr ptr)
|
@ stdcall HBITMAP_UserMarshal(ptr ptr ptr)
|
||||||
@ stdcall HBITMAP_UserSize(ptr long ptr)
|
@ stdcall HBITMAP_UserSize(ptr long ptr)
|
||||||
@ stdcall HBITMAP_UserUnmarshal(ptr ptr ptr)
|
@ stdcall HBITMAP_UserUnmarshal(ptr ptr ptr)
|
||||||
@ stub HBRUSH_UserFree
|
@ stdcall HBRUSH_UserFree(ptr ptr)
|
||||||
@ stub HBRUSH_UserMarshal
|
@ stdcall HBRUSH_UserMarshal(ptr ptr ptr)
|
||||||
@ stub HBRUSH_UserSize
|
@ stdcall HBRUSH_UserSize(ptr long ptr)
|
||||||
@ stub HBRUSH_UserUnmarshal
|
@ stdcall HBRUSH_UserUnmarshal(ptr ptr ptr)
|
||||||
@ stdcall HDC_UserFree(ptr ptr)
|
@ stdcall HDC_UserFree(ptr ptr)
|
||||||
@ stdcall HDC_UserMarshal(ptr ptr ptr)
|
@ stdcall HDC_UserMarshal(ptr ptr ptr)
|
||||||
@ stdcall HDC_UserSize(ptr long ptr)
|
@ stdcall HDC_UserSize(ptr long ptr)
|
||||||
|
|
|
@ -19,10 +19,6 @@
|
||||||
#if !defined( __WINE_OLESTD_H_ )
|
#if !defined( __WINE_OLESTD_H_ )
|
||||||
#define __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 */
|
/* Clipboard format strings */
|
||||||
#define CF_EMBEDSOURCE "Embed Source"
|
#define CF_EMBEDSOURCE "Embed Source"
|
||||||
#define CF_EMBEDDEDOBJECT "Embedded Object"
|
#define CF_EMBEDDEDOBJECT "Embedded Object"
|
||||||
|
|
|
@ -95,7 +95,7 @@ PointerMonikerImpl_Release(IMoniker* iface)
|
||||||
|
|
||||||
ref = InterlockedDecrement(&This->ref);
|
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 (ref == 0)
|
||||||
{
|
{
|
||||||
if (This->pObject) IUnknown_Release(This->pObject);
|
if (This->pObject) IUnknown_Release(This->pObject);
|
||||||
|
|
|
@ -1828,6 +1828,7 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
|
||||||
bufferlen = 0;
|
bufferlen = 0;
|
||||||
if (!ReadFile(hPipe,marshalbuffer,sizeof(marshalbuffer),&bufferlen,NULL)) {
|
if (!ReadFile(hPipe,marshalbuffer,sizeof(marshalbuffer),&bufferlen,NULL)) {
|
||||||
FIXME("Failed to read marshal id from classfactory of %s.\n",debugstr_guid(rclsid));
|
FIXME("Failed to read marshal id from classfactory of %s.\n",debugstr_guid(rclsid));
|
||||||
|
CloseHandle(hPipe);
|
||||||
Sleep(1000);
|
Sleep(1000);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1023,7 +1023,7 @@ static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This,
|
||||||
#define __thiscall_wrapper __cdecl
|
#define __thiscall_wrapper __cdecl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void* __thiscall_wrapper Allocate_CoTaskMemAlloc(void *userdata, ULONG size)
|
static void* __thiscall_wrapper Allocate_CoTaskMemAlloc(void *this, ULONG size)
|
||||||
{
|
{
|
||||||
return CoTaskMemAlloc(size);
|
return CoTaskMemAlloc(size);
|
||||||
}
|
}
|
||||||
|
@ -1032,7 +1032,7 @@ static void* __thiscall_wrapper Allocate_CoTaskMemAlloc(void *userdata, ULONG si
|
||||||
* end of the buffer.
|
* end of the buffer.
|
||||||
*/
|
*/
|
||||||
static HRESULT PropertyStorage_ReadProperty(PROPVARIANT *prop, const BYTE *data,
|
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;
|
HRESULT hr = S_OK;
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -150,8 +150,6 @@ struct DirEntry
|
||||||
|
|
||||||
HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsName, ILockBytes **pLockBytes) DECLSPEC_HIDDEN;
|
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
|
* Ole Convert support
|
||||||
*/
|
*/
|
||||||
|
@ -356,9 +354,9 @@ void StorageBaseImpl_RemoveStream(StorageBaseImpl * stg, StgStreamImpl * strm) D
|
||||||
#define BLOCKCHAIN_CACHE_SIZE 4
|
#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.
|
* storage. Basically, a document file.
|
||||||
*/
|
*/
|
||||||
struct StorageImpl
|
struct StorageImpl
|
||||||
|
@ -404,44 +402,13 @@ struct StorageImpl
|
||||||
BlockChainStream* blockChainCache[BLOCKCHAIN_CACHE_SIZE];
|
BlockChainStream* blockChainCache[BLOCKCHAIN_CACHE_SIZE];
|
||||||
UINT blockChainToEvict;
|
UINT blockChainToEvict;
|
||||||
|
|
||||||
|
ULONG locks_supported;
|
||||||
|
|
||||||
ILockBytes* lockBytes;
|
ILockBytes* lockBytes;
|
||||||
|
|
||||||
ULONG locked_bytes[8];
|
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.
|
* StgStreamImpl definitions.
|
||||||
*
|
*
|
||||||
|
@ -496,7 +463,10 @@ StgStreamImpl* StgStreamImpl_Construct(
|
||||||
/* Range lock constants.
|
/* Range lock constants.
|
||||||
*
|
*
|
||||||
* The storage format reserves the region from 0x7fffff00-0x7fffffff for
|
* 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.
|
* within that range are used, and for what. These are guesses based on testing.
|
||||||
* In particular, ends of ranges may be wrong.
|
* 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.
|
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_UNK1_LAST 0x7fffff57
|
||||||
#define RANGELOCK_PRIORITY1_FIRST 0x7fffff58
|
#define RANGELOCK_PRIORITY1_FIRST 0x7fffff58
|
||||||
#define RANGELOCK_PRIORITY1_LAST 0x7fffff6b
|
#define RANGELOCK_PRIORITY1_LAST 0x7fffff6b
|
||||||
|
@ -540,6 +510,9 @@ StgStreamImpl* StgStreamImpl_Construct(
|
||||||
#define RANGELOCK_FIRST RANGELOCK_UNK1_FIRST
|
#define RANGELOCK_FIRST RANGELOCK_UNK1_FIRST
|
||||||
#define RANGELOCK_LAST RANGELOCK_UNK2_LAST
|
#define RANGELOCK_LAST RANGELOCK_UNK2_LAST
|
||||||
|
|
||||||
|
/* internal value for LockRegion/UnlockRegion */
|
||||||
|
#define WINE_LOCK_READ 0x80000000
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Endian conversion macros
|
* 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,
|
void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination,
|
||||||
const DirEntry* source, int statFlags) DECLSPEC_HIDDEN;
|
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__ */
|
#endif /* __STORAGE32_H__ */
|
||||||
|
|
|
@ -290,7 +290,7 @@ static unsigned char * handle_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffe
|
||||||
return pBuffer + sizeof(RemotableHandle);
|
return pBuffer + sizeof(RemotableHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_UserFree(ULONG *pFlags, HANDLE *phMenu)
|
static void handle_UserFree(ULONG *pFlags, HANDLE *handle)
|
||||||
{
|
{
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
}
|
}
|
||||||
|
@ -323,6 +323,9 @@ static void handle_UserFree(ULONG *pFlags, HANDLE *phMenu)
|
||||||
IMPL_WIREM_HANDLE(HACCEL)
|
IMPL_WIREM_HANDLE(HACCEL)
|
||||||
IMPL_WIREM_HANDLE(HMENU)
|
IMPL_WIREM_HANDLE(HMENU)
|
||||||
IMPL_WIREM_HANDLE(HWND)
|
IMPL_WIREM_HANDLE(HWND)
|
||||||
|
IMPL_WIREM_HANDLE(HDC)
|
||||||
|
IMPL_WIREM_HANDLE(HICON)
|
||||||
|
IMPL_WIREM_HANDLE(HBRUSH)
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* HGLOBAL_UserSize [OLE32.@]
|
* HGLOBAL_UserSize [OLE32.@]
|
||||||
|
@ -642,204 +645,6 @@ void __RPC_USER HBITMAP_UserFree(ULONG *pFlags, HBITMAP *phBmp)
|
||||||
FIXME(":stub\n");
|
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.@]
|
* 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)
|
ULONG __RPC_USER SNB_UserSize(ULONG *pFlags, ULONG StartingSize, SNB *pSnb)
|
||||||
{
|
{
|
||||||
FIXME(":stub\n");
|
ULONG size = StartingSize;
|
||||||
return 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");
|
struct SNB_wire *wire;
|
||||||
return pBuffer;
|
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)
|
unsigned char * __RPC_USER SNB_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, SNB *pSnb)
|
||||||
{
|
{
|
||||||
FIXME(":stub\n");
|
USER_MARSHAL_CB *umcb = (USER_MARSHAL_CB*)pFlags;
|
||||||
return pBuffer;
|
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)
|
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 */
|
/* call_as/local stubs for unknwn.idl */
|
||||||
|
@ -2901,15 +2798,15 @@ HRESULT CALLBACK IOleInPlaceActiveObject_TranslateAccelerator_Proxy(
|
||||||
IOleInPlaceActiveObject* This,
|
IOleInPlaceActiveObject* This,
|
||||||
LPMSG lpmsg)
|
LPMSG lpmsg)
|
||||||
{
|
{
|
||||||
FIXME(":stub\n");
|
TRACE("(%p %p)\n", This, lpmsg);
|
||||||
return E_NOTIMPL;
|
return IOleInPlaceActiveObject_RemoteTranslateAccelerator_Proxy(This);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __RPC_STUB IOleInPlaceActiveObject_TranslateAccelerator_Stub(
|
HRESULT __RPC_STUB IOleInPlaceActiveObject_TranslateAccelerator_Stub(
|
||||||
IOleInPlaceActiveObject* This)
|
IOleInPlaceActiveObject* This)
|
||||||
{
|
{
|
||||||
FIXME(":stub\n");
|
TRACE("(%p)\n", This);
|
||||||
return E_NOTIMPL;
|
return S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CALLBACK IOleInPlaceActiveObject_ResizeBorder_Proxy(
|
HRESULT CALLBACK IOleInPlaceActiveObject_ResizeBorder_Proxy(
|
||||||
|
@ -2939,8 +2836,8 @@ HRESULT CALLBACK IOleCache2_UpdateCache_Proxy(
|
||||||
DWORD grfUpdf,
|
DWORD grfUpdf,
|
||||||
LPVOID pReserved)
|
LPVOID pReserved)
|
||||||
{
|
{
|
||||||
FIXME(":stub\n");
|
TRACE("(%p, %p, 0x%08x, %p)\n", This, pDataObject, grfUpdf, pReserved);
|
||||||
return E_NOTIMPL;
|
return IOleCache2_RemoteUpdateCache_Proxy(This, pDataObject, grfUpdf, (LONG_PTR)pReserved);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __RPC_STUB IOleCache2_UpdateCache_Stub(
|
HRESULT __RPC_STUB IOleCache2_UpdateCache_Stub(
|
||||||
|
@ -2949,8 +2846,8 @@ HRESULT __RPC_STUB IOleCache2_UpdateCache_Stub(
|
||||||
DWORD grfUpdf,
|
DWORD grfUpdf,
|
||||||
LONG_PTR pReserved)
|
LONG_PTR pReserved)
|
||||||
{
|
{
|
||||||
FIXME(":stub\n");
|
TRACE("(%p, %p, 0x%08x, %li)\n", This, pDataObject, grfUpdf, pReserved);
|
||||||
return E_NOTIMPL;
|
return IOleCache2_UpdateCache(This, pDataObject, grfUpdf, (void*)pReserved);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CALLBACK IEnumOLEVERB_Next_Proxy(
|
HRESULT CALLBACK IEnumOLEVERB_Next_Proxy(
|
||||||
|
|
|
@ -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/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/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/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/oleacc # Synced to WineStaging-1.7.37
|
||||||
reactos/dll/win32/oleaut32 # 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
|
reactos/dll/win32/olecli32 # Synced to WineStaging-1.7.37
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue