run-time error R6009 - not enough space environment

A

aXoneX

Hello people,

I did quite a lil bit of research already concerning my problem and
already came up with a working solution using a WindowsXP generated
DOS system boot disk. The thing is I HAVE to be able to make the older
program run under WindowsXP.

I have checked out CONFIG.NT and AUTOEXEC.NT up and tried myriad
different combination with either dos loaded in upper memory or not.

I have tried changing the size of the environment with the SHELL
command also. This is what my CONFIG.NT looks like right now

dos=high, umb
device=C:\WINDOWS\system32\himem.sys
REM EMM = RAM
files=45
buffers=30,0
fcbs=4,0
stacks=9,256
SHELL=C:\WINDOWS\system32\COMMAND.COM c:\WINDOWS\system32 /E:32768 /p

I also went as far as trying to augment the size of the NTVDM that
runs 16-bit applications, and also making it so 16-bit app have to run
in seperate NTVDM.

This is done in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WOW
windows registry.

I tried removing environment variables in the
System|Advanced|Environment Variables. But i noticed using SET while
in COMMAND.COM emulation that there is still an awful bunch of hidden
variables that i cant seem to be able to remove through windows. Any
idea how i could shield COMMAND.COM against all those environment
variables I dont need so i have a clean environment to work in?

Any other idea is also very much welcome
Thank you in advance

aXoneX
 
A

aXoneX

Alright, I'm posting this for whoever might encounter the same problem
hoping it will help.

The solution to the problem, if you have access to source code to
recompile, is to override the system function _getenvp() by
incorporating it in the source code with an empty body so the default
behavior is nil result.

In C:

void _getenvp(void);
void _getenvp() {}

This is a system function that normally allocates an array to store in
environment variables in the near heap. If it happens that the loaded
program already fills in most of the space in the near heap, then
there might not be enough memory left for the vector in question to
initialize correctly. This empty function makes it so that the vector
is NOT initialised at all therefore allowing it to pass the run-time
error R6009.

Hope this can help someone. For more information check up the
Microsoft site and in the search engine type in "run-time error R6009
- not enough space environment". The problem is fairly well
documented.

aXoneX
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top