Microsoft DirectX 9.0


This topic applies to Windows XP Service Pack 1 only.

The SetAllocator method specifies an allocator-presenter for the VMR as an IUnknown pointer.

This method is provided for Automation clients. C++ applications can also use the _SetAllocator method, which takes an IVMRSurfaceAllocator pointer.


HRESULT SetAllocator(
    IUnknown *pAllocPresent,
    long ID = -1



[in]  Pointer to the IUnknown interface of the allocator-presenter object.


[in]  Optionally, specifies an identifier (ID) for the allocator-presenter object. The default value of -1 indicates that the MSVidVideoRenderer object will create an ID when it builds the filter graph. In that case, the MSVidVideoRenderer object uses the lower 32 bits of the allocator-presenter's IUnknown interface pointer as the ID. Note that the ID is for application use; the VMR does not use it.

Return Values

Returns an HRESULT value. Possible values include the following.

Value Description
S_OK Success.

See Also