[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

CreateProcess fails with GetLastError=0

Posted on 1997-09-03
3
Medium Priority
?
1,066 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
ID: 1405568
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
ID: 1405569
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 100 total points
ID: 1405570
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

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Loops Section Overview

829 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