- Sync ole32 and oleaut32 with Wine head

svn path=/trunk/; revision=39853
This commit is contained in:
Dmitry Chapyshev 2009-03-03 09:12:43 +00:00
parent 3909c139ee
commit 472ec17a2f
40 changed files with 247 additions and 232 deletions

View file

@ -80,7 +80,7 @@ AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
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;

View file

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

View file

@ -80,7 +80,7 @@ static HRESULT WINAPI ClassMoniker_QueryInterface(IMoniker* iface,REFIID riid,vo
*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;

View file

@ -1138,7 +1138,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface(
}
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 @@ static LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORM
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 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_QueryInterface
}
else if(IsEqualIID(riid, &IID_IEnumFORMATETC))
{
*ppvObj = (IDataObject*)This;
*ppvObj = This;
}
if(*ppvObj)

View file

@ -226,12 +226,6 @@ static HRESULT COMCAT_IsClassOfCategories(
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 @@ static HRESULT WINAPI COMCAT_IClassFactory_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory))
{
*ppvObj = (LPVOID)iface;
*ppvObj = iface;
IUnknown_AddRef(iface);
return S_OK;
}
@ -847,7 +841,7 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_QueryInterface(
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 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_QueryInterface(
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 @@ static ULONG WINAPI COMCAT_CLSID_IEnumGUID_Release(LPENUMGUID iface)
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 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Clone(
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 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IEnumGUID))
{
*ppvObj = (LPVOID)iface;
*ppvObj = iface;
COMCAT_CATID_IEnumGUID_AddRef(iface);
return S_OK;
}

View file

@ -115,9 +115,9 @@ CompositeMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject
)
*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)

View file

