Einzelnen Beitrag anzeigen

venice2
(Gast)

n/a Beiträge
 
#1

CreateProcess wirft Kernelbase Error

  Alt 2. Apr 2021, 13:46
Wenn ich CreateProcess ohne UniqueString aufrufe wirft es einen Kernelbase Error.
Rufe ich es mit auf sind die Strings nicht lesbar.

Delphi-Quellcode:
function PipeExec(CommandLine, Path: String; EnvironementStrings: PChar; var StdIO: TStdIO; UserToken: THandle; ShowWindow: DWORD = SW_HIDE): TProcessInformation;

  UniqueString(CommandLine);

  if UserToken = 0 then
  begin
    if not CreateProcess( nil, // must be NIL for win16 apps under NT, including DOS progs
                   pchar(CommandLine),
                   nil, // Process security attibutes. Sue same as current
                   nil, // Thread security attibutes. Sue same as current
                   true, // Inherite handles. Must be true for IO redirection
                   ProcessCreationFlags, // creation flags
                   EnvironementStrings, // If using with a CGI aplication, you MUST pass the HTTP headers as env. strings in this variable
                   PathPChar, // Directory of the new process
                   SI, // SISTEMINFO Structure used to initialize the new process
                   result) // PROCESINFORMATION structure used to control the newly created process
    then
      RaiseLastOSError;
Warum?
  Mit Zitat antworten Zitat