You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Determines file read/write permissions. This is a version of [_access, _waccess](../../c-runtime-library/reference/access-waccess.md) with security enhancements as described in [Security Features in the CRT](../../c-runtime-library/security-features-in-the-crt.md).
25
26
26
27
## Syntax
@@ -36,15 +37,17 @@ errno_t _waccess_s(
36
37
);
37
38
```
38
39
39
-
#### Parameters
40
-
`path`
40
+
### Parameters
41
+
42
+
`path`
41
43
File or directory path.
42
44
43
45
`mode`
44
46
Permission setting.
45
47
46
48
## Return Value
47
-
Each function returns 0 if the file has the given mode. The function returns an error code if the named file does not exist or is not accessible in the given mode. In this case, the function returns an error code from the set as follows and also sets `errno` to the same value.
49
+
50
+
Each function returns 0 if the file has the given mode. The function returns an error code if the named file does not exist or is not accessible in the given mode. In this case, the function returns an error code from the set as follows and also sets `errno` to the same value.
48
51
49
52
`EACCES`
50
53
Access denied. The file's permission setting does not allow specified access.
@@ -58,7 +61,8 @@ errno_t _waccess_s(
58
61
For more information, see [errno, _doserrno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
59
62
60
63
## Remarks
61
-
When used with files, the `_access_s` function determines whether the specified file exists and can be accessed as specified by the value of `mode`. When used with directories, `_access_s` determines only whether the specified directory exists. In [!INCLUDE[Win2kFamily](../../c-runtime-library/includes/win2kfamily_md.md)] and later operating systems, all directories have read and write access.
64
+
65
+
When used with files, the `_access_s` function determines whether the specified file exists and can be accessed as specified by the value of `mode`. When used with directories, `_access_s` determines only whether the specified directory exists. In [!INCLUDE[Win2kFamily](../../c-runtime-library/includes/win2kfamily_md.md)] and later operating systems, all directories have read and write access.
62
66
63
67
|mode value|Checks file for|
64
68
|----------------|---------------------|
@@ -87,7 +91,8 @@ errno_t _waccess_s(
87
91
|`_waccess_s`|\<wchar.h> or \<io.h>|\<errno.h>|
88
92
89
93
## Example
90
-
This example uses `_access_s` to check the file named crt_access_s.c to see whether it exists and whether writing is allowed.
94
+
95
+
This example uses `_access_s` to check the file named crt_access_s.c to see whether it exists and whether writing is allowed.
91
96
92
97
```
93
98
// crt_access_s.c
@@ -130,7 +135,8 @@ File crt_access_s.c does not have write permission.
Determines if a file is read-only or not. More secure versions are available; see [_access_s, _waccess_s](../../c-runtime-library/reference/access-s-waccess-s.md).
25
26
26
27
## Syntax
@@ -36,15 +37,17 @@ int _waccess(
36
37
);
37
38
```
38
39
39
-
#### Parameters
40
-
`path`
40
+
### Parameters
41
+
42
+
`path`
41
43
File or directory path.
42
44
43
45
`mode`
44
46
Read/write attribute.
45
47
46
48
## Return Value
47
-
Each function returns 0 if the file has the given mode. The function returns -1 if the named file does not exist or does not have the given mode; in this case, `errno` is set as shown in the following table.
49
+
50
+
Each function returns 0 if the file has the given mode. The function returns -1 if the named file does not exist or does not have the given mode; in this case, `errno` is set as shown in the following table.
48
51
49
52
`EACCES`
50
53
Access denied: the file's permission setting does not allow specified access.
@@ -58,7 +61,8 @@ int _waccess(
58
61
For more information about these and other return codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
59
62
60
63
## Remarks
61
-
When used with files, the `_access` function determines whether the specified file or directory exists and has the attributes specified by the value of `mode`. When used with directories, `_access` determines only whether the specified directory exists; in [!INCLUDE[Win2kFamily](../../c-runtime-library/includes/win2kfamily_md.md)] and later operating systems, all directories have read and write access.
64
+
65
+
When used with files, the `_access` function determines whether the specified file or directory exists and has the attributes specified by the value of `mode`. When used with directories, `_access` determines only whether the specified directory exists; in [!INCLUDE[Win2kFamily](../../c-runtime-library/includes/win2kfamily_md.md)] and later operating systems, all directories have read and write access.
62
66
63
67
|`mode` value|Checks file for|
64
68
|------------------|---------------------|
@@ -87,7 +91,8 @@ int _waccess(
87
91
|`_waccess`|\<wchar.h> or \<io.h>|\<errno.h>|
88
92
89
93
## Example
90
-
The following example uses `_access` to check the file named crt_ACCESS.C to see whether it exists and whether writing is allowed.
94
+
95
+
The following example uses `_access` to check the file named crt_ACCESS.C to see whether it exists and whether writing is allowed.
91
96
92
97
```
93
98
// crt_access.c
@@ -120,7 +125,8 @@ File crt_ACCESS.C does not have write permission.
Frees a block of memory that was allocated with [_aligned_malloc](../../c-runtime-library/reference/aligned-malloc.md) or [_aligned_offset_malloc](../../c-runtime-library/reference/aligned-offset-malloc.md) (debug only).
25
26
26
27
## Syntax
@@ -31,12 +32,14 @@ void _aligned_free_dbg(
31
32
);
32
33
```
33
34
34
-
#### Parameters
35
-
`memblock`
35
+
### Parameters
36
+
37
+
`memblock`
36
38
A pointer to the memory block that was returned to the `_aligned_malloc` or `_aligned_offset_malloc` function.
37
39
38
40
## Remarks
39
-
The `_aligned_free_dbg` function is a debug version of the [_aligned_free](../../c-runtime-library/reference/aligned-free.md) function. When [_DEBUG](../../c-runtime-library/debug.md) is not defined, each call to `_aligned_free_dbg` is reduced to a call to `_aligned_free`. Both `_aligned_free` and `_aligned_free_dbg` free a memory block in the base heap, but `_aligned_free_dbg` accommodates a debugging feature: the ability to keep freed blocks in the heap's linked list to simulate low memory conditions.
41
+
42
+
The `_aligned_free_dbg` function is a debug version of the [_aligned_free](../../c-runtime-library/reference/aligned-free.md) function. When [_DEBUG](../../c-runtime-library/debug.md) is not defined, each call to `_aligned_free_dbg` is reduced to a call to `_aligned_free`. Both `_aligned_free` and `_aligned_free_dbg` free a memory block in the base heap, but `_aligned_free_dbg` accommodates a debugging feature: the ability to keep freed blocks in the heap's linked list to simulate low memory conditions.
40
43
41
44
`_aligned_free_dbg` performs a validity check on all specified files and block locations before performing the free operation. The application is not expected to provide this information. When a memory block is freed, the debug heap manager automatically checks the integrity of the buffers on either side of the user portion and issues an error report if overwriting has occurred. If the `_CRTDBG_DELAY_FREE_MEM_DF` bit field of the [_crtDbgFlag](../../c-runtime-library/crtdbgflag.md) flag is set, the freed block is filled with the value 0xDD, assigned the `_FREE_BLOCK` block type, and kept in the heap's linked list of memory blocks.
42
45
@@ -53,4 +56,5 @@ void _aligned_free_dbg(
53
56
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md) in the Introduction.
Frees a block of memory that was allocated with [_aligned_malloc](../../c-runtime-library/reference/aligned-malloc.md) or [_aligned_offset_malloc](../../c-runtime-library/reference/aligned-offset-malloc.md).
25
26
26
27
## Syntax
@@ -31,12 +32,14 @@ void _aligned_free (
31
32
);
32
33
```
33
34
34
-
#### Parameters
35
-
`memblock`
35
+
### Parameters
36
+
37
+
`memblock`
36
38
A pointer to the memory block that was returned to the `_aligned_malloc` or `_aligned_offset_malloc` function.
37
39
38
40
## Remarks
39
-
`_aligned_free` is marked `__declspec(noalias)`, meaning that the function is guaranteed not to modify global variables. For more information, see [noalias](../../cpp/noalias.md).
41
+
42
+
`_aligned_free` is marked `__declspec(noalias)`, meaning that the function is guaranteed not to modify global variables. For more information, see [noalias](../../cpp/noalias.md).
40
43
41
44
This function does not validate its parameter, unlike the other _aligned CRT functions. If `memblock` is a `NULL` pointer, this function simply performs no actions. It does not change `errno` and it does not invoke the invalid parameter handler. If an error occurs in the function due to not using _aligned functions previously to allocate the block of memory or a misalignment of memory occurs due to some unforeseen calamity, the function generates a debug report from the [_RPT, _RPTF, _RPTW, _RPTFW Macros](../../c-runtime-library/reference/rpt-rptf-rptw-rptfw-macros.md).
42
45
@@ -47,7 +50,9 @@ void _aligned_free (
47
50
|`_aligned_free`|\<malloc.h>|
48
51
49
52
## Example
50
-
For more information, see [_aligned_malloc](../../c-runtime-library/reference/aligned-malloc.md).
53
+
54
+
For more information, see [_aligned_malloc](../../c-runtime-library/reference/aligned-malloc.md).
0 commit comments