Illegal handles in FindClose

Dominik Strasser dominik.strasser at mchp.siemens.de
Thu Mar 1 07:25:31 CST 2001


The application I am trying to make runnable passes an illegal handle to
FindClose. It is 0xcccccccc which is an unitialized stack address (at
least I remember to have seen those when I was doing Windoze programs).
I wrapped the access into an exception handler.

ChangeLog:
	* files/dos_fs.c
	Dominik Strasser <dominik.strasser at mchp.siemens.de>
	Allow illegal handles in FindClose



-- 
Dominik Strasser	| Phone:  +49 89 636-43691
SIEMENS AG		| Fax:    +49 89 636-42284
CT SE 4			| E-Mail:Dominik.Strasser at mchp.siemens.de
Otto-Hahn-Ring 6	|
D-81739 Muenchen	| Room: 53-263
-------------- next part --------------
Index: files/dos_fs.c
===================================================================
RCS file: /home/wine/wine/files/dos_fs.c,v
retrieving revision 1.80
diff -r1.80 dos_fs.c
107a108,114
> static WINE_EXCEPTION_FILTER(page_fault)
> {
>     if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
>         return EXCEPTION_EXECUTE_HANDLER;
>     return EXCEPTION_CONTINUE_SEARCH;
> }
> 
1769,1770c1776,1787
<     if (info->dir) DOSFS_CloseDir( info->dir );
<     if (info->path) HeapFree( GetProcessHeap(), 0, info->path );
---
> 	__TRY
> 	{
> 		if (info->dir) DOSFS_CloseDir( info->dir );
> 		if (info->path) HeapFree( GetProcessHeap(), 0, info->path );
> 	}
> 	__EXCEPT(page_fault)
> 	{
> 		WARN("Illegal handle %x\n", info);
> 		SetLastError( ERROR_INVALID_HANDLE );
> 		return FALSE;
> 	}
> 	__ENDTRY


More information about the wine-patches mailing list