Changeset 57922 in vbox
- Timestamp:
- Sep 28, 2015 2:49:09 AM (9 years ago)
- Location:
- trunk/include/iprt/nt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/nt/nt-and-windows.h
r56291 r57922 37 37 38 38 #define IPRT_NT_USE_WINTERNL 39 #define IPRT_NT_HAVE_CURRENT_TEB_MACRO 39 40 #define WIN32_NO_STATUS 40 41 #include <Windows.h> -
trunk/include/iprt/nt/nt.h
r57302 r57922 1358 1358 typedef PTEB_COMMON PTEB; 1359 1359 1360 #define RTNtCurrentTeb() ((PTEB)NtCurrentTeb()) 1361 #define RTNtCurrentPeb() (RTNtCurrentTeb()->ProcessEnvironmentBlock) 1362 #define NtCurrentPeb() RTNtCurrentPeb() 1363 #define RTNtCurrentThreadId() ((uint32_t)(uintptr_t)RTNtCurrentTeb()->ClientId.UniqueThread) 1360 #if !defined(NtCurrentTeb) && !defined(IPRT_NT_HAVE_CURRENT_TEB_MACRO) 1361 # ifdef RT_ARCH_X86 1362 DECL_FORCE_INLINE(PTEB) RTNtCurrentTeb(void) { return (PTEB)__readfsdword(RT_OFFSETOF(TEB_COMMON, NtTib.Self)); } 1363 DECL_FORCE_INLINE(PPEB) RTNtCurrentPeb(void) { return (PPEB)__readfsdword(RT_OFFSETOF(TEB_COMMON, ProcessEnvironmentBlock)); } 1364 DECL_FORCE_INLINE(uint32_t) RTNtCurrentThreadId(void) { return __readfsdword(RT_OFFSETOF(TEB_COMMON, ClientId.UniqueThread)); } 1365 # elif defined(RT_ARCH_AMD64) 1366 DECL_FORCE_INLINE(PTEB) RTNtCurrentTeb(void) { return (PTEB)__readgsqword(RT_OFFSETOF(TEB_COMMON, NtTib.Self)); } 1367 DECL_FORCE_INLINE(PPEB) RTNtCurrentPeb(void) { return (PPEB)__readgsqword(RT_OFFSETOF(TEB_COMMON, ProcessEnvironmentBlock)); } 1368 DECL_FORCE_INLINE(uint32_t) RTNtCurrentThreadId(void) { return (uint32_t)__readgsqword(RT_OFFSETOF(TEB_COMMON, ClientId.UniqueThread)); } 1369 # else 1370 # error "Port me" 1371 # endif 1372 #else 1373 # define RTNtCurrentTeb() ((PTEB)NtCurrentTeb()) 1374 # define RTNtCurrentPeb() (RTNtCurrentTeb()->ProcessEnvironmentBlock) 1375 # define RTNtCurrentThreadId() ((uint32_t)(uintptr_t)RTNtCurrentTeb()->ClientId.UniqueThread) 1376 #endif 1377 #define NtCurrentPeb() RTNtCurrentPeb() 1378 1364 1379 1365 1380 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.