Dolphin,
You should read the post to your question by Scott.
The HAL prevents you from using the drivers to access a flash you're executing from, with good reason. If you try to write to the flash the data values read from a flash become status bits, so you're next instruction fetch could fetch status bits, which is unlikely to be what you want to do.
If you look in altera_avalon_cfi_flash.h you'll see how it's done. I would caution against changing this unless you understand the issue I raised above and in Scott's post.
It's also curious that you're writing a ReadFlash function, why not just read from the address?