Added api hooks for Memory and GDI object allocation functions & some bug fixes.