Invalid characters for WTSQuerySessionInformation?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Windows XP, probably SP2.

We have been told that in some foreign versions of Windows XP, the Unicode version of WTSQuerySessionInformationW is failing to retrieve a username if the name includes an at sign "@".

I am thinking of preparing a test to find which characters WTSQuerySessionInformationW can't deal with. Intuitively I feel that Unicode characters "$", backslash, forward slash, quotation mark, and a few others might also be troublesome. But first I tried to find if there's any documentation on such restrictions, and couldn't find any.

Also intuitively I think there are probably other APIs that need testing too. We've already abandoned use of WTSQuerySessionInformationA, instead calling WTSQuerySessionInformationW and WideCharToMultiByte instead. (I attempted to describe that workaround twice in postings that have been censored from this newsgroup.) Does anyone know what characters are troublesome for any APIs, whether ANSI or Unicode, that deal with usernames?

.



Relevant Pages

  • Re: Invalid characters for WTSQuerySessionInformation?
    ... code page different from Windows' default code page. ... We don't have to validate the username, ... I have discovered that Windows XP properly prevents characters such as ... WTSQuerySessionInformationW and WideCharToMultiByte.) ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Invalid characters for WTSQuerySessionInformation?
    ... and '/' from being used in a username. ... Characters such as '$' and '@' are problematic, ... (By the way this is with the Unicode version WTSQuerySessionInformationW. ... WTSQuerySessionInformationW and WideCharToMultiByte.) ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Invalid characters for WTSQuerySessionInformation?
    ... Characters such as '$' and '@' are problematic, for the reasons that we have discussed. ... But Windows XP permits these characters to be used in a username. ... As mentioned, WTSQuerySessionInformationA fails with quite a lot of characters, so I already made a workaround using WTSQuerySessionInformationW and WideCharToMultiByte.) ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Invalid characters for WTSQuerySessionInformation?
    ... Windows Server 2008 prohibits creating a username that contains an at sign "@". ... We have been told that in some foreign versions of Windows XP, the Unicode version of WTSQuerySessionInformationW is failing to retrieve a username if the name includes an at sign "@". ... Intuitively I feel that Unicode characters "$", backslash, forward slash, quotation mark, and a few others might also be troublesome. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: WTSQuerySessionInformation
    ... at a customer's site, 1 hour to code a workaround, and another 6 hours (so ... If the user that is logged into the session used a username consisting ... entirely of Italian characters, then even the Japanese version of Windows XP ... WTSQuerySessionInformation in order to call WTSQuerySessionInformationW ...
    (microsoft.public.win32.programmer.kernel)