DynaLoader dl_unload_file for win32 ( dl_win32.xs )
DH [Tue, 31 May 2005 08:33:27 +0000 (01:33 -0700)]
Message-ID: <20050531153327.85145.qmail@unknown-209-73-178-237.yahoo.com>

(with a couple of minor tweaks)

p4raw-id: //depot/perl@24679

win32/dl_win32.xs

index 4ff00a1..b69ad27 100644 (file)
@@ -129,6 +129,18 @@ dl_load_file(filename,flags=0)
        sv_setiv( ST(0), (IV)RETVAL);
   }
 
+int
+dl_unload_file(libref)
+    void *     libref
+  CODE:
+    DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_unload_file(%lx):\n", PTR2ul(libref)));
+    RETVAL = FreeLibrary(libref);
+    if (!RETVAL)
+        SaveError(aTHX_ "unload_file:%s", OS_Error_String(aTHX)) ;
+    DLDEBUG(2,PerlIO_printf(Perl_debug_log, " retval = %d\n", RETVAL));
+  OUTPUT:
+    RETVAL
+
 void *
 dl_find_symbol(libhandle, symbolname)
     void *     libhandle