cmd:batch: Check for a context is added

Anatoly Lyutin vostok at
Tue Jul 24 02:57:06 CDT 2007

Ann & Jason Edmeades wrote:
>> We need to check context before than refer to context -> skip_rest .
> But we have just referred to it higher up, and I didn't think it was valid
> to get into this routine without a context. 
> Whats the problem you are trying to fix?
I run a program which uses a *.bat files via "wine wineconsole 
--backend=user start program.bat" and this program runs well but after 
exit it  program fails with:

=>1 0x7ed518e5 WCMD_batch+0x105(file=0x346e1c, command=0x16d038, called=0x0,
startLabel=0x0, pgmHandle=0xffffffff) [/srv/vostok/Projects/wi
  2 0x7ed5e14c WCMD_run_program+0x85c(command=0x16d038, called=0x0)
[/srv/vostok/Projects/wine/programs/cmd/wcmdmain.c:1056] in cmd (0x0034
  3 0x7ed5e63e WCMD_process_command+0x28e(command=0x167580, cmdList=0x34f5e0)
[/srv/vostok/Projects/wine/programs/cmd/wcmdmain.c:813] in cm
  4 0x7ed53f26 WCMD_execute+0x1b6(orig_cmd=<register EDI not in topmost frame>,
param=0x0, subst=0x0, cmdList=0x34f5e0) [/srv/vostok/Projec
  5 0x7ed5bcc0 WCMD_process_commands+0x90(thisCmd=0x167568, oneBracket=0x0,
var=<register EDI not in topmost frame>, val=0x0) [/srv/vostok/
  6 0x7ed5d6f3 wmain+0xa83(argc=0x3, argvW=0x110338)
[/srv/vostok/Projects/wine/programs/cmd/wcmdmain.c:328] in cmd (0x0034fee8)
  7 0x7ed5fd5e __wine_spec_exe_wentry+0x4e(peb=0x7ffdf000)
[/srv/vostok/Projects/wine/dlls/winecrt0/exe_wentry.c:36] in cmd (0x0034ff08)
  8 0x7ee53e60 start_process+0xc0(arg=0x0)
[/srv/vostok/Projects/wine/dlls/kernel32/process.c:834] in kernel32
  9 0xb7e5a917 wine_switch_to_stack+0x17() in (0x00000000)
0x7ed518e5 WCMD_batch+0x105
[/srv/vostok/Projects/wine/programs/cmd/batch.c:108] in cmd: movl  
Unable to open file '/srv/vostok/Projects/wine/programs/cmd/batch.c'
Module  Address                 Debug info      Name (58 modules)
ELF     4792e000-4830f000       Deferred
ELF     4946e000-4955c000       Deferred
ELF     4955e000-4956c000       Deferred
ELF     4956e000-49576000       Deferred
ELF     49578000-4957b000       Deferred
ELF     4957d000-49583000       Deferred
ELF     49585000-4958e000       Deferred
ELF     49590000-49595000       Deferred
ELF     4a0fd000-4a102000       Deferred
ELF     4a4b1000-4a550000       Deferred
ELF     4acaa000-4acc3000       Deferred
ELF     4acc5000-4acc7000       Deferred
ELF     4b6ac000-4b7d2000       Deferred
ELF     4b7d4000-4b7d8000       Deferred
ELF     4b7da000-4b800000       Deferred
ELF     4b802000-4b818000       Deferred
ELF     4b81a000-4b82e000       Deferred
ELF     4b830000-4b835000       Deferred
ELF     4b837000-4b83a000       Deferred
ELF     4b93c000-4b95c000       Deferred
ELF     4e4a4000-4e51e000       Deferred
ELF     4e520000-4e528000       Deferred
ELF     4e560000-4e590000       Deferred
ELF     4e592000-4e5a9000       Deferred

In loop 

while ( context -> skip_rest == FALSE  ) {

      CMD_LIST *toExecute = NULL;         /* Commands left to be executed */

      if (WCMD_ReadAndParseLine(NULL, &toExecute, h) == NULL)


      WCMD_process_commands(toExecute, FALSE, NULL, NULL);


      toExecute = NULL;


the context may be damaged  and  I have tried to correct it addition of 

Best regards
	Anatoly Lyutin.

More information about the wine-devel mailing list