Please note that the current implementation of the functions
D3DXCreateEffectFromFileExW, D3DXCreateEffectFromFileExA, D3DXCreateEffectFromResourceExW, D3DXCreateEffectFromResourceExA
returns D3DERR_INVALIDCALL if defines are NULL. Actually, defines is an optional parameter and can indeed be NULL and return D3D_OK if everything else is correct.
I guess that that is the same for D3DXCreateEffectCompilerFromFileA, D3DXCreateEffectCompilerFromFileW