Quantcast
Channel: Visual Leak Detector for Visual C++ 2008-2015
Viewing all articles
Browse latest Browse all 704

Edited Issue: error C2065: 'NtQueryInformationThread' : undeclared identifier [10534]

$
0
0
vs2010
XP Pro 2002 SP3

I get the following compilation errors
```
1>d:\projs\tools\visual leak detector\src\utility.cpp(937): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\projs\tools\visual leak detector\src\utility.cpp(937): error C2146: syntax error : missing ';' before identifier 'ThreadBasicInformation'
1>d:\projs\tools\visual leak detector\src\utility.cpp(937): error C2065: 'ThreadBasicInformation' : undeclared identifier
1>d:\projs\tools\visual leak detector\src\utility.cpp(937): error C2143: syntax error : missing ';' before 'constant'
1>d:\projs\tools\visual leak detector\src\utility.cpp(939): error C2143: syntax error : missing ')' before '__stdcall'
1>d:\projs\tools\visual leak detector\src\utility.cpp(939): error C2059: syntax error : ')'
1>d:\projs\tools\visual leak detector\src\utility.cpp(943): error C2146: syntax error : missing ';' before identifier 'NtQueryInformationThread'
1>d:\projs\tools\visual leak detector\src\utility.cpp(943): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\projs\tools\visual leak detector\src\utility.cpp(943): error C2065: 'NtQueryInformationThread' : undeclared identifier
1>d:\projs\tools\visual leak detector\src\utility.cpp(947): error C2065: 'NtQueryInformationThread' : undeclared identifier
1>d:\projs\tools\visual leak detector\src\utility.cpp(951): error C2065: 'NtQueryInformationThread' : undeclared identifier
1>d:\projs\tools\visual leak detector\src\utility.cpp(951): error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
1>d:\projs\tools\visual leak detector\src\utility.cpp(954): error C2065: 'NtQueryInformationThread' : undeclared identifier
1>d:\projs\tools\visual leak detector\src\utility.cpp(959): error C2065: 'ThreadBasicInformation' : undeclared identifier
1>d:\projs\tools\visual leak detector\src\utility.cpp(959): error C3861: 'NtQueryInformationThread': identifier not found
```

the reason is that <winternl.h> is not included.

This happens because my SDK as updated by vs2010
```
c:\program files\microsoft sdks\windows\v7.0a\include\sdkddkver.h (line 197)
defines _WIN32_WINNT 0x0601 :

#if !defined(_WIN32_WINNT) && !defined(_CHICAGO_)
#define _WIN32_WINNT 0x0601
#endif
```

while stdafx.h does:
```
#if _WIN32_WINNT < 0x0600 // Windows XP or earlier, no GetProcessIdOfThread()
#include <winternl.h>
#endif
```

I simply had to modify 0x0600 -> 0x0602

I reported this but mostly for documentation
so other people having the same issue may easily know the reason.


Viewing all articles
Browse latest Browse all 704

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>