Moved allocation and freeing of Win structs into windows library.