Beispiel #1
0
 public static extern UInt32 NmGetApiConfiguration(ref NM_API_CONFIGURATION ApiConfig);
Beispiel #2
0
        private bool InitializeNMAPI()
        {
            // Initialize the NMAPI
            NM_API_CONFIGURATION apiConfig = new NM_API_CONFIGURATION();
            apiConfig.Size = (ushort)System.Runtime.InteropServices.Marshal.SizeOf(apiConfig);
            ulong errno = NetmonAPI.NmGetApiConfiguration(ref apiConfig);
            if (errno != 0)
            {
                Console.WriteLine("Failed to Get NMAPI Configuration Error Number = " + errno);
                return false;
            }

            // Set possible configuration values for API Initialization Here
            ////apiConfig.CaptureEngineCountLimit = 4;

            errno = NetmonAPI.NmApiInitialize(ref apiConfig);
            if (errno != 0)
            {
                Console.WriteLine("Failed to Initialize the NMAPI Error Number = " + errno);
                return false;
            }

            return true;
        }
Beispiel #3
0
 public static extern UInt32 NmApiInitialize(ref NM_API_CONFIGURATION ApiConfig);