Solved

CreateProcess fails with GetLastError=0

Posted on 1997-09-03
3
1,050 Views
Last Modified: 2013-12-03
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
Comment
Question by:poupou
  • 2
3 Comments
 
LVL 4

Expert Comment

by:davmarc
Comment Utility
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
 

Author Comment

by:poupou
Comment Utility
GetLastError() returns the value 0, as I explained in my question. And what is the maximum size of the environment list allowed?
0
 
LVL 4

Accepted Solution

by:
davmarc earned 50 total points
Comment Utility
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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now