Skip to content

Commit 18ee232

Browse files
Merge branch 'main' of https://github.com/MicrosoftDocs/cpp-docs-pr into vcraigcasey0302
2 parents 3878e54 + f225b51 commit 18ee232

14 files changed

Lines changed: 1051 additions & 1071 deletions

‎docs/c-runtime-library/reference/endthread-endthreadex.md‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_endthread", "endthreadex", "_endthreadex", "endthread"]
1010
helpviewer_keywords: ["_endthread function", "endthread function", "terminating threads", "endthreadex function", "_endthreadex function", "threading [C++], terminating threads"]
11-
ms.assetid: 18a91f2f-659e-40b4-b266-ec12dcf2abf5
1211
---
13-
# _endthread, _endthreadex
12+
# `_endthread`, `_endthreadex`
1413

15-
Terminates a thread; **_endthread** terminates a thread that's created by **_beginthread** and **_endthreadex** terminates a thread that's created by **_beginthreadex**.
14+
Terminates a thread; **`_endthread`** terminates a thread that's created by **`_beginthread`** and **`_endthreadex`** terminates a thread that's created by **`_beginthreadex`**.
1615

1716
## Syntax
1817

@@ -25,31 +24,31 @@ void _endthreadex(
2524

2625
### Parameters
2726

28-
*retval*<br/>
27+
*`retval`*\
2928
Thread exit code.
3029

3130
## Remarks
3231

33-
You can call **_endthread** or **_endthreadex** explicitly to terminate a thread; however, **_endthread** or **_endthreadex** is called automatically when the thread returns from the routine passed as a parameter to **_beginthread** or **_beginthreadex**. Terminating a thread with a call to **endthread** or **_endthreadex** helps ensure proper recovery of resources allocated for the thread.
32+
You can call **`_endthread`** or **`_endthreadex`** explicitly to terminate a thread; however, **`_endthread`** or **`_endthreadex`** is called automatically when the thread returns from the routine passed as a parameter to **`_beginthread`** or **`_beginthreadex`**. Terminating a thread with a call to **`endthread`** or **`_endthreadex`** helps ensure proper recovery of resources allocated for the thread.
3433

3534
> [!NOTE]
36-
> For an executable file linked with Libcmt.lib, do not call the Win32 [ExitThread](/windows/win32/api/processthreadsapi/nf-processthreadsapi-exitthread) API; this prevents the run-time system from reclaiming allocated resources. **_endthread** and **_endthreadex** reclaim allocated thread resources and then call **ExitThread**.
35+
> For an executable file linked with Libcmt.lib, do not call the Win32 [`ExitThread`](/windows/win32/api/processthreadsapi/nf-processthreadsapi-exitthread) API; this prevents the run-time system from reclaiming allocated resources. **`_endthread`** and **`_endthreadex`** reclaim allocated thread resources and then call **`ExitThread`**.
3736
38-
**_endthread** automatically closes the thread handle. (This behavior differs from the Win32 **ExitThread** API.) Therefore, when you use **_beginthread** and **_endthread**, do not explicitly close the thread handle by calling the Win32 [CloseHandle](/windows/win32/api/handleapi/nf-handleapi-closehandle) API.
37+
**`_endthread`** automatically closes the thread handle. (This behavior differs from the Win32 **`ExitThread`** API.) Therefore, when you use **`_beginthread`** and **`_endthread`**, don't explicitly close the thread handle by calling the Win32 [`CloseHandle`](/windows/win32/api/handleapi/nf-handleapi-closehandle) API.
3938

40-
Like the Win32 **ExitThread** API, **_endthreadex** does not close the thread handle. Therefore, when you use **_beginthreadex** and **_endthreadex**, you must close the thread handle by calling the Win32 **CloseHandle** API.
39+
Like the Win32 **`ExitThread`** API, **`_endthreadex`** doesn't close the thread handle. Therefore, when you use **`_beginthreadex`** and **`_endthreadex`**, you must close the thread handle by calling the Win32 **`CloseHandle`** API.
4140

4241
> [!NOTE]
43-
> **_endthread** and **_endthreadex** cause C++ destructors pending in the thread not to be called.
42+
> **`_endthread`** and **`_endthreadex`** cause C++ destructors pending in the thread not to be called.
4443
4544
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
4645

4746
## Requirements
4847

4948
|Function|Required header|
5049
|--------------|---------------------|
51-
|**_endthread**|\<process.h>|
52-
|**_endthreadex**|\<process.h>|
50+
|**`_endthread`**|`<process.h>`|
51+
|**`_endthreadex`**|`<process.h>`|
5352

5453
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
5554

@@ -59,9 +58,9 @@ Multithreaded versions of the [C run-time libraries](../../c-runtime-library/crt
5958

6059
## Example
6160

62-
See the example for [_beginthread](beginthread-beginthreadex.md).
61+
See the example for [`_beginthread`](beginthread-beginthreadex.md).
6362

6463
## See also
6564

66-
[Process and Environment Control](../../c-runtime-library/process-and-environment-control.md)<br/>
67-
[_beginthread, _beginthreadex](beginthread-beginthreadex.md)<br/>
65+
[Process and Environment Control](../../c-runtime-library/process-and-environment-control.md)\
66+
[`_beginthread`, `_beginthreadex`](beginthread-beginthreadex.md)

‎docs/c-runtime-library/reference/fstat-fstat32-fstat64-fstati64-fstat32i64-fstat64i32.md‎

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_fstat32i64", "fstat", "fstat64i32", "_fstat64", "_fstati64", "fstat64", "_fstat32", "fstat32i64", "fstati64", "_fstat", "fstat32", "_fstat64i32"]
1010
helpviewer_keywords: ["_fstat64 function", "fstati64 function", "_fstat64i32 function", "_fstat32i64 function", "_fstat32 function", "file information", "fstat64i32 function", "fstat32 function", "fstat function", "fstat64 function", "_fstat function", "_fstati64 function", "fstat32i64 function"]
11-
ms.assetid: 088f5e7a-9636-4cf7-ab8e-e28d2aa4280a
1211
---
13-
# _fstat, _fstat32, _fstat64, _fstati64, _fstat32i64, _fstat64i32
12+
# `_fstat`, `_fstat32`, `_fstat64`, `_fstati64`, `_fstat32i64`, `_fstat64i32`
1413

1514
Gets information about an open file.
1615

@@ -45,66 +44,66 @@ int _fstat64i32(
4544

4645
### Parameters
4746

48-
*fd*<br/>
47+
*`fd`*\
4948
File descriptor of the open file.
5049

51-
*buffer*<br/>
50+
*`buffer`*\
5251
Pointer to the structure to store results.
5352

5453
## Return Value
5554

56-
Returns 0 if the file-status information is obtained. A return value of -1 indicates an error. If the file descriptor is invalid or *buffer* is **NULL**, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, **errno** is set to **EBADF**, in the case of an invalid file descriptor, or to **EINVAL**, if *buffer* is **NULL**.
55+
Returns 0 if the file-status information is obtained. A return value of -1 indicates an error. If the file descriptor is invalid or *`buffer`* is **`NULL`**, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, **`errno`** is set to **`EBADF`**, in the case of an invalid file descriptor, or to **`EINVAL`**, if *`buffer`* is **`NULL`**.
5756

5857
## Remarks
5958

60-
The **_fstat** function obtains information about the open file associated with *fd* and stores it in the structure pointed to by *buffer*. The **_stat** structure, defined in SYS\Stat.h, contains the following fields.
59+
The **`_fstat`** function obtains information about the open file associated with *`fd`* and stores it in the structure pointed to by *`buffer`*. The **`_stat`** structure, defined in `SYS\Stat.h`, contains the following fields.
6160

6261
|Field|Meaning|
6362
|-|-|
64-
| **st_atime** | Time of the last file access. |
65-
| **st_ctime** | Time of the creation of the file. |
66-
| **st_dev** | If a device, *fd*; otherwise 0. |
67-
| **st_mode** | Bit mask for file-mode information. The **_S_IFCHR** bit is set if *fd* refers to a device. The **_S_IFREG** bit is set if *fd* refers to an ordinary file. The read/write bits are set according to the file's permission mode. **_S_IFCHR** and other constants are defined in SYS\Stat.h. |
68-
| **st_mtime** | Time of the last modification of the file. |
69-
| **st_nlink** | Always 1 on non-NTFS file systems. |
70-
| **st_rdev** | If a device, *fd*; otherwise 0. |
71-
| **st_size** | Size of the file in bytes. |
63+
| **`st_atime`** | Time of the last file access. |
64+
| **`st_ctime`** | Time of the creation of the file. |
65+
| **`st_dev`** | If a device, *`fd`*; otherwise 0. |
66+
| **`st_mode`** | Bit mask for file-mode information. The **`_S_IFCHR`** bit is set if *`fd`* refers to a device. The **`_S_IFREG`** bit is set if *`fd`* refers to an ordinary file. The read/write bits are set according to the file's permission mode. **`_S_IFCHR`** and other constants are defined in `SYS\Stat.h`. |
67+
| **`st_mtime`** | Time of the last modification of the file. |
68+
| **`st_nlink`** | Always 1 on non-NTFS file systems. |
69+
| **`st_rdev`** | If a device, *`fd`*; otherwise 0. |
70+
| **`st_size`** | Size of the file in bytes. |
7271

73-
If *fd* refers to a device, the **st_atime**, **st_ctime**, **st_mtime**, and **st_size** fields are not meaningful.
72+
If *`fd`* refers to a device, the **`st_atime`**, **`st_ctime`**, **`st_mtime`**, and **`st_size`** fields aren't meaningful.
7473

75-
Because Stat.h uses the [_dev_t](../../c-runtime-library/standard-types.md) type, which is defined in Types.h, you must include Types.h before Stat.h in your code.
74+
Because `Stat.h` uses the [`_dev_t`](../../c-runtime-library/standard-types.md) type, which is defined in `Types.h`, you must include `Types.h` before `Stat.h` in your code.
7675

77-
**_fstat64**, which uses the **__stat64** structure, allows file-creation dates to be expressed up through 23:59:59, December 31, 3000, UTC; whereas the other functions only represent dates through 23:59:59 January 18, 2038, UTC. Midnight, January 1, 1970, is the lower bound of the date range for all these functions.
76+
**`_fstat64`**, which uses the **`__stat64`** structure, allows file-creation dates to be expressed up through 23:59:59, December 31, 3000, UTC; whereas the other functions only represent dates through 23:59:59 January 18, 2038, UTC. Midnight, January 1, 1970, is the lower bound of the date range for all these functions.
7877

79-
Variations of these functions support 32-bit or 64-bit time types and 32-bit or 64-bit file lengths. The first numerical suffix (**32** or **64**) indicates the size of the time type used; the second suffix is either **i32** or **i64**, indicating whether the file size is represented as a 32-bit or 64-bit integer.
78+
Variations of these functions support 32-bit or 64-bit time types and 32-bit or 64-bit file lengths. The first numerical suffix (**32** or **64**) indicates the size of the time type used; the second suffix is either **`i32`** or **`i64`**, indicating whether the file size is represented as a 32-bit or 64-bit integer.
8079

81-
**_fstat** is equivalent to **_fstat64i32**, and **`struct`** **_stat** contains a 64-bit time. This is true unless **_USE_32BIT_TIME_T** is defined, in which case the old behavior is in effect; **_fstat** uses a 32-bit time, and **`struct`** **_stat** contains a 32-bit time. The same is true for **_fstati64**.
80+
**`_fstat`** is equivalent to **`_fstat64i32`**, and **`struct`** **`_stat`** contains a 64-bit time. This is true unless **`_USE_32BIT_TIME_T`** is defined, in which case the old behavior is in effect; **`_fstat`** uses a 32-bit time, and **`struct`** **`_stat`** contains a 32-bit time. The same is true for **`_fstati64`**.
8281

8382
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
8483

85-
### Time Type and File Length Type Variations of _stat
84+
### Time Type and File Length Type Variations of `_stat`
8685

87-
|Functions|_USE_32BIT_TIME_T defined?|Time type|File length type|
86+
|Functions|`_USE_32BIT_TIME_T` defined?|Time type|File length type|
8887
|---------------|------------------------------------|---------------|----------------------|
89-
|**_fstat**|Not defined|64-bit|32-bit|
90-
|**_fstat**|Defined|32-bit|32-bit|
91-
|**_fstat32**|Not affected by the macro definition|32-bit|32-bit|
92-
|**_fstat64**|Not affected by the macro definition|64-bit|64-bit|
93-
|**_fstati64**|Not defined|64-bit|64-bit|
94-
|**_fstati64**|Defined|32-bit|64-bit|
95-
|**_fstat32i64**|Not affected by the macro definition|32-bit|64-bit|
96-
|**_fstat64i32**|Not affected by the macro definition|64-bit|32-bit|
88+
|**`_fstat`**|Not defined|64-bit|32-bit|
89+
|**`_fstat`**|Defined|32-bit|32-bit|
90+
|**`_fstat32`**|Not affected by the macro definition|32-bit|32-bit|
91+
|**`_fstat64`**|Not affected by the macro definition|64-bit|64-bit|
92+
|**`_fstati64`**|Not defined|64-bit|64-bit|
93+
|**`_fstati64`**|Defined|32-bit|64-bit|
94+
|**`_fstat32i64`**|Not affected by the macro definition|32-bit|64-bit|
95+
|**`_fstat64i32`**|Not affected by the macro definition|64-bit|32-bit|
9796

9897
## Requirements
9998

10099
|Function|Required header|
101100
|--------------|---------------------|
102-
|**_fstat**|\<sys/stat.h> and \<sys/types.h>|
103-
|**_fstat32**|\<sys/stat.h> and \<sys/types.h>|
104-
|**_fstat64**|\<sys/stat.h> and \<sys/types.h>|
105-
|**_fstati64**|\<sys/stat.h> and \<sys/types.h>|
106-
|**_fstat32i64**|\<sys/stat.h> and \<sys/types.h>|
107-
|**_fstat64i32**|\<sys/stat.h> and \<sys/types.h>|
101+
|**`_fstat`**|`<sys/stat.h>` and `<sys/types.h>`|
102+
|**`_fstat32`**|`<sys/stat.h>` and `<sys/types.h>`|
103+
|**`_fstat64`**|`<sys/stat.h>` and `<sys/types.h>`|
104+
|**`_fstati64`**|`<sys/stat.h>` and `<sys/types.h>`|
105+
|**`_fstat32i64`**|`<sys/stat.h>` and `<sys/types.h>`|
106+
|**`_fstat64i32`**|`<sys/stat.h>` and `<sys/types.h>`|
108107

109108
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
110109

@@ -175,8 +174,8 @@ Time modified : Wed May 07 15:25:11 2003
175174

176175
## See also
177176

178-
[File Handling](../../c-runtime-library/file-handling.md)<br/>
179-
[_access, _waccess](access-waccess.md)<br/>
180-
[_chmod, _wchmod](chmod-wchmod.md)<br/>
181-
[_filelength, _filelengthi64](filelength-filelengthi64.md)<br/>
182-
[_stat, _wstat Functions](stat-functions.md)<br/>
177+
[File Handling](../../c-runtime-library/file-handling.md)\
178+
[`_access`, `_waccess`](access-waccess.md)\
179+
[`_chmod`, `_wchmod`](chmod-wchmod.md)\
180+
[`_filelength`, `_filelengthi64`](filelength-filelengthi64.md)\
181+
[`_stat`, `_wstat` Functions](stat-functions.md)

‎docs/c-runtime-library/reference/mkgmtime-mkgmtime32-mkgmtime64.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A quantity of type **`__time32_t`** or **`__time64_t`** representing the number
4040

4141
The **`_mkgmtime32`** and **`_mkgmtime64`** functions convert a UTC time to a **`__time32_t`** or **`__time64_t`** type representing the time in UTC. To convert a local time to UTC time, use **`mktime`**, **`_mktime32`**, and **`_mktime64`** instead.
4242

43-
**_mkgmtime** is an inline function that evaluates to **`_mkgmtime64`**, and **`time_t`** is equivalent to **`__time64_t`**. If you need to force the compiler to interpret **`time_t`** as the old 32-bit **`time_t`**, you can define **`_USE_32BIT_TIME_T`**. We don't recommend it, because your application might fail after January 18, 2038, the maximum range of a 32-bit **`time_t`**. It's not allowed at all on 64-bit platforms.
43+
**`_mkgmtime`** is an inline function that evaluates to **`_mkgmtime64`**, and **`time_t`** is equivalent to **`__time64_t`**. If you need to force the compiler to interpret **`time_t`** as the old 32-bit **`time_t`**, you can define **`_USE_32BIT_TIME_T`**. We don't recommend it, because your application might fail after January 18, 2038, the maximum range of a 32-bit **`time_t`**. It's not allowed at all on 64-bit platforms.
4444

4545
The time structure passed in is changed as follows, in the same way as it's changed by the **`_mktime`** functions: the **`tm_wday`** and **`tm_yday`** fields are set to new values based on the values of **`tm_mday`** and **`tm_year`**. Because the time is assumed to be UTC, the **`tm_isdst`** field is ignored.
4646

‎docs/code-quality/c26813.md‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
---
22
description: "Learn more about: C26813"
33
title: c26813
4-
keywords: c26813
5-
ms.date: 02/23/2022
4+
ms.date: 03/02/2022
65
ms.topic: reference
76
f1_keywords: ["C26813"]
87
helpviewer_keywords: ["C26813"]
9-
dev_langs: ["C++"]
108
---
119
# C26813
1210

1311
> Warning C26813: Use 'bitwise and' to check if a flag is set
1412
15-
Most `enum`s with power of two member values are intended to be used with bit flags. As a result, we rarely want to equality compare these flags. We want to extract the bits we are interested in using bitwise operations instead.
13+
Most `enum` types with power of two member values are intended to be used as bit flags. As a result, you rarely want to compare these flags for equality. Instead, extract the bits you're interested in by using bitwise operations.
1614

1715
## Example
1816

@@ -41,8 +39,7 @@ void useEqualsWithBitwiseEnum(BitWise a)
4139
}
4240
```
4341

44-
4542
## See also
4643

47-
[C26827](./c26827.md)
44+
[C26827](./c26827.md)\
4845
[C26828](./c26828.md)

‎docs/code-quality/c26827.md‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
---
22
description: "Learn more about: C26827"
33
title: c26827
4-
keywords: c26814
5-
ms.date: 02/23/2022
4+
ms.date: 03/02/2022
65
ms.topic: reference
76
f1_keywords: ["C26827"]
87
helpviewer_keywords: ["C26827"]
9-
dev_langs: ["C++"]
108
---
119
# C26827
1210

13-
> Warning C26827: Did you forgot to initialize an enum or wanted to use another type?
11+
> Warning C26827: Did you forget to initialize an enum, or intend to use another type?
1412
15-
Most `enum` types used in bitwise operations are expected to have members with values of powers of two. This warning attempts to find cases where we forgot to give a value to an enum constant explicitly or inadvertently used the wrong enum type.
13+
Most `enum` types used in bitwise operations are expected to have members with values of powers of two. This warning attempts to find cases where a value wasn't given explicitly to an enumeration constant. It also finds cases where the wrong enumeration type may have been used inadvertently.
1614

1715
## Example
1816

@@ -27,11 +25,11 @@ enum class AlmostBitWise
2725

2826
int almostBitwiseEnums(AlmostBitWise a, bool cond)
2927
{
30-
return (int)a|(int)AlmostBitWise::A; // Warning C26827: Did you forgot to initialize an enum or wanted to use another type?
28+
return (int)a|(int)AlmostBitWise::A; // Warning C26827: Did you forget to initialize an enum, or intend to use another type?
3129
}
3230
```
3331
34-
To fix the warning, initialize the enum constant to the correct value or use the correct enum type in the operation.
32+
To fix the warning, initialize the enumeration constant to the correct value, or use the correct enumeration type in the operation.
3533
3634
```cpp
3735
enum class AlmostBitWise
@@ -50,5 +48,5 @@ int almostBitwiseEnums(AlmostBitWise a, bool cond)
5048

5149
## See also
5250

53-
[C26813](./c26813.md)
51+
[C26813](./c26813.md)\
5452
[C26828](./c26828.md)

‎docs/code-quality/c26828.md‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
---
22
description: "Learn more about: C26828"
33
title: c26828
4-
keywords: c26828
5-
ms.date: 02/23/2022
4+
ms.date: 03/02/2022
65
ms.topic: reference
76
f1_keywords: ["C26828"]
87
helpviewer_keywords: ["C26828"]
9-
dev_langs: ["C++"]
108
---
119
# C26828
1210

1311
> Warning C26828: Different enum types have overlapping values. Did you want to use another enum constant here?
1412
15-
Most of the times we use a single enum to describe all the bit flags we can use for an option. If we use two different enum types in the same bitwise expression where the enums have overlapping values the chances are good those enums were not designed to be used in the expression.
13+
Most of the time, a single enumeration type describes all the bit flags that you can use for an option. If you use two different enumeration types that have overlapping values in the same bitwise expression, the chances are good those enumeration types weren't designed for use together.
1614

1715
## Example
1816

@@ -39,7 +37,7 @@ int overlappingBitwiseEnums(BitWiseA a)
3937
}
4038
```
4139
42-
To fix the warning make sure `enum`s that are designed to be used together have no overlapping values or make sure all the related options are in a single `enum`.
40+
To fix the warning, make sure enumeration types designed for use together have no overlapping values. Or, make sure all the related options are in a single enumeration type.
4341
4442
```cpp
4543
@@ -58,6 +56,5 @@ int overlappingBitwiseEnums(BitWiseA a)
5856

5957
## See also
6058

61-
[C26813](./c26813.md)
59+
[C26813](./c26813.md)\
6260
[C26827](./c26827.md)
63-

0 commit comments

Comments
 (0)