Can the pilot stop airflow between cockpit and cabin? During normal operation the entire fuselage is pressurized equally:


  An aircraft fuselage does not contain separate compartments with different pressure values in each. The entire vessel is pressurized equally from the forward pressure bulkhead to the aft pressure bulkhead. This normally includes the cabin, cockpit, and lower-deck cargo holds. (source)


If my understanding of physics is correct, this means that there must be airflow between the cockpit and the cabin (otherwise a pressure difference would occur). The airflow equalizes the atmospheric pressure in the cockpit and cabin.

Question: Can the pilot completely stop the airflow between cockpit and cabin, i.e. hermetically sealing off the cockpit from the cabin ?

3 scenarios for which this question is interesting:


fire
If there is smoke in the cabin, the pilot would need to prevent the smoke from entering the cockpit.
hull breach
Does cabin depressurization (due to a hull breach for example) directly lead to cockpit depressurization? Or can the pilot prevent this by stopping the air outflow from the cockpit to the cabin?
MH370
One working hypothesis in the MH370 mystery is accidental or deliberate cabin depressurization. Assuming the latter, is there any way the perpetrator in the cockpit could prevent the cockpit depressurization ?


I would appreciate if your answers included these 3 scenarios. Since the third scenario deals with a B777, please use this type as an example. Technical airflow diagrams very welcome!



Concerning scenario 1 (fire), my research into this question seems to suggest, that the cockpit is indeed designed to be sealed off in case of fire. I could not find the relevant information for a Boeing-777, but here is a description of how smoke entered the MD-11 cockpit in the Swissair 111 crash and how it was supposed to be prevented (smoke barrier, etc):

SR 111 Investigation Report:


  Airflow patterns in the MD-11 are affected by the aircraft configuration. In the forward portion of the aircraft, this configuration includes the valve position of individual air outlets in the cockpit and throughout the cabin, and the position of the louvres in the bottom part of the cockpit door. Also, all MD-11s are equipped with a smoke barrier installed laterally across the aircraft in the attic area above the cockpit aft wall (see figure 3). Inspection of Swissair MD-11s showed that the smoke barrier was sealed relatively tightly in some aircraft, while in others there were gaps in the barrier at the edges and at the seams where conditioned air ducts pass through the barrier. These gaps allowed air to flow past the smoke barrier. The holes in the barrier, designed to permit the engine fire shut-off cables to pass through the barrier, would also be a path for smoke to pass between the cabin and cockpit.
fire If there is smoke in the cabin, the pilot would need to prevent
  the smoke from entering the cockpit.


This is a bit more complex as the cockpit door by its own nature will slow the flow of smoke but will not stop it all together. Smoke flow is also dependent on the movement of air within the aircraft. In your example of SR-111 the smoke was not in the cabin but in the overhead section so closing the cabin door would not have accomplished much. While smoke barriers are installed ultimately in a fire situation its only a matter of time before another hole is burned through. This is why early identification and extinguishing is so key. By the nature of cockpits things like wire bundles, cable chases, and at one time in history control cables must come and go so you cant truly seal a cockpit anyway.   


  hull breach Does cabin depressurization (due to a hull breach for
  example) directly lead to cockpit depressurization? Or can the pilot
  prevent this by stopping the air outflow from the cockpit to the
  cabin?
  
  MH370 One working hypothesis in the MH370 mystery is accidental or
  deliberate cabin depressurization. Assuming the latter, is there any
  way the perpetrator in the cockpit could prevent the cockpit
  depressurization ?


You can generally lump these into the more general question of "can the cockpit be pressurized separately from the rest of the aircraft" to which the broad answer is no. Simplly put the cockpit door is not capable of serving as a bulkhead and cant withstand the pressure differential, as far as I know they also lack any sort of sealing, bracketing or joints for such a task. The only aircraft I can really think of that ever had a feature like this was the B29 Super fortress which had independent fore and aft sections that were independently pressurized. This allowed an unpressurized bomb bay in the center. To make this possible both sections had small pressure doors to allow entry. 



(source)

The only thing a flight crew could do, is potentially depressurize the whole aircraft and use the pilot and co-pilot 02 system to outlast the cabin 02 masks, then decent below FL100 and breathe normally.