ntdll: Move file mapping functionality to a helper function.