Fixed a forward declared windows struct type, and added a cast that was needed when malloc'ing to create a "CRITICAL_SECTION".