C++黑客编程揭秘与防范之创建一个不会被删除和文件夹

CString strDir("d:\\zzz");
CString strAuto("d:\\zzz\\autorun.inf");
CString strImm("d:\\zzz\\autorun.inf\\Immunity...\\");

void Immunity(LPCTSTR lpszDirectory)
{
    BOOL bRet = CreateDirectory(strDir, NULL);
    bRet = CreateDirectory(strAuto, NULL);
    bRet = CreateDirectory(strImm, NULL);
}

void UnImmunity(LPCTSTR lpszDirectory)
{
    BOOL bRet = RemoveDirectory(strImm);
    bRet = RemoveDirectory(strAuto);
    bRet = RemoveDirectory(strDir);
}


 

你可能感兴趣的:(c/c++)