Skip to content

Fix git push error for protected CLA branch #799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -8015,6 +8015,51 @@
"redirect_url": "/cpp/windows/accelerator-editor",
"redirect_document_id": false
},
{
"source_path": "docs/windows/showing-or-hiding-the-dialog-editor-toolbar.md",
"redirect_url": "/cpp/windows/dialog-editor",
"redirect_document_id": false
},
{
"source_path": "docs/windows/switching-between-dialog-box-controls-and-code.md",
"redirect_url": "/cpp/windows/dialog-editor",
"redirect_document_id": false
},
{
"source_path": "docs/windows/accelerator-keys-for-the-dialog-editor.md",
"redirect_url": "/cpp/windows/dialog-editor",
"redirect_document_id": false
},
{
"source_path": "docs/windows/testing-a-dialog-box.md",
"redirect_url": "/cpp/windows/creating-a-new-dialog-box",
"redirect_document_id": false
},
{
"source_path": "docs/windows/custom-controls-in-the-dialog-editor.md",
"redirect_url": "/cpp/windows/controls-in-dialog-boxes",
"redirect_document_id": false
},
{
"source_path": "docs/windows/troubleshooting-the-dialog-editor.md",
"redirect_url": "/cpp/windows/adding-editing-or-deleting-controls",
"redirect_document_id": false
},
{
"source_path": "docs/windows/adding-values-to-a-combo-box-control.md",
"redirect_url": "/cpp/windows/defining-mnemonics-access-keys",
"redirect_document_id": false
},
{
"source_path": "docs/windows/selecting-controls.md",
"redirect_url": "/cpp/windows/arrangement-of-controls-on-dialog-boxes",
"redirect_document_id": false
},
{
"source_path": "docs/windows/sizing-individual-controls.md",
"redirect_url": "/cpp/windows/arrangement-of-controls-on-dialog-boxes",
"redirect_document_id": false
},
{
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Calling Conventions, Parameters, and Return Type"
ms.date: "11/04/2016"
ms.date: "02/13/2019"
helpviewer_keywords: ["calling conventions, helper functions", "helper functions, calling conventions", "helper functions, return types"]
ms.assetid: 0ffa4558-6005-4803-be95-7a8ec8837660
---
Expand All @@ -18,12 +18,12 @@ FARPROC WINAPI __delayLoadHelper2(
### Parameters

*pidd*<br/>
A `const` pointer to a `ImgDelayDescr` (see delayimp.h) that contains the offsets of various import-related data, a timestamp for binding information, and a set of attributes that provide further information about the descriptor content. Currently there is only one attribute, `dlattrRva`, which indicates that the addresses in the descriptor are relative virtual addresses (as opposed to virtual addresses).
A `const` pointer to a `ImgDelayDescr` that contains the offsets of various import-related data, a timestamp for binding information, and a set of attributes that provide further information about the descriptor content. Currently there's only one attribute, `dlattrRva`, which indicates that the addresses in the descriptor are relative virtual addresses. For more information, see the declarations in *delayimp.h*.

For the definition of the `PCImgDelayDescr` structure, see [Structure and Constant Definitions](../../build/reference/structure-and-constant-definitions.md).

*ppfnIATEntry*<br/>
A pointer to the slot in the delay load import address table (IAT) to be updated with the address of the imported function. The helper routine needs to store the same value that it will be returning into this location.
A pointer to the slot in the delay load import address table (IAT) that's updated with the address of the imported function. The helper routine needs to store the same value that it returns into this location.

## Expected Return Values

Expand All @@ -37,11 +37,11 @@ If the function fails, it raises an exception and returns 0. Three types of exce

- Failure of `GetProcAddress`.

It is your responsibility to handle these exceptions.
It's your responsibility to handle these exceptions.

## Remarks

The calling convention for the helper function is `__stdcall`. The type of the return value is not relevant, so FARPROC is used. This function has C linkage.
The calling convention for the helper function is `__stdcall`. The type of the return value isn't relevant, so FARPROC is used. This function has C linkage.

The return value of the delay load helper needs to be stored in the passed-in function pointer location, unless you want your helper routine to be used as a notification hook. In that case, your code is responsible for finding the appropriate function pointer to return. The thunk code the linker generates then takes that return value as the real target of the import and jumps directly to it.

Expand Down Expand Up @@ -122,10 +122,10 @@ FARPROC WINAPI delayHook(unsigned dliNotify, PDelayLoadInfo pdli)

/*
and then at global scope somewhere
PfnDliHook __pfnDliNotifyHook2 = delayHook;
const PfnDliHook __pfnDliNotifyHook2 = delayHook;
*/
```

## See Also
## See also

[Understanding the Helper Function](../../build/reference/understanding-the-helper-function.md)
28 changes: 14 additions & 14 deletions docs/c-runtime-library/reference/read.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "_read"
ms.date: "11/04/2016"
ms.date: "02/13/2019"
apiname: ["_read"]
apilocation: ["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-stdio-l1-1-0.dll"]
apitype: "DLLExport"
Expand All @@ -16,9 +16,9 @@ Reads data from a file.

```C
int _read(
int fd,
void *buffer,
unsigned int count
int const fd,
void * const buffer,
unsigned const buffer_size
);
```

Expand All @@ -30,22 +30,22 @@ File descriptor referring to the open file.
*buffer*<br/>
Storage location for data.

*count*<br/>
Maximum number of bytes.
*buffer_size*<br/>
Maximum number of bytes to read.

## Return Value

**_read** returns the number of bytes read, which might be less than *count* if there are fewer than *count* bytes left in the file or if the file was opened in text mode, in which case each carriage return-line feed pair '\r\n' is replaced with a single linefeed character '\n'. Only the single linefeed character is counted in the return value. The replacement does not affect the file pointer.
**_read** returns the number of bytes read, which might be less than *buffer_size* if there are fewer than *buffer_size* bytes left in the file, or if the file was opened in text mode. In text mode, each carriage return-line feed pair `\r\n` is replaced with a single linefeed character `\n`. Only the single linefeed character is counted in the return value. The replacement does not affect the file pointer.

If the function tries to read at end of file, it returns 0. If *fd* is not valid, the file is not open for reading, or the file is locked, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, the function returns -1 and sets **errno** to **EBADF**.
If the function tries to read at end of file, it returns 0. If *fd* is not valid, the file isn't open for reading, or the file is locked, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, the function returns -1 and sets **errno** to **EBADF**.

If *buffer* is **NULL**, the invalid parameter handler is invoked. If execution is allowed to continue, the function returns -1 and **errno** is set to **EINVAL**.
If *buffer* is **NULL**, or if *buffer_size* > **INT_MAX**, the invalid parameter handler is invoked. If execution is allowed to continue, the function returns -1 and **errno** is set to **EINVAL**.

For more information about this and other return codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).

## Remarks

The **_read** function reads a maximum of *count* bytes into *buffer* from the file associated with *fd*. The read operation begins at the current position of the file pointer associated with the given file. After the read operation, the file pointer points to the next unread character.
The **_read** function reads a maximum of *buffer_size* bytes into *buffer* from the file associated with *fd*. The read operation begins at the current position of the file pointer associated with the given file. After the read operation, the file pointer points to the next unread character.

If the file was opened in text mode, the read terminates when **_read** encounters a CTRL+Z character, which is treated as an end-of-file indicator. Use [_lseek](lseek-lseeki64.md) to clear the end-of-file indicator.

Expand Down Expand Up @@ -81,18 +81,18 @@ char buffer[60000];

int main( void )
{
int fh;
unsigned int nbytes = 60000, bytesread;
int fh, bytesread;
unsigned int nbytes = 60000;

/* Open file for input: */
if( _sopen_s( &fh, "crt_read.txt", _O_RDONLY, _SH_DENYNO, 0 ) )
if ( _sopen_s( &fh, "crt_read.txt", _O_RDONLY, _SH_DENYNO, 0 ))
{
perror( "open failed on input file" );
exit( 1 );
}

/* Read in input: */
if( ( bytesread = _read( fh, buffer, nbytes ) ) <= 0 )
if (( bytesread = _read( fh, buffer, nbytes )) <= 0 )
perror( "Problem reading file" );
else
printf( "Read %u bytes from file\n", bytesread );
Expand Down
12 changes: 1 addition & 11 deletions docs/windows/TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,10 @@
#### [Binary Editor](binary-editor.md)
#### [Dialog Editor](dialog-editor.md)
##### [Creating a Dialog Box](creating-a-new-dialog-box.md)
##### [Showing or Hiding the Dialog Editor Toolbar](showing-or-hiding-the-dialog-editor-toolbar.md)
##### [Switching Between Dialog Box Controls and Code](switching-between-dialog-box-controls-and-code.md)
##### [Controls in Dialog Boxes](controls-in-dialog-boxes.md)
###### [Adding, Editing, or Deleting Controls](adding-editing-or-deleting-controls.md)
###### [Selecting Controls](selecting-controls.md)
###### [Sizing Controls](sizing-individual-controls.md)
###### [Adding Values to a Combo Box Control](adding-values-to-a-combo-box-control.md)
###### [Arrangement of Controls on Dialog Boxes](arrangement-of-controls-on-dialog-boxes.md)
###### [Custom Controls in the Dialog Editor](custom-controls-in-the-dialog-editor.md)
###### [Defining Mnemonics (Access Keys)](defining-mnemonics-access-keys.md)
###### [Designing a Dialog Box](testing-a-dialog-box.md)
##### [Accelerator Keys for the Dialog Editor](accelerator-keys-for-the-dialog-editor.md)
##### [Troubleshooting the Dialog Editor](troubleshooting-the-dialog-editor.md)
##### [Defining Member Variables for Dialog Controls](defining-member-variables-for-dialog-controls.md)
###### [Defining Control Access and Values](defining-mnemonics-access-keys.md)
#### [Image Editor for Icons](image-editor-for-icons.md)
##### [Editing Graphical Resources (Image Editor for Icons)](editing-graphical-resources-image-editor-for-icons.md)
###### [Creating an Icon or Other Image (Image Editor for Icons)](creating-an-icon-or-other-image-image-editor-for-icons.md)
Expand Down
43 changes: 0 additions & 43 deletions docs/windows/accelerator-keys-for-the-dialog-editor.md

This file was deleted.

Loading