Commit some better debug code for winapi