Dimitrie O. Paun wrote:
A small test in dlls/kernel/tests/*.c for this would be perfect. In general, it's better to submit such a test, rather than write a throw-away one on your box only.
You were, like always, right. I did a test and found that Wine is OK just like in windows. Probably in the version I was working on, when this fix was done, There was something Screwy with the exceptions and the kernel code did not catch them. But now it does and returns a proper error. I will submit a new patch with Just the winpos.c code.
Free Life Boaz
? dlls/kernel/tests/loadlib.c Index: dlls/kernel/tests/Makefile.in =================================================================== RCS file: /home/wine/wine/dlls/kernel/tests/Makefile.in,v retrieving revision 1.14 diff -u -r1.14 Makefile.in --- dlls/kernel/tests/Makefile.in 9 Feb 2004 20:58:16 -0000 1.14 +++ dlls/kernel/tests/Makefile.in 23 Mar 2004 07:10:11 -0000 @@ -26,7 +26,8 @@ process.c \ profile.c \ thread.c \ - virtual.c + virtual.c \ + loadlib.c --- /dev/null 1970-01-01 02:00:00.000000000 +0200 +++ ./loadlib.c 2004-03-23 09:09:20.000000000 +0200 @@ -0,0 +1,41 @@ +/* + * Unit test suite for LoadLibrary / GetProcAdress functions + * + * Copyright 2003 wine project + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <stdarg.h> +#include <stdlib.h> + +#include "windows.h" +#include "wine/test.h" + +START_TEST(loadlib) +{ + void* pProc = GetProcAddress( NULL ,"NotARealFunc" ) ; + int err = GetLastError() ; + ok(pProc==NULL, "GetProcAdress copes with NULL error is %d\n",err); + printf("GetProcAdress copes with NULL error is %d\n",err); + + todo_wine + { + void* pProc = GetProcAddress((void*) 0x117 ,"NotARealFunc" ) ; + int err = GetLastError() ; + ok(pProc==NULL, "GetProcAdress copes with BAD HModule error is %d\n",err); + printf( "GetProcAdress copes with BAD HModule error is %d\n",err); + } +}