• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1078
  • Last Modified:

CreateProcess fails with GetLastError=0

hi,

I call CreateProcess with the lpEnvironment parameter pointing to a buffer containing a lot of environment variables (see below) and the result is FALSE, with GetLastError = 0.
Then I recall CreateProcess, but with lpEnvironment = NULL, and I get the same results.

As the Winexec or ShellExececute functions returns 0 if the OS is out of memory or resources, I tried to reboot my machine (even if I run NT !!), but the CreateProcess behaviour keeps the same.

What's happening? Any comments or suggestions welcome.

laurent

my buffer format for the lpEnvironment: 'envVar1=value1§envVar2=value2§...envVarX=valueX§§', where the §§ stands for a zero byte)
0
poupou
Asked:
poupou
  • 2
1 Solution
 
davmarcCommented:
What does GetLastError() return?
This info will help you a lot troubleshooting - I bet it is a too long list of environment variables tough.

Davide Marcato.
0
 
poupouAuthor Commented:
GetLastError() returns the value 0, as I explained in my question. And what is the maximum size of the environment list allowed?
0
 
davmarcCommented:
Argh, yes, you said it - sorry.
What about trying to pass just one environment string and seeing if works (the CreateProcess(), you app won't probably but do it for testing purposes)?

Davide Marcato.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now