WriteBytes spect a pointer, so you have to pass a TBank.buf instead of the TBank object itself.
CurrentPakFile.Writebytes(SourceBank.buf(),Tmp_CompressSize)
this way you're passing the bank buffer, and not the bank buffer object.
CurrentPakFile.Writebytes(SourceBank.buf(),Tmp_CompressSize)
this way you're passing the bank buffer, and not the bank buffer object.