Besides protecting the crankshaft and connecting rods from foreign objects, the crankcase serves other functions, depending on engine type.
Two-stroke engines Edit
In two-stroke gasoline engines, the crankcase is sealed and is used as a pressurization chamber for the fuel/air mixture. As the piston rises, it pushes out exhaust gases and produces a partial vacuum in the crankcase which aspirates fuel and air. As the piston travels downward, the fuel/air charge is pushed from the crankcase and into the cylinder. 
Unlike four-stroke gasoline engines, the crankcase does not contain engine oil because it handles the fuel/air mixture. Instead, oil is mixed in with the fuel, and the mixture provides lubrication for the cylinder walls, crankshaft and connecting rod bearings.
Four-stroke engines Edit
In a four-stroke engine, the crankcase is filled mainly with air and oil, and is largely sealed off from the fuel/air mixture by the pistons.
Oil circulation Edit
Oil circulation is kept separate from the fuel/air mixture, thereby preserving oil rather than burning it as happens in two-stroke engines. Oil moves from its reservoir, is pressurized by an oil pump, and is pumped through the oil filter to remove grit. The oil is then squirted into the crankshaft and connecting rod bearings and onto the cylinder walls, and eventually drips off into the bottom of the crankcase.  In a wet sump system, oil remains in a reservoir at the bottom of the crankcase, referred to as the oil pan. In a dry sump system, oil is instead pumped to an external reservoir. 
Even in a wet sump system, the crankshaft has minimal contact with the sump oil. Otherwise, the high-speed rotation of the crankshaft would cause the oil to froth, making it difficult for the oil pump to move the oil, which can starve the engine of lubrication.  Small amounts of oil may splash onto the crankshaft during rough driving, referred to as windage. 
In a wet sump system, the main dipstick and oil filler cap connect to the crankcase.
Air ventilation Edit
During normal operation, a small amount of unburned fuel and exhaust gases escape around the piston rings and enter the crankcase, referred to as "blow-by".  If these gases remained in the crankcase and condensed, the oil would become more diluted over time, decreasing its ability to lubricate. Condensed water would also cause parts of the engine to rust.  To counter this, a crankcase ventilation system exists to draw fresh air in from the air filter]and expel the gases out the PCV valve into the intake manifold. In a non-turbo engine, the intake manifold is at a lower pressure than the crankcase, providing the suction to keep the ventilation system going. A turbo engine usually has a check valve somewhere in the tubing to avoid pressurizing the crankcase when the turbo produces boost.
If an engine is damaged or enters old age, gaps can form between the cylinder walls and pistons, resulting in larger amounts of blow-by than the crankcase ventilation system can handle. The gaps cause power loss, and ultimately mean that the engine needs to be rebuilt or replaced.  Symptoms of excessive blow-by include oil being pushed up into the air filter, out the dipstick, or out the PCV valve.
Open crank engineEdit
Early internal combustion engines were of the "open crank" style, that is, there was no enclosed crankcase. The crankshaft, connecting rod, camshaft, gears, governor, etc. were all completely exposed and could be viewed in operation when the engine was running. This made for a messy environment as oil was thrown from the engine and could run on the ground. Another disadvantage was that dirt and dust could get on moving engine parts, causing excessive wear and possible malfunction of the engine. Frequent cleaning of the engine was required to keep it in normal working order.
<ref>tags exist, but no
<references/>tag was found