Stas Sergeev <[EMAIL PROTECTED]> writes:
> And when creating 32-bit process, it does
> if (main_module) PROCESS_Start( main_module, main_exe_name );
> ^^^No problems here.
>
> My fix was to replace this NULL with main_exe_name for 16-bit processes
> too. It works for me. Can anyone fix it properly or just explain the
> situation? Is this replacement correct?
No; there can be several 16-bit tasks running inside the same process,
so we cannot simply use the first task name as the process name. The
real bug is that GetModuleFileName16 should never be called without a
current 16-bit task. Could you try this patch instead?
Index: files/directory.c
===================================================================
RCS file: /home/wine/wine/files/directory.c,v
retrieving revision 1.23
diff -u -r1.23 directory.c
--- files/directory.c 2000/07/16 14:38:53 1.23
+++ files/directory.c 2000/07/23 13:00:28
@@ -25,7 +25,6 @@
#include "wingdi.h"
#include "wine/winuser16.h"
#include "winerror.h"
-#include "process.h"
#include "drive.h"
#include "file.h"
#include "heap.h"
@@ -509,17 +508,16 @@
*
* Helper function for DIR_SearchPath.
*/
-static BOOL DIR_TryModulePath( LPCSTR name, DOS_FULL_NAME *full_name )
+static BOOL DIR_TryModulePath( LPCSTR name, DOS_FULL_NAME *full_name, BOOL win32 )
{
- PDB *pdb = PROCESS_Current();
-
/* FIXME: for now, GetModuleFileNameA can't return more */
/* than OFS_MAXPATHNAME. This may change with Win32. */
char buffer[OFS_MAXPATHNAME];
LPSTR p;
- if (pdb->flags & PDB32_WIN16_PROC) {
+ if (!win32)
+ {
if (!GetCurrentTask()) return FALSE;
if (!GetModuleFileName16( GetCurrentTask(), buffer, sizeof(buffer) ))
buffer[0]='\0';
@@ -595,7 +593,7 @@
/* Try the path of the current executable (for Win32 search order) */
- if (win32 && DIR_TryModulePath( name, full_name )) goto done;
+ if (win32 && DIR_TryModulePath( name, full_name, win32 )) goto done;
/* Try the current directory */
@@ -613,7 +611,7 @@
/* Try the path of the current executable (for Win16 search order) */
- if (!win32 && DIR_TryModulePath( name, full_name )) goto done;
+ if (!win32 && DIR_TryModulePath( name, full_name, win32 )) goto done;
/* Try all directories in path */
--
Alexandre Julliard
[EMAIL PROTECTED]