Ejemplo n.º 1
0
void *CoTaskMemRealloc( void *pvMem, uint32 cb )
{
   /*
    * Note that we don't go through the riff-raff specified above.
    * We know that the allocator object is /always/ present in the
    * process, since we never unload it (regardless of its reference
    * count).  Therefore, there's no point in wasting CPU cycles on it.
    */

   if( initCount != 0 )
	   return IMalloc_Realloc( pTaskMalloc, pvMem, cb );
   else
	   return NULL;
}
Ejemplo n.º 2
0
static void set_buffer(LPWSTR *buffer, LPCWSTR string)
{
    static const WCHAR empty_string[] = {0};
    IMalloc *malloc;
    ULONG cb;

    if (string == NULL)
        string = empty_string;
    CoGetMalloc(1, &malloc);

    cb = (strlenW(string) + 1)*sizeof(WCHAR);
    if (*buffer == NULL || cb > IMalloc_GetSize(malloc, *buffer))
        *buffer = IMalloc_Realloc(malloc, *buffer, cb);
    memcpy(*buffer, string, cb);
}
Ejemplo n.º 3
0
Archivo: ifs.c Proyecto: pstrealer/wine
/***********************************************************************
 *           CoTaskMemRealloc   [OLE32.@]
 *
 * Allocates memory using the current process memory allocator.
 *
 * PARAMS
 *  pvOld [I] Pointer to old memory block.
 *  size  [I] Size of the new memory block.
 *
 * RETURNS
 * 	Success: Pointer to newly allocated memory block.
 *  Failure: NULL.
 */
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, ULONG size)
{
        return IMalloc_Realloc((LPMALLOC)&Malloc32, pvOld, size);
}
Ejemplo n.º 4
0
Archivo: ifs.c Proyecto: RPG-7/reactos
/***********************************************************************
 *           CoTaskMemRealloc   [OLE32.@]
 *
 * Allocates memory using the current process memory allocator.
 *
 * PARAMS
 *  pvOld [I] Pointer to old memory block.
 *  size  [I] Size of the new memory block.
 *
 * RETURNS
 * 	Success: Pointer to newly allocated memory block.
 *  Failure: NULL.
 */
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, ULONG size)
{
        return IMalloc_Realloc(&Malloc32.IMalloc_iface, pvOld, size);
}