So you're using C++ then. We just want to provide the solution using whatever language you are using. It cuts down on issues. There is no reason to give you a C#/PS answer if you're using C++ since we can provide a C++ solution instead.
As @MotoX80 mentions you should be able to use the machine name directly, no reason to use the SID. Have you tried that approach and it doesn't work for some reason? Machine accounts are generally used to give one machine permissions to another such as in DB calls, etc.
I'm not really sure why you want to avoid the LSA approach as it is still valid but the more modern version would be LookupAccountName. While I haven't tested it on domain accounts, across trusted domains, etc it is documented as working in all those cases. Personally I would just be using the machine name from GetComputerName but if you got the full DNS name then it is supposed to work with that as well.