Skip to content

Commit c391466

Browse files
authored
Merge pull request #5803 from MicrosoftDocs/main
2/25/2025 AM Publish
2 parents 97b53d3 + fd0d05c commit c391466

11 files changed

+31
-36
lines changed

docs/build/cmake-remote-debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: "Tutorial: Debug a CMake project on a remote Windows machine"
3+
description: "How to use Visual Studio C++ on Windows to create and build a CMake project. You'll then deploy and debug it on a remote Windows machine."
34
ms.date: "12/4/2020"
45
ms.topic: tutorial
5-
description: "How to use Visual Studio C++ on Windows to create and build a CMake project. You'll then deploy and debug it on a remote Windows machine."
66
---
77

88
# Tutorial: Debug a CMake project on a remote Windows machine
@@ -115,7 +115,7 @@ For example, on the remote machine, from the Visual Studio Remote Debugger menu
115115

116116
Then, in Visual Studio on the host machine, update the *`launch.vs.json`* file to match. For example, if you choose **No Authentication** on the remote debugger, update the *`launch.vs.json`* file in your project by adding `"authenticationType": "none"` to the `configurations` section *`launch.vs.json`*. Otherwise, `"authenticationType"` defaults to `"windows"` and doesn't need to be explicitly stated. This example shows a *`launch.vs.json`* file configured for no authentication:
117117

