os_windows: implement type querying and fix queries