Salting is just concatenating salt to data in before applying hash function. Salt should be random and never twice the same, goal is to defeat precomputed rainbow tables. Salt should be stored together with the hash when checking of data ( password ) is done.
Based on your code, concanating salt in front of data is (untested whatsoever) :
bool simpleSHA256(void * salt, unsigned long salt_length, void* input, unsigned long length, unsigned char* md)
{
SHA256_CTX context;
if(!SHA256_Init(&context))
return false;
// first apply salt
if(!SHA256_Update(&context, (unsigned char*)salt, salt_length))
return false;
// continue with data...
if(!SHA256_Update(&context, (unsigned char*)input, length))
return false;
if(!SHA256_Final(md, &context))
return false;
return true;
}