summaryrefslogtreecommitdiff
path: root/win32/dl_win32.xs
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-06-20 21:48:32 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-06-20 21:48:32 +0000
commiteda5ff319dcb749e45b560057fa141edfd70ae33 (patch)
tree7de3799955f53ca2cb004f1c02ec63f616c6bcd6 /win32/dl_win32.xs
parent249edfdff1b2b750e894ee5a0b6cb64d2640ca02 (diff)
downloadperl-eda5ff319dcb749e45b560057fa141edfd70ae33.tar.gz
manual integration of all outstanding ansi branch stuff into mainline
p4raw-id: //depot/perl@1162
Diffstat (limited to 'win32/dl_win32.xs')
-rw-r--r--win32/dl_win32.xs18
1 files changed, 16 insertions, 2 deletions
diff --git a/win32/dl_win32.xs b/win32/dl_win32.xs
index d72173129e..a5183c3d90 100644
--- a/win32/dl_win32.xs
+++ b/win32/dl_win32.xs
@@ -26,6 +26,7 @@ calls.
#include "EXTERN.h"
#include "perl.h"
+#include "win32.h"
#ifdef PERL_OBJECT
#define NO_XSLOCKS
@@ -33,6 +34,19 @@ calls.
#include "XSUB.h"
+static SV *error_sv;
+
+static char *
+OS_Error_String(void)
+{
+ DWORD err = GetLastError();
+ STRLEN len;
+ if (!error_sv)
+ error_sv = newSVpv("",0);
+ win32_str_os_error(error_sv,err);
+ return SvPV(error_sv,len);
+}
+
#include "dlutils.c" /* SaveError() etc */
static void
@@ -96,7 +110,7 @@ dl_load_file(filename,flags=0)
DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
- SaveError(PERL_OBJECT_THIS_ "%d",GetLastError()) ;
+ SaveError(PERL_OBJECT_THIS_ "load_file:%s",OS_Error_String()) ;
else
sv_setiv( ST(0), (IV)RETVAL);
@@ -112,7 +126,7 @@ dl_find_symbol(libhandle, symbolname)
DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref = %x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
- SaveError(PERL_OBJECT_THIS_ "%d",GetLastError()) ;
+ SaveError(PERL_OBJECT_THIS_ "find_symbol:%s",OS_Error_String()) ;
else
sv_setiv( ST(0), (IV)RETVAL);