I'm trying to open a file and read the content inside a buffer using NSIS Installer. Unfortunatly, everything works except KERNEL32::ReadFile. I read that a lot of people have some problem with this API, and i can't find a solution.
Here is my code :
StrCpy $2 $2\TOS.TXT
System::Call 'Kernel32::CreateFile(t, i, i, i, i, i, i) i (r2, 0x80000000, 0, 0, 4, 0x80, 0) .r3'
System::Call 'kernel32::GetFileSize(pr3, p0)i.r7' ; Call API to read 32-bit file size
System::Call "kernel32::VirtualAlloc(i0, ir7, i0x3000, i0x40) .r1"
System::Call "KERNEL32::ReadFile(pr3,pr1,ir7,*i,p0)i.r3"
The file is well opened and the buffer is well created with the correct size.
Any help is appreciated, Thank, Chris.