Browse Source

Fix FindNext for NativeNT.

rtl/nativent/sysutils.pp, FindNext:
* the UNICODE_STRING.Length and the FILE_DIRECTORY_INFORMATION.FileNameLength fields contain the amount of bytes, not the amount of characters, so move the correct amount of bytes

git-svn-id: branches/cpstrrtl@25319 -
svenbarth 12 years ago
parent
commit
5be1a905e8
1 changed files with 2 additions and 2 deletions
  1. 2 2
      rtl/nativent/sysutils.pp

+ 2 - 2
rtl/nativent/sysutils.pp

@@ -785,7 +785,7 @@ begin
       Rslt.FindData.LastRes := res;
       if dirinfo^.Name.Length > 0 then begin
         SetLength(FName, dirinfo^.Name.Length div 2);
-        move(dirinfo^.Name.Buffer[0],FName[1],dirinfo^.Name.Length div 2);
+        move(dirinfo^.Name.Buffer[0],FName[1],dirinfo^.Name.Length);
 {$ifdef debug_findnext}
         Write(FName, ' (');
         for i := 0 to dirinfo^.TypeName.Length div 2 - 1 do
@@ -799,7 +799,7 @@ begin
         FName := '';
     end else begin
       SetLength(FName, filedirinfo^.FileNameLength div 2);
-      move(filedirinfo^.FileName[0],FName[1],filedirinfo^.FileNameLength div 2);
+      move(filedirinfo^.FileName[0],FName[1],filedirinfo^.FileNameLength);
     end;
     if FName = '' then
       Finished := True