Lines Matching defs:This
34 NineUnknown_ctor( struct NineUnknown *This,
38 This->refs = 0;
39 This->forward = true;
40 This->bind = 0;
43 This->refs = 0;
44 This->forward = false;
45 This->bind = 1;
47 This->refs = 1;
48 This->forward = false;
49 This->bind = 0;
52 This->container = pParams->container;
53 This->device = pParams->device;
54 if (This->refs && This->device)
55 NineUnknown_AddRef(NineUnknown(This->device));
57 This->vtable = pParams->vtable;
58 This->vtable_internal = pParams->vtable;
59 This->guids = pParams->guids;
60 This->dtor = pParams->dtor;
62 This->pdata = _mesa_hash_table_create(NULL, ht_guid_hash, ht_guid_compare);
63 if (!This->pdata)
70 NineUnknown_dtor( struct NineUnknown *This )
72 if (This->refs && This->device) /* Possible only if early exit after a ctor failed */
73 (void) NineUnknown_Release(NineUnknown(This->device));
75 if (This->pdata)
76 _mesa_hash_table_destroy(This->pdata, ht_guid_delete);
78 FREE(This);
82 NineUnknown_QueryInterface( struct NineUnknown *This,
89 DBG("This=%p riid=%p id=%s ppvObject=%p\n",
90 This, riid, riid ? GUID_sprintf(guid_str, riid) : "", ppvObject);
97 if (GUID_equal(This->guids[i], riid)) {
98 *ppvObject = This;
100 * zero refcount. This can happen if the app released all references
103 NineUnknown_AddRef(This);
106 } while (This->guids[++i]);
113 NineUnknown_AddRef( struct NineUnknown *This )
116 if (This->forward)
117 return NineUnknown_AddRef(This->container);
119 r = p_atomic_inc_return(&This->refs);
122 if (This->device)
123 NineUnknown_AddRef(NineUnknown(This->device));
129 NineUnknown_Release( struct NineUnknown *This )
131 if (This->forward)
132 return NineUnknown_Release(This->container);
134 /* Cannot decrease lower than 0. This is a thing
138 if (!p_atomic_read(&This->refs))
141 ULONG r = p_atomic_dec_return(&This->refs);
144 struct NineDevice9 *device = This->device;
147 if (!This->container && This->bind == 0) {
148 This->dtor(This);
160 NineUnknown_ReleaseWithDtorLock( struct NineUnknown *This )
162 if (This->forward)
163 return NineUnknown_ReleaseWithDtorLock(This->container);
165 ULONG r = p_atomic_dec_return(&This->refs);
168 struct NineDevice9 *device = This->device;
170 if (!This->container && This->bind == 0) {
172 This->dtor(This);
183 NineUnknown_GetDevice( struct NineUnknown *This,
187 NineUnknown_AddRef(NineUnknown(This->device));
188 *ppDevice = (IDirect3DDevice9 *)This->device;
193 NineUnknown_SetPrivateData( struct NineUnknown *This,
204 DBG("This=%p GUID=%s pData=%p SizeOfData=%u Flags=%x\n",
205 This, GUID_sprintf(guid_str, refguid), pData, SizeOfData, Flags);
218 NineUnknown_FreePrivateData(This, refguid);
233 _mesa_hash_table_insert(This->pdata, &header->guid, header);
239 NineUnknown_GetPrivateData( struct NineUnknown *This,
250 DBG("This=%p GUID=%s pData=%p pSizeOfData=%p\n",
251 This, GUID_sprintf(guid_str, refguid), pData, pSizeOfData);
255 entry = _mesa_hash_table_search(This->pdata, refguid);
283 NineUnknown_FreePrivateData( struct NineUnknown *This,
289 DBG("This=%p GUID=%s\n", This, GUID_sprintf(guid_str, refguid));
293 entry = _mesa_hash_table_search(This->pdata, refguid);
301 _mesa_hash_table_remove(This->pdata, entry);