Support TlsExpansionSlots (>64 TLS slots)

This commit is contained in:
2025-10-27 12:27:26 -06:00
parent cf166f828a
commit a240e3dc4b
6 changed files with 313 additions and 30 deletions

View File

@@ -387,7 +387,6 @@ DWORD WIN_FUNC TlsAlloc() {
wibo::lastError = ERROR_NOT_ENOUGH_MEMORY;
return TLS_OUT_OF_INDEXES;
}
wibo::tls::setValue(index, nullptr);
wibo::lastError = ERROR_SUCCESS;
return index;
}
@@ -399,7 +398,6 @@ BOOL WIN_FUNC TlsFree(DWORD dwTlsIndex) {
wibo::lastError = ERROR_INVALID_PARAMETER;
return FALSE;
}
wibo::tls::setValue(dwTlsIndex, nullptr);
wibo::lastError = ERROR_SUCCESS;
return TRUE;
}
@@ -411,7 +409,9 @@ LPVOID WIN_FUNC TlsGetValue(DWORD dwTlsIndex) {
wibo::lastError = ERROR_INVALID_PARAMETER;
return nullptr;
}
return wibo::tls::getValue(dwTlsIndex);
void *result = wibo::tls::getValue(dwTlsIndex);
wibo::lastError = ERROR_SUCCESS;
return result;
}
BOOL WIN_FUNC TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) {