118-
``` XAML
118+
```XAML
119119
{
120120
"version": "0.2.1",
121121
"defaults": {},

docs/build/how-to-use-build-events-in-msbuild-projects.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
description: "Learn more about: How to: Use Build Events in MSBuild Projects"
32
title: "How to: Use Build Events in MSBuild Projects"
3+
description: "Learn more about: How to: Use Build Events in MSBuild Projects"
44
ms.date: "11/04/2016"
55
helpviewer_keywords: ["msbuild (c++), howto: use build events in projects"]
6-
ms.assetid: 2a58dc9d-3d50-4e49-97c1-86c5a05ce218
76
---
87
# How to: Use Build Events in MSBuild Projects
98

@@ -33,7 +32,7 @@ The following table lists each *use-in-build* element:
3332

3433
The following example can be added inside of the Project element of the myproject.vcxproj file created in [Walkthrough: Using MSBuild to Create a C++ Project](walkthrough-using-msbuild-to-create-a-visual-cpp-project.md). A *pre-build* event makes a copy of main.cpp; a *pre-link* event makes a copy of main.obj; and a *post-build* event makes a copy of myproject.exe. If the project is built using a release configuration, the build events are executed. If the project is built using a debug configuration, the build events are not executed.
3534

36-
``` xml
35+
```xml
3736
<ItemDefinitionGroup>
3837
<PreBuildEvent>
3938
<Command>copy $(ProjectDir)main.cpp $(ProjectDir)copyOfMain.cpp</Command>
@@ -64,5 +63,5 @@ The following example can be added inside of the Project element of the myprojec
6463

6564
## See also
6665

67-
[MSBuild on the command line - C++](msbuild-visual-cpp.md)<br/>
66+
[MSBuild on the command line - C++](msbuild-visual-cpp.md)\
6867
[Walkthrough: Using MSBuild to Create a C++ Project](walkthrough-using-msbuild-to-create-a-visual-cpp-project.md)

docs/build/reference/guard-enable-control-flow-guard.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
description: "Learn more about: /guard (Enable Control Flow Guard)"
33
title: "/guard (Enable Control Flow Guard)"
4-
ms.date: 09/19/2022
4+
ms.date: 2/24/2025
55
f1_keywords: ["/guard", "VC.Project.VCCLCompilerTool.ControlFlowGuard"]
6-
ms.assetid: be495323-f59f-4cf3-a6b6-8ee69e6a19dd
76
---
87
# `/guard` (Enable Control Flow Guard)
98

@@ -16,15 +15,21 @@ Enable compiler generation of Control Flow Guard security checks.
1615
1716
## Remarks
1817

19-
The **`/guard:cf`** option causes the compiler to analyze control flow for indirect call targets at compile time, and then to insert code to verify the targets at runtime. By default, **`/guard:cf`** is off and must be explicitly enabled. To explicitly disable this option, use **`/guard:cf-`**.
18+
The **`/guard:cf`** option causes the compiler to analyze control flow for indirect call targets at compile time, and inserts code at runtime to verify the targets. By default, **`/guard:cf`** is off and must be explicitly enabled. To explicitly disable this option, use **`/guard:cf-`**.
2019

2120
**Visual Studio 2017 and later**: This option adds guards for **`switch`** statements that generate jump tables.
2221

2322
When the **`/guard:cf`** Control Flow Guard (CFG) option is specified, the compiler and linker insert extra runtime security checks to detect attempts to compromise your code. During compiling and linking, all indirect calls in your code are analyzed to find every location that the code can reach when it runs correctly. This information is stored in extra structures in the headers of your binaries. The compiler also injects a check before every indirect call in your code that ensures the target is one of the verified locations. If the check fails at runtime on a CFG-aware operating system, the operating system closes the program.
2423

2524
A common attack on software takes advantage of bugs in handling extreme or unexpected inputs. Carefully crafted input to the application may overwrite a location that contains a pointer to executable code. This technique can be used to redirect control flow to code controlled by the attacker. The CFG runtime checks don't fix the data corruption bugs in your executable. They instead make it more difficult for an attacker to use them to execute arbitrary code. CFG is a mitigation tool that prevents calls to locations other than function entry points in your code. It's similar to how Data Execution Prevention (DEP), [/GS](gs-buffer-security-check.md) stack checks, and [`/DYNAMICBASE`](dynamicbase-use-address-space-layout-randomization.md) and [/HIGHENTROPYVA](highentropyva-support-64-bit-aslr.md) address space layout randomization (ASLR) lower the chances that your code becomes an exploit vector.
2625

27-
The **`/guard:cf`** option must be passed to both the compiler and linker to build code that uses the CFG exploit mitigation technique. If your binary is built by using a single `cl` command, the compiler passes the option to the linker. If you compile and link separately, the option must be set on both the compiler and linker commands. The /DYNAMICBASE linker option is also required. To verify that your binary has CFG data, use the `dumpbin /headers /loadconfig` command. CFG-enabled binaries have `Guard` in the list of EXE or DLL characteristics, and Guard Flags include `CF Instrumented` and `FID table present`.
26+
To use the CFG exploit mitigation technique, pass **`/guard:cf`** to the compiler and **`/GUARD:CF`** to the linker.
27+
28+
To disable the CFG exploit mitigation technique, pass **`/guard:cf-`** to the compiler **`/GUARD:NO`** to the linker.
29+
30+
If you build using a single `cl` command, the compiler passes the option to the linker. If you compile and link separately, set the option for both the compiler and linker commands. The `/DYNAMICBASE` linker option is also required.
31+
32+
To verify that your binary has CFG data, use the `dumpbin /headers /loadconfig` command. CFG-enabled binaries have `Guard` in the list of EXE or DLL characteristics, and Guard Flags include `CF Instrumented` and `FID table present`.
2833

2934
The **`/guard:cf`** option is incompatible with [`/ZI`](z7-zi-zi-debug-information-format.md) (Edit and Continue debug information) or [`/clr`](clr-common-language-runtime-compilation.md) (Common Language Runtime Compilation).
3035

@@ -33,11 +38,8 @@ Code compiled by using **`/guard:cf`** can be linked to libraries and object fil
3338
### To set this compiler option in the Visual Studio development environment
3439

3540
1. Open the **Property Pages** dialog box for the project. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
36-
3741
1. Select the **Configuration Properties** > **C/C++** > **Code Generation** property page.
38-
3942
1. Select the **Control Flow Guard** property.
40-
4143
1. In the dropdown control, choose **Yes** to enable Control Flow Guard, or **No** to disable it.
4244

4345
## See also

docs/c-runtime-library/heapset.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
description: "Learn more about: _heapset"
32
title: "_heapset"
3+
description: "Learn more about: _heapset"
44
ms.date: "11/04/2016"
55
api_name: ["_heapset"]
66
api_location: ["msvcr90.dll", "msvcr80.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcrt.dll", "msvcr120.dll", "msvcr100.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_heapset", "heapset"]
1010
helpviewer_keywords: ["checking heap", "heapset function", "heaps, checking", "debugging [CRT], heap-related problems", "_heapset function"]
11-
ms.assetid: 9667eeb0-55bc-4c19-af5f-d1fd0a142b3c
1211
---
1312
# `_heapset`
1413

@@ -47,7 +46,7 @@ In addition, if an error occurs, **`_heapset`** sets `errno` to `ENOSYS`.
4746

4847
The **`_heapset`** function shows free memory locations or nodes that have been unintentionally overwritten.
4948

50-
**`_heapset`** checks for minimal consistency on the heap and then sets each byte of the heap's free entries to the `fill` value. This known value shows which memory locations of the heap contain free nodes and which contain data that were unintentionally written to freed memory. If the operating system doesn't support **`_heapset`**(for example, Windows 98), the function returns `_HEAPOK` and sets `errno` to `ENOSYS`.
49+
**`_heapset`** checks for minimal consistency on the heap and then sets each byte of the heap's free entries to the `fill` value. This known value shows which memory locations of the heap contain free nodes and which contain data that were unintentionally written to freed memory. If the operating system doesn't support **`_heapset`** (for example, Windows 98), the function returns `_HEAPOK` and sets `errno` to `ENOSYS`.
5150

5251
## Requirements
5352

docs/c-runtime-library/reference/heapchk.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
description: "Learn more about: _heapchk"
32
title: "_heapchk"
3+
description: "Learn more about: _heapchk"
44
ms.date: "4/2/2020"
55
api_name: ["_heapchk", "_o__heapchk"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-heap-l1-1-0.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_heapchk", "heapchk"]
1010
helpviewer_keywords: ["debugging [CRT], heap-related problems", "consistency checking of heaps", "heapchk function", "heaps, checking consistency", "_heapchk function"]
11-
ms.assetid: 859619a5-1e35-4f02-9e09-11d9fa266ec0
1211
---
1312
# `_heapchk`
1413

@@ -36,7 +35,7 @@ In addition, if an error occurs, **`_heapchk`** sets `errno` to `ENOSYS`.
3635
3736
## Remarks
3837
39-
The **`_heapchk`** function helps debug heap-related problems by checking for minimal consistency of the heap. If the operating system doesn't support **`_heapchk`**(for example, Windows 98), the function returns `_HEAPOK` and sets `errno` to `ENOSYS`.
38+
The **`_heapchk`** function helps debug heap-related problems by checking for minimal consistency of the heap. If the operating system doesn't support **`_heapchk`** (for example, Windows 98), the function returns `_HEAPOK` and sets `errno` to `ENOSYS`.
4039
4140
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
4241

docs/c-runtime-library/reference/heapmin.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
description: "Learn more about: _heapmin"
32
title: "_heapmin"
3+
description: "Learn more about: _heapmin"
44
ms.date: "4/2/2020"
55
api_name: ["_heapmin", "_o__heapmin"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-heap-l1-1-0.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_heapmin", "heapmin"]
1010
helpviewer_keywords: ["heap memory", "minimizing heaps", "memory, releasing", "heaps, releasing unused memory", "_heapmin function", "heapmin function"]
11-
ms.assetid: c0bccdf6-2d14-4d7b-a7ff-d6a17bdb410f
1211
---
1312
# `_heapmin`
1413

@@ -28,7 +27,7 @@ For more information about this and other return codes, see [`errno`, `_doserrno
2827
2928
## Remarks
3029
31-
The **`_heapmin`** function minimizes the heap by releasing unused heap memory to the operating system. If the operating system doesn't support **`_heapmin`**(for example, Windows 98), the function returns -1 and sets `errno` to `ENOSYS`.
30+
The **`_heapmin`** function minimizes the heap by releasing unused heap memory to the operating system. If the operating system doesn't support **`_heapmin`** (for example, Windows 98), the function returns -1 and sets `errno` to `ENOSYS`.
3231
3332
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
3433

docs/code-quality/c6030.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,32 @@ f1_keywords: ["C6030", "USE_ATTRIBUTE_NORETURN", "__WARNING_USE_ATTRIBUTE_NORETU
66
helpviewer_keywords: ["C6030"]
77
---
88

9-
# Warning C6030
9+
# Warning C6030
1010

1111
> Use attribute [[noreturn]] over __declspec(noreturn) in function '*function-name*'
1212
1313
## Remarks
1414

15-
This warning suggests using the C++11 standard attribute `[[noreturn]]` in place of the declspec variant `__declspec(noreturn)`. The standard attribute provides better cross-platform support because it doesn't rely on language extensions.
15+
This warning suggests using the C++11 standard attribute [`[[noreturn]]`](../cpp/attributes.md#noreturn) in place of the declspec variant [`__declspec(noreturn)`](../cpp/noreturn.md). The standard attribute provides better cross-platform support because it doesn't rely on language extensions.
1616

1717
This warning is off by default and isn't part of the `All Rules` rule set. To enable this warning, it must be added to the rule set file being used.
1818

1919
This check is available in Visual Studio 2022 version 17.0 and later versions.
20+
2021
Code analysis name: `USE_ATTRIBUTE_NORETURN`
2122

2223
## Example
2324

2425
The following code generates C6030:
2526

2627
```cpp
27-
__declspec(noreturn) void TerminateApplication();
28-
28+
__declspec(noreturn) void terminate_application();
2929
```
3030
3131
Fix the issue by using the `[[noreturn]]` attribute:
3232
3333
```cpp
34-
[[ noreturn ]] void TerminateApplication();
35-
34+
[[noreturn]] void terminate_application();
3635
```
3736

3837
## See also

docs/cpp/unhook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ A pointer to the event handler method to be unhooked from an event. The handler
6464

6565
- Managed events: *`ReceiverClass`* is the event receiver class and *`HandlerMethod`* is the handler.
6666

67-
*`receiver`*(optional)
67+
*`receiver`* (optional)
6868
A pointer to an instance of the event receiver class. If you don't specify a receiver, the default is the receiver class or structure in which **`__unhook`** is called.
6969

7070
## Usage

docs/dotnet/data-access-using-adonet-cpp-cli.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
description: "Learn more about: Data Access Using ADO.NET (C++/CLI)"
32
title: "Data Access Using ADO.NET (C++/CLI)"
3+
description: "Learn more about: Data Access Using ADO.NET (C++/CLI)"
44
ms.date: "11/04/2016"
55
helpviewer_keywords: ["ADO.NET [C++]", ".NET Framework [C++], data access", "databases [C++], accessing in C++", "data access [C++], ADO.NET", "data [C++], ADO.NET", "native strings [C++]", "ADO.NET [C++], marshaling ANSI strings", "strings [C++], ADO.NET", "BSTRs, strings", "ADO.NET [C++], marshaling BSTR strings", "strings [C++], marshaling BSTR strings", "ADO.NET [C++], marshaling Unicode strings", "Unicode [C++], strings", "strings [C++], Unicode", "VARIANT, marshaling", "ADO.NET [C++], marshaling VARIANT types", "VARIANT", "SAFEARRAY, marshaling", "ADO.NET [C++], marshaling SAFEARRAY types"]
6-
ms.assetid: b0cd987d-1ea7-4f76-ba01-cbd52503d06d
76
---
87
# Data Access Using ADO.NET (C++/CLI)
98

@@ -152,7 +151,7 @@ The rest of the code in this example is native C++ code, as is indicated by the
152151
> [!NOTE]
153152
> The memory allocated by <xref:System.Runtime.InteropServices.Marshal.StringToBSTR%2A> must be deallocated by calling either <xref:System.Runtime.InteropServices.Marshal.FreeBSTR%2A> or `SysFreeString`.
154153
155-
``` cpp
154+
```cpp
156155
// adonet_marshal_string_bstr.cpp
157156
// compile with: /clr /FU System.dll /FU System.Data.dll /FU System.Xml.dll
158157
#include <comdef.h>

docs/extensions/compiler-support-for-type-traits-cpp-component-extensions.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
2-
description: "Learn more about: Compiler Support for Type Traits (C++/CLI and C++/CX)"
32
title: "Compiler Support for Type Traits (C++/CLI and C++/CX)"
3+
description: "Learn more about: Compiler Support for Type Traits (C++/CLI and C++/CX)"
44
ms.date: "10/12/2018"
55
ms.topic: "reference"
66
f1_keywords: ["__is_simple_value_class", "__has_trivial_destructor", "__has_assign", "__is_union", "__is_class", "__is_abstract", "__has_trivial_assign", "__has_virtual_destructor", "__is_ref_array", "__is_base_of", "__has_copy", "__is_polymorphic", "__has_nothrow_constructor", "__is_ref_class", "__is_delegate", "__is_convertible_to", "__is_value_class", "__is_interface_class", "__has_nothrow_copy", "__is_sealed", "__has_trivial_constructor", "__has_trivial_copy", "__is_enum", "__has_nothrow_assign", "__has_finalizer", "__is_empty", "__is_pod", "__has_user_destructor"]
77
helpviewer_keywords: ["__is_class keyword [C++]", "__is_pod keyword [C++]", "__is_delegate keyword [C++]", "__is_value_class keyword [C++]", "__has_copy keyword [C++]", "__has_nothrow_copy keyword [C++]", "__is_interface_class keyword [C++]", "__is_sealed keyword [C++]", "__is_convertible_to keyword [C++]", "__is_ref_class keyword [C++]", "__has_trivial_copy keyword [C++]", "__has_user_destructor keyword [C++]", "__is_abstract keyword [C++]", "__is_empty keyword [C++]", "__has_trivial_assign keyword [C++]", "__has_nothrow_constructor keyword [C++]", "__is_ref_array keyword [C++]", "__is_base_of keyword [C++]", "__has_nothrow_assign keyword [C++]", "__has_virtual_destructor keyword [C++]", "__has_finalizer keyword [C++]", "__is_union keyword [C++]", "__has_assign keyword [C++]", "__has_trivial_destructor keyword [C++]", "__is_polymorphic keyword [C++]", "__is_enum keyword [C++]", "__is_simple_value_class keyword [C++]", "__has_trivial_constructor keyword [C++]"]
8-
ms.assetid: cd440630-0394-48c0-a16b-1580b6ef5844
98
---
109
# Compiler Support for Type Traits (C++/CLI and C++/CX)
1110

@@ -160,7 +159,7 @@ The following list contains the type traits that are supported by the compiler.
160159

161160
Returns **`true`** if the type has a trivial, compiler-generated destructor.
162161

163-
``` cpp
162+
```cpp
164163
// has_trivial_destructor.cpp
165164
#include <stdio.h>
166165
struct S {};

docs/mfc/reference/buffercommand-enumeration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Used by [CMemFile::GetBufferPtr](cmemfile-class.md#getbufferptr) to determine wh
1111

1212
## Syntax
1313

14-
``` cpp
14+
```cpp
1515
public enum BufferCommand
1616
{
1717
bufferRead,

0 commit comments

Comments
 (0)