12. Given sets
$$
M=\{1,2,3\}, N=\{1,2,3,4\} \text {. }
$$

Define the function $f: M \rightarrow N$, and points $A(1, f(1))$, $B(2, f(2))$, $C(3, f(3))$. If the incenter of $\triangle A B C$ is $D$, and $\overrightarrow{D A}+\overrightarrow{D C}=\lambda \overrightarrow{D B}(\lambda \in \mathbf{R})$, then the number of functions that satisfy the condition is ( ) .
(A) 12
(B) 10
(C) 6
(D) 16
12. A.

Let $K$ be the midpoint of $A C$.
From $\overrightarrow{D A}+\overrightarrow{D C}=\lambda \overrightarrow{D B}(\lambda \in \mathbf{R})$, we know that $D$, $B$, and $K$ are collinear. This implies $A B=B C$.
Let $f(1)=x, f(2)=y, f(3)=z$.
By combining geometric and numerical analysis, we know $x=z$, and $z \neq y$.
Therefore, $\mathrm{A}^{2}=12$.