• 网络访问控制


    _FX BOOLEAN File_BlockInternetAccess(PROCESS *proc)
    {
        BOOLEAN is_open, is_closed;
        BOOLEAN ok;
    
        //
        // is this process excempted from the blocade
        //
    
    	if (proc->AllowInternetAccess)
    		return TRUE;
    
        //
        // should we warn on access to internet resources
        //
    
        proc->file_warn_internet = Conf_Get_Boolean(
            proc->box->name, L"NotifyInternetAccessDenied", 0, TRUE);
    
        if (proc->image_sbie)
            proc->file_warn_internet = FALSE;
    
        //
        // add Internet devices if ClosedFilePath=InternetAccessDevices
        //
    
        Process_MatchPath(
            proc->pool, L"InternetAccessDevices", 21,
            NULL, &proc->closed_file_paths,
            &is_open, &is_closed);
    
        ok = TRUE;
    
        if (is_closed) {
    
            //
            // if the configuration specifies to block the pseudo Internet
            // device, add real Internet devices.  keep in sync with the
            // list of devices in File_Api_CheckInternetAccess
            //
    
            if (ok)         // \Device\RawIp6
                ok = File_BlockInternetAccess2(proc, File_RawIp, 0);
    
            if (ok)         // \Device\RawIp4
                ok = File_BlockInternetAccess2(proc, File_RawIp, -1);
    
            if (ok)         // \Device\Http\*
                ok = File_BlockInternetAccess2(proc, File_Http, +1);
    
            if (ok)         // \Device\Tcp6
                ok = File_BlockInternetAccess2(proc, File_Tcp, 0);
    
            if (ok)         // \Device\Tcp4
                ok = File_BlockInternetAccess2(proc, File_Tcp, -1);
    
            if (ok)         // \Device\Udp6
                ok = File_BlockInternetAccess2(proc, File_Udp, 0);
    
            if (ok)         // \Device\Udp4
                ok = File_BlockInternetAccess2(proc, File_Udp, -1);
    
            if (ok)         // \Device\Ip6
                ok = File_BlockInternetAccess2(proc, File_Ip, 0);
    
            if (ok)         // \Device\Ip4
                ok = File_BlockInternetAccess2(proc, File_Ip, -1);
    
            if (ok)         // \Device\Afd*
                ok = File_BlockInternetAccess2(proc, File_Afd, +1);
    
            if (ok)         // \Device\Nsi
                ok = File_BlockInternetAccess2(proc, File_Nsi, 0);
        }
    
        return ok;
    }
    

      

  • 相关阅读:
    Event 事件(最简单实用)
    Codeforces Beta Round #93_A题
    欧几里得算法扩展(extended gcd)解不定方程_初入门
    HDU2955_Robberies_01背包变种
    HDU2602_Bone Collector_很水的01背包
    USACO_2_1_3_Sorting a ThreeValued Sequence_交换环
    Codeforces Beta Round #93_B题
    中国剩余定理的_非互素同余模板
    HDU1114_DP_完全背包
    HDU3809_Decrypt coordinate_迭代法
  • 原文地址:https://www.cnblogs.com/chunyou128/p/16278792.html
Copyright © 2020-2023  润新知