[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pnet-developers] [bug #4468] PInvoke does not throw System.DllNotFoundE
From: |
nobody |
Subject: |
[Pnet-developers] [bug #4468] PInvoke does not throw System.DllNotFoundException |
Date: |
Mon, 28 Jul 2003 04:04:19 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 |
=================== BUG #4468: LATEST MODIFICATIONS ==================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=4468&group_id=353
Changes by: Rhys Weatherley <address@hidden>
Date: Mon 07/28/2003 at 08:04 (GMT)
What | Removed | Added
---------------------------------------------------------------------------
Resolution | None | Fixed
Status | Open | Closed
------------------ Additional Follow-up Comments ----------------------------
Fix committed to CVS - 28 July 2003
=================== BUG #4468: FULL BUG SNAPSHOT ===================
Submitted by: yannis_bres Project: DotGNU Portable.NET
Submitted on: Fri 07/25/2003 at 09:11
Category: None Severity: 5 - Major
Bug Group: None Resolution: Fixed
Assigned to: None Status: Closed
Summary: PInvoke does not throw System.DllNotFoundException
Original Submission: When invoking a function imported from a dynamic library
that cannot be found, a System.DllNotFoundException should be thrown. Instead,
error messages ("could not load dynamic library") are output in the different
versions of ILDynLibraryOpen in pnet/support/dynlib.c. These messages should
be removed and I guess that ILDynLibraryOpen should silently return 0.
I guess that pnet/engine/convert.c should be updated to throw
System.DllNotFoundException when ILDynLibraryOpen returns 0, but I don't know
how to do it ;-).
Also, pnet/ilnative/ilcheck.c should be updated as it relies on
ILDynLibraryOpen to output an error message in case of failure.
Here is a little test program.
ilrun output:
--------------------------------------------------
zobzob.dll: could not load dynamic library
Failed in calling a dummy function from a dummy DLL:
System.MissingMethodException: Attempted to access a non-existing method
at Test_PInvoke.Main()
DummyFunctionInExistingDLL: could not resolve symbolFailed in calling a dummy
function from an existing DLL:
System.MissingMethodException: Attempted to access a non-existing method
at Test_PInvoke.Main()
Succeeded in calling SHGetFolderPath: C:WindowsSystem32
--------------------------------------------------
MS VM output:
--------------------------------------------------
Failed in calling a dummy function from a dummy DLL:
System.DllNotFoundException: Unable to load DLL (zobzob.dll).
at Test_PInvoke.DummyFunctionInDummyDLL()
at Test_PInvoke.Main()
Failed in calling a dummy function from an existing DLL:
System.EntryPointNotFoundException: Unable to find an entry point named
DummyFunctionInExistingDLL in DLL shell32.dll.
at Test_PInvoke.DummyFunctionInExistingDLL()
at Test_PInvoke.Main()
Succeeded in calling SHGetFolderPath: C:WindowsSystem32
--------------------------------------------------
Have fun,
Follow-up Comments
*******************
-------------------------------------------------------
Date: Mon 07/28/2003 at 08:04 By: rweather
Fix committed to CVS - 28 July 2003
CC list is empty
File Attachments
****************
-------------------------------------------------------
Date: Fri 07/25/2003 at 09:11 Name: Test_PInvoke.cs Size: 2KB By:
yannis_bres
http://savannah.gnu.org/bugs/download.php?group_id=353&bug_id=4468&bug_file_id=555
For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=4468&group_id=353
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/