Replaced NULL macros with nullptr.
Added basic implementation for a static buffer, fixed some invalid nullptr to DWORD parameters.