8 Jul
2004
8 Jul
'04
5:10 p.m.
On Thu, 08 Jul 2004 18:58:57 -0400, Andrei Barbu wrote:
It doesn't have to return that memory, DX functions work by taking parameters they modify. In essence, that's the point, modifying pParameters and returning D3D_OK
Right, what he means is that the parameter is basically a pointer to a pointer, so you have this: HRESULT SomeFunc(void **output) { output = HeapAlloc(GetProcessHeap(), 0, sizeof(whatever)); // that is wrong, as you are just modifying a local argument. // the pointer to the new memory will be lost when the function exits *output = HeapAlloc(GetProcessHeap(), 0, sizeof(whatever)); // that's right, as you're now assigning to the location pointed // to by output } thanks -mike