Switch to /W4.

Fix the C4100 warnings.
Remove unused variables.
Remove unneeded code for old OS.