KERNEL: check for NULL in LoadModule16

Alex Villací­s Lasso a_villacis at palosanto.com
Thu Sep 1 11:15:37 CDT 2005


Andreas Mohr wrote:

>Hi,
>
>On Mon, Aug 29, 2005 at 01:43:04PM -0500, Alex Villací­s Lasso wrote:
>  
>
>>I could not find any MSDN reference on any documented behavior for 
>>LoadLibrary16 or LoadModule16 when libname == NULL.
>>    
>>
>
>I've checked it now (Watcom, Win98 SE):
>
>(forgot to zero LOADPARAMS, sorry! But it hopefully didn't matter...)
>
>a) NULL, &lp		0 "system out of mem/executable corrupt/relocs invalid"
>b) "kernel", NULL	kernel handle
>c) NULL, NULL		0
>d) (char *)0x1, &lp	2 "file not found"
>e) (char *)0x1256, NULL	2
>f) NULL, (void *)0x1257	0
>
>NO CRASHES whatsoever, IOW it fully intercepts any invalid pointers.
>
>a), c), f) vs. d) indicates that it does an explicit check against a NULL name,
>since probably otherwise LoadModule16 will continue due to the non-NULL
>name (0x1) and notice somewhat later (in some file API) that file name 0x1
>is invalid.
>  
>
The attached patch should implement the observed behavior in Win98SE.

Alex Villacís Lasso

Changelog:
- Add NULL and exception handler to LoadModule16 to check against NULL 
or invalid libname

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-kernel-ne_module-check-libname_3.patch
Type: text/x-patch
Size: 665 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050901/37cbbae3/wine-kernel-ne_module-check-libname_3.bin


More information about the wine-patches mailing list