src/taesooLib/BaseLib/utility/FileEx.cpp
BOOL CFileEx::NextIoSegment( BOOL bWrite, RDWROVERLAPPEDPLUS& ovp, BYTE* pBuffer, DWORD dwTtlSegs, DWORD dwCurSeg )
{
	BOOL	bSuccess	= FALSE;
	BYTE*	pOffBuf		= NULL;
	DWORD	dwTransfer	= 0;


	pOffBuf			= ( BYTE* ) POINTEROFFSET( pBuffer, ovp.dwTotalSoFar );
	dwTransfer		= ( dwCurSeg == dwTtlSegs ) ? ( ovp.dwTotalSizeToTransfer % m_dwSegSize ) : m_dwSegSize;
	ovp.ov.Offset	= ovp.dwTotalSoFar;

	if( bWrite ) {
		bSuccess = ::WriteFileEx(	m_hFile, pOffBuf, dwTransfer, &ovp.ov, 
									CFileEx::FileIoCompletionRoutine );
	}else{
		bSuccess = ::ReadFileEx(	m_hFile, pOffBuf, dwTransfer, &ovp.ov, 
									CFileEx::FileIoCompletionRoutine );
	}		

	return bSuccess;
}
///////////////////////////////////////////////////////////////////////////////
//	Desc:
//		Reads or writes the next segment of input/output.
///////////////////////////////////////////////////////////////////////////////
Reads or writes the next segment of input/output.
Reads or writes the next segment of input / output .
BOOL CFileEx::NextIoSegment( BOOL bWrite, RDWROVERLAPPEDPLUS& ovp, BYTE* pBuffer, DWORD dwTtlSegs, DWORD dwCurSeg )
{
	BOOL	bSuccess	= FALSE;
	BYTE*	pOffBuf		= NULL;
	DWORD	dwTransfer	= 0;
	pOffBuf			= ( BYTE* ) POINTEROFFSET( pBuffer, ovp.dwTotalSoFar );
	dwTransfer		= ( dwCurSeg == dwTtlSegs ) ? ( ovp.dwTotalSizeToTransfer % m_dwSegSize ) : m_dwSegSize;
	ovp.ov.Offset	= ovp.dwTotalSoFar;
	if( bWrite ) {
		bSuccess = ::WriteFileEx(	m_hFile, pOffBuf, dwTransfer, &ovp.ov, 
									CFileEx::FileIoCompletionRoutine );
	}else{
		bSuccess = ::ReadFileEx(	m_hFile, pOffBuf, dwTransfer, &ovp.ov, 
									CFileEx::FileIoCompletionRoutine );
	}		
	return bSuccess;
}
BOOL CFileEx :: NextIoSegment ( BOOL bWrite , RDWROVERLAPPEDPLUS & ovp , BYTE * pBuffer , DWORD dwTtlSegs , DWORD dwCurSeg ) { BOOL bSuccess = FALSE ; BYTE * pOffBuf = NULL ; DWORD dwTransfer = 0 ; pOffBuf = ( BYTE * ) POINTEROFFSET ( pBuffer , ovp . dwTotalSoFar ) ; dwTransfer = ( dwCurSeg == dwTtlSegs ) ? ( ovp . dwTotalSizeToTransfer % m_dwSegSize ) : m_dwSegSize ; ovp . ov . Offset = ovp . dwTotalSoFar ; if ( bWrite ) { bSuccess = :: WriteFileEx ( m_hFile , pOffBuf , dwTransfer , & ovp . ov , CFileEx :: FileIoCompletionRoutine ) ; } else { bSuccess = :: ReadFileEx ( m_hFile , pOffBuf , dwTransfer , & ovp . ov , CFileEx :: FileIoCompletionRoutine ) ; } return bSuccess ; }
Desc:
Reads or writes the next segment of input/output.
Desc : Reads or writes the next segment of input / output .