POS for .NET Support on 64-Bit Editions of Microsoft Windows Operating Systems

Article translations Article translations
Close Close
Article ID: 959944 - View products that this article applies to.
Expand all | Collapse all

On This Page

Source: Microsoft Support

RAPID PUBLISHING

RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.

Symptom



This article contains information about how to use POS for .NET on 64-bit x64-based editions of Microsoft Windows operating systems. POS for .NET is designed to run in both 32-bit and 64-bit mode, but there are some limitations and issues that should be considered when you deploy on 64-bit platforms. These issues are discussed in this KnowledgeBase article.

Background Information

 

WOW64



Windows 32-bit on Windows 64-bit (WOW64) is an emulation layer that enables 32-bit applications to run seamlessly on 64-bit platforms. WOW64 is included on all 64-bit editions of Windows.

 

Registry Redirection



In order to allow 32-bit and 64-bit COM registration and program states to coexist, the WOW64 subsystem transparently intercepts and redirects registry calls. This guarantees that registry calls are directed to the correct branch for 32-bit software. 

 

Windows allows 64-bit programs and installers to access the HKEY_LOCAL_MACHINE\Software registry subkey without redirection. However, for 32-bit programs, WOW64 intercepts registry calls to the HKEY_LOCAL_MACHINE\Software subkey and redirects them to HKEY_LOCAL_MACHINE\Software\WOW6432node. By redirecting only the 32-bit program calls, WOW64 guarantees that programs always write to and access the appropriate registry subkey. Registry redirection does not require program code modifications and the process is transparent to the user.

 

Registry Subkeys Included in Redirection



The following registry subkeys are redirected in current versions of the 64-bit editions of Windows operating systems:

HKEY_LOCAL_MACHINE\Software\Classes
HKEY_LOCAL_MACHINE\Software\Ole

HKEY_LOCAL_MACHINE\Software\Rpc

HKEY_LOCAL_MACHINE\Software\COM3

HKEY_LOCAL_MACHINE\Software\EventSystem

Registry key redirection may change in later operating system versions. Software developers are encouraged to avoid developing program code that is based on previously documented lists of redirected keys. Instead, code should be written to verify redirection status before it makes calls to the 32-bit or 64-bit logical view of the registry.

 

.NET Framework Applications on 64-bit Computers



By default, .NET Framework applications have the platform target set to “Any CPU.” Host applications developed with this option selected can run 64-bit code on a 64-bit operating system, and 32-bit code on a 32-bit operating system. The host application developer has the option to specify the platform target of x86 or x64 at compile time. If the x86 option is selected at compile time, the host application will run it in 32-bit mode on a 64-bit operating system. If the x64 option is selected at compile time, the host application will run in 64-bit mode on a 64-bit operating system and will not run on a 32-bit operating system.

 

You can override the target platform of a .NET Framework application by using the corflags.exe command that uses the /32BIT command-line option. However, we do not recommend using this option, because it will affect strong name signed applications.

  POS for .NET (P4DN)

 

Libraries



The POS for .NET libraries are designed to run in both 32-bit and 64-bit mode on a 64-bit system. Because the libraries run in-process with the host application, they will run in 32-bit mode on a 32-bit host, and 64-bit mode on a 64-bit host. 

 

In order to support both a 32-bit and a 64-bit host on a 64-bit operating system, all registry data is stored and retrieved from the subkey contained under WOW6432node. Therefore the registry subkey

 

HKEY_LOCAL_MACHINE\SOFTWARE\POSfor.NET

 

is translated by P4DN to the following subkey on a 64-bit operating system:

 

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432node \POSfor.NET

 

 

POSDM



The POSDM utility runs in 32-bit mode on both 64-bit and 32-bit operating systems.

  Native Service Objects

Native service objects that are designed to work in both 32-bit and 64-bit mode continue to operate on 64-bit editions of Windows operating systems. Service objects that rely on 32-bit COM or other technology will not function if the host application is running in 64-bit mode.  Therefore, all service object developers are encouraged to write 32/64-bit agnostic code. 

  Impact on Legacy Control and Service Objects

Legacy control and service objects are based on the 32-bit version of COM. Therefore, the WOW system automatically redirects the registry key for these objects. In particular, consider the following registry key:

 

HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail

 

This key is automatically redirected to the following location:

 

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432node\OLEforRetail

 

Although this redirection should be transparent, it may still cause problems for legacy code depending on how the registry keys are created (for example, registry keys that are created by using a registry file will not be automatically redirected). Changes to the registry in the wrong location will be unavailable to 32-bit COM code.

 

Important: Legacy controls and service objects are based on 32-bit COM. Therefore, the host application must be started in a 32-bit process if it wishes to support such legacy OPOS controls and service objects.

 

Important: Legacy OPOS control and service objects may not function as expected on the 64-bit editions of Windows operating systems even when the host is running in 32-bit mode. If you want to use such legacy software on a 64-bit edition of Windows, we recommend that you contact the software developer to determine whether they are compatible. 

 

SDK Samples



All SDK sample service objects and the test applications are designed to be 32 or 64-bit agnostic. Therefore, they work on both 32-bit and 64-bit processes.

 

 

 

More Information

Learn More



For more information about the difference between 32-bit and 64-bit editions of Windows, see the following:

 

http://support.microsoft.com/kb/896459

http://www.microsoft.com/whdc/system/platform/64bit/WoW64_bestprac.mspx

DISCLAIMER

MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.

Properties

Article ID: 959944 - Last Review: May 12, 2009 - Revision: 2.0
APPLIES TO
  • Microsoft POS for .NET Software Development Kit v.1.1
Keywords: 
kbnomt kbrapidpub KB959944

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com