Raphael wrote:
*lphStart = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
*lphDeath = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
*lphRead = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
if( ( !DuplicateHandle( GetCurrentProcess(), *lphStart, hDestProcess, &hAppStart,
@@ -1185,6 +1181,13 @@ ) { /* FIXME: Handle leak... */
- if (INVALID_HANDLE_VALUE != *lphStart) { CloseHandle(*lphStart); *lphStart = INVALID_HANDLE_VALUE; }
- if (INVALID_HANDLE_VALUE != *lphDeath) { CloseHandle(*lphDeath); *lphDeath = INVALID_HANDLE_VALUE; }
- if (INVALID_HANDLE_VALUE != *lphRead) { CloseHandle(*lphRead); *lphRead = INVALID_HANDLE_VALUE; }
- if (INVALID_HANDLE_VALUE != hAppStart) CloseHandle(hAppStart);
- if (INVALID_HANDLE_VALUE != hAppDeath) CloseHandle(hAppDeath);
- if (INVALID_HANDLE_VALUE != hAppRead) CloseHandle(hAppRead);
You can't close handles from another process.
ERR( "Unable to dup handles\n" ); return FALSE;
}
Rob