9-12-2014
This is a 64-bit program
Running Windows 7 pro 64-bit and GoAsm
memory of the puter is 6G
This code is failing way before 1,600,000
In HeapCreate the 3rd parameter is set to zero and
what I see in the API Doc is that this will allocate
more memory as it is growable.
The actual # of bytes read by ReadFile is in the neighborhood
of 125000. Anything more causes failure.
No Heap errors are generated.
The file that is being read in is a tad less than 1,600,000 bytes.
BytesRead dq 0
FileSize dq 0
HeapH dq 0 ; heap handle
hFile dq 0
PtrMem dq 0
FileByte . db 0
invoke GetFileSize, [hFile],NULL
mov [FileSize],rax
invoke HeapCreate, HEAP_GENERATE_EXCEPTIONS,1600000,0
mov [HeapH],rax
invoke HeapAlloc, [HeapH],HEAP_GENERATE_EXCEPTIONS,1600000
mov [PtrMem],rax
mov rcx,[PtrMem]
xor rsi,rsi
.n7
cmp rsi,[FileSize]
jge >>.n9
invoke ReadFile, [hFile],addr FileByte,1,addr BytesRead,NULL
mov al,B[FileByte]
mov B[rcx+rsi],al ; builds data from readfile to memory
inc rsi
jmp <.n7
.n9
Help would be most appreciated.