Skip to content

Conversation

@nir9
Copy link
Contributor

@nir9 nir9 commented Jan 21, 2025

Problem: Currently the doc about IsDebuggerPresent claims that you need to define the _WIN32_WINNT macro to use this function, even though this macro is defined automatically on a clean build with cl:

#include <windows.h>
#include <stdio.h>

void main()
{
	printf("WIN32_WINNT: %x\n", _WIN32_WINNT);
	printf("DbgPresent: %d\n", IsDebuggerPresent());
}
cl main.c
main.exe

will output on my Win10 machine as expected:

WIN32_WINNT: a00
DbgPresent: 0

Solution: Remove the sentence about this macro, this it is not something that the users of this function need to take care of, the bottom of the page mention the minimum OS requirement anyway.

@prmerger-automator
Copy link

@nir9 : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Comment on lines -76 to -78
To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information, see
<a href="/windows/desktop/WinProg/using-the-windows-headers">Using the Windows Headers</a>.

Copy link
Contributor

@riverar riverar Jan 21, 2025

Choose a reason for hiding this comment

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

[...] the bottom of the page mention the minimum OS requirement anyway.

The documentation indicates 0x0400 (Windows NT 4), but the bottom of the page says Windows XP / Server 2003. Perhaps fix the metadata too?

(The metadata at the bottom of pages is typically incorrect, making this sentence much more valuable.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting, indeed confirmed the current metadata is false, screenshot from msdn.microsoft.com from 2004 wayback machine:
image

will work on a fix for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@Karl-Bridge-Microsoft Karl-Bridge-Microsoft merged commit ec8a84d into MicrosoftDocs:docs Jan 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants