Click here to Skip to main content
15,906,558 members
Home / Discussions / System Admin
   

System Admin

 
GeneralRe: Authentication mechanism for Windows Pin
Jasmine25017-Jun-07 9:24
Jasmine25017-Jun-07 9:24 
AnswerRe: Authentication mechanism for Windows Pin
Sebastian Schneider6-Jun-07 0:55
Sebastian Schneider6-Jun-07 0:55 
GeneralRe: Authentication mechanism for Windows Pin
Jasmine25017-Jun-07 9:26
Jasmine25017-Jun-07 9:26 
GeneralRe: Authentication mechanism for Windows Pin
Richard Andrew x647-Jun-07 9:28
professionalRichard Andrew x647-Jun-07 9:28 
GeneralRe: Authentication mechanism for Windows Pin
Jasmine25017-Jun-07 10:02
Jasmine25017-Jun-07 10:02 
AnswerRe: Authentication mechanism for Windows Pin
Mike Dimmick6-Jun-07 1:06
Mike Dimmick6-Jun-07 1:06 
AnswerRe: Authentication mechanism for Windows Pin
Craster6-Jun-07 3:10
Craster6-Jun-07 3:10 
QuestionWhy did the function PfAddFiltersToInterface fails? Pin
yzzm5-Jun-07 5:58
yzzm5-Jun-07 5:58 
The goal of my code is to filter some specific IP packet,just like the firewall.But one of the function in my code was always failed.The error code is 87(error parameter).I really don't known where goes wrong.I was puzzled of this problem.Any help is much appreciated.

#include "stdio.h"<br />
#include "windows.h"<br />
#include "Fltdefs.h"<br />
<br />
#pragma comment(lib, "iphlpapi.lib")<br />
<br />
void main(int argc, char* argv[])<br />
{<br />
	DWORD err = NO_ERROR;<br />
	// Create a filter interface<br />
	INTERFACE_HANDLE hInterface;<br />
	PfCreateInterface(<br />
		0, <br />
		PF_ACTION_FORWARD,//PF_ACTION_DROP,	<br />
          	PF_ACTION_FORWARD,//PF_ACTION_DROP,<br />
		FALSE, <br />
		TRUE, <br />
		&hInterface);<br />
<br />
	// Bind the filter interface to a IP<br />
	BYTE localIp[] = {192,168,0,111};<br />
	BYTE remoteIp[] = {220,181,38,4};<br />
	PfBindInterfaceToIPAddress(hInterface, PF_IPV4, localIp);<br />
<br />
<br />
	FILTER_HANDLE fHandle;<br />
	// Fill the filter struct <br />
	PF_FILTER_DESCRIPTOR outFilter;<br />
	outFilter.dwFilterFlags = FD_FLAGS_NOSYN; always use this<br />
	outFilter.dwRule = 0; //always use this<br />
	outFilter.pfatType = PF_IPV4; <br />
	outFilter.SrcAddr = localIp; <br />
	outFilter.SrcMask = (PBYTE)"\xFF\xFF\xFF\x0"; <br />
	outFilter.wSrcPort = FILTER_TCPUDP_PORT_ANY; 	outFilter.wSrcPortHighRange = FILTER_TCPUDP_PORT_ANY;<br />
	outFilter.DstAddr = 0; <br />
	outFilter.DstMask = 0;<br />
	outFilter.wDstPort = 1; <br />
	outFilter.wDstPortHighRange = 10000;<br />
	outFilter.fLateBound = LB_SRC_ADDR_USE_DSTADDR_FLAG|LB_DST_ADDR_USE_DSTADDR_FLAG;<br />
	outFilter.dwProtocol = FILTER_PROTO_ANY; <br />
	err = PfAddFiltersToInterface(hInterface, 0, NULL,1, &outFilter, &fHandle);<br />
        //PfAddFiltersToInterface always failed<br />
    if(err != NO_ERROR) <br />
    { <br />
                int exitcode = GetLastError();<br />
		printf("PfAddFiltersToInterface is Wrong\n");<br />
                printf("The error exit code is %d\n", exitcode);<br />
		//return ;<br />
    }<br />
<br />
	printf("Try to connect to the internet...\n");<br />
	char ch=getchar();<br />
	printf("Filter Enabled!");<br />
	// Remove the filter interface<br />
	PfRemoveFilterHandles(hInterface, 1, &fHandle);<br />
	PfUnBindInterface(hInterface);<br />
	PfDeleteInterface(hInterface);<br />
<br />
	return;<br />
}

QuestionWhy did the function PfAddFiltersToInterface fails? Pin
yzzm5-Jun-07 5:57
yzzm5-Jun-07 5:57 
AnswerRe: Why did the function PfAddFiltersToInterface fails? Pin
Dave Kreskowiak5-Jun-07 6:08
mveDave Kreskowiak5-Jun-07 6:08 
QuestionStarting a service on Windows Vista after installing it from the installer Pin
ComplexLifeForm5-Jun-07 1:19
ComplexLifeForm5-Jun-07 1:19 
AnswerRe: Starting a service on Windows Vista after installing it from the installer Pin
Jasmine25015-Jun-07 19:11
Jasmine25015-Jun-07 19:11 
QuestionShortcuts for volume Control Pin
vimal_yet5-Jun-07 0:42
vimal_yet5-Jun-07 0:42 
AnswerRe: Shortcuts for volume Control Pin
Jasmine25015-Jun-07 19:28
Jasmine25015-Jun-07 19:28 
QuestionDebug a process Pin
chandni_chandrakant_maheta5-Jun-07 0:08
chandni_chandrakant_maheta5-Jun-07 0:08 
AnswerRe: Debug a process Pin
WoutL5-Jun-07 2:19
WoutL5-Jun-07 2:19 
QuestionNetwork Time Protocol in Windows 2000 Server Pin
P.T.R.K4-Jun-07 19:01
P.T.R.K4-Jun-07 19:01 
AnswerRe: Network Time Protocol in Windows 2000 Server Pin
Mike Dimmick6-Jun-07 1:19
Mike Dimmick6-Jun-07 1:19 
QuestionWindows Media Issue Pin
Jasmine25014-Jun-07 9:06
Jasmine25014-Jun-07 9:06 
AnswerRe: Windows Media Issue Pin
Dave Kreskowiak4-Jun-07 17:02
mveDave Kreskowiak4-Jun-07 17:02 
GeneralRe: Windows Media Issue Pin
Jasmine25014-Jun-07 18:39
Jasmine25014-Jun-07 18:39 
GeneralRe: Windows Media Issue Pin
Dave Kreskowiak5-Jun-07 14:14
mveDave Kreskowiak5-Jun-07 14:14 
GeneralRe: Windows Media Issue Pin
Jasmine25015-Jun-07 18:53
Jasmine25015-Jun-07 18:53 
Questioncharecter inputting function Pin
sonavi3-Jun-07 14:43
sonavi3-Jun-07 14:43 
AnswerRe: charecter inputting function Pin
Mike Dimmick6-Jun-07 3:46
Mike Dimmick6-Jun-07 3:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.