Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with writefile when Heap is more than 1 megabyte

9 views
Skip to first unread message

jklosak

unread,
Dec 9, 2010, 10:53:54 PM12/9/10
to
masm32 on Win7 machine
trying to save a large Heap to file
invoke HeapCreate,NULL,2000000,0
mov Heap1,eax ;handle to the heap
invoke HeapAlloc,Heap1,HEAP_ZERO_MEMORY,2000000
invoke FileAccess,0,0,0,ADDR CPTChargeFile,GRGW,SHARE,NORMAL
invoke SetFilePointer,tmphandle,NULL,NULL,FILE_BEGIN
invoke WriteFile,tmphandle,lpHeap,M2,ADDR byteswritten,NULL
invoke GetLastError

getlasterror returns
1784 The supplied user buffer is not valid for the requested
operation. ERROR_INVALID_USER_BUFFER
works fine if the Heap is under 1 meg. any ideas appreciated.
thanks
john klosak

0 new messages