I found that it takes one of three values:
A. -10: to retrieve input device handle
B. -11: to retrieve output device handle
C. -12: to retrieve error device handle
Although, DWORD is "unsigned 32-bit integer" and it is marshaled System.UInt32, System.UInt32 does not support negative values, therefore, it cannot take any value of the three. So, I have marshaled it as System.Int32 instead.
Now, the question is:
Do I have a misconception about DWORD? And why we marshal DWORD to System.UInt32 and GetStdHandle() requires negative values?
I am very thankful Darwen. The code segment was very brilliant.
But I know that the size reserved for the variable is more important, and System.UInt32 is non-CLS-compliant. But the question here, why GetStdHandle() requires DWORD? I think it would be OK if it requires INT instead!