//////////////////////////////////////////////////////////////////////////////
//
// Asura_Chunk_ResourceFile_PS2_DnasAuthData.cpp
//
// Copyright (c) 2003 Rebellion. All rights reserved.
//
// Description:
//
//     DNAS auth data chunk parsing code
//
//////////////////////////////////////////////////////////////////////////////

// I N C L U D E S ///////////////////////////////////////////////////////////

#include "Core/Asura.h"

#include "ChunkSystem/Asura_Chunk_ResourceFile_PS2_DnasAuthData.h"

// independent includes
#include "Debugging/Asura_Assert.h"
#include "FileAccess/Asura_FileAccess.h"

// ps2 includes
#include "Network/Asura_PS2_DNAS.h"

bool Asura_Chunk_ResourceFile_PS2_DnasAuthData::Process( Asura_Handle hFile )
{
	// get ptr to memory for the authdata. Asura_PS2_DNAS will allocate and
	// free the memory.
	void* pvBuffer = Asura_PS2_DNAS::GetAuthDataPtr(this->FileSize);
	Asura_Assert(pvBuffer, "no buffer");
	if (!pvBuffer)
	{
		return false;
	}
	
	return Asura_FileAccess::ReadData( hFile, pvBuffer, this->FileSize );
}
