Sync to Wine-20040505:

Francois Gouget <fgouget@free.fr>
- Make Unicode strings static const.
- Add a stub for StgCreateStorageEx(). Returns
  STG_E_UNIMPLEMENTEDFUNCTION as per MSDN. Fixes an error saving files
  in Word XP.
- Make our ascii strings static const.
  Remove a couple string variables that were used only once and use the
  string literal directly.
Marcus Meissner <marcus@jet.franken.de>
- Fixed strict aliasing issues in dlls/ole32.
- Implemented CoReleaseMarshalData.
- Fixed lvalue casts.
- Fixed strict aliasing issues in dlls/ole32.
Filip Navara <xnavara@volny.cz>
- Get rid of E_UNSPEC non-standard error value.

svn path=/trunk/; revision=9328
This commit is contained in:
Gé van Geldorp 2004-05-08 13:32:51 +00:00
parent 4c54d1cace
commit f7a4bc8f45
16 changed files with 148 additions and 81 deletions

View file

@ -539,7 +539,7 @@ HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker* iface,
IMoniker* pmkToLeft, IMoniker* pmkToLeft,
LPOLESTR *ppszDisplayName) LPOLESTR *ppszDisplayName)
{ {
WCHAR back[]={'\\','.','.',0}; static const WCHAR back[]={'\\','.','.',0};
TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName); TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName);

View file

@ -1015,7 +1015,7 @@ _LocalServerThread(LPVOID param) {
strcpy(pipefn,PIPEPREF); strcpy(pipefn,PIPEPREF);
WINE_StringFromCLSID(&newClass->classIdentifier,pipefn+strlen(PIPEPREF)); WINE_StringFromCLSID(&newClass->classIdentifier,pipefn+strlen(PIPEPREF));
hres = IUnknown_QueryInterface(newClass->classObject,&IID_IClassFactory,(LPVOID*)&classfac); hres = IUnknown_QueryInterface(newClass->classObject,&IID_IClassFactory,(LPVOID*)(char*)&classfac);
if (hres) return hres; if (hres) return hres;
hres = CreateStreamOnHGlobal(0,TRUE,&pStm); hres = CreateStreamOnHGlobal(0,TRUE,&pStm);
@ -1543,7 +1543,7 @@ HRESULT WINAPI CoCreateInstanceEx(
pUnkOuter, pUnkOuter,
dwClsContext, dwClsContext,
&IID_IUnknown, &IID_IUnknown,
(VOID**)&pUnk); (VOID**)(char*)&pUnk);
if (hr) if (hr)
return hr; return hr;

View file

@ -1085,7 +1085,7 @@ static HRESULT WINAPI DataCache_GetData(
{ {
/* Get the Persist Storage */ /* Get the Persist Storage */
hr = IDataObject_QueryInterface(iface, &IID_IPersistStorage, (void**)&pPersistStorage); hr = IDataObject_QueryInterface(iface, &IID_IPersistStorage, (void**)(char*)&pPersistStorage);
if (hr != S_OK) if (hr != S_OK)
goto cleanup; goto cleanup;
@ -1214,7 +1214,7 @@ static HRESULT WINAPI DataCache_IDataObject_SetData(
TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease); TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
hres = IDataObject_QueryInterface(iface, &IID_IOleCache2, (void**)&oleCache); hres = IDataObject_QueryInterface(iface, &IID_IOleCache2, (void**)(char*)&oleCache);
if (FAILED(hres)) if (FAILED(hres))
return E_UNEXPECTED; return E_UNEXPECTED;

View file

@ -925,7 +925,7 @@ static HRESULT WINAPI DefaultHandler_GetMoniker(
} }
return E_UNSPEC; return E_FAIL;
} }
/************************************************************************ /************************************************************************
@ -1103,7 +1103,7 @@ static HRESULT WINAPI DefaultHandler_GetExtent(
TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel); TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView); hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)(char*)&cacheView);
if (FAILED(hres)) if (FAILED(hres))
return E_UNEXPECTED; return E_UNEXPECTED;
@ -1337,7 +1337,7 @@ static HRESULT WINAPI DefaultHandler_GetData(
hres = IUnknown_QueryInterface(this->dataCache, hres = IUnknown_QueryInterface(this->dataCache,
&IID_IDataObject, &IID_IDataObject,
(void**)&cacheDataObject); (void**)(char*)&cacheDataObject);
if (FAILED(hres)) if (FAILED(hres))
return E_UNEXPECTED; return E_UNEXPECTED;
@ -1381,7 +1381,7 @@ static HRESULT WINAPI DefaultHandler_QueryGetData(
hres = IUnknown_QueryInterface(this->dataCache, hres = IUnknown_QueryInterface(this->dataCache,
&IID_IDataObject, &IID_IDataObject,
(void**)&cacheDataObject); (void**)(char*)&cacheDataObject);
if (FAILED(hres)) if (FAILED(hres))
return E_UNEXPECTED; return E_UNEXPECTED;
@ -1434,7 +1434,7 @@ static HRESULT WINAPI DefaultHandler_SetData(
hres = IUnknown_QueryInterface(this->dataCache, hres = IUnknown_QueryInterface(this->dataCache,
&IID_IDataObject, &IID_IDataObject,
(void**)&cacheDataObject); (void**)(char*)&cacheDataObject);
if (FAILED(hres)) if (FAILED(hres))
return E_UNEXPECTED; return E_UNEXPECTED;

View file

@ -473,8 +473,8 @@ HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa
int nb=0,i; int nb=0,i;
int sizeStr=lstrlenW(lpszPathName); int sizeStr=lstrlenW(lpszPathName);
LPOLESTR *tabStr=0; LPOLESTR *tabStr=0;
WCHAR twoPoint[]={'.','.',0}; static const WCHAR twoPoint[]={'.','.',0};
WCHAR bkSlash[]={'\\',0}; static const WCHAR bkSlash[]={'\\',0};
BYTE addBkSlash; BYTE addBkSlash;
TRACE("(%p,%p)\n",This,lpszPathName); TRACE("(%p,%p)\n",This,lpszPathName);
@ -587,7 +587,7 @@ HRESULT WINAPI FileMonikerImpl_BindToObject(IMoniker* iface,
res=GetClassFile(This->filePathName,&clsID); res=GetClassFile(This->filePathName,&clsID);
if (SUCCEEDED(res)){ if (SUCCEEDED(res)){
res=CoCreateInstance(&clsID,NULL,CLSCTX_ALL,&IID_IPersistFile,(void**)&ppf); res=CoCreateInstance(&clsID,NULL,CLSCTX_ALL,&IID_IPersistFile,(void**)(char*)&ppf);
if (SUCCEEDED(res)){ if (SUCCEEDED(res)){
res=IPersistFile_Load(ppf,This->filePathName,STGM_READ); res=IPersistFile_Load(ppf,This->filePathName,STGM_READ);
@ -602,11 +602,11 @@ HRESULT WINAPI FileMonikerImpl_BindToObject(IMoniker* iface,
} }
} }
else{ else{
res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IClassFactory,(void**)&pcf); res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IClassFactory,(void**)(char*)&pcf);
if (res==E_NOINTERFACE){ if (res==E_NOINTERFACE){
res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IClassActivator,(void**)&pca); res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IClassActivator,(void**)(char*)&pca);
if (res==E_NOINTERFACE) if (res==E_NOINTERFACE)
return MK_E_INTERMEDIATEINTERFACENOTSUPPORTED; return MK_E_INTERMEDIATEINTERFACENOTSUPPORTED;
@ -708,10 +708,8 @@ HRESULT WINAPI FileMonikerImpl_BindToStorage(IMoniker* iface,
} }
else else
if ( (IsEqualIID(&IID_IStream, riid)) || (IsEqualIID(&IID_ILockBytes, riid)) ) if ( (IsEqualIID(&IID_IStream, riid)) || (IsEqualIID(&IID_ILockBytes, riid)) )
return E_FAIL;
return E_UNSPEC;
else else
return E_NOINTERFACE; return E_NOINTERFACE;
} }
else { else {
@ -753,8 +751,8 @@ HRESULT WINAPI FileMonikerImpl_ComposeWith(IMoniker* iface,
{ {
HRESULT res; HRESULT res;
LPOLESTR str1=0,str2=0,*strDec1=0,*strDec2=0,newStr=0; LPOLESTR str1=0,str2=0,*strDec1=0,*strDec2=0,newStr=0;
WCHAR twoPoint[]={'.','.',0}; static const WCHAR twoPoint[]={'.','.',0};
WCHAR bkSlash[]={'\\',0}; static const WCHAR bkSlash[]={'\\',0};
IBindCtx *bind=0; IBindCtx *bind=0;
int i=0,j=0,lastIdx1=0,lastIdx2=0; int i=0,j=0,lastIdx1=0,lastIdx2=0;
DWORD mkSys; DWORD mkSys;
@ -1100,7 +1098,7 @@ HRESULT WINAPI FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOth
******************************************************************************/ ******************************************************************************/
int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable) int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable)
{ {
WCHAR bSlash[] = {'\\',0}; static const WCHAR bSlash[] = {'\\',0};
WCHAR word[MAX_PATH]; WCHAR word[MAX_PATH];
int i=0,j,tabIndex=0; int i=0,j,tabIndex=0;
LPOLESTR *strgtable ; LPOLESTR *strgtable ;
@ -1159,7 +1157,7 @@ HRESULT WINAPI FileMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther,
HRESULT res; HRESULT res;
LPOLESTR str1=0,str2=0,*tabStr1=0,*tabStr2=0,relPath=0; LPOLESTR str1=0,str2=0,*tabStr1=0,*tabStr2=0,relPath=0;
DWORD len1=0,len2=0,sameIdx=0,j=0; DWORD len1=0,len2=0,sameIdx=0,j=0;
WCHAR back[] ={'.','.','\\',0}; static const WCHAR back[] ={'.','.','\\',0};
TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath); TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath);

View file

@ -144,7 +144,7 @@ static HRESULT WINAPI IMalloc_fnQueryInterface(LPMALLOC iface,REFIID refiid,LPVO
TRACE("(%s,%p)\n",debugstr_guid(refiid),obj); TRACE("(%s,%p)\n",debugstr_guid(refiid),obj);
if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMalloc,refiid)) { if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMalloc,refiid)) {
*obj = (LPMALLOC)&Malloc32; *obj = (LPMALLOC)(char*)&Malloc32;
return S_OK; return S_OK;
} }
return E_NOINTERFACE; return E_NOINTERFACE;
@ -380,7 +380,7 @@ static HRESULT WINAPI IMallocSpy_fnQueryInterface(LPMALLOCSPY iface,REFIID refii
TRACE("(%s,%p)\n",debugstr_guid(refiid),obj); TRACE("(%s,%p)\n",debugstr_guid(refiid),obj);
if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMallocSpy,refiid)) { if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMallocSpy,refiid)) {
*obj = (LPMALLOC)&MallocSpy; *obj = (LPMALLOC)(char*)&MallocSpy;
return S_OK; return S_OK;
} }
return E_NOINTERFACE; return E_NOINTERFACE;
@ -530,7 +530,7 @@ static ICOM_VTABLE(IMallocSpy) VT_IMallocSpy =
*/ */
HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC *lpMalloc) HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC *lpMalloc)
{ {
*lpMalloc = (LPMALLOC)&Malloc32; *lpMalloc = (LPMALLOC)(char*)&Malloc32;
return S_OK; return S_OK;
} }
@ -541,14 +541,14 @@ HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC *lpMalloc)
*/ */
LPVOID WINAPI CoTaskMemAlloc(ULONG size) LPVOID WINAPI CoTaskMemAlloc(ULONG size)
{ {
return IMalloc_Alloc((LPMALLOC)&Malloc32,size); return IMalloc_Alloc((LPMALLOC)(char*)&Malloc32,size);
} }
/*********************************************************************** /***********************************************************************
* CoTaskMemFree [OLE32.@] * CoTaskMemFree [OLE32.@]
*/ */
VOID WINAPI CoTaskMemFree(LPVOID ptr) VOID WINAPI CoTaskMemFree(LPVOID ptr)
{ {
IMalloc_Free((LPMALLOC)&Malloc32, ptr); IMalloc_Free((LPMALLOC)(char*)&Malloc32, ptr);
} }
/*********************************************************************** /***********************************************************************
@ -558,7 +558,7 @@ VOID WINAPI CoTaskMemFree(LPVOID ptr)
*/ */
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, ULONG size) LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, ULONG size)
{ {
return IMalloc_Realloc((LPMALLOC)&Malloc32, pvOld, size); return IMalloc_Realloc((LPMALLOC)(char*)&Malloc32, pvOld, size);
} }
/*********************************************************************** /***********************************************************************
@ -576,13 +576,13 @@ HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy)
TRACE("\n"); TRACE("\n");
/* HACK TO ACTIVATE OUT SPY */ /* HACK TO ACTIVATE OUT SPY */
if (pMallocSpy == (LPVOID)-1) pMallocSpy =(IMallocSpy*)&MallocSpy; if (pMallocSpy == (LPVOID)-1) pMallocSpy =(IMallocSpy*)(char*)&MallocSpy;
if(Malloc32.pSpy) return CO_E_OBJISREG; if(Malloc32.pSpy) return CO_E_OBJISREG;
EnterCriticalSection(&IMalloc32_SpyCS); EnterCriticalSection(&IMalloc32_SpyCS);
if (SUCCEEDED(IUnknown_QueryInterface(pMallocSpy, &IID_IMallocSpy, (LPVOID*)&pSpy))) { if (SUCCEEDED(IUnknown_QueryInterface(pMallocSpy, &IID_IMallocSpy, (LPVOID*)(char*)&pSpy))) {
Malloc32.pSpy = pSpy; Malloc32.pSpy = pSpy;
hres = S_OK; hres = S_OK;
} }
@ -607,7 +607,7 @@ HRESULT WINAPI CoRevokeMallocSpy(void)
EnterCriticalSection(&IMalloc32_SpyCS); EnterCriticalSection(&IMalloc32_SpyCS);
/* if it's our spy it's time to dump the leaks */ /* if it's our spy it's time to dump the leaks */
if (Malloc32.pSpy == (IMallocSpy*)&MallocSpy) { if (Malloc32.pSpy == (IMallocSpy*)(char*)&MallocSpy) {
MallocSpyDumpLeaks(); MallocSpyDumpLeaks();
} }

