none
FilterSendMessage in C# RRS feed

  • General discussion

  • I am using FilterSendMessage in C# code. 

    I have written ,

    Declaration: 

     [DllImport("fltlib", SetLastError = false)]
            public static extern int FilterConnectCommunicationPort([MarshalAs(UnmanagedType.LPWStr)]
                string portName,
                        uint options,
                        IntPtr context,
                        uint sizeOfContext,
                        IntPtr securityAttributes,
                        IntPtr portPtr);

            [DllImport("fltlib.dll")]
            public static extern IntPtr FilterSendMessage(
                IntPtr hPort,
                IntPtr inBuffer,
                UInt32 inBufferSize,
                IntPtr outBuffer,
                UInt32 outBufferSize,
                out UInt32 bytesReturned);

    Call:

      IntPtr portPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)));
                string portName = "\\ScannerPort";
                int status = FilterConnectCommunicationPort(
                                portName,
                                0,
                                IntPtr.Zero,
                                0,
                                IntPtr.Zero,
                                portPtr);

    How I should call  FilterSendMessage. 

    Monday, April 1, 2013 11:52 AM

All replies

  • Not the appropriate forum, you should ask on a c# forum

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, April 1, 2013 2:31 PM