VirtualBox

Changeset 57922 in vbox


Ignore:
Timestamp:
Sep 28, 2015 2:49:09 AM (9 years ago)
Author:
vboxsync
Message:

iprt/nt: Forgot to commit RTNtCurrentPeb/Teb fixes for direnum-r3-nt.cpp.

Location:
trunk/include/iprt/nt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/nt/nt-and-windows.h

    r56291 r57922  
    3737
    3838#define IPRT_NT_USE_WINTERNL
     39#define IPRT_NT_HAVE_CURRENT_TEB_MACRO
    3940#define WIN32_NO_STATUS
    4041#include <Windows.h>
  • trunk/include/iprt/nt/nt.h

    r57302 r57922  
    13581358typedef PTEB_COMMON PTEB;
    13591359
    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
     1362DECL_FORCE_INLINE(PTEB)     RTNtCurrentTeb(void) { return (PTEB)__readfsdword(RT_OFFSETOF(TEB_COMMON, NtTib.Self)); }
     1363DECL_FORCE_INLINE(PPEB)     RTNtCurrentPeb(void) { return (PPEB)__readfsdword(RT_OFFSETOF(TEB_COMMON, ProcessEnvironmentBlock)); }
     1364DECL_FORCE_INLINE(uint32_t) RTNtCurrentThreadId(void) { return __readfsdword(RT_OFFSETOF(TEB_COMMON, ClientId.UniqueThread)); }
     1365# elif defined(RT_ARCH_AMD64)
     1366DECL_FORCE_INLINE(PTEB)     RTNtCurrentTeb(void) { return (PTEB)__readgsqword(RT_OFFSETOF(TEB_COMMON, NtTib.Self)); }
     1367DECL_FORCE_INLINE(PPEB)     RTNtCurrentPeb(void) { return (PPEB)__readgsqword(RT_OFFSETOF(TEB_COMMON, ProcessEnvironmentBlock)); }
     1368DECL_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
    13641379
    13651380/** @} */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette