Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

FPC 2.6.2 released (Announce)

posted by Arjay, 19.03.2013, 01:48

> > 2)
> > Again occured weird problems with environment settings when shelling
> into
> > DOS. Under W98 it cuts some environment variables.
>
> The only difference I see here is TMP and TEMP missing. Maybe that's
> intentional for some reason, dunno.

I noted the damaged environment starts with the new string "D:\WINDOWS\COMMAND.COM" which is 22 bytes long. Comparing that to the undamaged environment, it appears that this is an size/alignment issue when "patching" the environment under W98 since the P of TEMP variable is infact still present but has the first 3 bytes of it overwritten. The environment uses nul terminated strings between strings. Comparing environments:

1234567890123456789012345
TMP=D:\WINDOWS\TEMP
TEM
P=D:\WINDOWS\TEMP

vs
1234567890123456789012345
D:\WINDOWS\COMMAND.COM
P=D:\WINDOWS\TEMP


The string "TMP=D:\WINDOWS\TEMP" is 19 bytes in length, with 3 bytes missing off the next variable TEMP (TEM) = 22 in total. Or to write it another way which should help show exactly what I am talking about:
1234567890123456789012345
TMP=D:\WINDOWS\TEMP TEMP=D:\WINDOWS\TEMP
D:\WINDOWS\COMMAND.COM P=D:\WINDOWS\TEMP


I have further thoughts but am too tired to write something sensible now.

 

Complete thread:

Back to the forum
Board view  Mix view
22777 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum