Skip to content

Commit 7656bf3

Browse files
authored
Merge pull request #3628 from MicrosoftDocs/master636985512469661850
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents a08815f + da4079f commit 7656bf3

File tree

6 files changed

+108
-14
lines changed

6 files changed

+108
-14
lines changed

docs/code-quality/annotating-function-parameters-and-return-values.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Annotating Function Parameters and Return Values
3-
ms.date: 11/04/2016
3+
ms.date: 07/11/2019
44
ms.topic: "conceptual"
55
f1_keywords:
66
- "_Outptr_opt_result_bytebuffer_to_"
@@ -119,6 +119,9 @@ f1_keywords:
119119
- "_Outref_result_bytebuffer_"
120120
- "_Result_nullonfailure_"
121121
- "_Ret_null_"
122+
- "_Scanf_format_string_"
123+
- "_Scanf_s_format_string_"
124+
- "_Printf_format_string_"
122125
ms.assetid: 82826a3d-0c81-421c-8ffe-4072555dca3a
123126
author: mikeblome
124127
ms.author: mblome
@@ -279,6 +282,7 @@ This article describes typical uses of annotations for simple function parameter
279282
A pointer to a null-terminated array for which the expression `p` - `_Curr_` (that is, `p` minus `_Curr_`) is defined by the appropriate language standard. The elements prior to `p` do not have to be valid in pre-state and must be valid in post-state.
280283

281284
## Optional Pointer Parameters
285+
282286
When a pointer parameter annotation includes `_opt_`, it indicates that the parameter may be null. Otherwise, the annotation performs the same as the version that doesn't include `_opt_`. Here is a list of the `_opt_` variants of the pointer parameter annotations:
283287

284288
||||
@@ -378,6 +382,7 @@ This article describes typical uses of annotations for simple function parameter
378382
The returned pointer points to a valid buffer if the function succeeds, or null if the function fails. This annotation is for a reference parameter.
379383

380384
## Output Reference Parameters
385+
381386
A common use of the reference parameter is for output parameters. For simple output reference parameters—for example, `int&``_Out_` provides the correct semantics. However, when the output value is a pointer—for example `int *&`—the equivalent pointer annotations like `_Outptr_ int **` don't provide the correct semantics. To concisely express the semantics of output reference parameters for pointer types, use these composite annotations:
382387

383388
**Annotations and Descriptions**
@@ -439,13 +444,65 @@ This article describes typical uses of annotations for simple function parameter
439444
Result must be valid in post-state, but may be null in post state. Points to valid buffer of `s` bytes of valid elements.
440445

441446
## Return Values
447+
442448
The return value of a function resembles an `_Out_` parameter but is at a different level of de-reference, and you don't have to consider the concept of the pointer to the result. For the following annotations, the return value is the annotated object—a scalar, a pointer to a struct, or a pointer to a buffer. These annotations have the same semantics as the corresponding `_Out_` annotation.
443449

444450
|||
445451
|-|-|
446452
|`_Ret_z_`<br /><br /> `_Ret_writes_(s)`<br /><br /> `_Ret_writes_bytes_(s)`<br /><br /> `_Ret_writes_z_(s)`<br /><br /> `_Ret_writes_to_(s,c)`<br /><br /> `_Ret_writes_maybenull_(s)`<br /><br /> `_Ret_writes_to_maybenull_(s)`<br /><br /> `_Ret_writes_maybenull_z_(s)`|`_Ret_maybenull_`<br /><br /> `_Ret_maybenull_z_`<br /><br /> `_Ret_null_`<br /><br /> `_Ret_notnull_`<br /><br /> `_Ret_writes_bytes_to_`<br /><br /> `_Ret_writes_bytes_maybenull_`<br /><br /> `_Ret_writes_bytes_to_maybenull_`|
447453

454+
## Format string parameters
455+
456+
- `_Printf_format_string_`
457+
Indicates that the parameter is a format string for use in a `printf` expression.
458+
459+
**Example**
460+
461+
```cpp
462+
int MyPrintF(_Printf_format_string_ const wchar_t* format, ...)
463+
{
464+
va_list args;
465+
va_start(args, format);
466+
int ret = vwprintf(format, args);
467+
va_end(args);
468+
return ret;
469+
}
470+
```
471+
472+
- `_Scanf_format_string_`
473+
Indicates that the parameter is a format string for use in a `scanf` expression.
474+
475+
**Example**
476+
477+
```cpp
478+
int MyScanF(_Scanf_format_string_ const wchar_t* format, ...)
479+
{
480+
va_list args;
481+
va_start(args, format);
482+
int ret = vwscanf(format, args);
483+
va_end(args);
484+
return ret;
485+
}
486+
```
487+
488+
- `_Scanf_s_format_string_`
489+
Indicates that the parameter is a format string for use in a `scanf_s` expression.
490+
491+
**Example**
492+
493+
```cpp
494+
int MyScanF_s(_Scanf_s_format_string_ const wchar_t* format, ...)
495+
{
496+
va_list args;
497+
va_start(args, format);
498+
int ret = vwscanf_s(format, args);
499+
va_end(args);
500+
return ret;
501+
}
502+
```
503+
448504
## Other Common Annotations
505+
449506
**Annotations and Descriptions**
450507

