資源簡介
是我的畢業(yè)設(shè)計,包含所有心血,有驅(qū)動和應(yīng)用程序的代碼
代碼片段和文件信息
/*
??DrvFltIp.C
??Author:?your?name
??Last?Updated:?2001-01-01/0101
??This?framework?is?generated?by?QuickSYS.
*/
#include?
#include?
#include?
#include?
#include?
#include?“DrvFltIp.h“
#if?DBG
#define?dprintf?DbgPrint
#else
#define?dprintf(x)
#endif
NTSTATUS?DrvDispatch(IN?PDEVICE_object?Deviceobject?IN?PIRP?Irp);
VOID?DrvUnload(IN?PDRIVER_object?Driverobject);
NTSTATUS?SetFilterFunction(PacketFilterExtensionPtr?filterFunction);
NTSTATUS?AddFilterToList(IPFilter?*pf);
void?ClearFilterList(void);
PF_FORWARD_ACTION?cbFilterFunction(IN?unsigned?char?*PacketHeaderIN?unsigned?char?*Packet?IN?unsigned?int?PacketLength?IN?unsigned?int?RecvInterfaceIndex?IN?unsigned?int?SendInterfaceIndex?IN?unsigned?long?RecvlinkNextHop?IN?unsigned?long?SendlinkNextHop);
#define?NT_DEVICE_NAME?L“\\Device\\DrvFltIp“
#define?DOS_DEVICE_NAME?L“\\DosDevices\\DrvFltIp“
struct?filterList?*first?=?NULL;
struct?filterList?*last?=?NULL;
/*++
Routine?Description:
????Installable?driver?initialization?entry?point.
????This?entry?point?is?called?directly?by?the?I/O?system.
Arguments:
????Driverobject?-?pointer?to?the?driver?object
????RegistryPath?-?pointer?to?a?unicode?string?representing?the?path
???????????????????to?driver-specific?key?in?the?registry
Return?Value:
????STATUS_SUCCESS?if?successful
????STATUS_UNSUCCESSFUL?otherwise
--*/
NTSTATUS?DriverEntry(IN?PDRIVER_object?Driverobject?IN?PUNICODE_STRING?RegistryPath)
{
????PDEVICE_object?????????deviceobject?=?NULL;
????NTSTATUS???????????????ntStatus;
????UNICODE_STRING?????????deviceNameUnicodeString;
????UNICODE_STRING?????????devicelinkUnicodeString;
dprintf(“DrvFltIp.SYS:?entering?DriverEntry\n“);
//we?have?to?create?the?device
RtlInitUnicodeString(&deviceNameUnicodeString?NT_DEVICE_NAME);
ntStatus?=?IoCreateDevice(Driverobject?
0
&deviceNameUnicodeString?
FILE_DEVICE_DRVFLTIP
0
FALSE
&deviceobject);
????if?(?NT_SUCCESS(ntStatus)?)
????{
????
????????//?Create?a?symbolic?link?that?Win32?apps?can?specify?to?gain?access
????????//?to?this?driver/device
????????RtlInitUnicodeString(&devicelinkUnicodeString?DOS_DEVICE_NAME);
????????ntStatus?=?IoCreateSymboliclink(&devicelinkUnicodeString?&deviceNameUnicodeString);
????????if?(?!NT_SUCCESS(ntStatus)?)
????????{
????????????dprintf(“DrvFltIp.SYS:?IoCreateSymboliclink?failed\n“);
????????}
????????//
????????//?Create?dispatch?points?for?device?control?create?close.
????????//
????????Driverobject->MajorFunction[IRP_MJ_CREATE]?????????=
????????Driverobject->MajorFunction[IRP_MJ_CLOSE]??????????=
????????Driverobject->MajorFunction[IRP_MJ_DEVICE_CONTROL]?=?DrvDispatch;
????????Driverobject->DriverUnload?????????????????????????=?DrvUnload;
????}
????if?(?!NT_SUCCESS(ntStatus)?)
????{
????????dprintf(“Error?in?in
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????4519746??2008-05-29?18:26??Fire?Wall?2.4.rar
?????文件??????14058??2008-05-29?02:08??DrvFltIp2\DrvFltIp.c
?????文件???????4823??2008-05-28?22:29??DrvFltIp2\DrvFltIp.dsp
?????文件????????313??2008-05-28?22:29??DrvFltIp2\DrvFltIp.dsw
?????文件???????2894??2008-05-28?22:30??DrvFltIp2\DrvFltIp.h
?????文件??????50176??2008-06-05?17:40??DrvFltIp2\DrvFltIp.ncb
?????文件??????53760??2008-06-05?17:40??DrvFltIp2\DrvFltIp.opt
?????文件????????271??2000-07-26?18:37??DrvFltIp2\makefile
?????文件????????987??2008-05-28?22:29??DrvFltIp2\readme.txt
?????文件?????????79??2002-12-21?00:47??DrvFltIp2\sources
?????目錄??????????0??2008-05-31?00:00??DrvFltIp2\Debug
?????目錄??????????0??2008-06-05?17:40??DrvFltIp2
-----------?---------??----------?-----??----
??????????????4647107????????????????????12
評論
共有 條評論