See the question and my original answer on StackOverflow

From official documentation here: http://www.acceed.de/manuals/inlog/EDAM5000_Manual.pdf there is a C++ definition, plus a bit of documentation on what the second parameter is, which is really what you want to look at:

VC++: (see E5KDAQ.h)

unsigned short E5K_ReadDIStatus (int id, unsigned long *Didata);

Parameters:

id: module ID address

Didata: points to a 32-bit buffer to store DI status

So the C# definition should simply be (long and int in C++ are 32-bit)

[DllImport("E5KDAQ")]
static extern ushort E5K_ReadDIStatus(int id, ref uint Didata)