kann mir jemand sagen, was ich übersehen haben (oder falsch mache), dass ich mit FileOpen & RawRead ein anderes (falsches) Ergebnis bekomme als mit CreateFile & ReadFile?
Code: Select all
f := FileOpen(filename, "r"))
while !(f.AtEOF) && (dataread := f.RawRead(data, 262144))
NT_STATUS := DllCall("bcrypt\BCryptHashData", "ptr", hHash, "ptr", &data, "uint", dataread, "uint", 0)
f.Close()
Code: Select all
hFile := DllCall("CreateFile", "str", filename, "uint", 0x80000000, "uint", 0x1, "ptr", 0, "uint", 3, "uint", 0x08000000, "ptr", 0, "ptr")
VarSetCapacity(data, 262144)
while (DllCall("ReadFile", "ptr", hFile, "ptr", &data, "uint", 262144, "uint*", dataread, "ptr", 0)) && (dataread)
NT_STATUS := DllCall("bcrypt\BCryptHashData", "ptr", hHash, "ptr", &data, "uint", dataread, "uint", 0)
DllCall("CloseHandle", "ptr", hFile)
Edit:
In meiner Beispiel-Datei:
- dataread mit RawRead -> 6437 Bytes
- dataread mit ReadFile -> 6440 Bytes
- Datei-Eigenschaften -> 6440 Bytes
Jetzt muss ich nur noch rausfinden warum der unterschied
jNizM