@ -892,26 +892,26 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface(
}
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;
}
/*

View file

@ -206,11 +206,11 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
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;

View file

@ -95,7 +95,7 @@ static BSTR ERRORINFO_SysAllocString(const OLECHAR* in)
stringBuffer = (WCHAR*)newBuffer;
stringBuffer[len] = 0;
return (LPWSTR)stringBuffer;
return stringBuffer;
}
/* this code is from SysFreeString (ole2disp.c in oleaut32)*/
@ -163,9 +163,9 @@ static inline ErrorInfoImpl *impl_from_ISupportErrorInfo( ISupportErrorInfo *ifa
/*
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)
{

View file

@ -92,7 +92,7 @@ FileMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
*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 @@ FileMonikerImpl_BindToObject(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft
/* 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);
}

View file

@ -46,8 +46,8 @@ typedef struct _FTMarshalImpl {
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 )
{

View file

@ -308,7 +308,7 @@ GITCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid, LPVOID *ppv)
if (IsEqualIID(riid,&IID_IUnknown) ||
IsEqualIID(riid,&IID_IGlobalInterfaceTable))
{
*ppv = (LPVOID)iface;
*ppv = iface;
return S_OK;
}
return E_NOINTERFACE;

View file

@ -151,7 +151,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_QueryInterface(
IsEqualIID(&IID_ISequentialStream, riid) ||
IsEqualIID(&IID_IStream, riid))
{
*ppvObject = (IStream*)This;
*ppvObject = This;
}
/*

View file

@ -148,7 +148,7 @@ static HRESULT WINAPI IMalloc_fnQueryInterface(LPMALLOC iface,REFIID refiid,LPVO
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 @@ static HRESULT WINAPI IMallocSpy_fnQueryInterface(LPMALLOCSPY iface,REFIID refii
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;

View file

@ -176,7 +176,7 @@ HRESULT WINAPI ItemMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void**
*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;

View file

@ -216,7 +216,7 @@ static HRESULT WINAPI ClientIdentity_QueryInterface(IMultiQI * iface, REFIID rii
mqi.pIID = riid;
hr = IMultiQI_QueryMultipleInterfaces(iface, 1, &mqi);
*ppv = (void *)mqi.pItf;
*ppv = mqi.pItf;
return hr;
}
@ -837,19 +837,19 @@ static HRESULT proxy_manager_query_local_interface(struct proxy_manager * This,
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 @@ static HRESULT proxy_manager_create_ifproxy(
* 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 @@ StdMarshalImpl_MarshalInterface(
/* 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 @@ static HRESULT WINAPI StdMarshalCF_QueryInterface(LPCLASSFACTORY iface,
*ppv = NULL;
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
{
*ppv = (LPVOID)iface;
*ppv = iface;
return S_OK;
}
return E_NOINTERFACE;

View file

@ -289,7 +289,7 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_QueryInterface(
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_ILockBytes))
{
*ppvObject = (ILockBytes*)This;
*ppvObject = This;
}
/*

View file

@ -316,7 +316,7 @@ RunningObjectTableImpl_QueryInterface(IRunningObjectTable* iface,
if (IsEqualIID(&IID_IUnknown, riid) ||
IsEqualIID(&IID_IRunningObjectTable, riid))
*ppvObject = (IRunningObjectTable*)This;
*ppvObject = This;
if ((*ppvObject)==0)
return E_NOINTERFACE;
@ -1291,10 +1291,10 @@ static HRESULT WINAPI EnumMonikerImpl_QueryInterface(IEnumMoniker* iface,REFIID
*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;

View file

@ -500,15 +500,10 @@ HRESULT WINAPI DoDragDrop (
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 @@ static LRESULT WINAPI OLEDD_DragTrackerWindowProc(
{
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 @@ static LRESULT WINAPI OLEDD_DragTrackerWindowProc(
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 @@ static LRESULT WINAPI OLEDD_DragTrackerWindowProc(
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 @@ BSTR WINAPI PropSysAllocString(LPCOLESTR str)
stringBuffer = (WCHAR*)newBuffer;
stringBuffer[len] = '\0';
return (LPWSTR)stringBuffer;
return stringBuffer;
}
/***********************************************************************
@ -2901,9 +2896,9 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */
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:

View file

@ -256,7 +256,7 @@ static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface(
else if(IsEqualIID(riid, &IID_IOleAdviseHolder))
{
/* IOleAdviseHolder */
*ppvObj = (IOleAdviseHolder*) This;
*ppvObj = This;
}
if(*ppvObj == NULL)

View file

@ -440,7 +440,7 @@ static HRESULT WINAPI RpcChannelBuffer_QueryInterface(LPRPCCHANNELBUFFER iface,
*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 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
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 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
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 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
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 @@ static HRESULT WINAPI ServerRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac
/* 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 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac
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 @@ static HRESULT WINAPI ServerRpcChannelBuffer_FreeBuffer(LPRPCCHANNELBUFFER iface
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 @@ static HRESULT WINAPI ClientRpcChannelBuffer_FreeBuffer(LPRPCCHANNELBUFFER iface
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 @@ static HRESULT unmarshal_ORPC_EXTENT_ARRAY(RPC_MESSAGE *msg, const char *end,
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 @@ void RPC_ExecuteCall(struct dispatch_params *params)
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 @@ struct local_server_params
/* 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;

View file

@ -927,23 +927,23 @@ static HRESULT WINAPI IPropertyStorage_fnStat(
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 int PropertyStorage_PropCompare(const void *a, const void *b,
static void PropertyStorage_PropertyDestroy(void *k, void *d, void *extra)
{
PropVariantClear((PROPVARIANT *)d);
PropVariantClear(d);
HeapFree(GetProcessHeap(), 0, d);
}
@ -1486,8 +1486,8 @@ struct DictionaryClosure
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 @@ struct PropertyClosure
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);

View file

@ -126,7 +126,7 @@ static HRESULT WINAPI StgStreamImpl_QueryInterface(
IsEqualIID(&IID_ISequentialStream, riid) ||
IsEqualIID(&IID_IStream, riid))
{
*ppvObject = (IStream*)This;
*ppvObject = This;
}
/*

View file

@ -1287,7 +1287,7 @@ HRESULT CDECL IStream16_fnWrite(
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;

View file

@ -314,11 +314,11 @@ static HRESULT WINAPI StorageBaseImpl_QueryInterface(
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 @@ static HRESULT deleteStreamProperty(
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 @@ static HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface(
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 @@ static ULONG IEnumSTATSTGImpl_FindProperty(
currentSearchNode,
currentProperty);
if ( propertyNameCmp(
(const OLECHAR*)currentProperty->name, lpszPropName) == 0)
if (propertyNameCmp(currentProperty->name, lpszPropName) == 0)
return currentSearchNode;
/*
@ -4344,7 +4338,7 @@ void StorageUtl_CopyPropertyToSTATSTG(
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 @@ HRESULT BlockChainStream_WriteAt(BlockChainStream* This,
}
*bytesWritten = 0;
bufferWalker = (const BYTE*)buffer;
bufferWalker = buffer;
while ( (size > 0) && (blockIndex != BLOCK_END_OF_CHAIN) )
{
@ -5368,7 +5362,7 @@ HRESULT SmallBlockChainStream_WriteAt(
* 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 @@ static HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM
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 @@ static HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM
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 @@ static HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM
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 @@ static HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREA
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;

View file

@ -606,7 +606,7 @@ static HRESULT WINAPI RemUnknown_QueryInterface(IRemUnknown *iface, REFIID riid,
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IRemUnknown))
{
*ppv = (LPVOID)iface;
*ppv = iface;
IRemUnknown_AddRef(iface);
return S_OK;
}

View file

@ -105,7 +105,7 @@ ULONG __RPC_USER CLIPFORMAT_UserSize(ULONG *pFlags, ULONG StartingSize, CLIPFORM
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 @@ ULONG __RPC_USER CLIPFORMAT_UserSize(ULONG *pFlags, ULONG StartingSize, CLIPFORM
{
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 @@ ULONG __RPC_USER CLIPFORMAT_UserSize(ULONG *pFlags, ULONG StartingSize, CLIPFORM
*/
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 @@ unsigned char * __RPC_USER CLIPFORMAT_UserMarshal(ULONG *pFlags, unsigned char *
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_UserMarshal(ULONG *pFlags, unsigned char *
*/
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));

View file

@ -161,9 +161,9 @@ static HRESULT WINAPI ConnectionPointImpl_QueryInterface(
* 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 @@ static HRESULT WINAPI EnumConnectionsImpl_QueryInterface(
* 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.

View file

@ -233,7 +233,7 @@ static HRESULT WINAPI StdDispatch_QueryInterface(
if (IsEqualIID(riid, &IID_IDispatch) ||
IsEqualIID(riid, &IID_IUnknown))
{
*ppvObject = (LPVOID)This;
*ppvObject = This;
IUnknown_AddRef((LPUNKNOWN)*ppvObject);
return S_OK;
}

View file

@ -266,7 +266,7 @@ BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
stringBuffer = (WCHAR*)newBuffer;
stringBuffer[len] = '\0';
return (LPWSTR)stringBuffer;
return stringBuffer;
}
/******************************************************************************
@ -706,7 +706,7 @@ static HRESULT WINAPI PSDispatchFacBuf_QueryInterface(IPSFactoryBuffer *iface, R
IsEqualIID(riid, &IID_IPSFactoryBuffer))
{
IUnknown_AddRef(iface);
*ppv = (void *)iface;
*ppv = iface;
return S_OK;
}
return E_NOINTERFACE;

View file

@ -351,21 +351,21 @@ static HRESULT WINAPI OLEFontImpl_QueryInterface(
* 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 const IClassFactoryVtbl SFCF_Vtbl = {
};
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; }

View file

@ -459,15 +459,15 @@ static HRESULT WINAPI OLEPictureImpl_QueryInterface(
* 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 @@ struct gifdata {
};
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 @@ static int serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLengt
*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 const IClassFactoryVtbl SPCF_Vtbl = {
};
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; }

View file

@ -237,7 +237,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordClear(IRecordInfo *iface, PVOID pvEx
*(void**)var = NULL;
break;
case VT_SAFEARRAY:
SafeArrayDestroy((SAFEARRAY*)var);
SafeArrayDestroy(var);
break;
default:
FIXME("Not supported vt = %d\n", This->fields[i].vt);

View file

@ -299,7 +299,7 @@ static HRESULT SAFEARRAY_DestroyData(SAFEARRAY *psa, ULONG ulStartCell)
if (SUCCEEDED(SafeArrayGetRecordInfo(psa, &lpRecInfo)))
{
PBYTE pRecordData = (PBYTE)psa->pvData;
PBYTE pRecordData = psa->pvData;
while(ulCellCount--)
{
IRecordInfo_RecordClear(lpRecInfo, pRecordData);
@ -350,8 +350,8 @@ static HRESULT SAFEARRAY_CopyData(SAFEARRAY *psa, SAFEARRAY *dest)
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 @@ static HRESULT SAFEARRAY_CopyData(SAFEARRAY *psa, SAFEARRAY *dest)
}
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 @@ static HRESULT SAFEARRAY_CopyData(SAFEARRAY *psa, SAFEARRAY *dest)
if (psa->fFeatures & (FADF_UNKNOWN|FADF_DISPATCH))
{
LPUNKNOWN *lpUnknown = (LPUNKNOWN *)dest->pvData;
LPUNKNOWN *lpUnknown = dest->pvData;
while(ulCellCount--)
{
@ -596,7 +596,7 @@ SAFEARRAY* WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabo
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 SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElement
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 @@ HRESULT WINAPI SafeArrayPutElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
{
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 @@ HRESULT WINAPI SafeArrayPutElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
else if (psa->fFeatures & FADF_BSTR)
{
BSTR lpBstr = (BSTR)pvData;
BSTR* lpDest = (BSTR*)lpvDest;
BSTR* lpDest = lpvDest;
SysFreeString(*lpDest);
@ -874,8 +874,8 @@ HRESULT WINAPI SafeArrayPutElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
{
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 @@ HRESULT WINAPI SafeArrayGetElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
{
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 @@ HRESULT WINAPI SafeArrayGetElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
}
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 @@ HRESULT WINAPI SafeArrayGetElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
{
if (psa->fFeatures & (FADF_UNKNOWN|FADF_DISPATCH))
{
LPUNKNOWN *lpUnknown = (LPUNKNOWN *)lpvSrc;
LPUNKNOWN *lpUnknown = lpvSrc;
if (*lpUnknown)
IUnknown_AddRef(*lpUnknown);

View file

@ -254,7 +254,7 @@ fail:
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 @@ TMProxyImpl_QueryInterface(LPRPCPROXYBUFFER iface, REFIID riid, LPVOID *ppv)
{
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 @@ static HRESULT WINAPI TMarshalDispatchChannel_QueryInterface(LPRPCCHANNELBUFFER
*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 @@ PSFacBuf_CreateProxy(
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 @@ static HRESULT WINAPI
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;
}

View file

@ -396,7 +396,7 @@ HRESULT WINAPI LoadTypeLibEx(
/* 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 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength)
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 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength)
}
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 @@ static HRESULT WINAPI ITypeInfo_fnGetTypeAttr( ITypeInfo2 *iface,
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 @@ DispCallFunc(
#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) \

View file

@ -350,7 +350,7 @@ DGifGetImageDesc(GifFileType * GifFile) {
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 @@ DGifGetLine(GifFileType * GifFile,
int LineLen) {
GifByteType *Dummy;
GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
GifFilePrivateType *Private = GifFile->Private;
if (!LineLen)
LineLen = GifFile->Image.Width;
@ -492,7 +492,7 @@ DGifGetExtensionNext(GifFileType * GifFile,
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 @@ DGifGetCodeNext(GifFileType * GifFile,
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 @@ DGifSetupDecompress(GifFileType * GifFile) {
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 @@ DGifDecompressLine(GifFileType * GifFile,
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 @@ static int
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 @@ DGifCloseFile(GifFileType * GifFile) {
if (GifFile == NULL)
return GIF_ERROR;
Private = (GifFilePrivateType *) GifFile->Private;
Private = GifFile->Private;
if (GifFile->Image.ColorMap) {
FreeMapObject(GifFile->Image.ColorMap);

View file

@ -784,7 +784,7 @@ ULONG WINAPI LPSAFEARRAY_UserSize(ULONG *pFlags, ULONG StartingSize, LPSAFEARRAY
{
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 @@ ULONG WINAPI LPSAFEARRAY_UserSize(ULONG *pFlags, ULONG StartingSize, LPSAFEARRAY
{
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 @@ unsigned char * WINAPI LPSAFEARRAY_UserMarshal(ULONG *pFlags, unsigned char *Buf
{
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 @@ unsigned char * WINAPI LPSAFEARRAY_UserMarshal(ULONG *pFlags, unsigned char *Buf
{
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 @@ unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(ULONG *pFlags, unsigned char *B
{
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 @@ unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(ULONG *pFlags, unsigned char *B
{
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;

View file

@ -462,7 +462,7 @@ static inline const BYTE *VARIANT_GetNamedFormat(LPCWSTR lpszFormat)
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;

View file

@ -82,7 +82,7 @@ static inline void VARIANT_CopyData(const VARIANT *srcVar, VARTYPE vt, void *pOu
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 @@ HRESULT WINAPI VarR8FromUI4(ULONG ulIn, double *pDblOut)
* 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 @@ HRESULT WINAPI VarCyRound(const CY cyIn, int cDecimals, CY* pCyOut)
_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 VarDecAbs(const DECIMAL* pDecIn, DECIMAL* pDecOut)
*/
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 @@ HRESULT WINAPI VarDecFix(const DECIMAL* pDecIn, DECIMAL* pDecOut)
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 VarDecFix(const DECIMAL* pDecIn, DECIMAL* pDecOut)
*/
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;
}
/************************************************************************