Remko Weijnen's Blog (Remko's Blog)

About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like


4,669 views

Another interesting issue today with an application that runs on Citrix XenApp.

Environment
Customer has a Citrix XenApp 5 environment running on Windows Server 2003. Clients are all Windows XP and run the Citrix Online Plugin 12.3 full screen.

RES Workspace Extender is used to integrate locally installed application into the XenApp Session. Users have no access to the local desktop.

Symptoms
This particular application scans invoices using a USB scanner attached to the client and runs them trough a workflow.
Whenever the Start scan button was pressed the application froze.

SNAGHTML48ec098

 

Read the rest of this entry »

  • 1 Comment
  • Filed under: Citrix
  • 2,846 views

    imageSome 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.

    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.

    If the application relies on unique computernames to handle tasks such as file and record locking, then the application will fail.

    imageWe can however set an Application Compatibility Flag in the registry to return the username instead of the computername.

    To demonstrate this behaviour I wrote a small Test Application called TestAppCompatFlags.exe.

    Read the rest of this entry »

    2,350 views

    imageOn Windows 2000, XP and Server 2003 a mechanism called Windows File Protection (WFP) is used to protect system integrity.

    How does WFP Work?
    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:

    • Cache Folder (%systemroot%\System32\DllCache)
    • Network Installation Path
    • Windows CD (or i386 folder on harddisk)

    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.

    A more reliable method is to use an undocumented export from sfc_os.dll called SfcFileException (only exported by ordinal #5).

    Read the rest of this entry »

    4,142 views

    Twain LogoScanners attached to client machines can be used from within a Citrix XenApp session via a mechanism called Twain Redirection.

    For this mechanism to work correctly the file twain_32.dll must be present in the Windows directory.

    On Windows 2008 this dll should be copied from winsxs (side by side) to the windows directory as described in CTX123981.

    On Windows 2003 the dll is already in the correct directory, however applications that are not Terminal Server Aware cannot find this dll because the Windows directory is redirected to the user profile. Citrix recommends copying twain_32.dll to each user’s profile directory but this will take up unnecessary space.

    So what alternatives do we have?

    Read the rest of this entry »

    5,106 views

    Within half an hour of writing the article "Application causes Screen Flickering in Citrix XenApp Session" I got a message that the hotfix in that article also fixes a similar problem in PowerPoint 2010.

    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):

    Screen Flickering when running WPF Applications on Citrix XenApp

     

    Read the rest of this entry »

    17,397 views

    Yesterday I was asked to troubleshoot an interesting issue with an application running on Citrix XenApp.

    Environment
    This customer is running Citrix XenApp 5 on Windows Server 2003 (x86). On the Client Side the Online Plugin version 12.3 is used.

    The Problem
    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:

    image

    My experience is that display issues are often related to either HDX Flash Redirection (offloading flash to the client) or the Multi Monitor hook.

     

    Read the rest of this entry »

    3,210 views

    Sometimes you need to know the Process Id (PID) of a running service. Since Windows 2003 you can use the tasklist.exe tool with the /SVC switch. But how to do this programmatically?

    The QueryServiceStatusEx API returns a SERVICE_STATUS_PROCESS structure that contains the PID.

    The code is not very complicated:

  • 0 Comments
  • Filed under: Delphi
  • 2,662 views

    A customer had partially implemented a (written) policy in the past where the the Local Administrator account was renamed according to a special convention.

    This policy stated that the Administrator account needed to be renamed to admin with the computername as a prefix.

    However they didn’t know exactly on which machines this policy had been applied to in the past. I was asked to write a script that would check a list of machine names, query the Administrator account name and write this in a new list.

    The Administrator account has a Well Known SID of S-1-5-21-xxxxxxx-500 where xxxxxxx is the SID of the computer.

    Read the rest of this entry »

  • 0 Comments
  • Filed under: PowerShell
  • 6,243 views

    Yesterday I wrote about converting an IP Address to an Integer in C#. But both methods I presented return the IP Address in network byte order.

    However in some cases, especially when calling WinApi functions, you will need to convert the Integer to host byte order which is little-endian on Intel processors.

    In an unmanaged language we could do very fast byte swap with inline assembly, eg:

    From WinApi we could use the ntohl function and in managed languages we can use the NetworkToHostOrder method from the System.Net.IPAddress class.

    For an IPv4 address we need to make sure we are using the proper overload by casting the result of System.BitConverter to an int:

     

  • 0 Comments
  • Filed under: C#
  • 4,451 views

    For a call to a WinApi function I needed to convert an IP Address to an Integer in C#.

    This can be done using the System.Net.IPAddress class:

    Although this works, the compiler issues a warning: 

    warning CS0618: ‘System.Net.IPAddress.Address’ is obsolete: ‘This property has been deprecated. It is address family dependent. Please use IPAddress.Equals method to perform comparisons. http://go.microsoft.com/fwlink/?linkid=14202′

    This warning is issued because the Address property is not IPv6 compatible. The warning can be suppressed like this:

    But it would be better to use the non deprecated GetAddressBytes() Method:

  • 1 Comment
  • Filed under: C#
  • Blogroll


    Categories


    Archives