Skip to content
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

2021 August Console-Docs pass #214

Merged
merged 16 commits into from Aug 26, 2021
Merged

2021 August Console-Docs pass #214

merged 16 commits into from Aug 26, 2021

Conversation

miniksa
Copy link
Collaborator

@miniksa miniksa commented Aug 17, 2021

Fixes a variety of issues including:

@opbld30
Copy link

opbld30 commented Aug 17, 2021

Docs Build status updates of commit 3798325:

✅ Validation status: passed

File Status Preview URL Details
docs/TOC.md ✅Succeeded View
docs/char-info-str.md ✅Succeeded View
docs/clearing-the-screen.md ✅Succeeded View
docs/console-control-handlers.md ✅Succeeded View
docs/console-screen-buffers.md ✅Succeeded View
docs/console-virtual-terminal-sequences.md ✅Succeeded View
docs/creation-of-a-console.md ✅Succeeded View
docs/getstdhandle.md ✅Succeeded View
docs/includes/console-mode-flags.md ✅Succeeded View
docs/input-and-output-methods.md ✅Succeeded View
docs/registering-a-control-handler-function.md ✅Succeeded View
docs/setconsolectrlhandler.md ✅Succeeded View
docs/setstdhandle.md ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

docs/console-screen-buffers.md Outdated Show resolved Hide resolved

## Return value

If the function succeeds, the return value is a handle to the specified device, or a redirected handle set by a previous call to [**SetStdHandle**](setstdhandle.md). The handle has **GENERIC\_READ** and **GENERIC\_WRITE** access rights, unless the application has used **SetStdHandle** to set a standard handle with lesser access.

