Hi all,

This is my first post, i hope my question is'not to much idiot.

I try to write a small prog to copie files from CD to c:\xxx:

        invoke GlobalAlloc,GMEM_MOVEABLE or GMEM_ZEROINIT,MEMSIZE
  mov  hMemory,eax
  invoke GlobalLock,hMemory
  mov  pMemory,eax
        invoke CreateFile,ADDR hFile1,
              GENERIC_READ or GENERIC_WRITE,FILE_SHARE_READ or FILE_SHARE_WRITE,
              NULL,OPEN_EXISTING,FILE_ATTRIBUTE_ARCHIVE,NULL
        invoke ReadFile,fhandle,pMemory,MEMSIZE-1,ADDR SizeReadWrite,NULL
        mov fhandle,eax
        invoke CreateFile,ADDR hFile2,\
              GENERIC_READ or GENERIC_WRITE,FILE_SHARE_READ or FILE_SHARE_WRITE,
              NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE,NULL
        mov fhandle,eax
  invoke WriteFile,fhandle,pMemory,eax,ADDR SizeReadWrite,NULL
        invoke CloseHandle,fhandle
        invoke GlobalUnlock,pMemory
  invoke GlobalFree,hMemory

It's working only if i put a value for (eax) when i want to write the new file.


Can somebody help me.

Thank you for your help.

Posted on 2005-10-21 04:16:34 by Atome_X
try this:

invoke WriteFile,fhandle,pMemory,SizeReadWrite,ADDR var_for_num_of_written_bytes,NULL

why not use CopyFile?
Posted on 2005-10-21 04:31:17 by Shoo
Thank you Shoo, for your help i have make the same more simple with copyfile.

:)

Best regards.
Posted on 2005-10-21 07:27:10 by Atome_X