Replaced more MS secure functions with standards.
Converted more functions to standards.