Removed AnsiToWideString local function and replaced with ConvertToUnicode, fixed a bug in WTSQuerySessionInformationW, and added exception handler