Click here to Skip to main content
15,887,776 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
Questionwhat is mainframe testing software? Pin
Rakib khan00927-Apr-12 9:48
Rakib khan00927-Apr-12 9:48 
AnswerRe: what is mainframe testing software? Pin
Albert Holguin27-Apr-12 9:54
professionalAlbert Holguin27-Apr-12 9:54 
AnswerRe: what is mainframe testing software? Pin
Richard MacCutchan27-Apr-12 23:29
mveRichard MacCutchan27-Apr-12 23:29 
AnswerRe: what is mainframe testing software? Pin
Jon Bravo09829-Apr-12 20:04
Jon Bravo09829-Apr-12 20:04 
AnswerRe: what is mainframe testing software? Pin
JosephvObrien1-May-12 20:28
JosephvObrien1-May-12 20:28 
QuestionFile System Driver Programming Pin
casa cargo8-Apr-12 9:11
casa cargo8-Apr-12 9:11 
AnswerRe: File System Driver Programming Pin
Richard Andrew x648-Apr-12 11:38
professionalRichard Andrew x648-Apr-12 11:38 
Questionminifilter demo Pin
daotian5-Apr-12 22:55
daotian5-Apr-12 22:55 
I'm a fresh man in developing Microsoft Windows' Driver ,I tried to test a little demo on my PC, My environment of testing is :Win7(32bit)+Visual Studio 2010+WDK7600, to my disappointment ,No response in my DbgView's text area.(I have been test another little print demo in my environment ,and succeed)

the successful demo is:
C++
#include "ntddk.h"

VOID DriverUnload(PDRIVER_OBJECT driver) //  提供一个Unload 函数只是为了让这个程序能动态卸载,方便调试。 
{ 
	DbgPrint("first: ===Our driver is unloading…"); //  但是实际上我们什么都不做,只打印一句话: 
} 


NTSTATUS DriverEntry(
	IN PDRIVER_OBJECT driver, 
	IN PUNICODE_STRING reg_path
	) // DriverEntry,入口函数。相当于 main。
{ 
	DbgPrint("first:===Hello, my salary!"); 
	driver->DriverUnload = DriverUnload;  //  设置一个卸载函数便于这个函数能退出。 
	return STATUS_SUCCESS; 
} 


And the failed demo is:
C++
//
// drMain.h
//
#ifndef _DRMAIN_H_
#define _DRMAIN_H_
NTSTATUS DriverEntry(
	PDRIVER_OBJECT DriverObject,
	PUNICODE_STRING RegistryPath
	);

NTSTATUS MyDriverUnload(PDRIVER_OBJECT DriverObject);

FLT_PREOP_CALLBACK_STATUS DriverPreCreate(
	PFLT_CALLBACK_DATA data,
	PCFLT_RELATED_OBJECTS FltObjects,
	PVOID *CompletionContext
	);

FLT_POSTOP_CALLBACK_STATUS DriverPostCreate(
	PFLT_CALLBACK_DATA data,
	PCFLT_RELATED_OBJECTS FltObjects,
	PVOID *CompletionContext,
	FLT_POST_OPERATION_FLAGS flags
	);
#endif //_DRMAIN_H_


C++
//
// drMain.c
//
#include"Fltkernel.h"
#include"drMain.h"

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>CallBacks
CONST FLT_OPERATION_REGISTRATION CallBacks[]={
	{
		IRP_MJ_CREATE,
			0,
			(PFLT_PRE_OPERATION_CALLBACK)DriverPreCreate,
			(PFLT_POST_OPERATION_CALLBACK)DriverPostCreate
	},
	
	{ IRP_MJ_OPERATION_END}
};
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




//-------------------------------------------------
CONST FLT_REGISTRATION FilterRegistration ={
	sizeof(FLT_REGISTRATION),
	FLT_REGISTRATION_VERSION,
	0,
	NULL,
	CallBacks,
	(PFLT_FILTER_UNLOAD_CALLBACK)MyDriverUnload,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
};
//-------------------------------------------------
NTSTATUS status;
UNICODE_STRING string;
PFLT_FILTER theFilter;
//=================================================


