<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Windows Internals on Remko's Blog</title><link>https://remkoweijnen.nl/blog/categories/windows-internals/</link><description>Recent content in Windows Internals on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 09 May 2016 12:30:02 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/categories/windows-internals/index.xml" rel="self" type="application/rss+xml"/><item><title>Invalid file handle when trying to delete a file</title><link>https://remkoweijnen.nl/blog/2016/05/09/invalid-file-handle-when-trying-to-delete-a-file/</link><pubDate>Mon, 09 May 2016 12:30:02 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2016/05/09/invalid-file-handle-when-trying-to-delete-a-file/</guid><description>&lt;p&gt;When I was trying to delete a folder from my local harddrive (cygwin64 in my case) I got the following error message: "&lt;em&gt;Invalid file handle.&lt;/em&gt;":&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2016/05/image.webp" class="glightbox" data-type="image" data-gallery="post-3668"&gt;&lt;img loading="lazy" decoding="async" title="1 Interrupted Action" style="display: inline" alt="Invalid file handle" src="https://remkoweijnen.nl/blog/wp-content/uploads/2016/05/image_thumb.webp" width="290" height="133" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I then attempted to delete the folder from the command prompt which failed as well with an "&lt;em&gt;Access is denied&lt;/em&gt;" error:&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2016/05/image-1.webp" class="glightbox" data-type="image" data-gallery="post-3668"&gt;&lt;img loading="lazy" decoding="async" title="image" style="display: inline" alt="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2016/05/image_thumb-1.webp" width="345" height="69" /&gt;&lt;/a&gt;&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>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>DefaultPassword Dumper</title><link>https://remkoweijnen.nl/blog/2012/05/21/defaultpassword-dumper/</link><pubDate>Mon, 21 May 2012 22:39:05 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/05/21/defaultpassword-dumper/</guid><description>&lt;p&gt;Just a small post today: a small commandline utility that reads the &amp;ldquo;DefaultPassword&amp;rdquo; LSA secret.&lt;/p&gt;
&lt;p&gt;This secret is stored in the registry under the SECURITY Hive:&lt;/p&gt;
&lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/05/SNAGHTML34f1d213.webp" data-type="image" data-gallery="post-2621"&gt;&lt;img loading="lazy" decoding="async" style="display: inline;" title="RegEdit" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/05/SNAGHTML34f1d213_thumb.webp" alt="HKEY_LOCAL_MACHINE\SECURITY\Policy\Secrets\DefaultPassword" width="392" height="320" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Programmatically determine if we run server core</title><link>https://remkoweijnen.nl/blog/2011/05/17/programmatically-determine-if-we-run-server-core/</link><pubDate>Tue, 17 May 2011 21:32:22 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/05/17/programmatically-determine-if-we-run-server-core/</guid><description>&lt;p&gt;If you want to check if you are running on a Server Core edition of Windows you can use the &lt;a href="http://msdn.microsoft.com/en-us/library/ms724358.aspx" target="_blank"&gt;GetProductInfo&lt;/a&gt; API.&lt;/p&gt; &lt;p&gt;GetProductInfo takes 4 input parameters that can be obtained using &lt;a href="http://msdn.microsoft.com/en-us/library/ms724451(VS.85).aspx" target="_blank"&gt;GetVersionEx&lt;/a&gt; and the &lt;a href="http://msdn.microsoft.com/en-us/library/ms724833(v=VS.85).aspx" target="_blank"&gt;OSVERSIONINFOEX&lt;/a&gt; structure:&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,dmFyCiAgb3N2aTogT1NWRVJTSU9OSU5GT0VYOwpiZWdpbgogIFplcm9NZW1vcnkoQG9zdmksIFNpemVPZihvc3ZpKSk7CiAgb3N2aS5kd09TVmVyc2lvbkluZm9TaXplIDo9IFNpemVPZihvc3ZpKTsKICBXaW4zMkNoZWNrKEdldFZlcnNpb25FeChvc3ZpKSk7"&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;osvi&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;OSVERSIONINFOEX&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 class="w"&gt; &lt;/span&gt;ZeroMemory&lt;span class="o"&gt;(@&lt;/span&gt;osvi&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;osvi&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;osvi&lt;span class="p"&gt;.&lt;/span&gt;dwOSVersionInfoSize&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;SizeOf&lt;span class="o"&gt;(&lt;/span&gt;osvi&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;Win32Check&lt;span class="o"&gt;(&lt;/span&gt;GetVersionEx&lt;span class="o"&gt;(&lt;/span&gt;osvi&lt;span class="o"&gt;))&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;No we call GetProductInfo:&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,dmFyCiAgZHdQcm9kVHlwZTogRFdPUkQ7CmJlZ2luCiAgV2luMzJDaGVjayhHZXRQcm9kdWN0SW5mbyhvc3ZpLmR3TWFqb3JWZXJzaW9uLCBvc3ZpLmR3TWlub3JWZXJzaW9uLAogICAgb3N2aS53U2VydmljZVBhY2tNYWpvciwgb3N2aS53U2VydmljZVBhY2tNaW5vciwgZHdQcm9kVHlwZSkpOw=="&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;dwProdType&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="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;Win32Check&lt;span class="o"&gt;(&lt;/span&gt;GetProductInfo&lt;span class="o"&gt;(&lt;/span&gt;osvi&lt;span class="p"&gt;.&lt;/span&gt;dwMajorVersion&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;osvi&lt;span class="p"&gt;.&lt;/span&gt;dwMinorVersion&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;osvi&lt;span class="p"&gt;.&lt;/span&gt;wServicePackMajor&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;osvi&lt;span class="p"&gt;.&lt;/span&gt;wServicePackMinor&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;dwProdType&lt;span class="o"&gt;))&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;&amp;#160;&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&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>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 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>Using Fast User Switching on domain XP computers</title><link>https://remkoweijnen.nl/blog/2011/01/30/using-fast-user-switching-on-domain-xp-computers/</link><pubDate>Sun, 30 Jan 2011 20:42:20 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/30/using-fast-user-switching-on-domain-xp-computers/</guid><description>&lt;p&gt;As you may know, Fast User Switching (FUS) is not available (disabled) on Windows XP computers joined to a domain, Microsoft confirms this in &lt;a href="http://support.microsoft.com/kb/280758" target="_blank"&gt;kb280758&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However, Microsoft doesn&amp;rsquo;t tell us there&amp;rsquo;s an undocumented registry value that allows us to have FUS when joined to a domain!&lt;/p&gt;
&lt;p&gt;To enable FUS you need to set the &lt;strong&gt;DWORD&lt;/strong&gt; registry value &lt;em&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\ForceFriendlyUI&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;It can also be set by Group Policy at &lt;em&gt;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;When the value is set to 1, and &lt;em&gt;LogonType&lt;/em&gt; key is also set to 1, it allows you to use a Friendly UI on a computer joined in a domain:&lt;/p&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>Determine the System Page Size</title><link>https://remkoweijnen.nl/blog/2011/01/24/determine-the-system-page-size/</link><pubDate>Mon, 24 Jan 2011 15:46:58 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/24/determine-the-system-page-size/</guid><description>&lt;p&gt;Just a quick note: if you want to determine the page size of the OS (Windows) you can use the &lt;a href="http://msdn.microsoft.com/en-us/library/ms724381(v=vs.85).aspx" target="_blank"&gt;GetSystemInfo&lt;/a&gt; function.&lt;/p&gt;
&lt;p&gt;Example:&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,dmFyCiAgU3lzdGVtSW5mbzogU1lTVEVNX0lORk87CiAgUGFnZVNpemU6IERXT1JEOwpiZWdpbgogIEdldFN5c3RlbUluZm8oU3lzdGVtSW5mbyk7CiAgUGFnZVNpemUgOj0gU3lzdGVtSW5mby5kd1BhZ2VTaXplOw=="&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;SystemInfo&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;SYSTEM_INFO&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;PageSize&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="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;GetSystemInfo&lt;span class="o"&gt;(&lt;/span&gt;SystemInfo&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;PageSize&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;SystemInfo&lt;span class="p"&gt;.&lt;/span&gt;dwPageSize&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;Note that MSDN recommends to use the &lt;a href="http://msdn.microsoft.com/en-us/library/ms724340(v=vs.85).aspx" target="_blank"&gt;GetNativeSystemInfo&lt;/a&gt; function when running in a 32 bit app on an x64 OS (and you can use the &lt;a href="http://msdn.microsoft.com/en-us/library/ms684139(v=vs.85).aspx" target="_blank"&gt;IsWow64Process&lt;/a&gt; function to determine that).&lt;/p&gt;</description></item></channel></rss>