$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
Have you ever tried running the Terminal Server Administration tool (aka TSAdmin) on Windows Vista? You would need it to remotely administer windows 2000/2003 Terminal Servers. If you try to run it you will get an Access Violation but why? I found the answer to this question today because I was testing my TSAdmin replacement on different Windows versions. Just like TSAdmin I use an (undocumented) function from Utildll.dll called ElapsedTimeString. It’s a very simple function that returns a formatted elapsed time string (as seen in the Idle time column from TSAdmin).
While my TSAdminEx ran fine on Windows XP, 2003 and even 2008 it would crash on Vista. Investigation showed that the stack was corrupted in the process of enumerating processes and sessions. Eventually I pinned it down to ElapsedTimeString but could not understand what went wrong. At least not until I investigated Utildll.dll version from Windows Vista. In what was probably an attempt from Microsoft to produce safer code they replaced wsprintfW by StringCchPrintfW. But StringCchPrintfW has an additional parameter (count of characters) so they introduced a new parameter to ElapsedTimeString. Now that’s not a smart decision as this directly breaks compatibility with software that uses this API, but they probably thought that it wasn’t issue since TSAdmin is not included with Vista (I don’t know of any other MS tool that uses this API).
But why doesn’t the Access Violation appear on Server 2008? Is this still using wsprintfW for string formatting? The answer is no, they also use StringCchPrintfW but use a fixed 15 character length. (so they “fixed” the issue).
That leaves you with 2 options if you still want to use TSAdmin on Vista:
For now I’ll leave you with a screenshot (click to enlarge) of the current Beta version. As you can see it returns detailed information in the process tab like Memory Usage, Virtual Memory Usage, CPU Time and Process Age.
11 Responses for "Why TSAdmin crashes on Windows Vista"
Microsoft has documented the Access Violation of TSAdmin!
The Terminal Server Administrator tool does not work on a Windows Vista-based computer because of an access violation. To work around this issue, run Remote Desktop from a Windows Vista-based computer, and connect to another computer that can use Tsadmin.exe. For example, connect to a Microsoft Windows XP-based or a Windows Server 2003-based computer that has the Administration Tools Pack installed.
http://support.microsoft.com/kb/930056/en-us
The API DateTimeSting from Utildll has the same issue on Vista. Server 2008 version of DateTimeString does not take an extra parameter.
Another incompatible API call is QueryCurrentWinStation also from utildll and also called by tsadmin.
Any possible way I can get into a beta test of this? Thanks!
I hope to finish a beta version soon that is ready for testing. Currently I’m rewriting the main code because I decided to drop Delphi TListView and implement TVirtualStringTree component from Mike Lischke. I expect VirtualStringTree to improve development speed.
Hi, I would be very intrested in beta testing TSAdminEx
Thanks
Ron.
Vista is said to up a lot of files to the 2008 versions with sp1.
Maybe wise to get sb with sp1 running to test this? If so, this could be only a temporary setback.
@Marco: I’m currently testing with SP1. So far is seems that MS has taken the Server 2008 route for Vista which means that things like TSAdmin should be working again. However nothing is mentioned in the SP1 release notes or fix list stating that the issue was addressed. I consider the Terminal Server API and Vista a pain because we need to check for 3 versions in code (non sp1, sp1, and the WTSWaitSystemEvent hotfix) and act accordingly.
[…] a previous article I wrote about changes in utildll in vista that breaked compatibality for Terminal Server. Even […]
Nice Blog. Good Look
[…] by installing the Administration Pack. Please note that TSAdmin does not work on Vista RTM due to a bug that was corrected in Vista […]
Leave a reply