summaryrefslogtreecommitdiff
path: root/win32/perllib.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/perllib.c')
-rw-r--r--win32/perllib.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/win32/perllib.c b/win32/perllib.c
index 84a2a6dc4b..26135f864e 100644
--- a/win32/perllib.c
+++ b/win32/perllib.c
@@ -259,13 +259,19 @@ static DWORD g_TlsAllocIndex;
EXTERN_C DllExport bool
SetPerlInterpreter(void *interp)
{
- return TlsSetValue(g_TlsAllocIndex, interp);
+ DWORD dwErr = GetLastError();
+ bool bResult = TlsSetValue(g_TlsAllocIndex, interp);
+ SetLastError(dwErr);
+ return bResult;
}
EXTERN_C DllExport void*
GetPerlInterpreter(void)
{
- return TlsGetValue(g_TlsAllocIndex);
+ DWORD dwErr = GetLastError();
+ LPVOID pResult = TlsGetValue(g_TlsAllocIndex);
+ SetLastError(dwErr);
+ return pResult;
}
EXTERN_C DllExport int