ole32: The type of the size of IMalloc'ed blocks is SIZE_T.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-01-19 16:19:09 +00:00 committed by Alexandre Julliard
parent d1841f496b
commit bf5dca1976
5 changed files with 44 additions and 42 deletions

View File

@ -2821,7 +2821,7 @@ static ULONG WINAPI MimeAlloc_Release(
static LPVOID WINAPI MimeAlloc_Alloc( static LPVOID WINAPI MimeAlloc_Alloc(
IMimeAllocator* iface, IMimeAllocator* iface,
ULONG cb) SIZE_T cb)
{ {
return CoTaskMemAlloc(cb); return CoTaskMemAlloc(cb);
} }
@ -2829,7 +2829,7 @@ static LPVOID WINAPI MimeAlloc_Alloc(
static LPVOID WINAPI MimeAlloc_Realloc( static LPVOID WINAPI MimeAlloc_Realloc(
IMimeAllocator* iface, IMimeAllocator* iface,
LPVOID pv, LPVOID pv,
ULONG cb) SIZE_T cb)
{ {
return CoTaskMemRealloc(pv, cb); return CoTaskMemRealloc(pv, cb);
} }
@ -2841,7 +2841,7 @@ static void WINAPI MimeAlloc_Free(
CoTaskMemFree(pv); CoTaskMemFree(pv);
} }
static ULONG WINAPI MimeAlloc_GetSize( static SIZE_T WINAPI MimeAlloc_GetSize(
IMimeAllocator* iface, IMimeAllocator* iface,
LPVOID pv) LPVOID pv)
{ {

View File

@ -112,9 +112,9 @@ static ULONG WINAPI IMAPIMalloc_fnRelease(LPMALLOC iface)
/************************************************************************** /**************************************************************************
* IMAPIMalloc_Alloc * IMAPIMalloc_Alloc
*/ */
static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, DWORD cb) static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, SIZE_T cb)
{ {
TRACE("(%p)->(%d)\n", iface, cb); TRACE("(%p)->(%ld)\n", iface, cb);
return LocalAlloc(LMEM_FIXED, cb); return LocalAlloc(LMEM_FIXED, cb);
} }
@ -122,9 +122,9 @@ static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, DWORD cb)
/************************************************************************** /**************************************************************************
* IMAPIMalloc_Realloc * IMAPIMalloc_Realloc
*/ */
static LPVOID WINAPI IMAPIMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, DWORD cb) static LPVOID WINAPI IMAPIMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, SIZE_T cb)
{ {
TRACE("(%p)->(%p, %d)\n", iface, pv, cb); TRACE("(%p)->(%p, %ld)\n", iface, pv, cb);
if (!pv) if (!pv)
return LocalAlloc(LMEM_FIXED, cb); return LocalAlloc(LMEM_FIXED, cb);
@ -148,7 +148,7 @@ static void WINAPI IMAPIMalloc_fnFree(LPMALLOC iface, LPVOID pv)
/************************************************************************** /**************************************************************************
* IMAPIMalloc_GetSize * IMAPIMalloc_GetSize
*/ */
static DWORD WINAPI IMAPIMalloc_fnGetSize(LPMALLOC iface, LPVOID pv) static SIZE_T WINAPI IMAPIMalloc_fnGetSize(LPMALLOC iface, LPVOID pv)
{ {
TRACE("(%p)->(%p)\n", iface, pv); TRACE("(%p)->(%p)\n", iface, pv);
return LocalSize(pv); return LocalSize(pv);

View File

@ -143,8 +143,8 @@ static BOOL RemoveMemoryLocation(LPCVOID pMem)
/****************************************************************************** /******************************************************************************
* IMalloc32_QueryInterface [VTABLE] * IMalloc32_QueryInterface [VTABLE]
*/ */
static HRESULT WINAPI IMalloc_fnQueryInterface(LPMALLOC iface,REFIID refiid,LPVOID *obj) { static HRESULT WINAPI IMalloc_fnQueryInterface(IMalloc *iface, REFIID refiid, void **obj)
{
TRACE("(%s,%p)\n",debugstr_guid(refiid),obj); TRACE("(%s,%p)\n",debugstr_guid(refiid),obj);
if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMalloc,refiid)) { if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMalloc,refiid)) {
@ -157,21 +157,22 @@ static HRESULT WINAPI IMalloc_fnQueryInterface(LPMALLOC iface,REFIID refiid,LPVO
/****************************************************************************** /******************************************************************************
* IMalloc32_AddRefRelease [VTABLE] * IMalloc32_AddRefRelease [VTABLE]
*/ */
static ULONG WINAPI IMalloc_fnAddRefRelease (LPMALLOC iface) { static ULONG WINAPI IMalloc_fnAddRefRelease(IMalloc *iface)
{
return 1; return 1;
} }
/****************************************************************************** /******************************************************************************
* IMalloc32_Alloc [VTABLE] * IMalloc32_Alloc [VTABLE]
*/ */
static LPVOID WINAPI IMalloc_fnAlloc(LPMALLOC iface, DWORD cb) { static void * WINAPI IMalloc_fnAlloc(IMalloc *iface, SIZE_T cb)
{
void *addr;
LPVOID addr; TRACE("(%ld)\n",cb);
TRACE("(%d)\n",cb);
if(Malloc32.pSpy) { if(Malloc32.pSpy) {
DWORD preAllocResult; SIZE_T preAllocResult;
EnterCriticalSection(&IMalloc32_SpyCS); EnterCriticalSection(&IMalloc32_SpyCS);
preAllocResult = IMallocSpy_PreAlloc(Malloc32.pSpy, cb); preAllocResult = IMallocSpy_PreAlloc(Malloc32.pSpy, cb);
@ -198,14 +199,14 @@ static LPVOID WINAPI IMalloc_fnAlloc(LPMALLOC iface, DWORD cb) {
/****************************************************************************** /******************************************************************************
* IMalloc32_Realloc [VTABLE] * IMalloc32_Realloc [VTABLE]
*/ */
static LPVOID WINAPI IMalloc_fnRealloc(LPMALLOC iface,LPVOID pv,DWORD cb) { static void * WINAPI IMalloc_fnRealloc(IMalloc *iface, void *pv, SIZE_T cb)
{
void *pNewMemory;
LPVOID pNewMemory; TRACE("(%p,%ld)\n",pv,cb);
TRACE("(%p,%d)\n",pv,cb);
if(Malloc32.pSpy) { if(Malloc32.pSpy) {
LPVOID pRealMemory; void *pRealMemory;
BOOL fSpyed; BOOL fSpyed;
EnterCriticalSection(&IMalloc32_SpyCS); EnterCriticalSection(&IMalloc32_SpyCS);
@ -250,8 +251,8 @@ static LPVOID WINAPI IMalloc_fnRealloc(LPMALLOC iface,LPVOID pv,DWORD cb) {
/****************************************************************************** /******************************************************************************
* IMalloc32_Free [VTABLE] * IMalloc32_Free [VTABLE]
*/ */
static VOID WINAPI IMalloc_fnFree(LPMALLOC iface,LPVOID pv) { static void WINAPI IMalloc_fnFree(IMalloc *iface, void *pv)
{
BOOL fSpyed = FALSE; BOOL fSpyed = FALSE;
TRACE("(%p)\n",pv); TRACE("(%p)\n",pv);
@ -286,9 +287,9 @@ static VOID WINAPI IMalloc_fnFree(LPMALLOC iface,LPVOID pv) {
* win95: size allocated (4 byte boundarys) * win95: size allocated (4 byte boundarys)
* win2k: size originally requested !!! (allocated on 8 byte boundarys) * win2k: size originally requested !!! (allocated on 8 byte boundarys)
*/ */
static DWORD WINAPI IMalloc_fnGetSize(LPMALLOC iface,LPVOID pv) { static SIZE_T WINAPI IMalloc_fnGetSize(IMalloc *iface, void *pv)
{
DWORD cb; SIZE_T cb;
BOOL fSpyed = FALSE; BOOL fSpyed = FALSE;
TRACE("(%p)\n",pv); TRACE("(%p)\n",pv);
@ -311,8 +312,8 @@ static DWORD WINAPI IMalloc_fnGetSize(LPMALLOC iface,LPVOID pv) {
/****************************************************************************** /******************************************************************************
* IMalloc32_DidAlloc [VTABLE] * IMalloc32_DidAlloc [VTABLE]
*/ */
static INT WINAPI IMalloc_fnDidAlloc(LPMALLOC iface,LPVOID pv) { static INT WINAPI IMalloc_fnDidAlloc(IMalloc *iface, void *pv)
{
BOOL fSpyed = FALSE; BOOL fSpyed = FALSE;
int didAlloc; int didAlloc;
@ -335,7 +336,8 @@ static INT WINAPI IMalloc_fnDidAlloc(LPMALLOC iface,LPVOID pv) {
/****************************************************************************** /******************************************************************************
* IMalloc32_HeapMinimize [VTABLE] * IMalloc32_HeapMinimize [VTABLE]
*/ */
static VOID WINAPI IMalloc_fnHeapMinimize(LPMALLOC iface) { static void WINAPI IMalloc_fnHeapMinimize(IMalloc *iface)
{
TRACE("()\n"); TRACE("()\n");
if(Malloc32.pSpy) { if(Malloc32.pSpy) {
@ -398,7 +400,7 @@ HRESULT WINAPI CoGetMalloc(DWORD context, IMalloc **imalloc)
* Success: Pointer to newly allocated memory block. * Success: Pointer to newly allocated memory block.
* Failure: NULL. * Failure: NULL.
*/ */
LPVOID WINAPI CoTaskMemAlloc(ULONG size) LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
{ {
return IMalloc_Alloc(&Malloc32.IMalloc_iface,size); return IMalloc_Alloc(&Malloc32.IMalloc_iface,size);
} }
@ -432,7 +434,7 @@ VOID WINAPI CoTaskMemFree(LPVOID ptr)
* Success: Pointer to newly allocated memory block. * Success: Pointer to newly allocated memory block.
* Failure: NULL. * Failure: NULL.
*/ */
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, ULONG size) LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, SIZE_T size)
{ {
return IMalloc_Realloc(&Malloc32.IMalloc_iface, pvOld, size); return IMalloc_Realloc(&Malloc32.IMalloc_iface, pvOld, size);
} }

View File

@ -304,9 +304,9 @@ HRESULT WINAPI CoGetInstanceFromFile(COSERVERINFO* pServerInfo, CLSID* pClsid, I
HRESULT WINAPI CoGetInstanceFromIStorage(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, IStorage* pstg, DWORD dwCount, MULTI_QI* pResults); HRESULT WINAPI CoGetInstanceFromIStorage(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter, DWORD dwClsCtx, IStorage* pstg, DWORD dwCount, MULTI_QI* pResults);
HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC* lpMalloc); HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC* lpMalloc);
LPVOID WINAPI CoTaskMemAlloc(ULONG size) __WINE_ALLOC_SIZE(1); LPVOID WINAPI CoTaskMemAlloc(SIZE_T size) __WINE_ALLOC_SIZE(1);
void WINAPI CoTaskMemFree(LPVOID ptr); void WINAPI CoTaskMemFree(LPVOID ptr);
LPVOID WINAPI CoTaskMemRealloc(LPVOID ptr, ULONG size); LPVOID WINAPI CoTaskMemRealloc(LPVOID ptr, SIZE_T size);
HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy); HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy);
HRESULT WINAPI CoRevokeMallocSpy(void); HRESULT WINAPI CoRevokeMallocSpy(void);

View File

@ -162,16 +162,16 @@ interface IMalloc : IUnknown
typedef [unique] IMalloc *LPMALLOC; typedef [unique] IMalloc *LPMALLOC;
LPVOID Alloc( LPVOID Alloc(
[in] ULONG cb); [in] SIZE_T cb);
LPVOID Realloc( LPVOID Realloc(
[in] LPVOID pv, [in] LPVOID pv,
[in] ULONG cb); [in] SIZE_T cb);
void Free( void Free(
[in] LPVOID pv); [in] LPVOID pv);
ULONG GetSize( SIZE_T GetSize(
[in] LPVOID pv); [in] LPVOID pv);
int DidAlloc(LPVOID pv); int DidAlloc(LPVOID pv);
@ -188,8 +188,8 @@ interface IMallocSpy : IUnknown
{ {
typedef [unique] IMallocSpy *LPMALLOCSPY; typedef [unique] IMallocSpy *LPMALLOCSPY;
ULONG PreAlloc( SIZE_T PreAlloc(
[in] ULONG cbRequest); [in] SIZE_T cbRequest);
LPVOID PostAlloc( LPVOID PostAlloc(
[in] LPVOID pActual); [in] LPVOID pActual);
@ -201,9 +201,9 @@ interface IMallocSpy : IUnknown
void PostFree( void PostFree(
[in] BOOL fSpyed); [in] BOOL fSpyed);
ULONG PreRealloc( SIZE_T PreRealloc(
[in] LPVOID pRequest, [in] LPVOID pRequest,
[in] ULONG cbRequest, [in] SIZE_T cbRequest,
[out] LPVOID *ppNewRequest, [out] LPVOID *ppNewRequest,
[in] BOOL fSpyed); [in] BOOL fSpyed);
@ -215,8 +215,8 @@ interface IMallocSpy : IUnknown
[in] LPVOID pRequest, [in] LPVOID pRequest,
[in] BOOL fSpyed); [in] BOOL fSpyed);
ULONG PostGetSize( SIZE_T PostGetSize(
[in] ULONG cbActual, [in] SIZE_T cbActual,
[in] BOOL fSpyed); [in] BOOL fSpyed);
LPVOID PreDidAlloc( LPVOID PreDidAlloc(