Extracted Device and Device_WIN32

also added WIN32 ifdefs