cl_init() private method

private cl_init ( uint initoptions ) : int
initoptions uint
return int
Exemplo n.º 1
0
        /// <summary>
        /// Global initialization method to load the ClamAV library into the process.
        /// This method should be called once during the lifetime of a host process.
        /// </summary>
        private static void Initialize()
        {
            if (!_initialized)
            {
                int result = UnsafeNativeMethods.cl_init(UnsafeNativeMethods.CL_INIT_DEFAULT);

                if (result != UnsafeNativeMethods.CL_SUCCESS)
                {
                    throw new ClamException(result, ErrorString(result));
                }
            }

            _initialized = true;
        }