I have the same problem. I use Rapi.CreateProcess and Rapi.CopyFileFromDevice in my C# application without incident, so I'm assuming it's not a security issue... at least I think not.
System.ArgumentNullException was unhandled
Message="Value cannot be null.\r\nParameter name: source"
Source="mscorlib"
ParamName="source"
StackTrace:
at System.Runtime.InteropServices.Marshal.CopyToManaged(IntPtr source, Object destination, Int32 startIndex, Int32 length)
at System.Runtime.InteropServices.Marshal.Copy(IntPtr source, Byte[] destination, Int32 startIndex, Int32 length)
at OpenNETCF.Desktop.Communication.RAPI.Invoke(String DLLPath, String FunctionName, Byte[] InputData, Byte[]& OutputData)
I wonder if this is a problem with my DLL path, possibly creating a DLL that just does not work properly, etc... (my DLL experience is rather limited).