On 8/29/19 4:46 PM, Jactry Zeng wrote:
+HRESULT WINAPI MFCreateDXGIDeviceManager(UINT *token, IMFDXGIDeviceManager **manager) +{
- struct dxgi_device_manager *object;
- TRACE("(%p, %p).\n", token, manager);
- if (!token || !manager)
return E_POINTER;
- object = heap_alloc(sizeof(*object));
- if (!object)
return E_OUTOFMEMORY;
- object->IMFDXGIDeviceManager_iface.lpVtbl = &dxgi_device_manager_vtbl;
- object->refcount = 1;
- object->token = MFGetSystemTime() >> 16;
- TRACE("Created device manager: %p, token: %u.\n", object, object->token);
- *token = object->token;
- *manager = &object->IMFDXGIDeviceManager_iface;
- return S_OK;
+}
Why 16? I still think it'd be better to use something more predictable, like sequentially incremented global counter.
I'll take a look, maybe it's easy to get "right" pattern for it.