Browse Source

* fix #40603:
- initialize thrdinfo record using Default() so that padding bytes are zeroed as well
- correctly pass the count of ULONG_PTRs

Sven/Sarah Barth 1 year ago
parent
commit
75b5e8e63d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      rtl/win/systhrd.inc

+ 2 - 2
rtl/win/systhrd.inc

@@ -375,12 +375,12 @@ var
     var
       thrdinfo: THREADNAME_INFO;
     begin
+      thrdinfo:=Default(THREADNAME_INFO);
       thrdinfo.dwType:=$1000;
       thrdinfo.szName:=@ThreadName[1];
       thrdinfo.dwThreadID:=threadHandle;
-      thrdinfo.dwFlags:=0;
       try
-        RaiseException(MS_VC_EXCEPTION, 0, SizeOf(thrdinfo) div SizeOf(DWord), @thrdinfo);
+        RaiseException(MS_VC_EXCEPTION, 0, SizeOf(thrdinfo) div SizeOf(PtrUInt), @thrdinfo);
       except
         {do nothing}
       end;