mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
More TEB syswow fix
This commit is contained in:
@@ -474,7 +474,7 @@ class TestProcessWithCheckGarbage(object):
|
||||
with proc32_64.allocated_memory(0x1000) as addr:
|
||||
assert proc32_64.get_mapped_filename(addr) is None
|
||||
|
||||
def test_current_thread_teb():
|
||||
def test_current_thread_teb(self):
|
||||
teb = windows.current_thread.teb
|
||||
assert ctypes.addressof(teb) == ctypes.addressof(windows.current_thread.teb.NtTib.Self[0])
|
||||
assert ctypes.addressof(windows.current_process.peb) == ctypes.addressof(teb.ProcessEnvironmentBlock[0])
|
||||
|
||||
@@ -916,8 +916,10 @@ class WinThread(Thread):
|
||||
|
||||
@property
|
||||
def teb_syswow(self):
|
||||
return RemoteTEB64(self.teb_syswow_base, self.owner)
|
||||
|
||||
if windows.current_process.bitness == 64:
|
||||
return RemoteTEB64(self.teb_syswow_base, self)
|
||||
else: #current is 32bits
|
||||
return RemoteTEB64(self.teb_syswow_base, windows.syswow64.ReadSyswow64Process(self.owner))
|
||||
|
||||
def exit(self, code=0):
|
||||
"""Exit the thread"""
|
||||
|
||||
Reference in New Issue
Block a user