Fix up x64 porting issues

- Using DWORD s as pointers doesn't work.
- int and size_t have changed relative sizes, causing lots of build
warnings.