Exemple #1
0
static HRESULT STDCALL COutputPin_GetAllocator(IMemInputPin* This,
					 /* [out] */ IMemAllocator** ppAllocator)
{
    Debug printf("COutputPin_GetAllocator(%p, %p) called\n", This->vt, ppAllocator);
    *ppAllocator = (IMemAllocator*) MemAllocatorCreate();
    return 0;
}
static long MemAllocator_CreateAllocator(GUID* clsid, const GUID* iid, void** ppv)
{
    IMemAllocator* p;
    int result;
    if (!ppv)
	return -1;
    *ppv = 0;
    if (memcmp(clsid, &CLSID_MemoryAllocator, sizeof(GUID)))
	return -1;

    p = (IMemAllocator*) MemAllocatorCreate();
    result = p->vt->QueryInterface((IUnknown*)p, iid, ppv);
    p->vt->Release((IUnknown*)p);

    return result;
}