Click here to Skip to main content
12,764,177 members (37,687 online)
Click here to Skip to main content

Stats

310.5K views
10.2K downloads
189 bookmarked
Posted 28 Oct 2004

An Adventure: How to implement a Firewall-Hook Driver?

, 28 Oct 2004
Firewall-Hook driver is a completely unknown method to develop simple packet filtering applications. With this article, I want to tell you how this driver works and what you need to do to use it in your applications.
FirewallApp.exe
FwHookDrv.sys
FirewallHooK
FirewallApp.dsp
FirewallApp.dsw
res
CVS
Entries
Entries.Extra
Repository
Root
FirewallApp.ico
FirewallAppDoc.ico
newtoolbar.bmp
Toolbar.bmp
Driver
buildchk_wxp_x86.log
Debug
FwHookDrv.sys
vc60.idb
FwHookDrv.dsp
FwHookDrv.dsw
makefile
objchk_wxp_x86
i386
fwhookdrv.obj
FwHookDrv.pdb
FwHookDrv.sys
_objects.mac
sources
FwHookDrv.sys
FirewallApp.exe
#if !defined(AFX_RULEDLG_H__C9161D68_7C56_47A7_8D2C_3A700665F7FE__INCLUDED_)
#define AFX_RULEDLG_H__C9161D68_7C56_47A7_8D2C_3A700665F7FE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RuleDlg.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CRuleDlg dialog

class CRuleDlg : public CDialog
{
// Construction
public:
	CRuleDlg(CWnd* pParent = NULL);   // standard constructor
	
	unsigned long srcIp;
	unsigned long srcMask;
	unsigned short srcPort;

	unsigned long dstIp;
	unsigned long dstMask;
	unsigned short dstPort;

	unsigned int protocol;

	int cAction;


// Dialog Data
	//{{AFX_DATA(CRuleDlg)
	enum { IDD = IDD_ADDRULEDLG };
	CString	m_ipsource;
	UINT	m_portsource;
	CString	m_ipdestination;
	UINT	m_portDestination;
	CString	m_action;
	CString	m_protocol;
	CString	m_srcMask;
	CString	m_dstMask;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRuleDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CRuleDlg)
	virtual void OnOK();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_RULEDLG_H__C9161D68_7C56_47A7_8D2C_3A700665F7FE__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Jesus Oliva
Chief Technology Officer
Spain Spain
To summarize: learn, learn, learn... and then try to remember something I.... I don't Know what i have to remember...

http://www.olivacorner.com

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 28 Oct 2004
Article Copyright 2004 by Jesus Oliva
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid