News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

read smaller file problem

Started by ragdog, February 15, 2007, 08:33:01 AM

Previous topic - Next topic

ragdog

hi people's
I have again times Trouble with a algo
I can pick larger files and this works I do not take a smaller work it any longer  :red


         invoke GetFileSize,hFile,0 
            mov ebx,eax
         invoke GlobalAlloc,0,eax
            mov esi,eax
         invoke GetFileSize,hFile2,0
            mov edi,eax
            mov dwBytes, 0
         invoke ReadFile,hFile2,esi,edi,offset dwBytes,0
           test eax,eax
            jnz @Next4
         invoke MessageBox,hWnd,addr szReadError,addr szInfo,MB_OK
            jmp @ret
  @Next4:         
         invoke WriteFile,hOutputFile,esi,edi,offset dwBytes,0
           test eax,eax
            jnz @Next5
         invoke MessageBox,hWnd,addr szWriteError,addr szInfo,MB_OK
            jmp @ret

can their me further help

thanks in forward
ragdog

Tedd

A little more code would help :P

BUT..
invoke GetFileSize,hFile,0                          ;get size of file1 (S1)
invoke GlobalAlloc,0,eax                            ;allocate memory, S1 bytes
mov esi,eax                                         ;esi = pS1Memory
invoke GetFileSize,hFile2,0                         ;get size of file2 (S2)
mov edi,eax                                         ;edi = S2
invoke ReadFile,hFile2,esi,edi,offset dwBytes,0     ;read S2 bytes from file2, into pS1Memory


if (file2.size > file1.size) Exception!! :bdg
No snowflake in an avalanche feels responsible.

ragdog

I already solved it this problem

thank you