<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Windows 2003 on Remko's Blog</title><link>https://remkoweijnen.nl/blog/categories/windows-2003/</link><description>Recent content in Windows 2003 on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 05 Aug 2013 16:51:21 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/categories/windows-2003/index.xml" rel="self" type="application/rss+xml"/><item><title>ClickOnce Applications in Enterprise Environments</title><link>https://remkoweijnen.nl/blog/2013/08/05/clickonce-applications-in-enterprise-environments/</link><pubDate>Mon, 05 Aug 2013 16:51:21 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2013/08/05/clickonce-applications-in-enterprise-environments/</guid><description>&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/t71a733d.aspx" target="_blank"&gt;ClickOnce&lt;/a&gt; is a Microsoft technology that enables an end user to install an application from the web without administrative permissions.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;That's great isn't it? &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;While ClickOnce may sound great to developers it's actually a nightmare for Enterprise administrators because they try to prevent users from installing software themselves.&lt;/p&gt; &lt;p&gt;ClickOnce also incorporates an Automatic Updates mechanism which means that users might run different or not tested/approved versions...&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Virtual Environments &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;It get's even worse in virtual environments such as VDI and SBC where machines are often non-persistent. Each time the users starts the application they will see a screen similar to the one below while they actually download and install it over and over again:&lt;/p&gt; &lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2013/08/SNAGHTML87937a.webp" data-type="image" data-gallery="post-3308"&gt;&lt;img loading="lazy" decoding="async" title="SNAGHTML87937a" style="margin: 0px; display: inline" alt="SNAGHTML87937a" src="https://remkoweijnen.nl/blog/wp-content/uploads/2013/08/SNAGHTML87937a_thumb.webp" width="240" height="136" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If the environment is persistent, it's not guaranteed that the user works on the same machine each day. This means that the application will be installed on every box the user ever logs onto...&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;How does it work? &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;In order to understand how we can best treat ClickOnce applications we need to understand how they work since MSDN documentation does not describe this in detail. &lt;/p&gt;</description></item><item><title>The case of the COM Port Redirection</title><link>https://remkoweijnen.nl/blog/2013/03/11/the-case-of-the-com-port-redirection/</link><pubDate>Mon, 11 Mar 2013 14:53:44 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2013/03/11/the-case-of-the-com-port-redirection/</guid><description>&lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2013/03/image.webp" data-type="image" data-gallery="post-3079"&gt;&lt;img loading="lazy" decoding="async" style="display: inline; float: right" title="Secutest" alt="Secutest" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2013/03/image_thumb.webp" width="128" height="122" /&gt;&lt;/a&gt;One of my colleagues asked me to assist in troubleshooting an application called SmartWare FM running on Citrix XenApp. &lt;/p&gt; &lt;p&gt;This application reads data from an external device called SECUTEST.&lt;/p&gt; &lt;p&gt;The device is connected to a COM port which is redirected to the XenApp session. In contrast to Microsoft Remote Desktop Services COM ports are not automatically redirected in XenApp but need to be mapped via eg a logonscript (NET USE COM1: \\Client\COM1:) or using UEM.&lt;/p&gt; &lt;p&gt;In my case the COM port was mapped with RES Workspace Manager:&lt;/p&gt; &lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2013/03/image1.webp" data-type="image" data-gallery="post-3079"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="image" alt="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2013/03/image_thumb1.webp" width="371" height="119" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Trick to Export Private Key from Certificate Request</title><link>https://remkoweijnen.nl/blog/2012/12/28/trick-to-export-private-key-from-certificate-request/</link><pubDate>Fri, 28 Dec 2012 15:51:13 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/12/28/trick-to-export-private-key-from-certificate-request/</guid><description>&lt;p&gt;I noticed something interesting today: I needed to generate a Code Signing certificate from a Windows 2003 CA Server.&lt;/p&gt; &lt;p&gt;However the default Code Signing Template does not allow us to export the private key. I found a nice trick however that enables us to request a code signing certificate WITH private key.&lt;/p&gt; &lt;p&gt;To do this I first needed to enable the Code Signing template on the CA Server. This can be done using the Certification Authority MMC Snap-in: right click on the Certificate Templates node and select New | Certificate Template to Issue | Code Signing:&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image29.webp" class="glightbox thickbox" data-type="image" data-gallery="post-2937"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="image" alt="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image_thumb29.webp" width="318" height="175" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt;</description></item><item><title>Return username instead of computername to Applications</title><link>https://remkoweijnen.nl/blog/2012/12/06/return-username-instead-of-computername-to-applications/</link><pubDate>Thu, 06 Dec 2012 10:45:40 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/12/06/return-username-instead-of-computername-to-applications/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image8.webp" class="glightbox thickbox" data-type="image" data-gallery="post-2841"&gt;&lt;img loading="lazy" decoding="async" style="display: inline; float: right" title="image" alt="image" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image_thumb8.webp" width="87" height="74" /&gt;&lt;/a&gt;Some applications use the computer's name as a unique identifier, rather than using the user name. In a single-user-per-computer environment, this strategy works well. &lt;/p&gt; &lt;p&gt;However, in a Multi User environment such as Citrix XenApp or Microsoft's Remote Desktop Services (Terminal Server), all connected users report the same computername. &lt;/p&gt; &lt;p&gt;If the application relies on unique computernames to handle tasks such as file and record locking, then the application will fail. &lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image9.webp" class="glightbox thickbox" data-type="image" data-gallery="post-2841"&gt;&lt;img loading="lazy" decoding="async" style="margin: 11px 6px 5px 0px; display: inline; float: left" title="image" alt="image" align="left" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image_thumb9.webp" width="32" height="32" /&gt;&lt;/a&gt;We can however set an &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;186499"&gt;Application Compatibility Flag&lt;/a&gt; in the registry to return the username instead of the computername.&lt;/p&gt; &lt;p&gt;To demonstrate this behaviour I wrote a small Test Application called TestAppCompatFlags.exe.&lt;/p&gt;</description></item><item><title>Replacing WFP Protected files</title><link>https://remkoweijnen.nl/blog/2012/12/05/replacing-wfp-protected-files/</link><pubDate>Wed, 05 Dec 2012 15:33:45 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/12/05/replacing-wfp-protected-files/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image5.webp" class="glightbox thickbox" data-type="image" data-gallery="post-2826"&gt;&lt;img loading="lazy" decoding="async" style="display: inline; float: right" title="image" alt="image" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image_thumb5.webp" width="54" height="51" /&gt;&lt;/a&gt;On Windows 2000, XP and Server 2003 a mechanism called &lt;a href="http://support.microsoft.com/kb/222193/en-us"&gt;Windows File Protection&lt;/a&gt; (WFP) is used to protect system integrity.&lt;/p&gt; &lt;p&gt;How does WFP Work? &lt;br /&gt;Inside SFCFILES.DLL a list of files is kept that are monitored for changes. When a monitored file gets deleted, modified or overwritten WFP will restore the original from one of the following locations:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;font color="#35383d"&gt;Cache Folder (%systemroot%\System32\DllCache)&lt;/font&gt; &lt;/li&gt; &lt;li&gt;&lt;font color="#35383d"&gt;Network Installation Path&lt;/font&gt; &lt;/li&gt; &lt;li&gt;&lt;font color="#35383d"&gt;Windows CD (or i386 folder on harddisk)&lt;/font&gt; &lt;/li&gt; &lt;/ul&gt; &lt;p&gt;But what if we need to replace such a file? You could write a batch file that copies the modified file to the cache folder, installation path and destination. And this may work if it's quick enough.&lt;/p&gt; &lt;p&gt;A more reliable method is to use an undocumented export from sfc_os.dll called SfcFileException (only exported by ordinal #5).&lt;/p&gt;</description></item><item><title>Screen flickering with PowerPoint 2010 on Citrix XenApp</title><link>https://remkoweijnen.nl/blog/2012/11/30/screen-flickering-with-powerpoint-2010-on-citrix-xenapp/</link><pubDate>Fri, 30 Nov 2012 14:18:22 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/11/30/screen-flickering-with-powerpoint-2010-on-citrix-xenapp/</guid><description>&lt;p&gt;Within half an hour of writing the article &amp;quot;&lt;a href="https://remkoweijnen.nl/blog/2012/11/30/application-causes-screen-flickering-in-citrix-xenapp-session/"&gt;Application causes Screen Flickering in Citrix XenApp Session&lt;/a&gt;&amp;quot; I got a message that the hotfix in that article also fixes a similar problem in PowerPoint 2010.&lt;/p&gt; &lt;p&gt;Office 2010 uses hardware acceleration for displaying images and when this is enabled (which is the default) you will see constant screen flicker when you try to display a presentation with Images on Citrix XenApp (Server 2003):&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:1baf0443-1822-4d90-8c1b-cf6059f5de34" class="wlWriterEditableSmartContent"&gt;&lt;div&gt;&lt;object width="448" height="252"&gt;&lt;param name="movie" value="http://www.youtube.com/v/uhWNwQQUZ3o?hl=en&amp;amp;hd=1"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/uhWNwQQUZ3o?hl=en&amp;amp;hd=1" type="application/x-shockwave-flash" width="448" height="252"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div style="width:448px;clear:both;font-size:.8em"&gt;Screen Flickering when running WPF Applications on Citrix XenApp&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&amp;#160;&lt;/p&gt;</description></item><item><title>Application causes Screen Flickering in Citrix XenApp Session</title><link>https://remkoweijnen.nl/blog/2012/11/30/application-causes-screen-flickering-in-citrix-xenapp-session/</link><pubDate>Fri, 30 Nov 2012 13:28:54 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/11/30/application-causes-screen-flickering-in-citrix-xenapp-session/</guid><description>&lt;p&gt;Yesterday I was asked to troubleshoot an interesting issue with an application running on Citrix XenApp.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Environment&lt;br&gt;
&lt;/span&gt;&lt;/strong&gt;This customer is running Citrix XenApp 5 on Windows Server 2003 (x86). On the Client Side the Online Plugin version 12.3 is used.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;The Problem&lt;/strong&gt;&lt;/span&gt;&lt;br&gt;
When this particular application was active the screen was flickering and black blocks appeared at seemingly random places. Further more it was not possible to resize the window:&lt;/p&gt;
&lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/11/image.webp" data-type="image" data-gallery="post-2778"&gt;&lt;img loading="lazy" decoding="async" style="display: inline;" title="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/11/image_thumb.webp" alt="image" width="425" height="239" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My experience is that display issues are often related to either HDX Flash Redirection (offloading flash to the client) or the Multi Monitor hook.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>My Network Places Internals</title><link>https://remkoweijnen.nl/blog/2012/07/19/my-network-places-internals/</link><pubDate>Thu, 19 Jul 2012 11:26:12 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/07/19/my-network-places-internals/</guid><description>&lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/07/image2.webp" data-type="image" data-gallery="post-2673"&gt;&lt;img loading="lazy" decoding="async" style="display: inline; float: right" title="Nethood" alt="Nethood Icon" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/07/image_thumb2.webp" width="56" height="52" /&gt;&lt;/a&gt;I am using a PowerShell script to copy some elements of from the users old profile location to a new location. This includes the Nethood (&amp;quot;My Network Places&amp;quot;) folder which contains the Network Places shortcuts.&lt;/p&gt; &lt;p&gt;A user reported that she could not save documents to Network Places anymore and after inspection the Network Places shortcuts were broken.&lt;/p&gt; &lt;p&gt;I started comparing the old Nethood folder to the new and observed the following difference in Explorer:&lt;/p&gt; &lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/07/image3.webp" data-type="image" data-gallery="post-2673"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="image" alt="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/07/image_thumb3.webp" width="409" height="80" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;When copying entries from the Nethood folder with Explorer manually they worked fine, so somehow Explorer gives the Nethood folder special treatment.&lt;/p&gt;</description></item><item><title>Edit Document requires a Windows SharePoint Services-compatible application</title><link>https://remkoweijnen.nl/blog/2012/03/09/edit-document-requires-a-windows-sharepoint-services-compatible-application/</link><pubDate>Fri, 09 Mar 2012 14:23:11 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/03/09/edit-document-requires-a-windows-sharepoint-services-compatible-application/</guid><description>&lt;p&gt;Today I was troubleshooting a message that appeared when a user tries to edit a document from SharePoint on a Citrix XenApp server. &lt;p&gt;The user browsed to a word document on Sharepoint and selected &amp;ldquo;Edit in Microsoft Office Word&amp;rdquo; from the Combobox:&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/03/image8.webp" class="glightbox" data-type="image" data-gallery="post-2526"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="Sharepoint Document Context Menu" alt="Edit in Microsoft Office Word" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/03/image_thumb8.webp" width="156" height="124" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This would present the following error message to the user:&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/03/image9.webp" class="glightbox" data-type="image" data-gallery="post-2526"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="Windows Internet Explorer" alt="&amp;#39;Edit Document&amp;#39; requires a Windows SharePoint Services-compatible application and Microsoft Internet Explorer 6.0 or greater." src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/03/image_thumb9.webp" width="415" height="73" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/p&gt;</description></item><item><title>Session freeze when starting Excel</title><link>https://remkoweijnen.nl/blog/2012/02/20/session-freeze-when-starting-excel/</link><pubDate>Mon, 20 Feb 2012 15:42:25 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/02/20/session-freeze-when-starting-excel/</guid><description>&lt;p&gt;&lt;strong&gt;Environment&lt;/strong&gt; &lt;br /&gt;Windows 2003 Enterprise (32 bit), Citrix XenApp 5, RES Workspace Manager 2011, McAfee VirusScan Enterprise 8.7.0i.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt; &lt;br /&gt;When a opening an Excel workbook from Sharepoint the whole session freezes.&lt;/p&gt; &lt;p&gt;I asked the user to open an Excel workbook from Sharepoint and I noticed the following popup:&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/02/image7.webp" class="glightbox" data-type="image" data-gallery="post-2450"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="Message from webpage" alt="Some files can harm your computer. If the file information looks suspicious or you do not fully trust the source, do not open the file | You are opening the following file: | File name: My Workbook.xls | From: Sharepoint" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/02/image_thumb7.webp" width="415" height="97" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;So my first thought was that the user somehow clicked this message to the background and IE was waiting for a response.&lt;/p&gt;</description></item><item><title>Harmony Client crashes upon exit</title><link>https://remkoweijnen.nl/blog/2012/01/31/harmony-client/</link><pubDate>Tue, 31 Jan 2012 16:37:08 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/01/31/harmony-client/</guid><description>&lt;p&gt;Today I was troubleshooting the application "Harmony Client" which crashed upon exiting:&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/01/image21.webp" class="glightbox" data-type="image" data-gallery="post-2368"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="HARMONY_Client.exe - Toepassingsfout" alt="Toepassingspop-up: HARMONY_Client.exe - Toepassingsfout : De instructie op 0x77e621b6 verwijst naar geheugen op 0x4b750000. Een lees- of schrijfbewerking op het geheugen is mislukt: | The memory could not be read." src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/01/image_thumb21.webp" width="415" height="84" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The application had been thinapped and the error only appeared when starting the thinapped version. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Bypassing RES/Appsense Application Security</title><link>https://remkoweijnen.nl/blog/2012/01/27/bypassing-res-application-security/</link><pubDate>Fri, 27 Jan 2012 16:15:38 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/01/27/bypassing-res-application-security/</guid><description>&lt;p&gt;The video below shows a Proof of Concept of bypassing Application Security in RES Workspace Manager .&lt;/p&gt;
&lt;p&gt;Please note that at this time the code is not publicly available so please don&amp;rsquo;t ask for it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT 2&lt;/strong&gt;: I added a video that I received from someone who tried my Excel Sheet with AppSense Application Manager.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I wanted to clarify a couple of things regarding this post.&lt;/p&gt;
&lt;p&gt;First of all I would like to explain why I wrote this code and why I choose to test it with RES WM.&lt;/p&gt;
&lt;p&gt;I had the idea about this approach a long time ago but I never got around to actually do it. The main reason was that I needed to convert Delphi code to VBA and especially converting some Windows headers was a lot of work. Then suddenly I noticed that someone had already converted the headers, so I all I had to do was rewrite the code that used it to VBA.&lt;/p&gt;
&lt;p&gt;The choice for RES was made because of two reasons:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;If you want to beat something, you want to beat the best and I most certainly consider RES WM to be one of the top products.&lt;/li&gt;
	&lt;li&gt;At the time I wrote the POC code I had access to an enviroment with RES in it.&lt;/li&gt;
