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
Conversation
…urious use of signed values to initialize unsigned constants. #177
Docs Build status updates of commit 3798325: ✅ Validation status: passed
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/getstdhandle.md
Outdated
|
||
## 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
docs/getstdhandle.md
Outdated
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. |
There was a problem hiding this comment.
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
simplifiedcomputerized, because the MSDN machine translation might choke on this.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> 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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Co-authored-by: Leonard Hecker <leonard@hecker.io>
Docs Build status updates of commit febf911: ✅ Validation status: passed
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>
Docs Build status updates of commit 54d0c9a: ✅ Validation status: passed
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 Build status updates of commit 74151bc: ✅ Validation status: passed
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 Build status updates of commit dd6235d: ✅ Validation status: passed
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:
|
Fixes a variety of issues including:
AllocConsole
,FreeConsole
, andAttachConsole
reset the CtrlHandlers list but isn't documented #212 - Document that Ctrl Handlers are reset when console session changed with Alloc/Attach/Free