Hi

Could someone please change in hbwhat32\_winsys.c:

//-------------------------------------------------------------------//
/*
BOOL WriteFile(
  HANDLE hFile,                    // handle to file to write to
  LPCVOID lpBuffer,                // pointer to data to write to file
  DWORD nNumberOfBytesToWrite,     // number of bytes to write
  LPDWORD lpNumberOfBytesWritten,  // pointer to number of bytes written
LPOVERLAPPED lpOverlapped // pointer to structure for overlapped I/O
);
*/
HB_FUNC( WRITEFILE )
{

   DWORD nWritten = 0     ;
   OVERLAPPED *Overlapped ;

   if( ISCHAR( 4 ))
Overlapped = ( OVERLAPPED *) hb_parc( 4 ); //hb_param( 4, HB_IT_STRING )->item.asString.value ;

   hb_retl ( WriteFile( (HANDLE)  hb_parnl( 1 )   ,
                     hb_parcx( 2 )       ,
                     hb_parclen( 2 )    ,
                     &nWritten          ,
                     ISCHAR( 4 ) ? Overlapped : NULL ) ) ;

   hb_stornl( nWritten, 3 ) ;
}


to:


//-------------------------------------------------------------------//
/*
BOOL WriteFile(
  HANDLE hFile,                    // handle to file to write to
  LPCVOID lpBuffer,                // pointer to data to write to file
  DWORD nNumberOfBytesToWrite,     // number of bytes to write
  LPDWORD lpNumberOfBytesWritten,  // pointer to number of bytes written
LPOVERLAPPED lpOverlapped // pointer to structure for overlapped I/O
);
*/
HB_FUNC( WRITEFILE )
{

   DWORD nWritten = 0     ;
   OVERLAPPED *Overlapped ;

   if( ISCHAR( 5 ))
Overlapped = ( OVERLAPPED *) hb_parc( 5 ); //hb_param( 4, HB_IT_STRING )->item.asString.value ;

   hb_retl ( WriteFile( (HANDLE)  hb_parnl( 1 )   ,
                     hb_parcx( 2 )       ,
                     hb_parclen( 3 )    ,
                     &nWritten          ,
                     ISCHAR( 5 ) ? Overlapped : NULL ) ) ;

   hb_stornl( nWritten, 4 ) ;
}

The params seem off by one for params 4 and 5.

Thanks
Alex
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to