fix compiling on Windows.

use windows api which requires at least Windows Vista.