Needs a fix for 64-bit, length is a DWORD not size_t.