FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour hb_xfree(00E5C368) Pointer Overflow'' ''
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
hb_xfree(00E5C368) Pointer Overflow'' ''
Posted: Fri May 03, 2013 08:01 AM
Llevo varios intentos de poder hacer un Directory vía FTP con el siguiente código pero no encuentro la manera. Necesito que alguien me diga donde puede estar el error. Subir y Bajar archivos y comprobar si están lo hago sin problemas pero con la secuencia de comandos para hacer Directory no hay forma:

Code (fw): Select all Collapse
    HB_FUNC( FTPFINDFIRSTFILE )  
    {
        hb_retnl( ( LONG ) FtpFindFirstFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), ( WIN32_FIND_DATA * ) hb_parc( 3 ), hb_parnl( 4 ), hb_parnl( 5 ) ) );
    }

    HB_FUNC( INTERNETFINDNEXTFILE )  
    {
        BOOL lSuccess = InternetFindNextFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) ;
       
        hb_retl( lSuccess );
    }



Code (fw): Select all Collapse
    function FTPDirectory( cMask,cIP,cUser,cPass )
       local hFTPDir, aFiles := {}
       local oWin32FindData, cBuffer
       local i:=0

       default cMask := "*.*"

       STRUCT oWin32FindData
          MEMBER nFileAttributes  AS DWORD
          MEMBER nCreationTime    AS STRING LEN 8
          MEMBER nLastReadAccess  AS STRING LEN 8
          MEMBER nLastWriteAccess AS STRING LEN 8
          MEMBER nSizeHight       AS DWORD
          MEMBER nSizeLow         AS DWORD
          MEMBER nReserved0       AS DWORD
          MEMBER nReserved1       AS DWORD
          MEMBER cFileName        AS STRING LEN 260
          MEMBER cAltName         AS STRING LEN  14
       ENDSTRUCT

       hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )
       hConnect = INTERNETCONNECT( hInternet, cIP, INTERNET_INVALID_PORT_NUMBER, cUser, cPass, INTERNET_SERVICE_FTP, 0, 0 )
       
       if hConnect != nil
          cBuffer = oWin32FindData:cBuffer
          hFTPDir =[b] FtpFindFirstFile( hConnect, cMask, @cBuffer, 0, 0 )[/b]
          oWin32FindData:cBuffer = cBuffer
          if ! empty( oWin32FindData:cFileName )
             aadd( aFiles, { oWin32FindData:cFileName,oWin32FindData:nSizeLow } )
             while [b]InternetFindNextFile( hFTPDir, @cBuffer )[/b]
                [color=#FF0000]oWin32FindData:cBuffer = cBuffer[/color]   // ¡¡ Aquí es donde se produce el error !!
                aadd( aFiles, { oWin32FindData:cFileName,oWin32FindData:nSizeLow } )
             end
          endif
          InternetCloseHandle( hFTPDir )
       endif
       
       for i=1 TO len(aFiles)
          msginfo(aFiles[i,1])
       next i  

    return aFiles


Se obtiene el siguiente error: hb_xfree(00E5C368) Pointer Overflow'' ''

Continue the discussion