Use GetLastError() to detect if win32 api functions failed.
Update Headers