/hotpatch (Create Hotpatchable Image)

Prepares an image for hot patching.

/hotpatch

Remarks

When /hotpatch is used in a compilation, the compiler ensures that first instruction of each function is at least two bytes, which is required for hot patching.

To complete the preparation for making an image hotpatchable, after you use /hotpatch to compile, you must use /FUNCTIONPADMIN (Create Hotpatchable Image) to link. When you compile and link an image by using one invocation of cl.exe, /hotpatch implies /functionpadmin.

Because instructions are always two bytes or larger on the ARM architecture, and because x64 compilation is always treated as if /hotpatch has been specified, you don't have to specify /hotpatch when you compile for these targets; however, you must still link by using /functionpadmin to create hotpatchable images for them. The /hotpatch compiler option only affects x86 compilation.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.

  2. Select the C/C++ folder.

  3. Select the Command Line property page.

  4. Add the compiler option to the Additional Options box.

To set this compiler option programmatically

Guidance

For more information about update management, see "Security Guidance for Update Management" at https://www.microsoft.com/technet/security/guidance/PatchManagement.mspx.

See Also

Reference

Compiler Options

Setting Compiler Options