fix the return value struct.
separate struct and func due to the lack of syscall on windows.
add windows stub.