> [!TIP]
> It is not required to dispose of this handle with [**CloseHandle**](/windows/win32/api/handleapi/nf-handleapi-closehandle) when use is complete. See [**Remarks**](#handle-disposal) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> It is not required to dispose of this handle with [**CloseHandle**](/windows/win32/api/handleapi/nf-handleapi-closehandle) when use is complete. See [**Remarks**](#handle-disposal) for more information.
It is not required to dispose of this handle with [**CloseHandle**](/windows/win32/api/handleapi/nf-handleapi-closehandle) when you're done using it. See [**Remarks**](#handle-disposal) for more information.

Same below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was told once upon a time to not involve "You" in technical documentation. I could change it to "when completed" or "when done" though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah I remember having read the same. But I checked again and neither Microsoft's nor Google's technical writing guide mention anything against using "you". In fact they use it in their own examples.

Comment on lines 91 to 93
The case to manipulate the lifetime of these handles manually with **CloseHandle** is if intentionally trying to replace or block other parts of the process from using these handles going forward. Remember that `HANDLE` is a numerical value so another thread storing it locally will not necessarily be updated when the value from the table is updated with **SetStdHandle**. Closing the value will close it process wide and the next usage of the stored copy will encounter an error on **ReadFile** or **WriteFile** accordingly.

Guidance for replacing would be to get the existing `HANDLE` from the table with **GetStdHandle**, use **SetStdHandle** to place a new `HANDLE` in that is opened with **CreateFile** (or a similar function), then to close the retrieved handle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • In the first sentence I feel like some sort of pronoun or something is missing.
  • In the second sentence, "Remember" feels a bit condescending
  • If possible it'd be awesome if the English could be simplified computerized, because the MSDN machine translation might choke on this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a bit of clarity to the first bit.
I cut "remember" from the second bit.
I improved wording on the 3rd bit a little, I think.

Beyond that, I'm hoping @mattwojo can edit for clarity if necessary.

@@ -25,12 +27,13 @@ When a **CTRL\_CLOSE\_EVENT** signal is received, the control handler returns **

When a **CTRL\_BREAK\_EVENT**, **CTRL\_LOGOFF\_EVENT**, or **CTRL\_SHUTDOWN\_EVENT** signal is received, the control handler returns **FALSE**. Doing this causes the signal to be passed to the next control handler function. If no other control handlers have been registered or none of the registered handlers returns **TRUE**, the default handler will be used, resulting in the process being terminated.

> [!NOTE]
> Calling [**AttachConsole**](attachconsole.md), [**AllocConsole**](allocconsole.md), or [**FreeConsole**](freeconsole.md) will reset the table of control handlers in the client process to its initial default state. Handlers must be registered again when the attached console session changes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> Calling [**AttachConsole**](attachconsole.md), [**AllocConsole**](allocconsole.md), or [**FreeConsole**](freeconsole.md) will reset the table of control handlers in the client process to its initial default state. Handlers must be registered again when the attached console session changes.
> Calling [**AttachConsole**](attachconsole.md), [**AllocConsole**](allocconsole.md), or [**FreeConsole**](freeconsole.md) will reset the table of control handlers in the client process to their initial default state. Handlers must be registered again when the attached console session changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Their for "control handlers" instead of its for "table" is what you're saying?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Because control handlers is plural I assumed that it needs to be "their" initial states, since there are multiple. Is that incorrect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends how pedantic you want to be about English. The way I was taught, "table" is the object that is being "reset" therefore it should be "its" as if the additional prepositional phrase "of control handlers" describing what's in the table did not exist in this sentence. This one's done both ways all the time, though, so whichever is clearer to readers is fine with me.

docs/registering-a-control-handler-function.md Outdated Show resolved Hide resolved
docs/registering-a-control-handler-function.md Outdated Show resolved Hide resolved
docs/registering-a-control-handler-function.md Outdated Show resolved Hide resolved
Co-authored-by: Leonard Hecker <leonard@hecker.io>
@opbld32
Copy link

opbld32 commented Aug 19, 2021

Docs Build status updates of commit febf911:

✅ Validation status: passed

File Status Preview URL Details
docs/TOC.md ✅Succeeded View
docs/char-info-str.md ✅Succeeded View
docs/clearing-the-screen.md ✅Succeeded View
docs/console-control-handlers.md ✅Succeeded View
docs/console-screen-buffers.md ✅Succeeded View
docs/console-virtual-terminal-sequences.md ✅Succeeded View
docs/creation-of-a-console.md ✅Succeeded View
docs/getstdhandle.md ✅Succeeded View
docs/includes/console-mode-flags.md ✅Succeeded View
docs/input-and-output-methods.md ✅Succeeded View
docs/registering-a-control-handler-function.md ✅Succeeded View
docs/setconsolectrlhandler.md ✅Succeeded View
docs/setstdhandle.md ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

Co-authored-by: Leonard Hecker <leonard@hecker.io>
@opbld30
Copy link

opbld30 commented Aug 19, 2021

Docs Build status updates of commit 54d0c9a:

✅ Validation status: passed

File Status Preview URL Details
docs/TOC.md ✅Succeeded View
docs/char-info-str.md ✅Succeeded View
docs/clearing-the-screen.md ✅Succeeded View
docs/console-control-handlers.md ✅Succeeded View
docs/console-screen-buffers.md ✅Succeeded View
docs/console-virtual-terminal-sequences.md ✅Succeeded View
docs/creation-of-a-console.md ✅Succeeded View
docs/getstdhandle.md ✅Succeeded View
docs/includes/console-mode-flags.md ✅Succeeded View
docs/input-and-output-methods.md ✅Succeeded View
docs/registering-a-control-handler-function.md ✅Succeeded View
docs/setconsolectrlhandler.md ✅Succeeded View
docs/setstdhandle.md ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@opbld33
Copy link

opbld33 commented Aug 19, 2021

Docs Build status updates of commit 74151bc:

✅ Validation status: passed

File Status Preview URL Details
docs/TOC.md ✅Succeeded View
docs/char-info-str.md ✅Succeeded View
docs/clearing-the-screen.md ✅Succeeded View
docs/console-control-handlers.md ✅Succeeded View
docs/console-screen-buffers.md ✅Succeeded View
docs/console-virtual-terminal-sequences.md ✅Succeeded View
docs/creation-of-a-console.md ✅Succeeded View
docs/getstdhandle.md ✅Succeeded View
docs/includes/console-mode-flags.md ✅Succeeded View
docs/input-and-output-methods.md ✅Succeeded View
docs/registering-a-control-handler-function.md ✅Succeeded View
docs/setconsolectrlhandler.md ✅Succeeded View
docs/setstdhandle.md ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

docs/char-info-str.md Show resolved Hide resolved
docs/console-screen-buffers.md Outdated Show resolved Hide resolved
docs/getstdhandle.md Outdated Show resolved Hide resolved
docs/getstdhandle.md Outdated Show resolved Hide resolved
docs/getstdhandle.md Show resolved Hide resolved
docs/registering-a-control-handler-function.md Outdated Show resolved Hide resolved
docs/setconsolectrlhandler.md Outdated Show resolved Hide resolved
@opbld33
Copy link

opbld33 commented Aug 23, 2021

Docs Build status updates of commit dd6235d:

✅ Validation status: passed

File Status Preview URL Details
docs/TOC.md ✅Succeeded View
docs/char-info-str.md ✅Succeeded View
docs/clearing-the-screen.md ✅Succeeded View
docs/console-control-handlers.md ✅Succeeded View
docs/console-screen-buffers.md ✅Succeeded View
docs/console-virtual-terminal-sequences.md ✅Succeeded View
docs/creation-of-a-console.md ✅Succeeded View
docs/getstdhandle.md ✅Succeeded View
docs/includes/console-mode-flags.md ✅Succeeded View
docs/input-and-output-methods.md ✅Succeeded View
docs/registering-a-control-handler-function.md ✅Succeeded View
docs/setconsolectrlhandler.md ✅Succeeded View
docs/setstdhandle.md ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@miniksa miniksa merged commit 97b0948 into master Aug 26, 2021
@miniksa miniksa deleted the miniksa-2021-08-fixes branch August 26, 2021 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants