瀏覽代碼

* Need to zero out all structures

michael 25 年之前
父節點
當前提交
8751d6bd6f
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      fcl/win32/process.inc

+ 4 - 1
fcl/win32/process.inc

@@ -17,6 +17,9 @@ Var PName,PDir : PChar;
     FProcessInformation : TProcessInformation;
 
 begin
+  FillChar(FProcessAttributes,SizeOf(FProcessAttributes),#0);
+  FillChar(FThreadAttributes,SizeOf(FThreadAttributes),#0);
+  FillChar(FStartupInfo,SizeOf(FStartupInfo),#0);
   if poNoConsole in FCReateOptions then
     FCreationFlags:=FCreationFlags or Detached_Process;
   If poRunSuspended in FCreateOptions Then
@@ -40,7 +43,7 @@ begin
     hStdInput:=FChildInputStream.Handle;
     hStdOutput:=FChildOutPutStream.Handle;
     hStdError:=FChildErrorStream.Handle;
-    If (FFillAttribute<>0) then
+    If (FFillAttribute<>-1) then
       begin
       dwFlags:=dwFlags or Startf_UseFillAttribute;
       dwFillAttribute:=FFIllAttribute;