Fix FLS FiberManager writing last_error to a dead attribute

FiberManager.free/set/get set `self.last_error` on the FiberManager
instance, but nothing ever reads that attribute. The Windows last-error
that GetLastError returns lives on `ql.os.last_error`, so FlsFree,
FlsSetValue and FlsGetValue never actually reported ERROR_INVALID_PARAMETER
for an invalid FLS index. Route the three writes to `self.ql.os.last_error`,
consistent with every other kernel32 hook.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
w1tcher
2026-07-07 17:37:59 +08:00
co-authored by Claude Opus 4.8
parent 499218bd1a
commit d8f904c44a
+3 -3
View File
@@ -33,7 +33,7 @@ class FiberManager:
def free(self, idx: int) -> bool:
if idx not in self.fibers:
self.last_error = ERROR_INVALID_PARAMETER
self.ql.os.last_error = ERROR_INVALID_PARAMETER
return False
fiber = self.fibers[idx]
@@ -99,7 +99,7 @@ class FiberManager:
def set(self, idx: int, data: int) -> bool:
if idx not in self.fibers:
self.last_error = ERROR_INVALID_PARAMETER
self.ql.os.last_error = ERROR_INVALID_PARAMETER
return False
self.fibers[idx].data = data
@@ -108,7 +108,7 @@ class FiberManager:
def get(self, idx: int) -> int:
if idx not in self.fibers:
self.last_error = ERROR_INVALID_PARAMETER
self.ql.os.last_error = ERROR_INVALID_PARAMETER
return 0
return self.fibers[idx].data