&lt;/ol&gt;
I would like to emphasize that RES contacted me very quickly after publishing this blog. I've had contact with RES and they showed a very constructive approach with their primary goal being a fix or guidance for their customers. Hats of to RES taking a constructive approach and I will be working together with RES on this issue.
&lt;p&gt;Finally I would like to state that I didn&amp;rsquo;t expect this post to draw this much attention, if I did I would have probably taken another approach.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>The case of the Slow Xerox Universal Print Driver</title><link>https://remkoweijnen.nl/blog/2012/01/04/the-case-of-the-slow-xerox-universal-print-driver/</link><pubDate>Wed, 04 Jan 2012 22:54:29 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/01/04/the-case-of-the-slow-xerox-universal-print-driver/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/01/image9.webp" class="glightbox" data-type="image" data-gallery="post-2319"&gt;&lt;img loading="lazy" decoding="async" style="display: inline; float: right" title="Xerox Logo" alt="Xerox Logo" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/01/image_thumb9.webp" width="64" height="64" /&gt;&lt;/a&gt;Earlier this week I was asked to investigate a problem with the Xerox Universal Printer Driver. Users complained that printing to a Xerox printer was much slower than printing to an HP printer.&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/01/image10.webp" class="glightbox" data-type="image" data-gallery="post-2319"&gt;&lt;img loading="lazy" decoding="async" style="margin: 0px 9px 0px 0px; display: inline; float: left" title="Excel 2007 Icon" alt="Excel 2007 Icon" align="left" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/01/image_thumb10.webp" width="67" height="65" /&gt;&lt;/a&gt;I received a reference document from a user, a rather complex Excel sheet. When selecting multiple tabs it took almost a minute to generate a print preview in Excel 2007 running on Windows 2003 with XenApp 5.&lt;/p&gt; &lt;p&gt;I was aware of a bug in the Xerox Universal Driver where almost 9.000 files were copied into the user's profile directory (I wrote about that in an &lt;a href="https://remkoweijnen.nl/blog/2011/02/08/the-case-of-the-citrix-ready-printer-driver/" target="_blank"&gt;earlier post&lt;/a&gt;). But this seemed to be another problem.&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt;</description></item><item><title>NTVDM encountered a hard error</title><link>https://remkoweijnen.nl/blog/2011/12/14/ntvdm-encountered-a-hard-error/</link><pubDate>Wed, 14 Dec 2011 21:41:22 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/12/14/ntvdm-encountered-a-hard-error/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image7.webp" class="glightbox" data-type="image" data-gallery="post-2254"&gt;&lt;img loading="lazy" decoding="async" style="margin: 0px 3px 0px 0px; display: inline; float: left" title="MS-Dos Logo" alt="MS-Dos Logo" align="left" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image_thumb7.webp" width="74" height="82" /&gt;&lt;/a&gt;Today I troubleshooted an old DOS application that needed to run on a 32 bit Citrix XenApp Server. The last time I saw an actual DOS application in a production environment must be years ago.&lt;/p&gt; &lt;p&gt;When starting the application, the WOW subsystem (NTVDM) crashed with the message: "NTVM encountered a hard error.":&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image8.webp" class="glightbox" data-type="image" data-gallery="post-2254"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="ntvdm.exe - System Error" border="0" alt="NTVDM encoutered a hard error" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image_thumb8.webp" width="198" height="104" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;After spending some time troubleshooting I remembered a similar issue from a few years ago where a DOS application worked fine from the Console but refused to work from an RDP or ICA session.&lt;/p&gt;</description></item><item><title>Remote Registry from 32 to 64 bit</title><link>https://remkoweijnen.nl/blog/2011/10/21/remote-registry-from-32-to-64-bit/</link><pubDate>Fri, 21 Oct 2011 09:05:11 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/10/21/remote-registry-from-32-to-64-bit/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/10/image5.webp" class="glightbox" data-type="image" data-gallery="post-2146"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/10/image_thumb5.webp" width="40" height="38" /&gt;&lt;/a&gt;Yesterday I needed to set a few registry keys remotely from a 32 bit windows machine to a 64 bit machine.&lt;/p&gt; &lt;p&gt;I used reg.exe to set the key but even though it returned success the key wasn't altered.&lt;/p&gt; &lt;p&gt;As I suspected the key was written to the Wow6432Node. In the help I couldn't find any switch to force reg.exe to use the 64-bit view.&lt;/p&gt; &lt;p&gt;On a 64 bit machine this is not a problem since both 32- and 64 bit versions of reg.exe exists. The 32 bit version of reg.exe defaults to the 32 bit view and the 64 bit version defaults to the 64 bit view.&lt;/p&gt; &lt;p&gt;But luckily reg.exe has a switch (that is not listed in the help) to force the View:&lt;/p&gt; &lt;ul&gt;</description></item><item><title>Windows 2003 Server Standard memory patch</title><link>https://remkoweijnen.nl/blog/2011/03/27/windows-2003-server-standard-memory-patch/</link><pubDate>Sun, 27 Mar 2011 21:42:17 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/03/27/windows-2003-server-standard-memory-patch/</guid><description>&lt;p&gt;So a few days ago I got new memory for a development box - an upgrade from 4 to 6 GiB (later on even 8 GiB). Much appreciated as you can imagine. After dismissing the BIOS warning about changed amount of memory (oh really? :mrgreen:), I booted into Ubuntu and happily looked at the memory stats. After that I booted into Windows (a Windows 2003 Server Standard, but I&amp;rsquo;ll just use Windows from here on) and was disappointed to see only 4 GiB available. This is apparently a limitation specific to the Standard edition.&lt;/p&gt;
&lt;p&gt;After some pouting, I decided to take action. Of course one of my first thoughts was to ask Remko, because he had done similar things for some other Windows versions. He pointed me to &lt;code&gt;MmInitSystem&lt;/code&gt;, which was not an immediate hit, though. I loaded my kernel .exe into a disassembler to look at the details, but &lt;code&gt;MmInitSystem&lt;/code&gt; was a lengthy and rather boring function. However, the advice was good and got me a good bit closer, especially when Remko also mentioned the use of &lt;code&gt;ExVerifySuite&lt;/code&gt; in the logic that would set the limits. So I brought up the references to &lt;code&gt;ExVerifySuite&lt;/code&gt; and - surprise surprise - only seven other functions used it and out of these only one was not recognized by name from the exports and debug symbols. And since the inspection of that function (at &lt;code&gt;0x00615FB0&lt;/code&gt; in my kernel) proved that it was being called from &lt;code&gt;MmInitSystem&lt;/code&gt;, this was an immediate hit.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Windows 2003 align OS disk</title><link>https://remkoweijnen.nl/blog/2011/03/14/windows-2003-align-os-disk/</link><pubDate>Mon, 14 Mar 2011 15:11:48 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/03/14/windows-2003-align-os-disk/</guid><description>&lt;p&gt;If you read one of VMWare's Best Practices Guides (in my case &lt;a href="http://www.peppercrew.nl/?p=1637" target="_blank"&gt;this&lt;/a&gt; one) then you may have read that it's important to align guest partitions.&lt;/p&gt; &lt;p&gt;We can do this (for Windows OS) using the DiskPart tool that comes with the OS since Windows 2003 SP1 (there is a &lt;a href="http://support.microsoft.com/kb/923076" target="_blank"&gt;hotfix&lt;/a&gt; for earlier versions).&lt;/p&gt; &lt;p&gt;On Windows 2008, and higher, all partitions are automatically aligned to a &lt;a href="http://frankdenneman.nl/2009/05/windows-2008-disk-alignment/" target="_blank"&gt;1 MB boundary&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;But how to do this for the OS disk on Server 2003? &lt;/p&gt; &lt;p&gt;My first thought was to open a &lt;a href="http://support.microsoft.com/kb/242380" target="_blank"&gt;command prompt during setup&lt;/a&gt;, right before creating the partitions and then use diskpart.&lt;/p&gt; &lt;p&gt;However the OS partition is created during the Text portion of the install process and even though we can get a cmd prompt using SHIFT-F10 we get the recovery console (which has a builtin diskpart but cannot align).&lt;/p&gt; &lt;p&gt;So I used a Windows PE bootdisk. Any version with Diskpart should do but I used a bootdisk from Symantec Backup Exec System Recovery that I've customized to my own needs.&lt;/p&gt; &lt;p&gt;If you boot the original Symantec disk you can open a command prompt by accessing a hidden feature: move the mouse above the "S" from Symantec until you get a Hand icon and press the left mouse button:&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/03/image12.webp" class="glightbox" data-type="image" data-gallery="post-1561"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/03/image_thumb12.webp" width="244" height="184" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt;</description></item><item><title>Autologon user on Windows XP/2003 using AutoReconnect pipe - part 3 (implementation details)</title><link>https://remkoweijnen.nl/blog/2011/03/03/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-3-implementation-details/</link><pubDate>Thu, 03 Mar 2011 13:00:46 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/03/03/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-3-implementation-details/</guid><description>&lt;p&gt;In the previous parts (&lt;a href="https://remkoweijnen.nl/blog/2011/02/28/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-1-theory/"&gt;part 1&lt;/a&gt; &lt;a href="https://remkoweijnen.nl/blog/2011/03/02/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-2-problems-and-workarounds/"&gt;part 2&lt;/a&gt;) i&amp;rsquo;ve described the theoretical part and implementation problems. So, now we can write the code:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In case we login the user, we just call &lt;a href="http://msdn.microsoft.com/en-us/library/aa378292(v=vs.85).aspx"&gt;LsaLogonUser&lt;/a&gt; to get the token:&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Autologon user on Windows XP/2003 using AutoReconnect pipe - part 2 (problems and workarounds)</title><link>https://remkoweijnen.nl/blog/2011/03/02/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-2-problems-and-workarounds/</link><pubDate>Wed, 02 Mar 2011 00:10:02 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/03/02/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-2-problems-and-workarounds/</guid><description>&lt;p&gt;In &lt;a href="https://remkoweijnen.nl/blog/2011/02/28/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-1-theory/"&gt;part 1&lt;/a&gt; I&amp;rsquo;ve described the theoretical parts needed for a custom autologon application implementation.&lt;/p&gt;
&lt;p&gt;But there are some practical problems which I will describe here.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I use the &lt;a href="http://msdn.microsoft.com/en-us/library/aa378292(v=vs.85).aspx"&gt;LsaLogonUser&lt;/a&gt; function to log in the user. However, if I do not pass not null for the &lt;em&gt;LocalGroups&lt;/em&gt; parameter, msgina.dll fails to process the logon.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Why? Because it looks for the &lt;strong&gt;SE_GROUP_LOGON_ID&lt;/strong&gt; SID and treat it as logon SID. So we have to add the logon SID manually:&lt;/p&gt;</description></item><item><title>Autologon user on Windows XP/2003 using AutoReconnect pipe - part 1 (theory)</title><link>https://remkoweijnen.nl/blog/2011/02/28/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-1-theory/</link><pubDate>Mon, 28 Feb 2011 10:46:29 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/02/28/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-1-theory/</guid><description>&lt;p&gt;Windows XP introduced the ability to use Fast User Switching (FUS from here on), which is implemented using &lt;em&gt;Terminal Services&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;But in some cases (i.e. when FUS is not enabled, or when you connect to the console in Windows 2003 server), the Winlogon process in an RDP session needs to transfer credentials to Session 0.&lt;/p&gt;
&lt;p&gt;Although not documented in MSDN, the process of transferring credentials is described by Keith Brown in the June 2005 issue of MSDN magazine: &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163786.aspx"&gt;Customizing GINA, Part 2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa380577(v=vs.85).aspx"&gt;WlxQueryConsoleSwitchCredentials&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/aa380563(v=vs.85).aspx"&gt;WlxGetConsoleSwitchCredentials&lt;/a&gt; are used in the transfer with the semi-documented &lt;strong&gt;WLX_SAS_TYPE_AUTHENTICATED&lt;/strong&gt; SAS code constant.&lt;/p&gt;
&lt;p&gt;Internally, &lt;em&gt;winlogon.exe&lt;/em&gt; uses a Named Pipe, &lt;strong&gt;\.\Pipe\TerminalServer\AutoReconnect, &lt;/strong&gt;to implement both of these functions.&lt;/p&gt;
&lt;p&gt;The pipe format is described in this structure:&lt;/p&gt;</description></item><item><title>Script to install SNMP</title><link>https://remkoweijnen.nl/blog/2011/02/04/script-to-install-snmp/</link><pubDate>Fri, 04 Feb 2011 11:22:26 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/02/04/script-to-install-snmp/</guid><description>&lt;p&gt;In my project the monitoring group required that SNMP was installed and configured on all servers. &lt;p&gt;I wrote scripts for Windows 2003 and Windows 2008 that I deploy from my Altiris Server.&lt;/p&gt; &lt;p&gt;This is the script for Windows 2003:&lt;/p&gt;&lt;/p&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;span class="codelang"&gt;batch&lt;/span&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".bat" href="data:text/plain;charset=utf-8;base64,QGVjaG8gb2ZmCnJlbSBJbnN0YWxsIFNOTVAKCnJlbSBDcmVhdGUgU3lzb2MgQW5zd2VyIEZpbGUKZWNobyBbTmV0T3B0aW9uYWxDb21wb25lbnRzXSAgPkluc3RhbGxTTk1QLnR4dAplY2hvIFNOTVAgPSAxID4&amp;#43;SW5zdGFsbFNOTVAudHh0CmVjaG8uID4&amp;#43;SW5zdGFsbFNOTVAudHh0CmVjaG8gW1NOTVBdID4&amp;#43;SW5zdGFsbFNOTVAudHh0CmVjaG8gQWNjZXB0X0NvbW11bml0eU5hbWUgPSBNWUNPTU1VTklUWTpSZWFkX09ubHkgPj5JbnN0YWxsU05NUC50eHQKZWNobyBBbnlfSG9zdCA9IE5vID4&amp;#43;SW5zdGFsbFNOTVAudHh0CmVjaG8gQ29tbXVuaXR5X05hbWUgPSAiTVlDT01NVU5JVFkiID4&amp;#43;SW5zdGFsbFNOTVAudHh0CmVjaG8gQ29udGFjdF9OYW1lID0gIk1ZQ09OVEFOVCIgID4&amp;#43;SW5zdGFsbFNOTVAudHh0CmVjaG8gTGltaXRfSG9zdCA9IE1ZSVAgID4&amp;#43;SW5zdGFsbFNOTVAudHh0CmVjaG8gTG9jYXRpb24gPSAiTVlMT0NBVElPTiIgID4&amp;#43;SW5zdGFsbFNOTVAudHh0CmVjaG8gU2VuZF9BdXRoZW50aWNhdGlvbiA9IFllcyA&amp;#43;Pkluc3RhbGxTTk1QLnR4dAplY2hvIFNlcnZpY2UgPSBBcHBsaWNhdGlvbnMsIEludGVybmV0LCBFbmQtdG8tRW5kLCBQaHlzaWNhbCwgRGF0YWxpbmsgPj5JbnN0YWxsU05NUC50eHQKZWNobyBUcmFwcyA9IFRIRVRSQVBJUCAgPj5JbnN0YWxsU05NUC50eHQKClN5c29jbWdyLmV4ZSAvaTpcd2luZG93c1xpbmZcc3lzb2MuaW5mIC91OlxXaW5kb3dzXFRlbXBcSW5zdGFsbFNOTVAudHh0IC9y"&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-batch" data-lang="batch"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="k"&gt;echo&lt;/span&gt; off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;rem Install SNMP&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;rem Create Sysoc Answer File&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; [NetOptionalComponents] &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; SNMP = 1 &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt;. &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; [SNMP] &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; Accept_CommunityName = MYCOMMUNITY:Read_Only &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; Any_Host = No &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; Community_Name = &lt;span class="s2"&gt;&amp;#34;MYCOMMUNITY&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; Contact_Name = &lt;span class="s2"&gt;&amp;#34;MYCONTANT&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; Limit_Host = MYIP &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; Location = &lt;span class="s2"&gt;&amp;#34;MYLOCATION&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; Send_Authentication = Yes &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; Service = Applications, Internet, End-to-End, Physical, Datalink &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;echo&lt;/span&gt; Traps = THETRAPIP &lt;span class="p"&gt;&amp;gt;&amp;gt;&lt;/span&gt;InstallSNMP.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Sysocmgr.exe /i:\windows\inf\sysoc.inf /u:\Windows\Temp\InstallSNMP.txt /r&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Querying a user token under 64 bit version of 2003/XP</title><link>https://remkoweijnen.nl/blog/2011/01/29/querying-a-user-token-under-64-bit-version-of-2003xp/</link><pubDate>Sat, 29 Jan 2011 22:17:52 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/29/querying-a-user-token-under-64-bit-version-of-2003xp/</guid><description>&lt;p&gt;If you want to obtain a user&amp;rsquo;s token in a Terminal Server or Citrix session (eg to launch a process in a session) you can call the &lt;a href="http://msdn.microsoft.com/en-us/library/aa383840(v=vs.85).aspx"&gt;WTSQueryUserToken&lt;/a&gt; function.&lt;/p&gt;
&lt;p&gt;On the x64 versions of Windows XP and Server 2003 this function fails however and returns &lt;strong&gt;ERROR_INSUFFICIENT_BUFFER&lt;/strong&gt; (&amp;quot;&lt;em&gt;The data area passed to a system call is too small&lt;/em&gt;.&amp;quot;) when called from a 32 bit process.&lt;/p&gt;
&lt;p&gt;Internally WTSQueryUserToken calls the undocumented function &lt;a href="http://msdn.microsoft.com/en-us/library/aa383827(v=vs.85).aspx"&gt;WinstationQueryInformationW&lt;/a&gt; with the &lt;strong&gt;WinStationUserToken&lt;/strong&gt; class (14) and passing a &lt;a href="http://msdn.microsoft.com/en-us/library/cc248658(PROT.10).aspx"&gt;WINSTATIONUSERTOKEN&lt;/a&gt; struct, filled with caller ProcessId and ThreadId.&lt;/p&gt;
&lt;p&gt;But on x64 Windows the size of this structure is 24 bytes, while on 32 bit Windows the size of the structure is 12 bytes!&lt;/p&gt;</description></item><item><title>PowerShell Script to raise Citrix Video Memory</title><link>https://remkoweijnen.nl/blog/2011/01/28/powershell-script-to-raise-citrix-video-memory/</link><pubDate>Fri, 28 Jan 2011 15:23:08 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/28/powershell-script-to-raise-citrix-video-memory/</guid><description>&lt;p&gt;On a Citrix XenApp 5 environment a user reported that he was unable to start a Full Screen session on a Dual Monitor Configuration.&lt;/p&gt;
&lt;p&gt;He received this error message:&lt;/p&gt;
&lt;p&gt;&lt;a class="glightbox" data-type="image" data-gallery="post-1316" href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/foutmelding-2.webp"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="foutmelding (2)" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/foutmelding-2_thumb.webp" border="0" alt="foutmelding (2)" width="244" height="78" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Enumerating Session Processes with NtQuerySystemInformation</title><link>https://remkoweijnen.nl/blog/2011/01/20/enumerating-session-process-with-ntquerysysteminformation/</link><pubDate>Thu, 20 Jan 2011 15:34:23 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/20/enumerating-session-process-with-ntquerysysteminformation/</guid><description>&lt;p&gt;As you may know, you can enumerate processes of a specific Terminal Server or Citrix session using the &lt;a href="http://msdn.microsoft.com/en-us/library/ms724509(VS.85).aspx"&gt;NtQuerySystemInformation&lt;/a&gt; function.&lt;/p&gt;
&lt;p&gt;On x86 system the code below works fine:&lt;/p&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;span class="codelang"&gt;objectpascal&lt;/span&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".pas" href="data:text/plain;charset=utf-8;base64,dmFyCiAgU3RhdHVzIDogTlRTVEFUVVM7CiAgUmV0TGVuZ3RoIDogRFdPUkQ7CiAgU2Vzc2lvbkluZm8gOiAgU1lTVEVNX1NFU1NJT05fUFJPQ0VTU19JTkZPUk1BVElPTjsKICBDdXJyZW50UHJvY2VzcyA6IFBTeXN0ZW1Qcm9jZXNzZXM7CmJlZ2luCgogIFNlc3Npb25JbmZvLlNlc3Npb25JZCA6PSBTZXNzaW9uSWQ7CiAgU2Vzc2lvbkluZm8uQnVmZmVyIDo9IG5pbDsKICBTZXNzaW9uSW5mby5TaXplT2ZCdWYgOj0gMDsKCiAgU3RhdHVzIDo9IE50UXVlcnlTeXN0ZW1JbmZvcm1hdGlvbihTeXN0ZW1TZXNzaW9uUHJvY2Vzc2VzSW5mb3JtYXRpb24sIEBTZXNzaW9uSW5mbywgU2l6ZU9mKFNlc3Npb25JbmZvKSwgQFJldExlbmd0aCk7CiAgd2hpbGUgKFN0YXR1cyA9IFNUQVRVU19JTkZPX0xFTkdUSF9NSVNNQVRDSCkgZG8KICBiZWdpbgogICAgU2Vzc2lvbkluZm8uU2l6ZU9mQnVmIDo9IFJldExlbmd0aDsKICAgIFNlc3Npb25JbmZvLkJ1ZmZlciA6PSBHZXRNZW1vcnkoUmV0TGVuZ3RoKTsKICAgIHRyeQogICAgICBTdGF0dXMgOj0gTnRRdWVyeVN5c3RlbUluZm9ybWF0aW9uKFN5c3RlbVNlc3Npb25Qcm9jZXNzZXNJbmZvcm1hdGlvbiwgQFNlc3Npb25JbmZvLCBTaXplT2YoU2Vzc2lvbkluZm8pLCBAUmV0TGVuZ3RoKTsKICAgICAgaWYgTlRfU1VDQ0VTUyhTdGF0dXMpIHRoZW4KICAgICAgYmVnaW4KICAgICAgICBDdXJyZW50UHJvY2VzcyA6PSBTZXNzaW9uSW5mby5CdWZmZXI7CiAgICAgICAgd2hpbGUgVHJ1ZSBkbwogICAgICAgIGJlZ2luCiAgICAgICAgICAvLyBZb3VyIGNvZGUgaGVyZQoKICAgICAgICAgIGlmIChDdXJyZW50UHJvY2Vzc14uTmV4dEVudHJ5RGVsdGEgPSAwKSB0aGVuCiAgICAgICAgICAgIEJyZWFrOwoKICAgICAgICAgIENhcmRpbmFsKEN1cnJlbnRQcm9jZXNzKSA6PSBDYXJkaW5hbChDdXJyZW50UHJvY2VzcykgKyBDdXJyZW50UHJvY2Vzc14uTmV4dEVudHJ5RGVsdGE7CiAgICAgICAgZW5kOwoKICAgICAgICBFeGl0OwogICAgICBlbmQ7CiAgICBmaW5hbGx5CiAgICAgIEZyZWVNZW1vcnkoU2Vzc2lvbkluZm8uQnVmZmVyKTsKICAgIGVuZDsKICBlbmQ7CgogIFNldExhc3RFcnJvcihSdGxOdFN0YXR1c1RvRG9zRXJyb3IoU3RhdHVzKSk7CiAgUmFpc2VMYXN0T1NFcnJvcjsKZW5kOw=="&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-objectpascal" data-lang="objectpascal"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;var&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;Status&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;NTSTATUS&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;RetLength&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;DWORD&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;SessionInfo&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;SYSTEM_SESSION_PROCESS_INFORMATION&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;CurrentProcess&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;PSystemProcesses&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;SessionInfo&lt;span class="p"&gt;.&lt;/span&gt;SessionId&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;SessionId&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;SessionInfo&lt;span class="p"&gt;.&lt;/span&gt;Buffer&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;SessionInfo&lt;span class="p"&gt;.&lt;/span&gt;SizeOfBuf&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;Status&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;NtQuerySystemInformation&lt;span class="o"&gt;(&lt;/span&gt;SystemSessionProcessesInformation&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;SessionInfo&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;SizeOf&lt;span class="o"&gt;(&lt;/span&gt;SessionInfo&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;RetLength&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;while&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;Status&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;STATUS_INFO_LENGTH_MISMATCH&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;SessionInfo&lt;span class="p"&gt;.&lt;/span&gt;SizeOfBuf&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;RetLength&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;SessionInfo&lt;span class="p"&gt;.&lt;/span&gt;Buffer&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;GetMemory&lt;span class="o"&gt;(&lt;/span&gt;RetLength&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;try&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;Status&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;NtQuerySystemInformation&lt;span class="o"&gt;(&lt;/span&gt;SystemSessionProcessesInformation&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;SessionInfo&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;SizeOf&lt;span class="o"&gt;(&lt;/span&gt;SessionInfo&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;RetLength&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;NT_SUCCESS&lt;span class="o"&gt;(&lt;/span&gt;Status&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;CurrentProcess&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;SessionInfo&lt;span class="p"&gt;.&lt;/span&gt;Buffer&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;while&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;True&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Your code here&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;CurrentProcess&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;NextEntryDelta&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;Break&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;Cardinal&lt;span class="o"&gt;(&lt;/span&gt;CurrentProcess&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Cardinal&lt;span class="o"&gt;(&lt;/span&gt;CurrentProcess&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;CurrentProcess&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;NextEntryDelta&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;Exit&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;finally&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;FreeMemory&lt;span class="o"&gt;(&lt;/span&gt;SessionInfo&lt;span class="p"&gt;.&lt;/span&gt;Buffer&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;SetLastError&lt;span class="o"&gt;(&lt;/span&gt;RtlNtStatusToDosError&lt;span class="o"&gt;(&lt;/span&gt;Status&lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;RaiseLastOSError&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;While this works fine on Windows XP and 2003 x86, it fails to work correctly on the x64 versions of Windows XP and 2003 (or maybe even higher).&lt;/p&gt;
&lt;p&gt;The problem is that RetLength is always SizeOf(SYSTEM_SESSION_PROCESS_INFORMATION) and thus we are in an endless loop!&lt;/p&gt;</description></item><item><title>The case of the Annotations Toolbar</title><link>https://remkoweijnen.nl/blog/2011/01/17/the-case-of-the-annotations-toolbar/</link><pubDate>Mon, 17 Jan 2011 22:24:22 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/17/the-case-of-the-annotations-toolbar/</guid><description>&lt;p&gt;I got some interesting questions from a user today regarding TIFF images on a Windows 2003 based Citrix environment.&lt;/p&gt;
&lt;p&gt;This user has an application that works with scanned documents and for each document exists both a pdf and a tiff version in the application.&lt;/p&gt;
&lt;p&gt;By default the TIF (and TIFF) file extensions are linked to the Windows Picture and Fax Viewer in Windows 2003.&lt;/p&gt;
&lt;p&gt;The user told me that some time ago she had an extra toolbar where she could perform some extra operations such as making a selection on TIFF images.&lt;/p&gt;
&lt;p&gt;At some point in time this mysterious Toolbar disappeared and she was never able to get it back. She reported this to the helpdesk and the system administrator but they were unable to resolve this.&lt;/p&gt;
&lt;p&gt;I hadn&amp;rsquo;t hear of this toolbar before but a Google Search led me to &lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/image_toolbar.mspx?mfr=true" target="_blank"&gt;this page&lt;/a&gt; which explains the toolbar in question which is called the &lt;em&gt;Annotation Toolbar&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Paging file and Memory Dump</title><link>https://remkoweijnen.nl/blog/2011/01/07/paging-file-and-memory-dump/</link><pubDate>Fri, 07 Jan 2011 13:45:55 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/07/paging-file-and-memory-dump/</guid><description>&lt;p&gt;I often hear that people configure the Paging File (on Citrix or Terminal Servers) on a seperate volume but, the reasons is either performance or the chance that the Paging File might corrupt the volume.&lt;/p&gt;
&lt;p&gt;However if at some point you would like to create a Memory Dump you must have a paging file on the boot volume.&lt;/p&gt;</description></item><item><title>Default User Profile: Remko’s solution</title><link>https://remkoweijnen.nl/blog/2011/01/04/default-user-profile-remkos-solution/</link><pubDate>Tue, 04 Jan 2011 15:46:18 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/04/default-user-profile-remkos-solution/</guid><description>&lt;p&gt;If you are implementing a Citrix, Terminal Server or even just a plain Client-Server environment you will need to create a Default User Profile at some point.&lt;/p&gt;
&lt;p&gt;The Default User Profile can be thought of as the initial registry settings that are used when a new profile is created.&lt;/p&gt;
&lt;p&gt;Many people think that the Default User Profile is available in regedit via HKEY_USERS.Default but this is NOT the Default User Profile.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/usersdefault.webp" class="glightbox" data-type="image" data-gallery="post-1066"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/usersdefault-small.webp" alt="UsersDefault" width="430" height="165" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Terminal Server Remote Keyboard Layout</title><link>https://remkoweijnen.nl/blog/2010/12/27/terminal-server-remote-keyboard-layout/</link><pubDate>Mon, 27 Dec 2010 16:38:55 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/12/27/terminal-server-remote-keyboard-layout/</guid><description>&lt;p&gt;Today I shadowed a user&amp;rsquo;s session in Citrix and when I wanted to type something I noticed that the keyboard layout was incorrect.&lt;/p&gt;
&lt;p&gt;This is and old &amp;ldquo;friend&amp;rdquo; that I always tend to forget about. So hopefully this post will help me to remember it :D.&lt;/p&gt;
&lt;p&gt;You can prevent this by adding a value &amp;ldquo;IgnoreRemoteKeyboardLayout&amp;rdquo; to the registry key HKLM\System\CurrentControlSet\Keyboard Layout:&lt;/p&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;span class="codelang"&gt;text&lt;/span&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".txt" href="data:text/plain;charset=utf-8;base64,cmVnIGFkZCAiSEtMTVxTWVNURU1cQ3VycmVudENvbnRyb2xTZXRcQ29udHJvbFxLZXlib2FyZCBMYXlvdXQiIC92IElnbm9yZVJlbW90ZUtleWJvYXJkTGF5b3V0IC90IFJFR19EV09SRCAvZCAweDAwMDAwMDAxIC9m"&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;reg add &amp;#34;HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout&amp;#34; /v IgnoreRemoteKeyboardLayout /t REG_DWORD /d 0x00000001 /f&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This option has been present since Windows 2000 but was broken in Windows 2003. For Windows 2003 there are two related hotfixes, see &lt;a title="The IgnoreRemoteKeyboardLayout registry entry has no effect in Windows Server 2003" href="http://support.microsoft.com/kb/842136" target="_blank"&gt;kb 842136&lt;/a&gt; and &lt;a title="The terminal server IME keyboard layout differs from the client computer when you remotely log on to a Windows Server 2003 SP1-based terminal server" href="http://support.microsoft.com/kb/917910" target="_blank"&gt;kb 917910&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Default Explorer View</title><link>https://remkoweijnen.nl/blog/2010/12/19/default-explorer-view/</link><pubDate>Sun, 19 Dec 2010 14:40:40 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/12/19/default-explorer-view/</guid><description>&lt;p&gt;As you probably know there are several different Folder Views in Windows Explorer:&lt;/p&gt;
&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2010/12/explorerview.webp" alt="ExplorerView" width="183" height="276" /&gt;
&lt;p&gt;The Explorer keeps tracks of the last used View per Folder in the registry in the key HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags. This &lt;a title="Changes to the size, view, icon or position of a folder are lost" href="http://support.microsoft.com/kb/813711" target="_blank"&gt;KB article&lt;/a&gt; sort of desribes this functionality.&lt;/p&gt;</description></item><item><title>Programmatically Changing the Driver Signing options</title><link>https://remkoweijnen.nl/blog/2010/11/11/programmatically-changing-the-driver-signing-options/</link><pubDate>Thu, 11 Nov 2010 09:57:17 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/11/11/programmatically-changing-the-driver-signing-options/</guid><description>&lt;p&gt;Today I was tested my unattended Citrix installation (XenApp 5 on Windows 2003) and I noticed that the install was taking longer than expected.&lt;/p&gt;
&lt;p&gt;This was because of a popup:&lt;/p&gt;
&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2010/11/driversigning-1.webp" alt="DriverSigning" width="411" height="335" /&gt;
&lt;p&gt;I am not sure if this popup is shown because I ran MsiExec with /Qb- (I usually do that when testing) but if the Popup is not shown it means that at least the installation of this driver (probably Citrix Universal Print driver) fails.&lt;/p&gt;
&lt;p&gt;So this means I needed to script turning off Driver Signature Warnings. A quick search led me to kb article &lt;a title="Driver signing registry values cannot be modified directly in Windows" href="http://support.microsoft.com/kb/298503" target="_blank"&gt;kb298503&lt;/a&gt; which is titled &amp;ldquo;&lt;em&gt;Driver signing registry values cannot be modified directly in Windows&lt;/em&gt;&amp;rdquo;. As you may guess that title drew my attention.&lt;/p&gt;</description></item></channel></rss>