Pārlūkot izejas kodu

* fix for Mantis #30747: for anonymous events CreateEvent() needs to be called with a Nil parameter for the name, not an empty string

git-svn-id: trunk@34736 -
svenbarth 8 gadi atpakaļ
vecāks
revīzija
f8b458106e
1 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. 7 2
      rtl/win/systhrd.inc

+ 7 - 2
rtl/win/systhrd.inc

@@ -414,10 +414,15 @@ type Tbasiceventstate=record
 
 function intBasicEventCreate(EventAttributes : Pointer;
 AManualReset,InitialState : Boolean;const Name : ansistring):pEventState;
-
+var
+  n : PChar;
 begin
   new(plocaleventrec(result));
-  plocaleventrec(result)^.FHandle := CreateEvent(EventAttributes, AManualReset, InitialState,PChar(Name));
+  if Length(Name) = 0 then
+    n := Nil
+  else
+    n := PChar(Name);
+  plocaleventrec(result)^.FHandle := CreateEvent(EventAttributes, AManualReset, InitialState,n);
 end;
 
 procedure intbasiceventdestroy(state:peventstate);