RE: [perl #42925] Win32::GetLastError fails when first called
Jan Dubois [Fri, 11 May 2007 16:55:17 +0000 (09:55 -0700)]
From: "Jan Dubois" <jand@activestate.com>
Message-ID: <02bd01c79427$d36140b0$7a23c210$@com>

p4raw-id: //depot/perl@31214

ext/Win32CORE/Win32CORE.c

index 8a56c3e..aacbf63 100644 (file)
@@ -15,7 +15,9 @@ static void
 forward(pTHX_ const char *function)
 {
     dXSARGS;
+    DWORD err = GetLastError();
     Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn("Win32",5), newSVnv(0.27));
+    SetLastError(err);
     SPAGAIN;
     PUSHMARK(SP-items);
     call_pv(function, GIMME_V);