NTSTATUS DriverEntry(
	PDRIVER_OBJECT DriverObject,
	PUNICODE_STRING RegistryPath
	)
{

	UNREFERENCED_PARAMETER(RegistryPath);
	DbgPrint("FIRST==driver begin!");

	//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>RegisterFilter
	status= FltRegisterFilter(
		DriverObject,
		&FilterRegistration,
		&theFilter
		);
	DbgPrint("FIRST==FltRegisterFilter begin!");

	ASSERT(status);

	if (NT_SUCCESS( status )) {

			DbgPrint("FIRST==SomeThing wrong happend before FltStartFiltering!");
		status=FltStartFiltering(theFilter);
		if(!NT_SUCCESS( status ))
		{
			DbgPrint("FIRST==SomeThing wrong happend after FltStartFiltering!");
			FltUnregisterFilter(theFilter);
		}

	}  
	//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

	return status;
}

NTSTATUS MyDriverUnload(PDRIVER_OBJECT DriverObject)
{

	PAGED_CODE();
	UNREFERENCED_PARAMETER(DriverObject);

	FltUnregisterFilter(theFilter);

	return STATUS_SUCCESS;

}
FLT_PREOP_CALLBACK_STATUS DriverPreCreate(
	PFLT_CALLBACK_DATA data,
	PCFLT_RELATED_OBJECTS FltObjects,
	PVOID *CompletionContext
	)
{
	DbgPrint("FIRST==DriverPreCreate dealing!");
	return FLT_PREOP_SUCCESS_WITH_CALLBACK;
}
FLT_POSTOP_CALLBACK_STATUS DriverPostCreate(
	PFLT_CALLBACK_DATA data,
	PCFLT_RELATED_OBJECTS FltObjects,
	PVOID *CompletionContext,
	FLT_POST_OPERATION_FLAGS flags
	)
{

	DbgPrint("FIRST==DriverPostCreate dealing!");
	return FLT_POSTOP_FINISHED_PROCESSING;
}

I can compile, link and install it successfully, but I can't start my drMain.sys.
I think I must fogot something when codeing it.
Thanks very much!
AnswerRe: minifilter demo Pin
Richard MacCutchan5-Apr-12 23:57
mveRichard MacCutchan5-Apr-12 23:57 
GeneralRe: minifilter demo Pin
Erudite_Eric6-Apr-12 6:24
Erudite_Eric6-Apr-12 6:24 
GeneralRe: minifilter demo Pin
Erudite_Eric1-May-12 5:12
Erudite_Eric1-May-12 5:12 
GeneralRe: minifilter demo Pin
daotian9-Apr-12 15:47
daotian9-Apr-12 15:47 
GeneralRe: minifilter demo Pin
Richard MacCutchan9-Apr-12 21:23
mveRichard MacCutchan9-Apr-12 21:23 
GeneralRe: minifilter demo Pin
Erudite_Eric10-Apr-12 21:21
Erudite_Eric10-Apr-12 21:21 
GeneralRe: minifilter demo Pin
Erudite_Eric10-Apr-12 21:19
Erudite_Eric10-Apr-12 21:19 
GeneralRe: minifilter demo Pin
Richard MacCutchan10-Apr-12 22:09
mveRichard MacCutchan10-Apr-12 22:09 
SuggestionRe: minifilter demo Pin
Deka Prikarna A.1-May-12 5:15
Deka Prikarna A.1-May-12 5:15 
QuestionHow to install the USB driver in silent? Pin
whiteclouds31-Mar-12 1:15
whiteclouds31-Mar-12 1:15 
AnswerRe: How to install the USB driver in silent? Pin
Dave Kreskowiak31-Mar-12 3:51
mveDave Kreskowiak31-Mar-12 3:51 
AnswerRe: How to install the USB driver in silent? Pin
Erudite_Eric31-Mar-12 23:27
Erudite_Eric31-Mar-12 23:27 
AnswerRe: How to install the USB driver in silent? Pin
JosephvObrien10-Apr-12 20:46
JosephvObrien10-Apr-12 20:46 
GeneralRe: How to install the USB driver in silent? Pin
Erudite_Eric10-Apr-12 21:24
Erudite_Eric10-Apr-12 21:24 
AnswerRe: How to install the USB driver in silent? Pin
memoarfaa1-Jun-16 2:59
memoarfaa1-Jun-16 2:59 
Questionabout bluetooth Pin
Aspault25-Mar-12 4:59
Aspault25-Mar-12 4:59 
AnswerRe: about bluetooth Pin
Richard Andrew x6425-Mar-12 8:44
professionalRichard Andrew x6425-Mar-12 8:44 

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.