On Mo, 2007-06-11 at 11:54 -0700, Evan Stade wrote:
+GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics) +{
- if(hdc == NULL)
return OutOfMemory;
- if(graphics == NULL)
return InvalidParameter;
- *graphics = (GpGraphics*) HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof(GpGraphics));
- (*graphics)->hdc = hdc;
- (*graphics)->hwnd = NULL;
There is no need to set a member to NULL, when you use HEAP_ZERO_MEMORY.
On 6/12/07, Detlef Riekenberg wine.dev@web.de wrote:
On Mo, 2007-06-11 at 11:54 -0700, Evan Stade wrote:
+GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics) +{
- if(hdc == NULL)
return OutOfMemory;
- if(graphics == NULL)
return InvalidParameter;
- *graphics = (GpGraphics*) HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof(GpGraphics));
- (*graphics)->hdc = hdc;
- (*graphics)->hwnd = NULL;
There is no need to set a member to NULL, when you use HEAP_ZERO_MEMORY.
The more important point is that we probably shouldn't be using HEAP_ZERO_MEMORY here at all.