You need to fix the car engine and the B1791 Code is related with the faulty engine. You can fix the problem of the engine if you have all necessary machines and information. It is better take car to the automobile repair center if you cannot solve the problem from the engine. The B1791 code comes when it fails to test the car engine. The general meaning of the code is B for Body Code Problem is antilock brake system, electronic suspension and steering systems. 1 for MFG – Manufacturer Specific. 7 for Auxiliary Emission Controls. 9 for Crankshaft Position Sensor Circuit Performance and 1 for TFP Valve Position Switch-Drive Without Drive Ratio.