Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,584 of 4,675    |
|    JJ to R.Wieser    |
|    Re: How to manipulate envirionment varia    |
|    14 Oct 18 19:23:57    |
      From: jj4public@nospicedham.vfemail.net              On Sat, 13 Oct 2018 16:54:40 +0200, R.Wieser wrote:       > Hello all,       >       > Many years ago I wrote a DOS program which could read, remove and create the       > consoles environment variables. The same does not work under Windows       > anymore (neither by using INT 2Eh, nor by following the PSP chain up to the       > console program and than grabbing the environment segment from it). This       > is most likely because the programs get wrapped in an ntvdm shell, which       > gets discarded when the program ends.       >       > I've been googeling for it a while, but have not stumbled on anything       > informational in that regard.       >       > So, does anyone know of any other way to change environment variables *from       > within a DOS program* under Windows (XP) ?       >       > And its fine, and even preferred, if the changes are non-permanent and for       > the current console only. Its also fine if it only works within a       > batchfile run within such a console.       >       > Regards,       > Rudy Wieser              Change from which platform? From a DOS program? Or from a Windows program?       16-bit or 32-bit Windows program?              Either way, a 32-bit Windows program is required to do the changes (programs       in a VDM process are not aware of other VDMs). Use the (almost undocumented)       VDM API to find which VDM process contains the DOS program whose environment       block needs to be changed. Walk the MCB chain in the VDM to find the one       which holds the environment block for the DOS program. Then overwrite the       (remote) memory.              If DOS program is the one which issue the environment variable change, it       use the Windows program as a server. There are many ways to communicate with       the Windows program. e.g. console window title, or a file. Or maybe       clipboard or MS-Network.              16-bit Windows program is similar like DOS program, except that       communicating with the server program is much simpler via Windows API.       Thunking can be used, but it only complicate things.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca