Author: dchapyshev
Date: Tue Mar 3 12:12:43 2009
New Revision: 39853
URL:
http://svn.reactos.org/svn/reactos?rev=39853&view=rev
Log:
- Sync ole32 and oleaut32 with Wine head
Modified:
trunk/reactos/dll/win32/ole32/antimoniker.c
trunk/reactos/dll/win32/ole32/bindctx.c
trunk/reactos/dll/win32/ole32/classmoniker.c
trunk/reactos/dll/win32/ole32/clipboard.c
trunk/reactos/dll/win32/ole32/comcat.c
trunk/reactos/dll/win32/ole32/compositemoniker.c
trunk/reactos/dll/win32/ole32/datacache.c
trunk/reactos/dll/win32/ole32/defaulthandler.c
trunk/reactos/dll/win32/ole32/errorinfo.c
trunk/reactos/dll/win32/ole32/filemoniker.c
trunk/reactos/dll/win32/ole32/ftmarshal.c
trunk/reactos/dll/win32/ole32/git.c
trunk/reactos/dll/win32/ole32/hglobalstream.c
trunk/reactos/dll/win32/ole32/ifs.c
trunk/reactos/dll/win32/ole32/itemmoniker.c
trunk/reactos/dll/win32/ole32/marshal.c
trunk/reactos/dll/win32/ole32/memlockbytes.c
trunk/reactos/dll/win32/ole32/moniker.c
trunk/reactos/dll/win32/ole32/ole2.c
trunk/reactos/dll/win32/ole32/oleobj.c
trunk/reactos/dll/win32/ole32/rpc.c
trunk/reactos/dll/win32/ole32/stg_prop.c
trunk/reactos/dll/win32/ole32/stg_stream.c
trunk/reactos/dll/win32/ole32/storage.c
trunk/reactos/dll/win32/ole32/storage32.c
trunk/reactos/dll/win32/ole32/stubmanager.c
trunk/reactos/dll/win32/ole32/usrmarshal.c
trunk/reactos/dll/win32/oleaut32/connpt.c
trunk/reactos/dll/win32/oleaut32/dispatch.c
trunk/reactos/dll/win32/oleaut32/oleaut.c
trunk/reactos/dll/win32/oleaut32/olefont.c
trunk/reactos/dll/win32/oleaut32/olepicture.c
trunk/reactos/dll/win32/oleaut32/recinfo.c
trunk/reactos/dll/win32/oleaut32/safearray.c
trunk/reactos/dll/win32/oleaut32/tmarshal.c
trunk/reactos/dll/win32/oleaut32/typelib.c
trunk/reactos/dll/win32/oleaut32/ungif.c
trunk/reactos/dll/win32/oleaut32/usrmarshal.c
trunk/reactos/dll/win32/oleaut32/varformat.c
trunk/reactos/dll/win32/oleaut32/vartype.c
Modified: trunk/reactos/dll/win32/ole32/antimoniker.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/antimonike…
==============================================================================
--- trunk/reactos/dll/win32/ole32/antimoniker.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/antimoniker.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -80,7 +80,7 @@
IsEqualIID(&IID_IMoniker, riid))
*ppvObject = iface;
else if (IsEqualIID(&IID_IROTData, riid))
- *ppvObject = (IROTData*)&(This->lpvtbl2);
+ *ppvObject = &This->lpvtbl2;
else if (IsEqualIID(&IID_IMarshal, riid))
{
HRESULT hr = S_OK;
Modified: trunk/reactos/dll/win32/ole32/bindctx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/bindctx.c?…
==============================================================================
--- trunk/reactos/dll/win32/ole32/bindctx.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/bindctx.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -87,7 +87,7 @@
if (IsEqualIID(&IID_IUnknown, riid) ||
IsEqualIID(&IID_IBindCtx, riid))
{
- *ppvObject = (IBindCtx*)This;
+ *ppvObject = This;
IBindCtx_AddRef(iface);
return S_OK;
}
Modified: trunk/reactos/dll/win32/ole32/classmoniker.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/classmonik…
==============================================================================
--- trunk/reactos/dll/win32/ole32/classmoniker.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/classmoniker.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -80,7 +80,7 @@
*ppvObject = iface;
}
else if (IsEqualIID(&IID_IROTData, riid))
- *ppvObject = (IROTData*)&(This->lpVtblRotData);
+ *ppvObject = &This->lpVtblRotData;
else if (IsEqualIID(&IID_IMarshal, riid))
{
HRESULT hr = S_OK;
Modified: trunk/reactos/dll/win32/ole32/clipboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/clipboard.…
==============================================================================
--- trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -1138,7 +1138,7 @@
}
else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
{
- *ppvObject = (IDataObject*)&(This->lpvtbl1);
+ *ppvObject = &This->lpvtbl1;
}
else /* We only support IUnknown and IDataObject */
{
@@ -1569,7 +1569,7 @@
HeapFree(GetProcessHeap(), 0, ef);
return NULL;
}
- ef->pFmt = (LPFORMATETC)IMalloc_Alloc(pIMalloc, size);
+ ef->pFmt = IMalloc_Alloc(pIMalloc, size);
IMalloc_Release(pIMalloc);
if (ef->pFmt)
@@ -1605,7 +1605,7 @@
}
else if(IsEqualIID(riid, &IID_IEnumFORMATETC))
{
- *ppvObj = (IDataObject*)This;
+ *ppvObj = This;
}
if(*ppvObj)
Modified: trunk/reactos/dll/win32/ole32/comcat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/comcat.c?r…
==============================================================================
--- trunk/reactos/dll/win32/ole32/comcat.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/comcat.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -226,12 +226,6 @@
HKEY key,
struct class_categories const* categories)
{
- static const WCHAR impl_keyname[] = { 'I', 'm', 'p',
'l', 'e', 'm', 'e', 'n',
- 't', 'e', 'd', '
', 'C', 'a', 't', 'e',
- 'g', 'o', 'r',
'i', 'e', 's', 0 };
- static const WCHAR req_keyname[] = { 'R', 'e', 'q',
'u', 'i', 'r', 'e', 'd',
- ' ', 'C', 'a',
't', 'e', 'g', 'o', 'r',
- 'i', 'e', 's', 0 };
HKEY subkey;
HRESULT res;
DWORD index;
@@ -732,7 +726,7 @@
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory))
{
- *ppvObj = (LPVOID)iface;
+ *ppvObj = iface;
IUnknown_AddRef(iface);
return S_OK;
}
@@ -847,7 +841,7 @@
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IEnumCATEGORYINFO))
{
- *ppvObj = (LPVOID)iface;
+ *ppvObj = iface;
COMCAT_IEnumCATEGORYINFO_AddRef(iface);
return S_OK;
}
@@ -1030,7 +1024,7 @@
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IEnumGUID))
{
- *ppvObj = (LPVOID)iface;
+ *ppvObj = iface;
COMCAT_CLSID_IEnumGUID_AddRef(iface);
return S_OK;
}
@@ -1048,7 +1042,7 @@
ref = InterlockedDecrement(&This->ref);
if (ref == 0) {
if (This->key) RegCloseKey(This->key);
- HeapFree(GetProcessHeap(), 0, (LPVOID)This->categories);
+ HeapFree(GetProcessHeap(), 0, This->categories);
HeapFree(GetProcessHeap(), 0, This);
return 0;
}
@@ -1139,14 +1133,14 @@
new_this->lpVtbl = This->lpVtbl;
new_this->ref = 1;
- size = HeapSize(GetProcessHeap(), 0, (LPVOID)This->categories);
+ size = HeapSize(GetProcessHeap(), 0, This->categories);
new_this->categories =
HeapAlloc(GetProcessHeap(), 0, size);
if (new_this->categories == NULL) {
HeapFree(GetProcessHeap(), 0, new_this);
return E_OUTOFMEMORY;
}
- memcpy((LPVOID)new_this->categories, This->categories, size);
+ memcpy(new_this->categories, This->categories, size);
/* FIXME: could we more efficiently use DuplicateHandle? */
RegOpenKeyExW(HKEY_CLASSES_ROOT, keyname, 0, KEY_READ, &new_this->key);
new_this->next_index = This->next_index;
@@ -1216,7 +1210,7 @@
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IEnumGUID))
{
- *ppvObj = (LPVOID)iface;
+ *ppvObj = iface;
COMCAT_CATID_IEnumGUID_AddRef(iface);
return S_OK;
}
Modified: trunk/reactos/dll/win32/ole32/compositemoniker.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compositem…
==============================================================================
--- trunk/reactos/dll/win32/ole32/compositemoniker.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/compositemoniker.c [iso-8859-1] Tue Mar 3 12:12:43
2009
@@ -115,9 +115,9 @@
)
*ppvObject = iface;
else if (IsEqualIID(&IID_IROTData, riid))
- *ppvObject = (IROTData*)&(This->lpvtbl2);
+ *ppvObject = &This->lpvtbl2;
else if (IsEqualIID(&IID_IMarshal, riid))
- *ppvObject = (IROTData*)&(This->lpvtblMarshal);
+ *ppvObject = &This->lpvtblMarshal;
/* Check that we obtained an interface.*/
if ((*ppvObject)==0)
Modified: trunk/reactos/dll/win32/ole32/datacache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/datacache.…
==============================================================================
--- trunk/reactos/dll/win32/ole32/datacache.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/datacache.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -892,26 +892,26 @@
}
else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
{
- *ppvObject = (IDataObject*)&(this->lpVtbl);
+ *ppvObject = &this->lpVtbl;
}
else if ( (memcmp(&IID_IPersistStorage, riid, sizeof(IID_IPersistStorage)) == 0)
||
(memcmp(&IID_IPersist, riid, sizeof(IID_IPersist)) == 0) )
{
- *ppvObject = (IPersistStorage*)&(this->lpvtblIPersistStorage);
+ *ppvObject = &this->lpvtblIPersistStorage;
}
else if ( (memcmp(&IID_IViewObject, riid, sizeof(IID_IViewObject)) == 0) ||
(memcmp(&IID_IViewObject2, riid, sizeof(IID_IViewObject2)) == 0) )
{
- *ppvObject = (IViewObject2*)&(this->lpvtblIViewObject);
+ *ppvObject = &this->lpvtblIViewObject;
}
else if ( (memcmp(&IID_IOleCache, riid, sizeof(IID_IOleCache)) == 0) ||
(memcmp(&IID_IOleCache2, riid, sizeof(IID_IOleCache2)) == 0) )
{
- *ppvObject = (IOleCache2*)&(this->lpvtblIOleCache2);
+ *ppvObject = &this->lpvtblIOleCache2;
}
else if (memcmp(&IID_IOleCacheControl, riid, sizeof(IID_IOleCacheControl)) == 0)
{
- *ppvObject = (IOleCacheControl*)&(this->lpvtblIOleCacheControl);
+ *ppvObject = &this->lpvtblIOleCacheControl;
}
/*
Modified: trunk/reactos/dll/win32/ole32/defaulthandler.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/defaulthan…
==============================================================================
--- trunk/reactos/dll/win32/ole32/defaulthandler.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/defaulthandler.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -206,11 +206,11 @@
if (IsEqualIID(&IID_IUnknown, riid))
*ppvObject = iface;
else if (IsEqualIID(&IID_IOleObject, riid))
- *ppvObject = (IOleObject*)&This->lpVtbl;
+ *ppvObject = &This->lpVtbl;
else if (IsEqualIID(&IID_IDataObject, riid))
- *ppvObject = (IDataObject*)&This->lpvtblIDataObject;
+ *ppvObject = &This->lpvtblIDataObject;
else if (IsEqualIID(&IID_IRunnableObject, riid))
- *ppvObject = (IRunnableObject*)&This->lpvtblIRunnableObject;
+ *ppvObject = &This->lpvtblIRunnableObject;
else if (IsEqualIID(&IID_IPersist, riid) ||
IsEqualIID(&IID_IPersistStorage, riid))
*ppvObject = &This->lpvtblIPersistStorage;
Modified: trunk/reactos/dll/win32/ole32/errorinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/errorinfo.…
==============================================================================
--- trunk/reactos/dll/win32/ole32/errorinfo.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/errorinfo.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -95,7 +95,7 @@
stringBuffer = (WCHAR*)newBuffer;
stringBuffer[len] = 0;
- return (LPWSTR)stringBuffer;
+ return stringBuffer;
}
/* this code is from SysFreeString (ole2disp.c in oleaut32)*/
@@ -163,9 +163,9 @@
/*
converts This to an object pointer
*/
-#define _IErrorInfo_(This) (IErrorInfo*)&(This->lpvtei)
-#define _ICreateErrorInfo_(This) (ICreateErrorInfo*)&(This->lpvtcei)
-#define _ISupportErrorInfo_(This) (ISupportErrorInfo*)&(This->lpvtsei)
+#define _IErrorInfo_(This) ((IErrorInfo*)&(This)->lpvtei)
+#define _ICreateErrorInfo_(This) (&(This)->lpvtcei)
+#define _ISupportErrorInfo_(This) (&(This)->lpvtsei)
static IErrorInfo * IErrorInfoImpl_Constructor(void)
{
Modified: trunk/reactos/dll/win32/ole32/filemoniker.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/filemonike…
==============================================================================
--- trunk/reactos/dll/win32/ole32/filemoniker.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/filemoniker.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -92,7 +92,7 @@
*ppvObject = iface;
else if (IsEqualIID(&IID_IROTData, riid))
- *ppvObject = (IROTData*)&(This->lpvtbl2);
+ *ppvObject = &This->lpvtbl2;
else if (IsEqualIID(&IID_IMarshal, riid))
{
HRESULT hr = S_OK;
@@ -560,7 +560,7 @@
/* get the requested interface from the loaded class */
res= IUnknown_QueryInterface(pObj,riid,ppvResult);
- IBindCtx_RegisterObjectBound(pbc,(IUnknown*)*ppvResult);
+ IBindCtx_RegisterObjectBound(pbc,*ppvResult);
IUnknown_Release(pObj);
}
Modified: trunk/reactos/dll/win32/ole32/ftmarshal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ftmarshal.…
==============================================================================
--- trunk/reactos/dll/win32/ole32/ftmarshal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/ftmarshal.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -46,8 +46,8 @@
IUnknown *pUnkOuter;
} FTMarshalImpl;
-#define _IFTMUnknown_(This)(IUnknown*)&(This->lpVtbl)
-#define _IFTMarshal_(This) (IMarshal*)&(This->lpvtblFTM)
+#define _IFTMUnknown_(This) ((IUnknown*)&(This)->lpVtbl)
+#define _IFTMarshal_(This) (&(This)->lpvtblFTM)
static inline FTMarshalImpl *impl_from_IMarshal( IMarshal *iface )
{
Modified: trunk/reactos/dll/win32/ole32/git.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/git.c?rev=…
==============================================================================
--- trunk/reactos/dll/win32/ole32/git.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/git.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -308,7 +308,7 @@
if (IsEqualIID(riid,&IID_IUnknown) ||
IsEqualIID(riid,&IID_IGlobalInterfaceTable))
{
- *ppv = (LPVOID)iface;
+ *ppv = iface;
return S_OK;
}
return E_NOINTERFACE;
Modified: trunk/reactos/dll/win32/ole32/hglobalstream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/hglobalstr…
==============================================================================
--- trunk/reactos/dll/win32/ole32/hglobalstream.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/hglobalstream.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -151,7 +151,7 @@
IsEqualIID(&IID_ISequentialStream, riid) ||
IsEqualIID(&IID_IStream, riid))
{
- *ppvObject = (IStream*)This;
+ *ppvObject = This;
}
/*
Modified: trunk/reactos/dll/win32/ole32/ifs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ifs.c?rev=…
==============================================================================
--- trunk/reactos/dll/win32/ole32/ifs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/ifs.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -148,7 +148,7 @@
TRACE("(%s,%p)\n",debugstr_guid(refiid),obj);
if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMalloc,refiid)) {
- *obj = (LPMALLOC)&Malloc32;
+ *obj = &Malloc32;
return S_OK;
}
return E_NOINTERFACE;
@@ -383,7 +383,7 @@
TRACE("(%s,%p)\n",debugstr_guid(refiid),obj);
if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMallocSpy,refiid)) {
- *obj = (LPMALLOC)&MallocSpy;
+ *obj = &MallocSpy;
return S_OK;
}
return E_NOINTERFACE;
Modified: trunk/reactos/dll/win32/ole32/itemmoniker.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/itemmonike…
==============================================================================
--- trunk/reactos/dll/win32/ole32/itemmoniker.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/itemmoniker.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -176,7 +176,7 @@
*ppvObject = iface;
else if (IsEqualIID(&IID_IROTData, riid))
- *ppvObject = (IROTData*)&(This->lpvtbl2);
+ *ppvObject = &This->lpvtbl2;
else if (IsEqualIID(&IID_IMarshal, riid))
{
HRESULT hr = S_OK;
Modified: trunk/reactos/dll/win32/ole32/marshal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/marshal.c?…
==============================================================================
--- trunk/reactos/dll/win32/ole32/marshal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/marshal.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -216,7 +216,7 @@
mqi.pIID = riid;
hr = IMultiQI_QueryMultipleInterfaces(iface, 1, &mqi);
- *ppv = (void *)mqi.pItf;
+ *ppv = mqi.pItf;
return hr;
}
@@ -837,19 +837,19 @@
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IMultiQI))
{
- *ppv = (void *)&This->lpVtbl;
+ *ppv = &This->lpVtbl;
IUnknown_AddRef((IUnknown *)*ppv);
return S_OK;
}
if (IsEqualIID(riid, &IID_IMarshal))
{
- *ppv = (void *)&This->lpVtblMarshal;
+ *ppv = &This->lpVtblMarshal;
IUnknown_AddRef((IUnknown *)*ppv);
return S_OK;
}
if (IsEqualIID(riid, &IID_IClientSecurity))
{
- *ppv = (void *)&This->lpVtblCliSec;
+ *ppv = &This->lpVtblCliSec;
IUnknown_AddRef((IUnknown *)*ppv);
return S_OK;
}
@@ -890,7 +890,7 @@
* proxy associated with the ifproxy as we handle IUnknown ourselves */
if (IsEqualIID(riid, &IID_IUnknown))
{
- ifproxy->iface = (void *)&This->lpVtbl;
+ ifproxy->iface = &This->lpVtbl;
IMultiQI_AddRef((IMultiQI *)&This->lpVtbl);
hr = S_OK;
}
@@ -1213,7 +1213,7 @@
/* make sure this apartment can be reached from other threads / processes */
RPC_StartRemoting(apt);
- hres = marshal_object(apt, &stdobjref, riid, (IUnknown *)pv, mshlflags);
+ hres = marshal_object(apt, &stdobjref, riid, pv, mshlflags);
if (hres)
{
ERR("Failed to create ifstub, hres=0x%x\n", hres);
@@ -1973,7 +1973,7 @@
*ppv = NULL;
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
{
- *ppv = (LPVOID)iface;
+ *ppv = iface;
return S_OK;
}
return E_NOINTERFACE;
Modified: trunk/reactos/dll/win32/ole32/memlockbytes.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/memlockbyt…
==============================================================================
--- trunk/reactos/dll/win32/ole32/memlockbytes.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/memlockbytes.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -289,7 +289,7 @@
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_ILockBytes))
{
- *ppvObject = (ILockBytes*)This;
+ *ppvObject = This;
}
/*
Modified: trunk/reactos/dll/win32/ole32/moniker.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/moniker.c?…
==============================================================================
--- trunk/reactos/dll/win32/ole32/moniker.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/moniker.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -316,7 +316,7 @@
if (IsEqualIID(&IID_IUnknown, riid) ||
IsEqualIID(&IID_IRunningObjectTable, riid))
- *ppvObject = (IRunningObjectTable*)This;
+ *ppvObject = This;
if ((*ppvObject)==0)
return E_NOINTERFACE;
@@ -1291,10 +1291,10 @@
*ppvObject = NULL;
if (IsEqualIID(&IID_IUnknown, riid))
- *ppvObject = (IEnumMoniker*)This;
+ *ppvObject = This;
else
if (IsEqualIID(&IID_IEnumMoniker, riid))
- *ppvObject = (IEnumMoniker*)This;
+ *ppvObject = This;
if ((*ppvObject)==NULL)
return E_NOINTERFACE;
Modified: trunk/reactos/dll/win32/ole32/ole2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole2.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -500,15 +500,10 @@
trackerInfo.curTargetHWND = 0;
trackerInfo.curDragTarget = 0;
- hwndTrackWindow = CreateWindowA(OLEDD_DRAGTRACKERCLASS,
- "TrackerWindow",
- WS_POPUP,
- CW_USEDEFAULT, CW_USEDEFAULT,
- CW_USEDEFAULT, CW_USEDEFAULT,
- 0,
- 0,
- 0,
- (LPVOID)&trackerInfo);
+ hwndTrackWindow = CreateWindowA(OLEDD_DRAGTRACKERCLASS, "TrackerWindow",
+ WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT,
+ CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0,
+ &trackerInfo);
if (hwndTrackWindow!=0)
{
@@ -1963,7 +1958,7 @@
{
LPCREATESTRUCTA createStruct = (LPCREATESTRUCTA)lParam;
- SetWindowLongA(hwnd, 0, (LONG)createStruct->lpCreateParams);
+ SetWindowLongPtrA(hwnd, 0, (LONG_PTR)createStruct->lpCreateParams);
SetTimer(hwnd, DRAG_TIMER_ID, 50, NULL);
break;
@@ -1971,7 +1966,7 @@
case WM_TIMER:
case WM_MOUSEMOVE:
{
- OLEDD_TrackMouseMove((TrackerWindowInfo*)GetWindowLongA(hwnd, 0));
+ OLEDD_TrackMouseMove((TrackerWindowInfo*)GetWindowLongPtrA(hwnd, 0));
break;
}
case WM_LBUTTONUP:
@@ -1981,7 +1976,7 @@
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
{
- OLEDD_TrackStateChange((TrackerWindowInfo*)GetWindowLongA(hwnd, 0));
+ OLEDD_TrackStateChange((TrackerWindowInfo*)GetWindowLongPtrA(hwnd, 0));
break;
}
case WM_DESTROY:
@@ -2599,7 +2594,7 @@
stringBuffer = (WCHAR*)newBuffer;
stringBuffer[len] = '\0';
- return (LPWSTR)stringBuffer;
+ return stringBuffer;
}
/***********************************************************************
@@ -2901,9 +2896,9 @@
case VT_FILETIME: elemSize = sizeof(pvarSrc->u.filetime); break;
case VT_CLSID: elemSize = sizeof(*pvarSrc->u.puuid); break;
case VT_CF: elemSize = sizeof(*pvarSrc->u.pclipdata); break;
- case VT_BSTR: elemSize = sizeof(*pvarSrc->u.bstrVal); break;
- case VT_LPSTR: elemSize = sizeof(*pvarSrc->u.pszVal); break;
- case VT_LPWSTR: elemSize = sizeof(*pvarSrc->u.pwszVal); break;
+ case VT_BSTR: elemSize = sizeof(pvarSrc->u.bstrVal); break;
+ case VT_LPSTR: elemSize = sizeof(pvarSrc->u.pszVal); break;
+ case VT_LPWSTR: elemSize = sizeof(pvarSrc->u.pwszVal); break;
case VT_VARIANT: elemSize = sizeof(*pvarSrc->u.pvarVal); break;
default:
Modified: trunk/reactos/dll/win32/ole32/oleobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/oleobj.c?r…
==============================================================================
--- trunk/reactos/dll/win32/ole32/oleobj.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/oleobj.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -256,7 +256,7 @@
else if(IsEqualIID(riid, &IID_IOleAdviseHolder))
{
/* IOleAdviseHolder */
- *ppvObj = (IOleAdviseHolder*) This;
+ *ppvObj = This;
}
if(*ppvObj == NULL)
Modified: trunk/reactos/dll/win32/ole32/rpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/rpc.c?rev=…
==============================================================================
--- trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -440,7 +440,7 @@
*ppv = NULL;
if (IsEqualIID(riid,&IID_IRpcChannelBuffer) ||
IsEqualIID(riid,&IID_IUnknown))
{
- *ppv = (LPVOID)iface;
+ *ppv = iface;
IUnknown_AddRef(iface);
return S_OK;
}
@@ -495,7 +495,7 @@
TRACE("(%p)->(%p,%s)\n", This, olemsg, debugstr_guid(riid));
- message_state = (struct message_state *)msg->Handle;
+ message_state = msg->Handle;
/* restore the binding handle and the real start of data */
msg->Handle = message_state->binding_handle;
msg->Buffer = (char *)msg->Buffer - message_state->prefix_data_len;
@@ -522,7 +522,7 @@
else
status = I_RpcGetBuffer(msg);
- orpcthat = (ORPCTHAT *)msg->Buffer;
+ orpcthat = msg->Buffer;
msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHAT, extensions);
orpcthat->flags = ORPCF_NULL /* FIXME? */;
@@ -702,7 +702,7 @@
if (status == RPC_S_OK)
{
- orpcthis = (ORPCTHIS *)msg->Buffer;
+ orpcthis = msg->Buffer;
msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHIS, extensions);
orpcthis->version.MajorVersion = COM_MAJOR_VERSION;
@@ -765,7 +765,7 @@
/* this thread runs an outgoing RPC */
static DWORD WINAPI rpc_sendreceive_thread(LPVOID param)
{
- struct dispatch_params *data = (struct dispatch_params *) param;
+ struct dispatch_params *data = param;
/* Note: I_RpcSendReceive doesn't raise exceptions like the higher-level
* RPC functions do */
@@ -825,7 +825,7 @@
return RPC_E_CANTCALLOUT_ININPUTSYNCCALL;
}
- message_state = (struct message_state *)msg->Handle;
+ message_state = msg->Handle;
/* restore the binding handle and the real start of data */
msg->Handle = message_state->binding_handle;
msg->Buffer = (char *)msg->Buffer - message_state->prefix_data_len;
@@ -950,7 +950,7 @@
TRACE("(%p)\n", msg);
- message_state = (struct message_state *)msg->Handle;
+ message_state = msg->Handle;
/* restore the binding handle and the real start of data */
msg->Handle = message_state->binding_handle;
msg->Buffer = (char *)msg->Buffer - message_state->prefix_data_len;
@@ -980,7 +980,7 @@
TRACE("(%p)\n", msg);
- message_state = (struct message_state *)msg->Handle;
+ message_state = msg->Handle;
/* restore the binding handle and the real start of data */
msg->Handle = message_state->binding_handle;
msg->Buffer = (char *)msg->Buffer - message_state->prefix_data_len;
@@ -1179,7 +1179,7 @@
return RPC_S_INVALID_BOUND;
}
- *first_wire_orpc_extent = wire_orpc_extent = (WIRE_ORPC_EXTENT *)msg->Buffer;
+ *first_wire_orpc_extent = wire_orpc_extent = msg->Buffer;
for (i = 0; i < ((extensions->size+1)&~1); i++)
{
if ((const char *)&wire_orpc_extent->data[0] > end)
@@ -1398,7 +1398,7 @@
HeapFree(GetProcessHeap(), 0, original_buffer);
exit_reset_state:
- message_state = (struct message_state *)msg->Handle;
+ message_state = msg->Handle;
msg->Handle = message_state->binding_handle;
msg->Buffer = (char *)msg->Buffer - message_state->prefix_data_len;
msg->BufferLength += message_state->prefix_data_len;
@@ -1847,7 +1847,7 @@
/* FIXME: should call to rpcss instead */
static DWORD WINAPI local_server_thread(LPVOID param)
{
- struct local_server_params * lsp = (struct local_server_params *)param;
+ struct local_server_params * lsp = param;
HANDLE hPipe;
WCHAR pipefn[100];
HRESULT hres;
Modified: trunk/reactos/dll/win32/ole32/stg_prop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/stg_prop.c…
==============================================================================
--- trunk/reactos/dll/win32/ole32/stg_prop.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/stg_prop.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -927,23 +927,23 @@
static int PropertyStorage_PropNameCompare(const void *a, const void *b,
void *extra)
{
- PropertyStorage_impl *This = (PropertyStorage_impl *)extra;
+ PropertyStorage_impl *This = extra;
if (This->codePage == CP_UNICODE)
{
TRACE("(%s, %s)\n", debugstr_w(a), debugstr_w(b));
if (This->grfFlags & PROPSETFLAG_CASE_SENSITIVE)
- return lstrcmpW((LPCWSTR)a, (LPCWSTR)b);
+ return lstrcmpW(a, b);
else
- return lstrcmpiW((LPCWSTR)a, (LPCWSTR)b);
+ return lstrcmpiW(a, b);
}
else
{
TRACE("(%s, %s)\n", debugstr_a(a), debugstr_a(b));
if (This->grfFlags & PROPSETFLAG_CASE_SENSITIVE)
- return lstrcmpA((LPCSTR)a, (LPCSTR)b);
+ return lstrcmpA(a, b);
else
- return lstrcmpiA((LPCSTR)a, (LPCSTR)b);
+ return lstrcmpiA(a, b);
}
}
@@ -961,7 +961,7 @@
static void PropertyStorage_PropertyDestroy(void *k, void *d, void *extra)
{
- PropVariantClear((PROPVARIANT *)d);
+ PropVariantClear(d);
HeapFree(GetProcessHeap(), 0, d);
}
@@ -1486,8 +1486,8 @@
static BOOL PropertyStorage_DictionaryWriter(const void *key,
const void *value, void *extra, void *closure)
{
- PropertyStorage_impl *This = (PropertyStorage_impl *)extra;
- struct DictionaryClosure *c = (struct DictionaryClosure *)closure;
+ PropertyStorage_impl *This = extra;
+ struct DictionaryClosure *c = closure;
DWORD propid;
ULONG count;
@@ -1756,8 +1756,8 @@
static BOOL PropertyStorage_PropertiesWriter(const void *key, const void *value,
void *extra, void *closure)
{
- PropertyStorage_impl *This = (PropertyStorage_impl *)extra;
- struct PropertyClosure *c = (struct PropertyClosure *)closure;
+ PropertyStorage_impl *This = extra;
+ struct PropertyClosure *c = closure;
assert(key);
assert(value);
Modified: trunk/reactos/dll/win32/ole32/stg_stream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/stg_stream…
==============================================================================
--- trunk/reactos/dll/win32/ole32/stg_stream.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/stg_stream.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -126,7 +126,7 @@
IsEqualIID(&IID_ISequentialStream, riid) ||
IsEqualIID(&IID_IStream, riid))
{
- *ppvObject = (IStream*)This;
+ *ppvObject = This;
}
/*
Modified: trunk/reactos/dll/win32/ole32/storage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage.c?…
==============================================================================
--- trunk/reactos/dll/win32/ole32/storage.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/storage.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -1287,7 +1287,7 @@
BYTE block[BIGSIZE];
ULONG *byteswritten=pcbWrite,xxwritten;
int oldsize,newsize,i,curoffset=0,lastblocknr,blocknr,cc;
- const BYTE* pbv = (const BYTE*)pv;
+ const BYTE* pbv = pv;
if (!pcbWrite) byteswritten=&xxwritten;
*byteswritten = 0;
Modified: trunk/reactos/dll/win32/ole32/storage32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.…
==============================================================================
--- trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -314,11 +314,11 @@
if (IsEqualGUID(&IID_IUnknown, riid) ||
IsEqualGUID(&IID_IStorage, riid))
{
- *ppvObject = (IStorage*)This;
+ *ppvObject = This;
}
else if (IsEqualGUID(&IID_IPropertySetStorage, riid))
{
- *ppvObject = (IStorage*)&This->pssVtbl;
+ *ppvObject = &This->pssVtbl;
}
/*
@@ -2041,13 +2041,8 @@
size.u.HighPart = 0;
size.u.LowPart = 0;
- hr = StorageBaseImpl_OpenStream(
- (IStorage*)parentStorage,
- (OLECHAR*)propertyToDelete.name,
- NULL,
- STGM_WRITE | STGM_SHARE_EXCLUSIVE,
- 0,
- &pis);
+ hr = StorageBaseImpl_OpenStream((IStorage*)parentStorage,
+ propertyToDelete.name, NULL, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, &pis);
if (hr!=S_OK)
{
@@ -3693,7 +3688,7 @@
if (IsEqualGUID(&IID_IUnknown, riid) ||
IsEqualGUID(&IID_IEnumSTATSTG, riid))
{
- *ppvObject = (IEnumSTATSTG*)This;
+ *ppvObject = This;
IEnumSTATSTG_AddRef((IEnumSTATSTG*)This);
return S_OK;
}
@@ -4031,8 +4026,7 @@
currentSearchNode,
currentProperty);
- if ( propertyNameCmp(
- (const OLECHAR*)currentProperty->name, lpszPropName) == 0)
+ if (propertyNameCmp(currentProperty->name, lpszPropName) == 0)
return currentSearchNode;
/*
@@ -4344,7 +4338,7 @@
destination->pwcsName =
CoTaskMemAlloc((lstrlenW(source->name)+1)*sizeof(WCHAR));
- strcpyW((LPWSTR)destination->pwcsName, source->name);
+ strcpyW(destination->pwcsName, source->name);
}
switch (source->propertyType)
@@ -4633,7 +4627,7 @@
}
*bytesWritten = 0;
- bufferWalker = (const BYTE*)buffer;
+ bufferWalker = buffer;
while ( (size > 0) && (blockIndex != BLOCK_END_OF_CHAIN) )
{
@@ -5368,7 +5362,7 @@
* This is OK since we don't intend to modify that buffer.
*/
*bytesWritten = 0;
- bufferWalker = (const BYTE*)buffer;
+ bufferWalker = buffer;
while ( (size > 0) && (blockIndex != BLOCK_END_OF_CHAIN) )
{
/*
@@ -6632,7 +6626,7 @@
if(pData->dwOleTypeNameLength > 0)
{
/* Get the OleTypeName */
- dwSize = pOleStream->lpstbl->Get(pOleStream, (void *)pData->strOleTypeName,
pData->dwOleTypeNameLength);
+ dwSize = pOleStream->lpstbl->Get(pOleStream, pData->strOleTypeName,
pData->dwOleTypeNameLength);
if(dwSize != pData->dwOleTypeNameLength)
{
hRes = CONVERT10_E_OLESTREAM_GET;
@@ -6653,7 +6647,7 @@
pData->pstrOleObjFileName = HeapAlloc(GetProcessHeap(), 0,
pData->dwOleObjFileNameLength);
if(pData->pstrOleObjFileName)
{
- dwSize = pOleStream->lpstbl->Get(pOleStream, (void
*)(pData->pstrOleObjFileName),pData->dwOleObjFileNameLength);
+ dwSize = pOleStream->lpstbl->Get(pOleStream, pData->pstrOleObjFileName,
pData->dwOleObjFileNameLength);
if(dwSize != pData->dwOleObjFileNameLength)
{
hRes = CONVERT10_E_OLESTREAM_GET;
@@ -6696,7 +6690,7 @@
if(!bStrem1) /* if it is a second OLE stream data */
{
pData->dwDataLength -= 8;
- dwSize = pOleStream->lpstbl->Get(pOleStream, (void *)(pData->strUnknown),
sizeof(pData->strUnknown));
+ dwSize = pOleStream->lpstbl->Get(pOleStream, pData->strUnknown,
sizeof(pData->strUnknown));
if(dwSize != sizeof(pData->strUnknown))
{
hRes = CONVERT10_E_OLESTREAM_GET;
@@ -6783,7 +6777,7 @@
if(pData->dwOleTypeNameLength > 0)
{
/* Set the OleTypeName */
- dwSize = pOleStream->lpstbl->Put(pOleStream, (void *)
pData->strOleTypeName, pData->dwOleTypeNameLength);
+ dwSize = pOleStream->lpstbl->Put(pOleStream,
pData->strOleTypeName, pData->dwOleTypeNameLength);
if(dwSize != pData->dwOleTypeNameLength)
{
hRes = CONVERT10_E_OLESTREAM_PUT;
Modified: trunk/reactos/dll/win32/ole32/stubmanager.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/stubmanage…
==============================================================================
--- trunk/reactos/dll/win32/ole32/stubmanager.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/stubmanager.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -606,7 +606,7 @@
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IRemUnknown))
{
- *ppv = (LPVOID)iface;
+ *ppv = iface;
IRemUnknown_AddRef(iface);
return S_OK;
}
Modified: trunk/reactos/dll/win32/ole32/usrmarshal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/usrmarshal…
==============================================================================
--- trunk/reactos/dll/win32/ole32/usrmarshal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/usrmarshal.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -105,7 +105,7 @@
TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags), StartingSize, pCF);
- size += sizeof(userCLIPFORMAT);
+ size += 8;
/* only need to marshal the name if it is not a pre-defined type and
* we are going remote */
@@ -113,7 +113,7 @@
{
WCHAR format[255];
INT ret;
- size += 3 * sizeof(INT);
+ size += 3 * sizeof(UINT);
/* urg! this function is badly designed because it won't tell us how
* much space is needed without doing a dummy run of storing the
* name into a buffer */
@@ -146,30 +146,30 @@
*/
unsigned char * __RPC_USER CLIPFORMAT_UserMarshal(ULONG *pFlags, unsigned char *pBuffer,
CLIPFORMAT *pCF)
{
- wireCLIPFORMAT wirecf = (wireCLIPFORMAT)pBuffer;
-
TRACE("(%s, %p, &0x%04x\n", debugstr_user_flags(pFlags), pBuffer,
*pCF);
-
- wirecf->u.dwValue = *pCF;
- pBuffer += sizeof(*wirecf);
/* only need to marshal the name if it is not a pre-defined type and
* we are going remote */
if ((*pCF >= 0xc000) && (LOWORD(*pFlags) == MSHCTX_DIFFERENTMACHINE))
{
WCHAR format[255];
- INT len;
- wirecf->fContext = WDT_REMOTE_CALL;
+ UINT len;
+
+ *(DWORD *)pBuffer = WDT_REMOTE_CALL;
+ pBuffer += 4;
+ *(DWORD *)pBuffer = *pCF;
+ pBuffer += 4;
+
len = GetClipboardFormatNameW(*pCF, format, sizeof(format)/sizeof(format[0])-1);
if (!len)
RaiseException(DV_E_CLIPFORMAT, 0, 0, NULL);
len += 1;
- *(INT *)pBuffer = len;
- pBuffer += sizeof(INT);
- *(INT *)pBuffer = 0;
- pBuffer += sizeof(INT);
- *(INT *)pBuffer = len;
- pBuffer += sizeof(INT);
+ *(UINT *)pBuffer = len;
+ pBuffer += sizeof(UINT);
+ *(UINT *)pBuffer = 0;
+ pBuffer += sizeof(UINT);
+ *(UINT *)pBuffer = len;
+ pBuffer += sizeof(UINT);
TRACE("marshaling format name %s\n", debugstr_wn(format, len-1));
lstrcpynW((LPWSTR)pBuffer, format, len);
pBuffer += len * sizeof(WCHAR);
@@ -177,7 +177,12 @@
pBuffer += sizeof(WCHAR);
}
else
- wirecf->fContext = WDT_INPROC_CALL;
+ {
+ *(DWORD *)pBuffer = WDT_INPROC_CALL;
+ pBuffer += 4;
+ *(DWORD *)pBuffer = *pCF;
+ pBuffer += 4;
+ }
return pBuffer;
}
@@ -203,24 +208,36 @@
*/
unsigned char * __RPC_USER CLIPFORMAT_UserUnmarshal(ULONG *pFlags, unsigned char
*pBuffer, CLIPFORMAT *pCF)
{
- wireCLIPFORMAT wirecf = (wireCLIPFORMAT)pBuffer;
+ LONG fContext;
TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags), pBuffer, pCF);
- pBuffer += sizeof(*wirecf);
- if (wirecf->fContext == WDT_INPROC_CALL)
- *pCF = (CLIPFORMAT)wirecf->u.dwValue;
- else if (wirecf->fContext == WDT_REMOTE_CALL)
+ fContext = *(DWORD *)pBuffer;
+ pBuffer += 4;
+
+ if (fContext == WDT_INPROC_CALL)
+ {
+ *pCF = *(CLIPFORMAT *)pBuffer;
+ pBuffer += 4;
+ }
+ else if (fContext == WDT_REMOTE_CALL)
{
CLIPFORMAT cf;
- INT len = *(INT *)pBuffer;
- pBuffer += sizeof(INT);
- if (*(INT *)pBuffer != 0)
+ UINT len;
+
+ /* pointer ID for registered clip format string */
+ if (*(DWORD *)pBuffer == 0)
RaiseException(RPC_S_INVALID_BOUND, 0, 0, NULL);
- pBuffer += sizeof(INT);
- if (*(INT *)pBuffer != len)
+ pBuffer += 4;
+
+ len = *(UINT *)pBuffer;
+ pBuffer += sizeof(UINT);
+ if (*(UINT *)pBuffer != 0)
RaiseException(RPC_S_INVALID_BOUND, 0, 0, NULL);
- pBuffer += sizeof(INT);
+ pBuffer += sizeof(UINT);
+ if (*(UINT *)pBuffer != len)
+ RaiseException(RPC_S_INVALID_BOUND, 0, 0, NULL);
+ pBuffer += sizeof(UINT);
if (((WCHAR *)pBuffer)[len] != '\0')
RaiseException(RPC_S_INVALID_BOUND, 0, 0, NULL);
TRACE("unmarshaling clip format %s\n", debugstr_w((LPCWSTR)pBuffer));
Modified: trunk/reactos/dll/win32/oleaut32/connpt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/connpt.…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/connpt.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/connpt.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -161,9 +161,9 @@
* Compare the riid with the interface IDs implemented by this object.
*/
if (IsEqualIID(&IID_IUnknown, riid))
- *ppvObject = (IConnectionPoint*)This;
+ *ppvObject = This;
else if (IsEqualIID(&IID_IConnectionPoint, riid))
- *ppvObject = (IConnectionPoint*)This;
+ *ppvObject = This;
/*
* Check that we obtained an interface.
@@ -430,9 +430,9 @@
* Compare the riid with the interface IDs implemented by this object.
*/
if (IsEqualIID(&IID_IUnknown, riid))
- *ppvObject = (IEnumConnections*)This;
+ *ppvObject = This;
else if (IsEqualIID(&IID_IEnumConnections, riid))
- *ppvObject = (IEnumConnections*)This;
+ *ppvObject = This;
/*
* Check that we obtained an interface.
Modified: trunk/reactos/dll/win32/oleaut32/dispatch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/dispatc…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/dispatch.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -233,7 +233,7 @@
if (IsEqualIID(riid, &IID_IDispatch) ||
IsEqualIID(riid, &IID_IUnknown))
{
- *ppvObject = (LPVOID)This;
+ *ppvObject = This;
IUnknown_AddRef((LPUNKNOWN)*ppvObject);
return S_OK;
}
Modified: trunk/reactos/dll/win32/oleaut32/oleaut.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut.…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -266,7 +266,7 @@
stringBuffer = (WCHAR*)newBuffer;
stringBuffer[len] = '\0';
- return (LPWSTR)stringBuffer;
+ return stringBuffer;
}
/******************************************************************************
@@ -706,7 +706,7 @@
IsEqualIID(riid, &IID_IPSFactoryBuffer))
{
IUnknown_AddRef(iface);
- *ppv = (void *)iface;
+ *ppv = iface;
return S_OK;
}
return E_NOINTERFACE;
Modified: trunk/reactos/dll/win32/oleaut32/olefont.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olefont…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/olefont.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/olefont.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -351,21 +351,21 @@
* Compare the riid with the interface IDs implemented by this object.
*/
if (IsEqualGUID(&IID_IUnknown, riid))
- *ppvObject = (IFont*)this;
+ *ppvObject = this;
if (IsEqualGUID(&IID_IFont, riid))
- *ppvObject = (IFont*)this;
+ *ppvObject = this;
if (IsEqualGUID(&IID_IDispatch, riid))
- *ppvObject = (IDispatch*)&(this->lpvtblIDispatch);
+ *ppvObject = &this->lpvtblIDispatch;
if (IsEqualGUID(&IID_IFontDisp, riid))
- *ppvObject = (IDispatch*)&(this->lpvtblIDispatch);
+ *ppvObject = &this->lpvtblIDispatch;
if (IsEqualIID(&IID_IPersist, riid) || IsEqualGUID(&IID_IPersistStream, riid))
- *ppvObject = (IPersistStream*)&(this->lpvtblIPersistStream);
+ *ppvObject = &this->lpvtblIPersistStream;
if (IsEqualGUID(&IID_IConnectionPointContainer, riid))
- *ppvObject =
(IConnectionPointContainer*)&(this->lpvtblIConnectionPointContainer);
+ *ppvObject = &this->lpvtblIConnectionPointContainer;
if (IsEqualGUID(&IID_IPersistPropertyBag, riid))
- *ppvObject = (IPersistPropertyBag*)&(this->lpvtblIPersistPropertyBag);
+ *ppvObject = &this->lpvtblIPersistPropertyBag;
if (IsEqualGUID(&IID_IPersistStreamInit, riid))
- *ppvObject = (IPersistStreamInit*)&(this->lpvtblIPersistStreamInit);
+ *ppvObject = &this->lpvtblIPersistStreamInit;
/*
* Check that we obtained an interface.
@@ -2343,4 +2343,4 @@
};
static IClassFactoryImpl STDFONT_CF = {&SFCF_Vtbl, 1 };
-void _get_STDFONT_CF(LPVOID *ppv) { *ppv = (LPVOID)&STDFONT_CF; }
+void _get_STDFONT_CF(LPVOID *ppv) { *ppv = &STDFONT_CF; }
Modified: trunk/reactos/dll/win32/oleaut32/olepicture.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olepict…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -459,15 +459,15 @@
* Compare the riid with the interface IDs implemented by this object.
*/
if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IPicture, riid))
- *ppvObject = (IPicture*)This;
+ *ppvObject = This;
else if (IsEqualIID(&IID_IDispatch, riid))
- *ppvObject = (IDispatch*)&(This->lpvtblIDispatch);
+ *ppvObject = &This->lpvtblIDispatch;
else if (IsEqualIID(&IID_IPictureDisp, riid))
- *ppvObject = (IDispatch*)&(This->lpvtblIDispatch);
+ *ppvObject = &This->lpvtblIDispatch;
else if (IsEqualIID(&IID_IPersist, riid) || IsEqualIID(&IID_IPersistStream,
riid))
- *ppvObject = (IPersistStream*)&(This->lpvtblIPersistStream);
+ *ppvObject = &This->lpvtblIPersistStream;
else if (IsEqualIID(&IID_IConnectionPointContainer, riid))
- *ppvObject =
(IConnectionPointContainer*)&(This->lpvtblIConnectionPointContainer);
+ *ppvObject = &This->lpvtblIConnectionPointContainer;
/*
* Check that we obtained an interface.
@@ -1064,7 +1064,7 @@
};
static int _gif_inputfunc(GifFileType *gif, GifByteType *data, int len) {
- struct gifdata *gd = (struct gifdata*)gif->UserData;
+ struct gifdata *gd = gif->UserData;
if (len+gd->curoff > gd->len) {
ERR("Trying to read %d bytes, but only %d available.\n",len,
gd->len-gd->curoff);
@@ -2011,7 +2011,7 @@
*ppBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *pLength);
/* Fill the BITMAPFILEHEADER */
- pFileHeader = (BITMAPFILEHEADER *)(*ppBuffer);
+ pFileHeader = *ppBuffer;
pFileHeader->bfType = BITMAP_FORMAT_BMP;
pFileHeader->bfSize = *pLength;
pFileHeader->bfOffBits =
@@ -2886,4 +2886,4 @@
};
static IClassFactoryImpl STDPIC_CF = {&SPCF_Vtbl, 1 };
-void _get_STDPIC_CF(LPVOID *ppv) { *ppv = (LPVOID)&STDPIC_CF; }
+void _get_STDPIC_CF(LPVOID *ppv) { *ppv = &STDPIC_CF; }
Modified: trunk/reactos/dll/win32/oleaut32/recinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/recinfo…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/recinfo.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/recinfo.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -237,7 +237,7 @@
*(void**)var = NULL;
break;
case VT_SAFEARRAY:
- SafeArrayDestroy((SAFEARRAY*)var);
+ SafeArrayDestroy(var);
break;
default:
FIXME("Not supported vt = %d\n", This->fields[i].vt);
Modified: trunk/reactos/dll/win32/oleaut32/safearray.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/safearr…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/safearray.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/safearray.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -299,7 +299,7 @@
if (SUCCEEDED(SafeArrayGetRecordInfo(psa, &lpRecInfo)))
{
- PBYTE pRecordData = (PBYTE)psa->pvData;
+ PBYTE pRecordData = psa->pvData;
while(ulCellCount--)
{
IRecordInfo_RecordClear(lpRecInfo, pRecordData);
@@ -350,8 +350,8 @@
if (psa->fFeatures & FADF_VARIANT)
{
- VARIANT* lpVariant = (VARIANT*)psa->pvData;
- VARIANT* lpDest = (VARIANT*)dest->pvData;
+ VARIANT* lpVariant = psa->pvData;
+ VARIANT* lpDest = dest->pvData;
while(ulCellCount--)
{
@@ -365,8 +365,8 @@
}
else if (psa->fFeatures & FADF_BSTR)
{
- BSTR* lpBstr = (BSTR*)psa->pvData;
- BSTR* lpDest = (BSTR*)dest->pvData;
+ BSTR* lpBstr = psa->pvData;
+ BSTR* lpDest = dest->pvData;
while(ulCellCount--)
{
@@ -389,7 +389,7 @@
if (psa->fFeatures & (FADF_UNKNOWN|FADF_DISPATCH))
{
- LPUNKNOWN *lpUnknown = (LPUNKNOWN *)dest->pvData;
+ LPUNKNOWN *lpUnknown = dest->pvData;
while(ulCellCount--)
{
@@ -596,7 +596,7 @@
SAFEARRAY* WINAPI SafeArrayCreateEx(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound,
LPVOID pvExtra)
{
ULONG ulSize = 0;
- IRecordInfo* iRecInfo = (IRecordInfo*)pvExtra;
+ IRecordInfo* iRecInfo = pvExtra;
SAFEARRAY* psa;
TRACE("(%d->%s,%d,%p,%p)\n", vt, debugstr_vt(vt), cDims, rgsabound,
pvExtra);
@@ -673,7 +673,7 @@
SAFEARRAY* WINAPI SafeArrayCreateVectorEx(VARTYPE vt, LONG lLbound, ULONG cElements,
LPVOID pvExtra)
{
ULONG ulSize;
- IRecordInfo* iRecInfo = (IRecordInfo*)pvExtra;
+ IRecordInfo* iRecInfo = pvExtra;
SAFEARRAY* psa;
TRACE("(%d->%s,%d,%d,%p\n", vt, debugstr_vt(vt), lLbound, cElements,
pvExtra);
@@ -851,8 +851,8 @@
{
if (psa->fFeatures & FADF_VARIANT)
{
- VARIANT* lpVariant = (VARIANT*)pvData;
- VARIANT* lpDest = (VARIANT*)lpvDest;
+ VARIANT* lpVariant = pvData;
+ VARIANT* lpDest = lpvDest;
hRet = VariantClear(lpDest);
if (FAILED(hRet)) FIXME("VariantClear failed with 0x%x\n", hRet);
@@ -862,7 +862,7 @@
else if (psa->fFeatures & FADF_BSTR)
{
BSTR lpBstr = (BSTR)pvData;
- BSTR* lpDest = (BSTR*)lpvDest;
+ BSTR* lpDest = lpvDest;
SysFreeString(*lpDest);
@@ -874,8 +874,8 @@
{
if (psa->fFeatures & (FADF_UNKNOWN|FADF_DISPATCH))
{
- LPUNKNOWN lpUnknown = (LPUNKNOWN)pvData;
- LPUNKNOWN *lpDest = (LPUNKNOWN *)lpvDest;
+ LPUNKNOWN lpUnknown = pvData;
+ LPUNKNOWN *lpDest = lpvDest;
if (lpUnknown)
IUnknown_AddRef(lpUnknown);
@@ -932,8 +932,8 @@
{
if (psa->fFeatures & FADF_VARIANT)
{
- VARIANT* lpVariant = (VARIANT*)lpvSrc;
- VARIANT* lpDest = (VARIANT*)pvData;
+ VARIANT* lpVariant = lpvSrc;
+ VARIANT* lpDest = pvData;
/* The original content of pvData is ignored. */
V_VT(lpDest) = VT_EMPTY;
@@ -942,8 +942,8 @@
}
else if (psa->fFeatures & FADF_BSTR)
{
- BSTR* lpBstr = (BSTR*)lpvSrc;
- BSTR* lpDest = (BSTR*)pvData;
+ BSTR* lpBstr = lpvSrc;
+ BSTR* lpDest = pvData;
if (*lpBstr)
{
@@ -958,7 +958,7 @@
{
if (psa->fFeatures & (FADF_UNKNOWN|FADF_DISPATCH))
{
- LPUNKNOWN *lpUnknown = (LPUNKNOWN *)lpvSrc;
+ LPUNKNOWN *lpUnknown = lpvSrc;
if (*lpUnknown)
IUnknown_AddRef(*lpUnknown);
Modified: trunk/reactos/dll/win32/oleaut32/tmarshal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/tmarsha…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -254,7 +254,7 @@
static HRESULT WINAPI
PSFacBuf_QueryInterface(LPPSFACTORYBUFFER iface, REFIID iid, LPVOID *ppv) {
if (IsEqualIID(iid,&IID_IPSFactoryBuffer)||IsEqualIID(iid,&IID_IUnknown)) {
- *ppv = (LPVOID)iface;
+ *ppv = iface;
/* No ref counting, static class */
return S_OK;
}
@@ -410,7 +410,7 @@
{
TRACE("()\n");
if (IsEqualIID(riid,&IID_IUnknown)||IsEqualIID(riid,&IID_IRpcProxyBuffer)) {
- *ppv = (LPVOID)iface;
+ *ppv = iface;
IRpcProxyBuffer_AddRef(iface);
return S_OK;
}
@@ -1646,7 +1646,7 @@
*ppv = NULL;
if (IsEqualIID(riid,&IID_IRpcChannelBuffer) ||
IsEqualIID(riid,&IID_IUnknown))
{
- *ppv = (LPVOID)iface;
+ *ppv = iface;
IUnknown_AddRef(iface);
return S_OK;
}
@@ -1937,8 +1937,8 @@
if (hres == S_OK)
{
- *ppv = (LPVOID)proxy;
- *ppProxy = (IRpcProxyBuffer *)&(proxy->lpvtbl2);
+ *ppv = proxy;
+ *ppProxy = (IRpcProxyBuffer *)&(proxy->lpvtbl2);
IUnknown_AddRef((IUnknown *)*ppv);
return S_OK;
}
@@ -1962,7 +1962,7 @@
TMStubImpl_QueryInterface(LPRPCSTUBBUFFER iface, REFIID riid, LPVOID *ppv)
{
if (IsEqualIID(riid,&IID_IRpcStubBuffer)||IsEqualIID(riid,&IID_IUnknown)){
- *ppv = (LPVOID)iface;
+ *ppv = iface;
IRpcStubBuffer_AddRef(iface);
return S_OK;
}
Modified: trunk/reactos/dll/win32/oleaut32/typelib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -396,7 +396,7 @@
/* else fall-through */
case REGKIND_REGISTER:
- if (FAILED(res = RegisterTypeLib(*pptLib, (LPOLESTR)szPath, NULL)))
+ if (FAILED(res = RegisterTypeLib(*pptLib, szPath, NULL)))
{
IUnknown_Release(*pptLib);
*pptLib = 0;
@@ -3748,7 +3748,7 @@
pPad9 = (SLTG_Pad9*)(pIndex + pTypeLibImpl->TypeInfoCount);
- pFirstBlk = (LPVOID)(pPad9 + 1);
+ pFirstBlk = pPad9 + 1;
/* We'll set up a ptr to the main library block, which is the last one. */
@@ -3952,23 +3952,23 @@
}
- if(pTITail) { /* could get cFuncs, cVars and cImplTypes from here
+ /* could get cFuncs, cVars and cImplTypes from here
but we've already set those */
#define X(x) TRACE_(typelib)("tt "#x": %x\n",pTITail->res##x);
- X(06);
- X(16);
- X(18);
- X(1a);
- X(1e);
- X(24);
- X(26);
- X(2a);
- X(2c);
- X(2e);
- X(30);
- X(32);
- X(34);
- }
+ X(06);
+ X(16);
+ X(18);
+ X(1a);
+ X(1e);
+ X(24);
+ X(26);
+ X(2a);
+ X(2c);
+ X(2e);
+ X(30);
+ X(32);
+ X(34);
+#undef X
ppTypeInfoImpl = &((*ppTypeInfoImpl)->next);
pBlk = (char*)pBlk + pBlkEntry[order].len;
}
@@ -4978,7 +4978,7 @@
if (This->TypeAttr.typekind == TKIND_ALIAS)
TLB_CopyTypeDesc(&(*ppTypeAttr)->tdescAlias,
- &This->TypeAttr.tdescAlias, (void *)(*ppTypeAttr + 1));
+ &This->TypeAttr.tdescAlias, *ppTypeAttr + 1);
if((*ppTypeAttr)->typekind == TKIND_DISPATCH) {
/* This should include all the inherited funcs */
@@ -5945,8 +5945,7 @@
#define INVBUF_ELEMENT_SIZE \
(sizeof(VARIANTARG) + sizeof(VARIANTARG) + sizeof(VARIANTARG *) + sizeof(VARTYPE))
-#define INVBUF_GET_ARG_ARRAY(buffer, params) \
- ((VARIANTARG *)(buffer))
+#define INVBUF_GET_ARG_ARRAY(buffer, params) (buffer)
#define INVBUF_GET_MISSING_ARG_ARRAY(buffer, params) \
((VARIANTARG *)((char *)(buffer) + sizeof(VARIANTARG) * (params)))
#define INVBUF_GET_ARG_PTR_ARRAY(buffer, params) \
Modified: trunk/reactos/dll/win32/oleaut32/ungif.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/ungif.c…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/ungif.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/ungif.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -350,7 +350,7 @@
int i, BitsPerPixel;
GifByteType Buf[3];
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+ GifFilePrivateType *Private = GifFile->Private;
SavedImage *sp;
if (DGifGetWord(GifFile, &GifFile->Image.Left) == GIF_ERROR ||
@@ -436,7 +436,7 @@
int LineLen) {
GifByteType *Dummy;
- GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+ GifFilePrivateType *Private = GifFile->Private;
if (!LineLen)
LineLen = GifFile->Image.Width;
@@ -492,7 +492,7 @@
GifByteType ** Extension) {
GifByteType Buf;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+ GifFilePrivateType *Private = GifFile->Private;
if (READ(GifFile, &Buf, 1) != 1) {
return GIF_ERROR;
@@ -536,7 +536,7 @@
GifByteType ** CodeBlock) {
GifByteType Buf;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+ GifFilePrivateType *Private = GifFile->Private;
if (READ(GifFile, &Buf, 1) != 1) {
return GIF_ERROR;
@@ -566,7 +566,7 @@
int i, BitsPerPixel;
GifByteType CodeSize;
GifPrefixType *Prefix;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+ GifFilePrivateType *Private = GifFile->Private;
READ(GifFile, &CodeSize, 1); /* Read Code size from file. */
BitsPerPixel = CodeSize;
@@ -605,7 +605,7 @@
int j, CrntCode, EOFCode, ClearCode, CrntPrefix, LastCode, StackPtr;
GifByteType *Stack, *Suffix;
GifPrefixType *Prefix;
- GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+ GifFilePrivateType *Private = GifFile->Private;
StackPtr = Private->StackPtr;
Prefix = Private->Prefix;
@@ -744,7 +744,7 @@
DGifDecompressInput(GifFileType * GifFile,
int *Code) {
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+ GifFilePrivateType *Private = GifFile->Private;
GifByteType NextByte;
static const unsigned short CodeMasks[] = {
@@ -973,7 +973,7 @@
if (GifFile == NULL)
return GIF_ERROR;
- Private = (GifFilePrivateType *) GifFile->Private;
+ Private = GifFile->Private;
if (GifFile->Image.ColorMap) {
FreeMapObject(GifFile->Image.ColorMap);
Modified: trunk/reactos/dll/win32/oleaut32/usrmarshal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/usrmars…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -784,7 +784,7 @@
{
BSTR* lpBstr;
- for (lpBstr = (BSTR*)psa->pvData; ulCellCount; ulCellCount--,
lpBstr++)
+ for (lpBstr = psa->pvData; ulCellCount; ulCellCount--, lpBstr++)
size = BSTR_UserSize(pFlags, size, lpBstr);
break;
@@ -798,7 +798,7 @@
{
VARIANT* lpVariant;
- for (lpVariant = (VARIANT*)psa->pvData; ulCellCount; ulCellCount--,
lpVariant++)
+ for (lpVariant = psa->pvData; ulCellCount; ulCellCount--,
lpVariant++)
size = VARIANT_UserSize(pFlags, size, lpVariant);
break;
@@ -897,7 +897,7 @@
{
BSTR* lpBstr;
- for (lpBstr = (BSTR*)psa->pvData; ulCellCount; ulCellCount--,
lpBstr++)
+ for (lpBstr = psa->pvData; ulCellCount; ulCellCount--, lpBstr++)
Buffer = BSTR_UserMarshal(pFlags, Buffer, lpBstr);
break;
@@ -911,7 +911,7 @@
{
VARIANT* lpVariant;
- for (lpVariant = (VARIANT*)psa->pvData; ulCellCount;
ulCellCount--, lpVariant++)
+ for (lpVariant = psa->pvData; ulCellCount; ulCellCount--,
lpVariant++)
Buffer = VARIANT_UserMarshal(pFlags, Buffer, lpVariant);
break;
@@ -1052,7 +1052,7 @@
{
BSTR* lpBstr;
- for (lpBstr = (BSTR*)(*ppsa)->pvData; cell_count; cell_count--,
lpBstr++)
+ for (lpBstr = (*ppsa)->pvData; cell_count; cell_count--, lpBstr++)
Buffer = BSTR_UserUnmarshal(pFlags, Buffer, lpBstr);
break;
@@ -1066,7 +1066,7 @@
{
VARIANT* lpVariant;
- for (lpVariant = (VARIANT*)(*ppsa)->pvData; cell_count; cell_count--,
lpVariant++)
+ for (lpVariant = (*ppsa)->pvData; cell_count; cell_count--,
lpVariant++)
Buffer = VARIANT_UserUnmarshal(pFlags, Buffer, lpVariant);
break;
Modified: trunk/reactos/dll/win32/oleaut32/varformat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/varform…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/varformat.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/varformat.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -462,7 +462,7 @@
LPCNAMED_FORMAT fmt;
key.name = lpszFormat;
- fmt = (LPCNAMED_FORMAT)bsearch(&key, VARIANT_NamedFormats,
+ fmt = bsearch(&key, VARIANT_NamedFormats,
sizeof(VARIANT_NamedFormats)/sizeof(NAMED_FORMAT),
sizeof(NAMED_FORMAT), FormatCompareFn);
return fmt ? fmt->format : NULL;
Modified: trunk/reactos/dll/win32/oleaut32/vartype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/vartype…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] Tue Mar 3 12:12:43 2009
@@ -82,7 +82,7 @@
else if (fract == -0.5) { typ is_odd = (typ)whole & 1; res = whole - is_odd; } \
else if (fract > -0.5) res = (typ)whole; \
else res = (typ)whole - (typ)1; \
-} while(0);
+} while(0)
/* Coerce VT_BSTR to a numeric type */
@@ -3265,7 +3265,7 @@
* Success: S_OK.
* Failure: E_INVALIDARG, if the source value is invalid.
*/
-HRESULT WINAPI VarR8FromDec(DECIMAL* pDecIn, double *pDblOut)
+HRESULT WINAPI VarR8FromDec(const DECIMAL* pDecIn, double *pDblOut)
{
BYTE scale = DEC_SCALE(pDecIn);
double divisor = 1.0, highPart;
@@ -3980,9 +3980,9 @@
_VarR8FromCy(cyIn, &d);
d = d * div;
- VARIANT_DutchRound(LONGLONG, d, pCyOut->int64)
+ VARIANT_DutchRound(LONGLONG, d, pCyOut->int64);
d = (double)pCyOut->int64 / div * CY_MULTIPLIER_F;
- VARIANT_DutchRound(LONGLONG, d, pCyOut->int64)
+ VARIANT_DutchRound(LONGLONG, d, pCyOut->int64);
return S_OK;
}
}
@@ -5662,6 +5662,9 @@
*/
HRESULT WINAPI VarDecFix(const DECIMAL* pDecIn, DECIMAL* pDecOut)
{
+ double dbl;
+ HRESULT hr;
+
if (DEC_SIGN(pDecIn) & ~DECIMAL_NEG)
return E_INVALIDARG;
@@ -5671,8 +5674,13 @@
return S_OK;
}
- FIXME("semi-stub!\n");
- return DISP_E_OVERFLOW;
+ hr = VarR8FromDec(pDecIn, &dbl);
+ if (SUCCEEDED(hr)) {
+ LONGLONG rounded = dbl;
+
+ hr = VarDecFromI8(rounded, pDecOut);
+ }
+ return hr;
}
/************************************************************************
@@ -5694,14 +5702,22 @@
*/
HRESULT WINAPI VarDecInt(const DECIMAL* pDecIn, DECIMAL* pDecOut)
{
+ double dbl;
+ HRESULT hr;
+
if (DEC_SIGN(pDecIn) & ~DECIMAL_NEG)
return E_INVALIDARG;
if (!(DEC_SIGN(pDecIn) & DECIMAL_NEG) || !DEC_SCALE(pDecIn))
return VarDecFix(pDecIn, pDecOut); /* The same, if +ve or no fractionals */
- FIXME("semi-stub!\n");
- return DISP_E_OVERFLOW;
+ hr = VarR8FromDec(pDecIn, &dbl);
+ if (SUCCEEDED(hr)) {
+ LONGLONG rounded = dbl >= 0.0 ? dbl + 0.5 : dbl - 0.5;
+
+ hr = VarDecFromI8(rounded, pDecOut);
+ }
+ return hr;
}
/************************************************************************