Re: GenEnvironmentVariable and CreateProcess failures under XP
From: magician (magician_at_null.hk)
Date: 04/28/04
- Next message: Charles Geach: "Re: RAS API"
- Previous message: Bob Butler: "Re: Compiling VB-applications on different systems"
- In reply to: LarryH: "GenEnvironmentVariable and CreateProcess failures under XP"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Apr 2004 01:57:21 +0800
Dear LarryH,
What parameter you passed in CreateProcess?
Regards,
Magician
"LarryH" <BigLar@nospam.nospam> ¦b¶l¥ó
news:B1533CE0-AC69-4AC8-A3DF-398662B8A9E0@microsoft.com ¤¤¼¶¼g...
> I am having truble figuring out how to debug a problem with VB6 program
that shells other Win32 executables. The program has been running for years
and was just recompiled under Windows XP Pro SP1. The problem is with calls
to the Win32 API not returning results even though the exit code indicates
success. The program calls GenEnvironmentVariable to get the sytem PATH,
SetEnvironmentVariable to prepend a value to the system PATH, then calls
CreateProcess to launch Notepad or other Win32 executables. I can launch
Notepad 6 or 7 times in a row with no problem, then I start getting one of
three unexpected results. The unexpected results are:
>
> (1) GetEnvironmentVariable fails to return anything, but still returns "1"
to indicate success,
> (2) CreateProcess fails to launch Notepad (or whataver is called), but
still returns "1" to indicate success,
> (3) Createprocess fails to launch Notepad (or whataver is called) and
returns "0" to indicate failure.
>
> Once an unexpected result happens, it will happen on all subsequent
attempts to launch that program until I shut the program down (when
debugging, I have to shut VB 6 down). Only the third result makes sense.
The Event log is not updated by any of these errors.
>
> I cannot find any information on this problem in the MSDN library or
through Internet searches, including some of the more popular VB sites.
>
> I have also been told that this problem ocurrs infrequently on Windows NT,
but only happens once, not continuously. On XP, of the two PCs we are
testing on, one computer produces the unexpected results a lot more
frequently that the other. All of our PCs are locked down and all software
is remotely installed. Our workstation people looked at the computers and
say the same patches have been applied to each. I can replicate this
problem at will.
>
> Is this a known problem? What can I do about it? If it is unfamiliar,
what tools do I need to debug it?
- Next message: Charles Geach: "Re: RAS API"
- Previous message: Bob Butler: "Re: Compiling VB-applications on different systems"
- In reply to: LarryH: "GenEnvironmentVariable and CreateProcess failures under XP"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|