Alexandre Julliard пишет:
>> 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
OK, thanks for the explanation. But anyway, why argv[0]?
>real bug is that GetModuleFileName16 should never be called without a
>current 16-bit task. Could you try this patch instead?
Of course I can. Unfortunately it doesn't work:(
>- if (pdb->flags & PDB32_WIN16_PROC) {
> + if (!win32)
I am trying to start 16-bit process, so !win32 == 1 also. I don't see
any difference (probably because I am a novice with wine).
> + {
> if (!GetCurrentTask()) return FALSE;
> if (!GetModuleFileName16( GetCurrentTask(), buffer, sizeof(buffer) ))
And we are calling GetModuleFileName16 as before, and it doesn't work
as before...
> buffer[0]='\0';
Have a look at a GDB session (I think it's much more usefull then to
provide a trace log):
-----------------------------------------------
Breakpoint 2, DIR_TryModulePath (name=0x40746ba4 "WWINTL.DLL",
full_name=0x40746198, win32=0) at directory.c:519
519 if (!win32)
(gdb) n
521 if (!GetCurrentTask()) return FALSE;
(gdb)
522 if (!GetModuleFileName16( GetCurrentTask(), buffer, sizeof(bufr) ))
(gdb) b GetModuleFileName16
Breakpoint 3 at 0x40109571: file module.c, line 1329.
(gdb) c
Continuing.
Breakpoint 3, GetModuleFileName16 (hModule=383,
lpFileName=0x407460bc "<some garbage>", nSize=128) at module.c:1329
1329 if (!hModule) hModule = GetCurrentTask();
(gdb) n
1331 if (!(pModule = NE_GetPtr( hModule ))) return 0;
(gdb)
1332 lstrcpynA( lpFileName, NE_MODULE_NAME(pModule), nSize );
(gdb)
1333 if (pModule->expected_version >= 0x400)
(gdb) p lpFileName
$1 = (CHAR *) 0x407460bc "/usr/local/bin/wine"
(gdb) n
1334 GetLongPathNameA(NE_MODULE_NAME(pModule), lpFileName, nSize);
(gdb)
Warning: /usr/local/bin/wine not accessible from a DOS drive
1335 TRACE("%04x -> '%s'\n", hModule, lpFileName );
(gdb)
1336 return strlen(lpFileName);
(gdb) p lpFileName
$2 = (CHAR *) 0x407460bc "/usr/local/bin/wine"
(gdb) n
1337 }
(gdb)
DIR_TryModulePath (name=0x40746ba4 "WWINTL.DLL", full_name=0x40746198,
win32=0 at directory.c:524
524 } else {
(gdb) p buffer
$3 = (CHAR *) 0x407460bc "/usr/local/bin/wine"
528 if (!(p = strrchr( buffer, '\\' ))) return FALSE;
(gdb)
----------------------------------------
so we still have "/usr/local/bin/wine" instead of
"C:\windows\winword\winword.exe".
Any suggestions/explanations?
Is there any way for me to provide more info to clear out the problem?