"James Hawkins" truiken@gmail.com wrote:
+#define HH_Alloc(size) ((LPVOID)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size))
+#define HH_Free(buffer) \
- if (buffer) \
HeapFree(GetProcessHeap(), 0, (HLOCAL)buffer);
Alot of work has been done to avoid tests for NULL before HeapFree call, please do not introduce them again. Personally I don't see the point of HH_Alloc and HH_Free macros at all.
+#define HH_SafeRelease(x) \
- if (x) \
- { \
x->lpVtbl->Release(x); \
x = NULL; \
- }
Again, a direct access to a vtable. There is no much point in that macro either, do that check directly instead and get rid of hhctrl.h completely.