View file

@ -454,7 +454,7 @@ HRESULT WINAPI ItemMonikerImpl_BindToObject(IMoniker* iface,
*ppvResult=0; *ppvResult=0;
res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&refid,(void**)&poic); res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&refid,(void**)(char*)&poic);
if (SUCCEEDED(res)){ if (SUCCEEDED(res)){
@ -487,7 +487,7 @@ HRESULT WINAPI ItemMonikerImpl_BindToStorage(IMoniker* iface,
if(pmkToLeft==NULL) if(pmkToLeft==NULL)
return E_INVALIDARG; return E_INVALIDARG;
res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic); res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)(char*)&poic);
if (SUCCEEDED(res)){ if (SUCCEEDED(res)){
@ -715,7 +715,7 @@ HRESULT WINAPI ItemMonikerImpl_IsRunning(IMoniker* iface,
/* requesting an IOleItemContainer interface pointer. The method then calls IOleItemContainer::IsRunning,*/ /* requesting an IOleItemContainer interface pointer. The method then calls IOleItemContainer::IsRunning,*/
/* passing the string contained within this moniker. */ /* passing the string contained within this moniker. */
res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic); res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)(char*)&poic);
if (SUCCEEDED(res)){ if (SUCCEEDED(res)){
@ -876,11 +876,11 @@ HRESULT WINAPI ItemMonikerImpl_ParseDisplayName(IMoniker* iface,
/* Otherwise, the method calls IMoniker::BindToObject on the pmkToLeft parameter, requesting an */ /* Otherwise, the method calls IMoniker::BindToObject on the pmkToLeft parameter, requesting an */
/* IParseDisplayName interface pointer to the object identified by the moniker, and passes the display */ /* IParseDisplayName interface pointer to the object identified by the moniker, and passes the display */
/* name to IParseDisplayName::ParseDisplayName */ /* name to IParseDisplayName::ParseDisplayName */
res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic); res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)(char*)&poic);
if (SUCCEEDED(res)){ if (SUCCEEDED(res)){
res=IOleItemContainer_GetObject(poic,This->itemName,BINDSPEED_MODERATE,pbc,&IID_IParseDisplayName,(void**)&ppdn); res=IOleItemContainer_GetObject(poic,This->itemName,BINDSPEED_MODERATE,pbc,&IID_IParseDisplayName,(void**)(char*)&ppdn);
res=IMoniker_GetDisplayName(iface,pbc,NULL,&displayName); res=IMoniker_GetDisplayName(iface,pbc,NULL,&displayName);

View file

@ -256,7 +256,7 @@ StdMarshalImpl_MarshalInterface(
IPSFactoryBuffer *psfacbuf; IPSFactoryBuffer *psfacbuf;
TRACE("(...,%s,...)\n",debugstr_guid(riid)); TRACE("(...,%s,...)\n",debugstr_guid(riid));
IUnknown_QueryInterface((LPUNKNOWN)pv,&IID_IUnknown,(LPVOID*)&pUnk); IUnknown_QueryInterface((LPUNKNOWN)pv,&IID_IUnknown,(LPVOID*)(char*)&pUnk);
mid.processid = GetCurrentProcessId(); mid.processid = GetCurrentProcessId();
mid.objectid = (DWORD)pUnk; /* FIXME */ mid.objectid = (DWORD)pUnk; /* FIXME */
IUnknown_Release(pUnk); IUnknown_Release(pUnk);
@ -280,7 +280,7 @@ StdMarshalImpl_MarshalInterface(
FIXME("Failed to create a stub for %s\n",debugstr_guid(riid)); FIXME("Failed to create a stub for %s\n",debugstr_guid(riid));
return hres; return hres;
} }
IUnknown_QueryInterface((LPUNKNOWN)pv,riid,(LPVOID*)&pUnk); IUnknown_QueryInterface((LPUNKNOWN)pv,riid,(LPVOID*)(char*)&pUnk);
MARSHAL_Register_Stub(&mid,pUnk,stub); MARSHAL_Register_Stub(&mid,pUnk,stub);
IUnknown_Release(pUnk); IUnknown_Release(pUnk);
return S_OK; return S_OK;
@ -379,7 +379,8 @@ CoGetStandardMarshal(
TRACE("(%s,%p,%lx,%p,%lx,%p)\n", TRACE("(%s,%p,%lx,%p,%lx,%p)\n",
debugstr_guid(riid),pUnk,dwDestContext,pvDestContext,mshlflags,pMarshal debugstr_guid(riid),pUnk,dwDestContext,pvDestContext,mshlflags,pMarshal
); );
dm = (StdMarshalImpl*) *pMarshal = HeapAlloc(GetProcessHeap(),0,sizeof(StdMarshalImpl)); *pMarshal = HeapAlloc(GetProcessHeap(),0,sizeof(StdMarshalImpl));
dm = (StdMarshalImpl*) *pMarshal;
if (!dm) return E_FAIL; if (!dm) return E_FAIL;
dm->lpvtbl = &stdmvtbl; dm->lpvtbl = &stdmvtbl;
dm->ref = 1; dm->ref = 1;
@ -447,7 +448,7 @@ CoMarshalInterface( IStream *pStm, REFIID riid, IUnknown *pUnk,
); );
STUBMGR_Start(); /* Just to be sure we have one running. */ STUBMGR_Start(); /* Just to be sure we have one running. */
mid.processid = GetCurrentProcessId(); mid.processid = GetCurrentProcessId();
IUnknown_QueryInterface(pUnk,&IID_IUnknown,(LPVOID*)&pUnknown); IUnknown_QueryInterface(pUnk,&IID_IUnknown,(LPVOID*)(char*)&pUnknown);
mid.objectid = (DWORD)pUnknown; mid.objectid = (DWORD)pUnknown;
IUnknown_Release(pUnknown); IUnknown_Release(pUnknown);
memcpy(&mid.iid,riid,sizeof(mid.iid)); memcpy(&mid.iid,riid,sizeof(mid.iid));
@ -522,7 +523,7 @@ CoUnmarshalInterface(IStream *pStm, REFIID riid, LPVOID *ppv) {
FIXME("Stream read 3 failed, %lx, (%ld of %d)\n",hres,res,sizeof(xclsid)); FIXME("Stream read 3 failed, %lx, (%ld of %d)\n",hres,res,sizeof(xclsid));
return hres; return hres;
} }
hres=CoCreateInstance(&xclsid,NULL,CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER,&IID_IMarshal,(void**)&pUnk); hres=CoCreateInstance(&xclsid,NULL,CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER,&IID_IMarshal,(void**)(char*)&pUnk);
if (hres) { if (hres) {
FIXME("Failed to create instance of unmarshaller %s.\n",debugstr_guid(&xclsid)); FIXME("Failed to create instance of unmarshaller %s.\n",debugstr_guid(&xclsid));
return hres; return hres;
@ -542,6 +543,56 @@ release_marshal:
return hres; return hres;
} }
/***********************************************************************
* CoReleaseMarshalData [OLE32.@]
*/
HRESULT WINAPI
CoReleaseMarshalData(IStream *pStm) {
HRESULT hres;
wine_marshal_id mid;
wine_marshal_data md;
ULONG res;
LPMARSHAL pMarshal;
LPUNKNOWN pUnk;
CLSID xclsid;
TRACE("(%p)\n",pStm);
hres = IStream_Read(pStm,&mid,sizeof(mid),&res);
if (hres) {
FIXME("Stream read 1 failed, %lx, (%ld of %d)\n",hres,res,sizeof(mid));
return hres;
}
hres = IStream_Read(pStm,&md,sizeof(md),&res);
if (hres) {
FIXME("Stream read 2 failed, %lx, (%ld of %d)\n",hres,res,sizeof(md));
return hres;
}
hres = IStream_Read(pStm,&xclsid,sizeof(xclsid),&res);
if (hres) {
FIXME("Stream read 3 failed, %lx, (%ld of %d)\n",hres,res,sizeof(xclsid));
return hres;
}
hres=CoCreateInstance(&xclsid,NULL,CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER,&IID_IMarshal,(void**)(char*)&pUnk);
if (hres) {
FIXME("Failed to create instance of unmarshaller %s.\n",debugstr_guid(&xclsid));
return hres;
}
hres = IUnknown_QueryInterface(pUnk,&IID_IMarshal,(LPVOID*)(char*)&pMarshal);
if (hres) {
FIXME("Failed to get IMarshal iface, %lx?\n",hres);
return hres;
}
hres = IMarshal_ReleaseMarshalData(pMarshal,pStm);
if (hres) {
FIXME("Failed to releasemarshaldata the interface, %lx?\n",hres);
}
IMarshal_Release(pMarshal);
IUnknown_Release(pUnk);
return hres;
}
/*********************************************************************** /***********************************************************************
* CoMarshalInterThreadInterfaceInStream [OLE32.@] * CoMarshalInterThreadInterfaceInStream [OLE32.@]
* *

View file

@ -505,7 +505,7 @@ HRESULT WINAPI OleRun(LPUNKNOWN pUnknown)
ICOM_THIS(IRunnableObject,pUnknown); ICOM_THIS(IRunnableObject,pUnknown);
LRESULT ret; LRESULT ret;
ret = IRunnableObject_QueryInterface(This,&IID_IRunnableObject,(LPVOID*)&runable); ret = IRunnableObject_QueryInterface(This,&IID_IRunnableObject,(LPVOID*)(char*)&runable);
if (ret) if (ret)
return 0; /* Appears to return no error. */ return 0; /* Appears to return no error. */
ret = IRunnableObject_Run(runable,NULL); ret = IRunnableObject_Run(runable,NULL);

View file

@ -710,7 +710,7 @@ HRESULT WINAPI OleSetContainedObject(
hres = IUnknown_QueryInterface(pUnknown, hres = IUnknown_QueryInterface(pUnknown,
&IID_IRunnableObject, &IID_IRunnableObject,
(void**)&runnable); (void**)(char*)&runnable);
if (SUCCEEDED(hres)) if (SUCCEEDED(hres))
{ {
@ -756,7 +756,7 @@ HRESULT WINAPI OleLoad(
NULL, NULL,
CLSCTX_INPROC_HANDLER, CLSCTX_INPROC_HANDLER,
&IID_IOleObject, &IID_IOleObject,
(void**)&oleObject); (void**)(char*)&oleObject);
/* /*
* If that fails, as it will most times, load the default * If that fails, as it will most times, load the default
@ -767,7 +767,7 @@ HRESULT WINAPI OleLoad(
hres = OleCreateDefaultHandler(&storageInfo.clsid, hres = OleCreateDefaultHandler(&storageInfo.clsid,
NULL, NULL,
&IID_IOleObject, &IID_IOleObject,
(void**)&oleObject); (void**)(char*)&oleObject);
} }
/* /*
@ -786,7 +786,7 @@ HRESULT WINAPI OleLoad(
*/ */
hres = IOleObject_QueryInterface(oleObject, hres = IOleObject_QueryInterface(oleObject,
&IID_IPersistStorage, &IID_IPersistStorage,
(void**)&persistStorage); (void**)(char*)&persistStorage);
if (SUCCEEDED(hres)) if (SUCCEEDED(hres))
{ {
@ -860,7 +860,7 @@ HRESULT WINAPI OleLockRunning(LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCl
hres = IUnknown_QueryInterface(pUnknown, hres = IUnknown_QueryInterface(pUnknown,
&IID_IRunnableObject, &IID_IRunnableObject,
(void**)&runnable); (void**)(char*)&runnable);
if (SUCCEEDED(hres)) if (SUCCEEDED(hres))
{ {
@ -2229,7 +2229,7 @@ HRESULT WINAPI OleDraw(
hres = IUnknown_QueryInterface(pUnk, hres = IUnknown_QueryInterface(pUnk,
&IID_IViewObject, &IID_IViewObject,
(void**)&viewobject); (void**)(char*)&viewobject);
if (SUCCEEDED(hres)) if (SUCCEEDED(hres))
{ {
@ -2284,20 +2284,20 @@ HRESULT WINAPI OleCreate(
FIXME("\n\t%s\n\t%s semi-stub!\n", debugstr_guid(rclsid), debugstr_guid(riid)); FIXME("\n\t%s\n\t%s semi-stub!\n", debugstr_guid(rclsid), debugstr_guid(riid));
if (SUCCEEDED((hres = CoCreateInstance(rclsid, 0, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER|CLSCTX_LOCAL_SERVER , riid, (LPVOID*)&pUnk)))) if (SUCCEEDED((hres = CoCreateInstance(rclsid, 0, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER|CLSCTX_LOCAL_SERVER , riid, (LPVOID*)(char*)&pUnk))))
{ {
if (pClientSite) if (pClientSite)
{ {
IOleObject * pOE; IOleObject * pOE;
IPersistStorage * pPS; IPersistStorage * pPS;
if (SUCCEEDED((hres = IUnknown_QueryInterface( pUnk, &IID_IOleObject, (LPVOID*)&pOE)))) if (SUCCEEDED((hres = IUnknown_QueryInterface( pUnk, &IID_IOleObject, (LPVOID*)(char*)&pOE))))
{ {
TRACE("trying to set clientsite %p\n", pClientSite); TRACE("trying to set clientsite %p\n", pClientSite);
hres1 = IOleObject_SetClientSite(pOE, pClientSite); hres1 = IOleObject_SetClientSite(pOE, pClientSite);
TRACE("-- result 0x%08lx\n", hres1); TRACE("-- result 0x%08lx\n", hres1);
IOleObject_Release(pOE); IOleObject_Release(pOE);
} }
if (SUCCEEDED((hres = IUnknown_QueryInterface( pUnk, &IID_IPersistStorage, (LPVOID*)&pPS)))) if (SUCCEEDED((hres = IUnknown_QueryInterface( pUnk, &IID_IPersistStorage, (LPVOID*)(char*)&pPS))))
{ {
TRACE("trying to set stg %p\n", pStg); TRACE("trying to set stg %p\n", pStg);
hres1 = IPersistStorage_InitNew(pPS, pStg); hres1 = IPersistStorage_InitNew(pPS, pStg);

View file

@ -151,7 +151,7 @@ HRESULT WINAPI OleCreateFromData(LPDATAOBJECT pSrcDataObject, REFIID riid,
/* Create default handler for Persist storage */ /* Create default handler for Persist storage */
if (hr1 == S_OK) if (hr1 == S_OK)
hr1 = OleCreateDefaultHandler(&clsID, NULL, &IID_IPersistStorage, (LPVOID*)&pPersistStorage); hr1 = OleCreateDefaultHandler(&clsID, NULL, &IID_IPersistStorage, (LPVOID*)(char*)&pPersistStorage);
/* Load the storage to Persist storage */ /* Load the storage to Persist storage */
@ -161,7 +161,7 @@ HRESULT WINAPI OleCreateFromData(LPDATAOBJECT pSrcDataObject, REFIID riid,
/* Query for IOleObject */ /* Query for IOleObject */
if (hr1 == S_OK) if (hr1 == S_OK)
hr1 = IPersistStorage_QueryInterface(pPersistStorage, &IID_IOleObject, (LPVOID*)&pOleObject); hr1 = IPersistStorage_QueryInterface(pPersistStorage, &IID_IOleObject, (LPVOID*)(char*)&pOleObject);
/* Set client site with the IOleObject */ /* Set client site with the IOleObject */

View file

@ -57,7 +57,7 @@
@ stdcall CoRegisterMessageFilter(ptr ptr) @ stdcall CoRegisterMessageFilter(ptr ptr)
@ stub CoRegisterPSClsid #@ stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED @ stub CoRegisterPSClsid #@ stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED
@ stub CoRegisterSurrogate @ stub CoRegisterSurrogate
@ stub CoReleaseMarshalData #@ stdcall (ptr) return 0,ERR_NOTIMPLEMENTED @ stdcall CoReleaseMarshalData(ptr)
@ stub CoReleaseServerProcess #@ stdcall () return 0,ERR_NOTIMPLEMENTED @ stub CoReleaseServerProcess #@ stdcall () return 0,ERR_NOTIMPLEMENTED
@ stdcall CoResumeClassObjects() @ stdcall CoResumeClassObjects()
@ stub CoRevertToSelf #@ stdcall () return 0,ERR_NOTIMPLEMENTED @ stub CoRevertToSelf #@ stdcall () return 0,ERR_NOTIMPLEMENTED
@ -233,7 +233,7 @@
@ stub SNB_UserUnmarshal @ stub SNB_UserUnmarshal
@ stdcall StgCreateDocfile(wstr long long ptr) @ stdcall StgCreateDocfile(wstr long long ptr)
@ stdcall StgCreateDocfileOnILockBytes(ptr long long ptr) @ stdcall StgCreateDocfileOnILockBytes(ptr long long ptr)
@ stub StgCreateStorageEx @ stdcall StgCreateStorageEx(wstr long long long ptr ptr ptr ptr)
@ stub StgGetIFillLockBytesOnFile @ stub StgGetIFillLockBytesOnFile
@ stub StgGetIFillLockBytesOnILockBytes @ stub StgGetIFillLockBytesOnILockBytes
@ stdcall StgIsStorageFile(wstr) @ stdcall StgIsStorageFile(wstr)

View file

@ -156,12 +156,12 @@ CFStub_Invoke(
} }
memcpy(&iid,msg->Buffer,sizeof(iid)); memcpy(&iid,msg->Buffer,sizeof(iid));
TRACE("->CreateInstance(%s)\n",debugstr_guid(&iid)); TRACE("->CreateInstance(%s)\n",debugstr_guid(&iid));
hres = IUnknown_QueryInterface(This->pUnkServer,&IID_IClassFactory,(LPVOID*)&classfac); hres = IUnknown_QueryInterface(This->pUnkServer,&IID_IClassFactory,(LPVOID*)(char*)&classfac);
if (hres) { if (hres) {
FIXME("Ole server does not provide a IClassFactory?\n"); FIXME("Ole server does not provide a IClassFactory?\n");
return hres; return hres;
} }
hres = IClassFactory_CreateInstance(classfac,NULL,&iid,(LPVOID*)&ppv); hres = IClassFactory_CreateInstance(classfac,NULL,&iid,(LPVOID*)(char*)&ppv);
IClassFactory_Release(classfac); IClassFactory_Release(classfac);
if (hres) { if (hres) {
msg->cbBuffer = 0; msg->cbBuffer = 0;

View file

@ -1061,6 +1061,7 @@ HRESULT WINAPI IStream16_fnRead(
BYTE block[BIGSIZE]; BYTE block[BIGSIZE];
ULONG *bytesread=pcbRead,xxread; ULONG *bytesread=pcbRead,xxread;
int blocknr; int blocknr;
LPBYTE pbv = pv;
TRACE_(relay)("(%p)->(%p,%ld,%p)\n",This,pv,cb,pcbRead); TRACE_(relay)("(%p)->(%p,%ld,%p)\n",This,pv,cb,pcbRead);
if (!pcbRead) bytesread=&xxread; if (!pcbRead) bytesread=&xxread;
@ -1081,9 +1082,9 @@ HRESULT WINAPI IStream16_fnRead(
cc = cb; cc = cb;
if (cc>SMALLSIZE-(This->offset.u.LowPart&(SMALLSIZE-1))) if (cc>SMALLSIZE-(This->offset.u.LowPart&(SMALLSIZE-1)))
cc=SMALLSIZE-(This->offset.u.LowPart&(SMALLSIZE-1)); cc=SMALLSIZE-(This->offset.u.LowPart&(SMALLSIZE-1));
memcpy((LPBYTE)pv,block+(This->offset.u.LowPart&(SMALLSIZE-1)),cc); memcpy(pbv,block+(This->offset.u.LowPart&(SMALLSIZE-1)),cc);
This->offset.u.LowPart+=cc; This->offset.u.LowPart+=cc;
(LPBYTE)pv+=cc; pbv+=cc;
*bytesread+=cc; *bytesread+=cc;
cb-=cc; cb-=cc;
blocknr = STORAGE_get_next_small_blocknr(This->hf,blocknr); blocknr = STORAGE_get_next_small_blocknr(This->hf,blocknr);
@ -1101,9 +1102,9 @@ HRESULT WINAPI IStream16_fnRead(
cc = cb; cc = cb;
if (cc>BIGSIZE-(This->offset.u.LowPart&(BIGSIZE-1))) if (cc>BIGSIZE-(This->offset.u.LowPart&(BIGSIZE-1)))
cc=BIGSIZE-(This->offset.u.LowPart&(BIGSIZE-1)); cc=BIGSIZE-(This->offset.u.LowPart&(BIGSIZE-1));
memcpy((LPBYTE)pv,block+(This->offset.u.LowPart&(BIGSIZE-1)),cc); memcpy(pbv,block+(This->offset.u.LowPart&(BIGSIZE-1)),cc);
This->offset.u.LowPart+=cc; This->offset.u.LowPart+=cc;
(LPBYTE)pv+=cc; pbv+=cc;
*bytesread+=cc; *bytesread+=cc;
cb-=cc; cb-=cc;
blocknr=STORAGE_get_next_big_blocknr(This->hf,blocknr); blocknr=STORAGE_get_next_big_blocknr(This->hf,blocknr);
@ -1123,6 +1124,7 @@ HRESULT WINAPI IStream16_fnWrite(
ULONG *byteswritten=pcbWrite,xxwritten; ULONG *byteswritten=pcbWrite,xxwritten;
int oldsize,newsize,i,curoffset=0,lastblocknr,blocknr,cc; int oldsize,newsize,i,curoffset=0,lastblocknr,blocknr,cc;
HANDLE hf = This->hf; HANDLE hf = This->hf;
LPBYTE pbv = (LPBYTE)pv;
if (!pcbWrite) byteswritten=&xxwritten; if (!pcbWrite) byteswritten=&xxwritten;
*byteswritten = 0; *byteswritten = 0;
@ -1340,14 +1342,14 @@ HRESULT WINAPI IStream16_fnWrite(
if (cc>cb) if (cc>cb)
cc=cb; cc=cb;
memcpy( ((LPBYTE)block)+(This->offset.u.LowPart&(SMALLSIZE-1)), memcpy( ((LPBYTE)block)+(This->offset.u.LowPart&(SMALLSIZE-1)),
(LPBYTE)((char *) pv+curoffset), pbv+curoffset,
cc cc
); );
if (!STORAGE_put_small_block(hf,blocknr,block)) if (!STORAGE_put_small_block(hf,blocknr,block))
return E_FAIL; return E_FAIL;
cb -= cc; cb -= cc;
curoffset += cc; curoffset += cc;
(LPBYTE)pv += cc; pbv += cc;
This->offset.u.LowPart += cc; This->offset.u.LowPart += cc;
*byteswritten += cc; *byteswritten += cc;
blocknr = STORAGE_get_next_small_blocknr(hf,blocknr); blocknr = STORAGE_get_next_small_blocknr(hf,blocknr);
@ -1368,14 +1370,14 @@ HRESULT WINAPI IStream16_fnWrite(
if (cc>cb) if (cc>cb)
cc=cb; cc=cb;
memcpy( ((LPBYTE)block)+(This->offset.u.LowPart&(BIGSIZE-1)), memcpy( ((LPBYTE)block)+(This->offset.u.LowPart&(BIGSIZE-1)),
(LPBYTE)((char *) pv+curoffset), pbv+curoffset,
cc cc
); );
if (!STORAGE_put_big_block(hf,blocknr,block)) if (!STORAGE_put_big_block(hf,blocknr,block))
return E_FAIL; return E_FAIL;
cb -= cc; cb -= cc;
curoffset += cc; curoffset += cc;
(LPBYTE)pv += cc; pbv += cc;
This->offset.u.LowPart += cc; This->offset.u.LowPart += cc;
*byteswritten += cc; *byteswritten += cc;
blocknr = STORAGE_get_next_big_blocknr(hf,blocknr); blocknr = STORAGE_get_next_big_blocknr(hf,blocknr);

View file

@ -5445,7 +5445,7 @@ HRESULT WINAPI StgCreateDocfile(
if (pwcsName == 0) if (pwcsName == 0)
{ {
WCHAR tempPath[MAX_PATH]; WCHAR tempPath[MAX_PATH];
WCHAR prefix[] = { 'S', 'T', 'O', 0 }; static const WCHAR prefix[] = { 'S', 'T', 'O', 0 };
if (!(grfMode & STGM_SHARE_EXCLUSIVE)) if (!(grfMode & STGM_SHARE_EXCLUSIVE))
return STG_E_INVALIDFLAG; return STG_E_INVALIDFLAG;
@ -5536,6 +5536,13 @@ HRESULT WINAPI StgCreateDocfile(
return hr; return hr;
} }
HRESULT WINAPI StgCreateStorageEx(const WCHAR* pwcsName, DWORD grfMode, DWORD stgfmt, DWORD grfAttrs, STGOPTIONS* pStgOptions, void* reserved, REFIID riid, void** ppObjectOpen)
{
TRACE("(%s, %lx, %lx, %lx, %p, %p, %p, %p)\n", debugstr_w(pwcsName),
grfMode, stgfmt, grfAttrs, pStgOptions, reserved, riid, ppObjectOpen);
return STG_E_UNIMPLEMENTEDFUNCTION;
}
/****************************************************************************** /******************************************************************************
* StgOpenStorage [OLE32.@] * StgOpenStorage [OLE32.@]
*/ */
@ -5891,7 +5898,7 @@ HRESULT WINAPI OleLoadFromStream(IStream *pStm,REFIID iidInterface,void** ppvOb
res=CoCreateInstance(&clsid,NULL,CLSCTX_INPROC_SERVER,iidInterface,ppvObj); res=CoCreateInstance(&clsid,NULL,CLSCTX_INPROC_SERVER,iidInterface,ppvObj);
if (!SUCCEEDED(res)) if (!SUCCEEDED(res))
return res; return res;
res=IUnknown_QueryInterface((IUnknown*)*ppvObj,&IID_IPersistStream,(LPVOID*)&xstm); res=IUnknown_QueryInterface((IUnknown*)*ppvObj,&IID_IPersistStream,(LPVOID*)(char*)&xstm);
if (!SUCCEEDED(res)) { if (!SUCCEEDED(res)) {
IUnknown_Release((IUnknown*)*ppvObj); IUnknown_Release((IUnknown*)*ppvObj);
return res; return res;
@ -6424,7 +6431,7 @@ void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD n
IStorage *pTempStorage; IStorage *pTempStorage;
DWORD dwNumOfBytesWritten; DWORD dwNumOfBytesWritten;
WCHAR wstrTempDir[MAX_PATH], wstrTempFile[MAX_PATH]; WCHAR wstrTempDir[MAX_PATH], wstrTempFile[MAX_PATH];
WCHAR wstrPrefix[] = {'s', 'i', 's', 0}; static const WCHAR wstrPrefix[] = {'s', 'i', 's', 0};
/* Create a temp File */ /* Create a temp File */
GetTempPathW(MAX_PATH, wstrTempDir); GetTempPathW(MAX_PATH, wstrTempDir);
@ -6474,7 +6481,7 @@ DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData)
DWORD nDataLength = 0; DWORD nDataLength = 0;
IStorage *pTempStorage; IStorage *pTempStorage;
WCHAR wstrTempDir[MAX_PATH], wstrTempFile[MAX_PATH]; WCHAR wstrTempDir[MAX_PATH], wstrTempFile[MAX_PATH];
WCHAR wstrPrefix[] = {'s', 'i', 's', 0}; static const WCHAR wstrPrefix[] = {'s', 'i', 's', 0};
*pData = NULL; *pData = NULL;
@ -6527,7 +6534,7 @@ void OLECONVERT_CreateOleStream(LPSTORAGE pStorage)
{ {
HRESULT hRes; HRESULT hRes;
IStream *pStream; IStream *pStream;
WCHAR wstrStreamName[] = {1,'O', 'l', 'e', 0}; static const WCHAR wstrStreamName[] = {1,'O', 'l', 'e', 0};
BYTE pOleStreamHeader [] = BYTE pOleStreamHeader [] =
{ {
0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
@ -6616,7 +6623,7 @@ static HRESULT STORAGE_WriteCompObj( LPSTORAGE pstg, CLSID *clsid,
{ {
IStream *pstm; IStream *pstm;
HRESULT r = S_OK; HRESULT r = S_OK;
WCHAR szwStreamName[] = {1, 'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; static const WCHAR szwStreamName[] = {1, 'C', 'o', 'm', 'p', 'O', 'b', 'j', 0};
static const BYTE unknown1[12] = static const BYTE unknown1[12] =
{ 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, { 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
@ -6663,7 +6670,7 @@ static HRESULT CLSIDFromUserType(LPCWSTR lpszUserType, CLSID *clsid)
HKEY hkey, hkeyclsid; HKEY hkey, hkeyclsid;
LPWSTR buffer = NULL; LPWSTR buffer = NULL;
BOOL found = FALSE; BOOL found = FALSE;
const WCHAR szclsid[] = { 'C','L','S','I','D',0 }; static const WCHAR szclsid[] = { 'C','L','S','I','D',0 };
TRACE("Finding CLSID for %s\n", debugstr_w(lpszUserType)); TRACE("Finding CLSID for %s\n", debugstr_w(lpszUserType));
@ -6770,7 +6777,7 @@ HRESULT WINAPI ReadFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT* pcf, LPOLESTR* lp
{ {
HRESULT r; HRESULT r;
IStream *stm = 0; IStream *stm = 0;
const WCHAR szCompObj[] = { 1, 'C','o','m','p','O','b','j', 0 }; static const WCHAR szCompObj[] = { 1, 'C','o','m','p','O','b','j', 0 };
unsigned char unknown1[12]; unsigned char unknown1[12];
unsigned char unknown2[16]; unsigned char unknown2[16];
DWORD count; DWORD count;
@ -6855,7 +6862,7 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName
IStream *pStream; IStream *pStream;
HRESULT hStorageRes, hRes = S_OK; HRESULT hStorageRes, hRes = S_OK;
OLECONVERT_ISTORAGE_COMPOBJ IStorageCompObj; OLECONVERT_ISTORAGE_COMPOBJ IStorageCompObj;
WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; static const WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0};
WCHAR bufferW[OLESTREAM_MAX_STR_LEN]; WCHAR bufferW[OLESTREAM_MAX_STR_LEN];
BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF}; BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};
@ -6956,7 +6963,7 @@ void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD d
{ {
HRESULT hRes; HRESULT hRes;
IStream *pStream; IStream *pStream;
WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0}; static const WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0};
BYTE pOlePresStreamHeader [] = BYTE pOlePresStreamHeader [] =
{ {
0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00,
@ -7040,7 +7047,7 @@ void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD d
{ {
HRESULT hRes; HRESULT hRes;
IStream *pStream; IStream *pStream;
WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; static const WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0};
/* Create the Ole10Native Stream */ /* Create the Ole10Native Stream */
hRes = IStorage_CreateStream(pStorage, wstrStreamName, hRes = IStorage_CreateStream(pStorage, wstrStreamName,
@ -7081,7 +7088,7 @@ HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dw
IStream *pStream; IStream *pStream;
LARGE_INTEGER iSeekPos; LARGE_INTEGER iSeekPos;
OLECONVERT_ISTORAGE_COMPOBJ CompObj; OLECONVERT_ISTORAGE_COMPOBJ CompObj;
WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; static const WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0};
/* Open the CompObj Stream */ /* Open the CompObj Stream */
hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL,
@ -7150,7 +7157,7 @@ void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *
HRESULT hRes; HRESULT hRes;
IStream *pStream; IStream *pStream;
WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; static const WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0};
/* Initialize Default data for OLESTREAM */ /* Initialize Default data for OLESTREAM */
pOleStreamData[0].dwOleID = OLESTREAM_ID; pOleStreamData[0].dwOleID = OLESTREAM_ID;
@ -7203,7 +7210,7 @@ void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *
HRESULT hRes; HRESULT hRes;
IStream *pStream; IStream *pStream;
OLECONVERT_ISTORAGE_OLEPRES olePress; OLECONVERT_ISTORAGE_OLEPRES olePress;
WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0}; static const WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0};
/* Initialize Default data for OLESTREAM */ /* Initialize Default data for OLESTREAM */
pOleStreamData[0].dwOleID = OLESTREAM_ID; pOleStreamData[0].dwOleID = OLESTREAM_ID;
@ -7228,7 +7235,7 @@ void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *
{ {
LARGE_INTEGER iSeekPos; LARGE_INTEGER iSeekPos;
METAFILEPICT16 MetaFilePict; METAFILEPICT16 MetaFilePict;
char strMetafilePictName[] = "METAFILEPICT"; static const char strMetafilePictName[] = "METAFILEPICT";
/* Set the TypeID for a Metafile */ /* Set the TypeID for a Metafile */
pOleStreamData[1].dwTypeID = 5; pOleStreamData[1].dwTypeID = 5;
@ -7384,7 +7391,7 @@ HRESULT WINAPI OleConvertIStorageToOLESTREAM (
HRESULT hRes = S_OK; HRESULT hRes = S_OK;
IStream *pStream; IStream *pStream;
OLECONVERT_OLESTREAM_DATA pOleStreamData[2]; OLECONVERT_OLESTREAM_DATA pOleStreamData[2];
WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; static const WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0};
memset(pOleStreamData, 0, sizeof(pOleStreamData)); memset(pOleStreamData, 0, sizeof(pOleStreamData));

View file

@ -84,6 +84,14 @@ typedef enum tagSTDMSHLFLAGS {
SMEXF_HANDLER = 0x02 SMEXF_HANDLER = 0x02
} STDMSHLFLAGS; } STDMSHLFLAGS;
typedef struct tagSTGOPTIONS
{
USHORT usVersion;
USHORT reserved;
ULONG ulSectorSize;
const WCHAR* pwcsTemplateFile;
} STGOPTIONS;
WINOLEAPI_(DWORD) CoBuildVersion(void); WINOLEAPI_(DWORD) CoBuildVersion(void);
WINOLEAPI CoInitialize(PVOID); WINOLEAPI CoInitialize(PVOID);
WINOLEAPI CoInitializeEx(LPVOID,DWORD); WINOLEAPI CoInitializeEx(LPVOID,DWORD);
@ -147,6 +155,7 @@ WINOLEAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER*);
WINOLEAPI CreateDataCache(LPUNKNOWN,REFCLSID,REFIID,PVOID*); WINOLEAPI CreateDataCache(LPUNKNOWN,REFCLSID,REFIID,PVOID*);
WINOLEAPI StgCreateDocfile(const OLECHAR*,DWORD,DWORD,IStorage**); WINOLEAPI StgCreateDocfile(const OLECHAR*,DWORD,DWORD,IStorage**);
WINOLEAPI StgCreateDocfileOnILockBytes(ILockBytes*,DWORD,DWORD,IStorage**); WINOLEAPI StgCreateDocfileOnILockBytes(ILockBytes*,DWORD,DWORD,IStorage**);
WINOLEAPI StgCreateStorageEx(const WCHAR*,DWORD,DWORD,DWORD,STGOPTIONS*,void*,REFIID,void**);
WINOLEAPI StgOpenStorage(const OLECHAR*,IStorage*,DWORD,SNB,DWORD,IStorage**); WINOLEAPI StgOpenStorage(const OLECHAR*,IStorage*,DWORD,SNB,DWORD,IStorage**);
WINOLEAPI StgOpenStorageOnILockBytes(ILockBytes*,IStorage*,DWORD,SNB,DWORD,IStorage**); WINOLEAPI StgOpenStorageOnILockBytes(ILockBytes*,IStorage*,DWORD,SNB,DWORD,IStorage**);
WINOLEAPI StgIsStorageFile(const OLECHAR*); WINOLEAPI StgIsStorageFile(const OLECHAR*);