dotgnu-pnet
[Top][All Lists]
Advanced

[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: Fri, 25 Jul 2003 05:12:01 -0400
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

=================== BUG #4468: FULL BUG SNAPSHOT ===================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=4468&group_id=353

Soumis par: yannis_bres               Projet: DotGNU Portable.NET           
Signalé le: ven 25.07.2003 à 09:11
Category:  None                       Severity:  5 - Major                  
Bug Group:  None                      Resolution:  None                     
Assigned to:  None                    Status:  Open                         

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,



No Followups Have Been Posted


La liste CC est vide


Fichiers attachés
****************

-------------------------------------------------------
Date: ven 25.07.2003 à 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/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]