451508
- `_In_range_(low, hi)`
@@ -484,6 +541,7 @@ This article describes typical uses of annotations for simple function parameter
484541
`min(pM->nSize, sizeof(MyStruct))`
485542

486543
## Related Resources
544+
487545
[Code Analysis Team Blog](http://go.microsoft.com/fwlink/?LinkId=251197)
488546

489547
## See Also

docs/code-quality/fxcop-analyzers.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
### YamlMime:YamlDocument
22
documentType: LandingData
3-
title: Migrate from FxCop code analysis to .NET compiler platform analyzers
3+
title: Migrate from binary analysis (FxCop) to source analysis (FxCop analyzers)
44
metadata:
55
title: FxCop migration documentation
6-
description: Learn how to migrate from legacy FxCop to analyzers for code analysis.
7-
ms.date: 07/18/2018
6+
description: Learn how to move from legacy binary analysis (FxCop) to source analysis (FxCop analyzers) when you analyze code.
7+
ms.date: 07/11/2019
88
ms.prod: visual-studio-dev16
99
ms.technology: vs-ide-code-analysis
1010
ms.topic: landing-page
@@ -14,7 +14,7 @@ metadata:
1414
author: gewarren
1515
manager: jillfra
1616
abstract:
17-
description: Learn how to analyze code for the first time, or how to migrate from FxCop to the new way of analyzing managed code using analyzers.
17+
description: Learn how to analyze code for the first time or how to migrate from binary analysis (FxCop) to the new way of analyzing managed code using source analysis (FxCop analyzers).
1818
aside:
1919
image:
2020
alt: Common management tasks logo
@@ -25,7 +25,7 @@ abstract:
2525
sections:
2626
- title: Frequently asked questions
2727
items:
28-
- html: Get answers to some <a href="fxcop-analyzers-faq.md">frequently asked questions</a> about the differences between FxCop and analyzers.
28+
- html: Get answers to some <a href="fxcop-analyzers-faq.md">frequently asked questions</a> about the differences between binary FxCop analysis and source analysis using FxCop analyzers.
2929

3030
- title: If you're new to code analysis...
3131
items:
@@ -55,15 +55,15 @@ sections:
5555
src: https://docs.microsoft.com/media/common/i_cligeneric.svg
5656
title: Command-line usage
5757

58-
- title: If you're an FxCop user...
58+
- title: If you're currently using binary analysis (FxCop)...
5959
items:
6060
- type: list
6161
style: cards
6262
className: cardsM
6363
columns: 2
6464
items:
6565
- href: roslyn-analyzers-overview.md#roslyn-analyzers-vs-static-code-analysis
66-
html: <p>Learn the differences between static (FxCop) and analyzer code analysis.</p>
66+
html: <p>Learn the differences between binary analysis (FxCop) and source analysis (FxCop analyzers).</p>
6767
image:
6868
src: https://docs.microsoft.com/media/common/i_learn-about.svg
6969
title: What's different?
@@ -73,7 +73,7 @@ sections:
7373
src: https://docs.microsoft.com/media/common/i_setup.svg
7474
title: Install FxCop analyzers
7575
- href: fxcop-rule-port-status.md
76-
html: <p>Lists the static code analysis FxCop rules that have been ported to FxCop analyzers.</p>
76+
html: <p>Lists the binary analysis (FxCop) rules that have been ported to source analysis (FxCop analyzers).</p>
7777
image:
7878
src: https://docs.microsoft.com/media/common/i_upgrade.svg
7979
title: Ported and unported rules

docs/debugger/debugging-errors-and-warning-dialog-boxes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Below are the errors and warning dialog boxes you may encounter while debugging
3131
[Cannot Change Value Dialog Box](../debugger/cannot-change-value-dialog-box.md)
3232

3333
[Debugger Cannot Display Source Code or Disassembly](../debugger/debugger-cannot-display-source-code-or-disassembly.md)
34+
35+
[Debugger Services Running Out of Memory](../debugger/error-debugger-services-no-memory.md)
3436

3537
[Executable for Debugging Session Dialog Box](../debugger/executable-for-debugging-session-dialog-box.md)
3638

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "Debugger Services Running Out of Memory | Microsoft Docs"
3+
ms.date: "07/10/2019"
4+
ms.topic: "troubleshooting"
5+
f1_keywords:
6+
- "vs.debug.error.debug_no_memory"
7+
dev_langs:
8+
- "CSharp"
9+
- "VB"
10+
- "FSharp"
11+
- "C++"
12+
helpviewer_keywords:
13+
- "debugger"
14+
author: "isadorasophia"
15+
ms.author: "isgarcia"
16+
manager: caslan
17+
ms.workload:
18+
- "multiple"
19+
---
20+
# Debugger Services Running Out of Memory
21+
The Debugging Services ran out of memory and caused the termination of the debugging session.
22+
23+
## To investigate this error on Windows
24+
- You can check the process memory graph in the **Diagnostics Tools** window to see if the target application is experiencing huge growth in memory. If so, use the **Memory Usage** tool to diagnose what is the underlying issue, see [Analyze memory usage](../profiling/memory-usage.md).
25+
26+
- If the target application does not seem to be consuming a lot of memory, use the **Task Manager** window to check out memory usage of Visual Studio (devenv.exe), the worker process (msvsmon.exe), or of VS Code (vsdbg.exe/vsdbg-ui.exe) to determine if this is a debugger problem. If the process running out of memory is devenv.exe, consider reducing the number of Visual Studio extensions running.
27+
28+
## See Also
29+
- [Blog post: Analyze CPU and Memory while Debugging](https://devblogs.microsoft.com/visualstudio/analyze-cpu-memory-while-debugging/)
30+
- [About Memory Management](/windows/win32/memory/about-memory-management)

docs/debugger/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,8 @@
710710
href: cannot-change-value-dialog-box.md
711711
- name: Debugger Cannot Display Source Code or Disassembly
712712
href: debugger-cannot-display-source-code-or-disassembly.md
713+
- name: Debugger Services Running Out of Memory
714+
href: error-debugger-services-no-memory.md
713715
- name: Executable for Debugging Session dialog box
714716
href: executable-for-debugging-session-dialog-box.md
715717
- name: Edit and Continue dialog box (C++)

docs/extensibility/set-install-root.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@ manager: jillfra
99
ms.workload:
1010
- "vssdk"
1111
---
12-
# Installing outside the extensions folder
12+
# Install outside the extensions folder
1313

14-
Starting with Visual Studio 2017 and VSIX v3 (version 3), there is now support for installing extension assets outside of the extensions folder. Currently, the following locations are enabled as valid installation locations (where [INSTALLDIR] is mapped to the Visual Studio instance's installation directory):
14+
Starting with Visual Studio 2017 and VSIX v3 (version 3), extension assets can be installed outside of the extensions folder. Currently, the following locations are enabled as valid installation locations (where [INSTALLDIR] is mapped to the Visual Studio instance's installation directory):
1515

1616
* [INSTALLDIR]\MSBuild
1717
* [INSTALLDIR]\Xml\Schemas
1818
* [INSTALLDIR]\Common7\IDE\PublicAssemblies
1919
* [INSTALLDIR]\Licenses
2020
* [INSTALLDIR]\Common7\IDE\ReferenceAssemblies
2121
* [INSTALLDIR]\Common7\IDE\RemoteDebugger
22-
* [INSTALLDIR]\Common7\IDE\VC\VCTargets
22+
* [INSTALLDIR]\Common7\IDE\VC\VCTargets (only supported for Visual Studio 2017; deprecated for Visual Studio 2019 and later)
2323

24-
>**Note:** The VSIX format does not allow you to install outside the VS install folder structure.
24+
> [!NOTE]
25+
> The VSIX format doesn't allow you to install outside the Visual Studio install folder structure.
2526
2627
In order to support installing to these directories, the VSIX must be installed "per-instance per-machine". This can be enabled by checking the "all-users" checkbox in the extension.vsixmanifest designer:
2728

@@ -43,7 +44,8 @@ This will add some metadata to the corresponding `ProjectReference` property ins
4344
</ProjectReference>
4445
```
4546

46-
>**Note:** You can edit the .csproj file directly, if you prefer.
47+
> [!NOTE]
48+
> You can edit the .csproj file directly, if you prefer.
4749
4850
## How to set a subpath under the InstallRoot
4951

0 commit comments

Comments
 (0)