示例#1
0
void CI8DeskSvr::AddWindowFireWall()
{
	WinXPSP2FireWall Fw;
	BOOL bOn = FALSE;
	Fw.IsWindowsFirewallOn(bOn);
	if (bOn)
	{
		wchar_t path[MAX_PATH] = {0};
		GetModuleFileNameW(NULL, path, MAX_PATH);
		Fw.AddApplication(path, L"I8DeskSvr");

		PathRemoveFileSpecW(path);
		lstrcatW(path, L"\\I8VDiskSvr.exe");
		Fw.AddApplication(path, L"I8VDiskSvr");

		PathRemoveFileSpecW(path);
		lstrcatW(path, L"\\DNAService\\DNAService.exe");
		Fw.AddApplication(path, L"DNAS");

		GetModuleFileNameW(NULL, path, MAX_PATH);
		PathRemoveFileSpecW(path);
		lstrcatW(path, L"\\SafeSvr\\KHPrtSvr.exe");
		Fw.AddApplication(path, L"I8DeskSafeSvr");

		GetModuleFileNameW(NULL, path, MAX_PATH);
		PathRemoveFileSpecW(path);
		lstrcatW(path, L"\\SafeSvr\\Server\\UndiskSafe.exe");
		Fw.AddApplication(path, L"I8DeskDisklessSafeSvr");
	}
}
示例#2
0
	void AddWindowFireWall()
	{
		WinXPSP2FireWall Fw;
		BOOL bOn = FALSE;
		Fw.Initialize();
		Fw.IsWindowsFirewallOn(bOn);
		if (bOn)
		{
			wchar_t path[MAX_PATH] = {0};
			GetModuleFileNameW(NULL, path, MAX_PATH);
			Fw.AddApplication(path, L"I8VDiskSvr");

			PathRemoveFileSpecW(path);
			lstrcatW(path, L"\\I8DeskSvr.exe");
			Fw.AddApplication(path, L"I8DeskSvr");

			PathRemoveFileSpecW(path);
			lstrcatW(path, L"\\DNAService\\DNAService.exe");
			Fw.AddApplication(path, L"DNAS");
		}
		Fw.Uninitialize();
	}