+Length passed to D3DCompile() does not look right. Shouldn't you pass source_size there instead? Also mapping the file is probably easier.
+ hr = D3DCompile(source, strlen(source), NULL, defines, includes, entrypoint, target, flags1, flags2, code, errors);
Yes, this is wrong. I sent another try.
Thanks!