a few more functions for Mac and Win32 with tests

Ported a few of the Mac functions, then I realized that Win32 would be more useful so switched to working on them instead.