DMScript functions can access the Windows registry and launch programs. When DMScript runs on a 64-bit Window, the OS imposes certain rules as DMScript is a 32-bit application. Registry access for certain keys is automatically redirected to a parallel 32-bit registry area. For example, access to HKLM\SOFTWARE\xxx is redirected to HKLM\SOFTWARE\Wow6432Node\xxx. For a complete list of redirected keys, see: http://msdn.microsoft.com/en-us/library/aa384253(v=vs.85).aspx.
Similarly, accessing the file system using certain environment variables that reference system directories, are automatically redirected to directories that contain 32-bit binaries. For example, the %windir%\System32 directory is reserved for 64-bit applications. If DMScript attempts to access this directory, it is automatically redirected to %windir%\SysWOW64. For more information, see http://msdn.microsoft.com/en-us/library/aa384187(v=vs.85).aspx.
This behavior is important for Intellisig scripts because the scripts must detect 64-bit applications by accessing the correct 64-bit registry keys and file systems. For example, if an Intellisig attempts to read the registry key for the 64-bit version of 7zip in HKLM\SOFTWARE\7-zip, the script fails because it actually searches in HKLM\SOFTWARE\ Wow6432Node\7-zip does not exist. Similarly, an attempt to look for the 64-bit version of Notepad in %windir%\System32 finds the 32-bit version.
To handle this behavior, DMScript provides the following function that turns off the automatic redirection on 64-bit Windows OS:
setmode64(mode)
Specifies whether the redirection must be turned off or on. A value of 1 turns off redirection and a value of 0 turns it on.
Example: setmode64(1)
Note: When in the 64-bit mode, access the 32-bit registry using the physical name such as HKLM\SOFTWARE\Wow6432Node\xxx. However, Microsoft does not recommend this practice because the method of redirection can change in the future versions of Windows. Instead, the script must revert to the 32-bit mode.
Important! Disabling file system redirection for longer periods can prevent dmscript from loading system DLLs, causing it to fail.
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|