[MSWSOCK] Rearrange the function places to avoid forward declarations and code formatting