64-Bit and 32-Bit Considerations

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

On a 64-bit version of Windows (both Itanium and x64), both native 64-bit MMC and 32-bit MMC exist on the system. This section covers the launch sequence and logic considerations, depending on various parameters used.

MMC (64) examines all snap-ins and extensions that are defined in the console file and checks the registry to determine if they are available as 32-bit, 64-bit, or both versions. Depending on the answer, it either runs as a 64-bit process or re-launches MMC (32). The goal is to run a process that is able to load the most number of snap-ins. If equal number of snap-ins can be loaded with both, the user is prompted to make a decision.

Note: To force MMC to run as a 32-bit process, you can set the /32 switch, and invoke either version of MMC to supersede all registry checks. This is only intended as an end user option to deal with third party snap-ins that do not provide 64-bit versions. A strong guideline for Microsoft snap-in developers is to ship both 32 and 64-bit versions of their snap-in in order to ensure that the snap-in is available regardless of any third party snap-ins installed on the system. Restricting yourself to developing only a 32-bit version of the snap-in has the following impact on your customers:

  1. The snap-in has to be launched specially.

  2. The snap-in is not visible in the normal MMC use case (64-bit process).

  3. The console file does not 'load' correctly using the File/Open dialog unless MMC is launched as a 32-bit process.

  4. Your snap-in cannot be used in any other console file without the same constraint.

Command Line Switches

MMC can be executed with command line parameters, such as a console file name. Additionally, the following command line switches are recognized by MMC.

  • /32

  • /64

Note: If both the preceding switches are specified on the command line, then the far right switch is in effect. If MMC is started with no command line parameters, or if MMC is started with the /64 switch, it executes as the MMC (64) application. Subsequently, if MMC is started with the /32 command-line option, MMC (32) is launched, using the same parameters that were initially passed to MMC (64), additionally including the /32 command-line option, and MMC (64) will terminate.

When a Console File is Specified

If the MMC (64) command line does not contain a /32 or /64 command-line option, but the command line does contain a console file name, then MMC (64) examines the console file before determining which version of MMC needs to execute. MMC (64) uses the following algorithm:

Algorithm in use when a console file is specified:

  1. If all snap-ins referenced by the console file are available in 64-bit form, then MMC (64) will remain as the executing version. In this event, the remaining algorithm steps are not executed. A snap-in is considered available in 64-bit form if there is a registry entry of the form HKEY_CLASSES_ROOT\CLSID\snap-in clsid\InprocServer32 key in the registry, where snap-in clsid is the registered CLSID for the snap-in.

  2. If not all snap-ins referenced by the console file are available in 64-bit form, but all of them are available in 32-bit form, then MMC (64) starts MMC (32) with the /32 switch. MMC (32) executes using the console file as specified on the command line, and MMC (64) terminates. The remaining algorithm steps are not executed. A snap-in is considered available in 32-bit form if there is a registry entry of the form HKEY_CLASSES_ROOT\Wow6432Node\CLSID\snap-in clsid\InprocServer32 key in the registry, where snap-in clsid is the registered CLSID for the snap-in.

  3. If there is a 64-bit version available for every snap-in that is available as a 32-bit version, and there are some snap-ins that are available only as 64-bit snap-ins, then MMC (64) is the version that is executed. The remaining algorithm steps are not executed.

  4. If there is a 32-bit version available for every snap-in that is available as a 64-bit version, and there are some snap-ins that are available only as 32-bit snap-ins, then MMC (64) starts MMC (32) and MMC (64) closes. The remaining algorithm steps are not executed.

  5. If none of the previous steps are conclusive, then a user interface is presented to the user, prompting the user to specify which version of MMC to run. An option to cancel is also presented to the user.

  6. In any event where MMC (64) fails to successfully start MMC (32), MMC (64) continues to run. After MMC (32) has been successfully started by MMC (64), MMC (64) closes. Note: If an error occurs after MMC (32) has successfully started, MMC (64) is not notified, since it will have already closed.

Known Issue About Installing 32-bit managed snap-ins on 64-bit Systems

The installer currently cannot recognize that a 32-bit snap-in is being installed on a 64-bit operating system, therefore, it does not register the snap-in correctly. Specifically, it adds registration information to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MMC\SnapIns\FX Registry instead of HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MMC\SnapIns\FX

To get around this problem, please run installutil.exe outside of the appropriate Framework/Framework64 directory. If you have a snap-in built for ILONLY (ILONLY indicates that the executable contains pure IL code and can run either as 32-bit or as a 64-bit process), but want to register it under the wow64 hive, use installutil.exe that is available in the directory %windir%\microsoft.net\framework\v2.n.n.n. For the 64-bit hive registration, run installutil.exe from the directory %windir%\microsoft.net\framework64\v2.n.n.n.

Installutil.exe is built for a specific platform, therefore it will start as a 32 or 64-bit process and the related registry hive will be updated. Note that if you have a snap-in built with the platform switch, you will only be able to register it in one of the hives (32-bit or 64-bit).

See Also

Introducing 64 bit Windows