Click here to Skip to main content
15,887,350 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: #define how to use with is code ? Pin
David Crow30-Dec-09 17:12
David Crow30-Dec-09 17:12 
GeneralRe: #define how to use with is code ? Pin
krish_kumar30-Dec-09 18:17
krish_kumar30-Dec-09 18:17 
GeneralRe: #define how to use with is code ? Pin
Maxwell Chen30-Dec-09 19:46
Maxwell Chen30-Dec-09 19:46 
AnswerRe: #define how to use with is code ? Pin
David Crow31-Dec-09 8:44
David Crow31-Dec-09 8:44 
Questionlibrary linking error Pin
noalias___30-Dec-09 11:44
noalias___30-Dec-09 11:44 
AnswerRe: library linking error Pin
Migounette30-Dec-09 13:12
Migounette30-Dec-09 13:12 
GeneralRe: library linking error Pin
noalias___31-Dec-09 6:13
noalias___31-Dec-09 6:13 
QuestionJust a minor KMDF concern Pin
Mattzimmerer30-Dec-09 10:47
Mattzimmerer30-Dec-09 10:47 
I' m trying to get a solid grasp on the whole KMDF. The reason for the following doesn't jump out at me immediately, can anyone explain?

When my input program sends the writefile IRP through WriteFile, my driver seems to receive 4 different IRP, 3 of which are unused. Should I be concerned about this? What exactly is happening?

Ohh and while im here, what should I do about the __drv_dispatchType(IRP_MJ_UNUSED) line before my mem_Unused declaration? I just made up IRP_MJ_UNUSED...


DRIVER SRC: (snippet)
DRIVER_INITIALIZE DriverEntry;
DRIVER_UNLOAD DriverUnload;
__drv_dispatchType(IRP_MJ_UNUSED) DRIVER_DISPATCH mem_Unused;
__drv_dispatchType(IRP_MJ_WRITE) DRIVER_DISPATCH mem_Write;


NTSTATUS mem_Write(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
	DbgPrint("Write IRP Received\n");
	Irp->IoStatus.Status = STATUS_SUCCESS;
	IoCompleteRequest(Irp, IO_NO_INCREMENT );
	return STATUS_SUCCESS;
}

NTSTATUS mem_Unused(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp )
{
	DbgPrint("Un-used IRP Received\n");
	Irp->IoStatus.Status = STATUS_SUCCESS;
	IoCompleteRequest(Irp, IO_NO_INCREMENT );
	return STATUS_NOT_SUPPORTED;
}


INTERFACE INPUT: (snippet)
hFile = CreateFile(L"\\\\.\\Meminterface", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

if ( hFile == INVALID_HANDLE_VALUE )
{
    printf("FAILED, last error:%i\n",GetLastError());
}
else
{
    WriteFile(hFile, "Hello from user mode!", sizeof("Hello from user mode!"), &dwReturn, NULL);

DEBUG OUTPUT:
Un-used IRP Received
Write IRP Received
Un-used IRP Received
Un-used IRP Received

AnswerRe: Just a minor KMDF concern Pin
JudyL_MD30-Dec-09 11:10
JudyL_MD30-Dec-09 11:10 
QuestionIs there any way to execute XQuery through MFC or C++ (This question Previously left with no answer) Pin
A&Ms30-Dec-09 8:21
A&Ms30-Dec-09 8:21 
QuestionRe: Is there any way to execute XQuery through MFC or C++ (This question Previously left with no answer) Pin
David Crow30-Dec-09 9:40
David Crow30-Dec-09 9:40 
JokeRe: Is there any way to execute XQuery through MFC or C++ (This question Previously left with no answer) Pin
enhzflep30-Dec-09 12:00
enhzflep30-Dec-09 12:00 
GeneralRe: Is there any way to execute XQuery through MFC or C++ (This question Previously left with no answer) Pin
Tim Craig30-Dec-09 19:59
Tim Craig30-Dec-09 19:59 
AnswerRe: Is there any way to execute XQuery through MFC or C++ (This question Previously left with no answer) Pin
A&Ms31-Dec-09 0:20
A&Ms31-Dec-09 0:20 
QuestionPipe & Fork code - need help Pin
SummerBulb30-Dec-09 7:24
SummerBulb30-Dec-09 7:24 
AnswerRe: Pipe & Fork code - need help Pin
CPallini30-Dec-09 8:02
mveCPallini30-Dec-09 8:02 
QuestionRe: Pipe & Fork code - need help Pin
SummerBulb30-Dec-09 8:14
SummerBulb30-Dec-09 8:14 
AnswerRe: Pipe & Fork code - need help Pin
CPallini30-Dec-09 9:57
mveCPallini30-Dec-09 9:57 
QuestionRe: Pipe & Fork code - need help Pin
SummerBulb30-Dec-09 19:44
SummerBulb30-Dec-09 19:44 
AnswerRe: Pipe & Fork code - need help Pin
CPallini30-Dec-09 22:02
mveCPallini30-Dec-09 22:02 
GeneralRe: Pipe & Fork code - need help Pin
SummerBulb31-Dec-09 23:33
SummerBulb31-Dec-09 23:33 
GeneralYou are welcome Pin
CPallini1-Jan-10 7:15
mveCPallini1-Jan-10 7:15 
AnswerRe: Pipe & Fork code - need help Pin
markkuk30-Dec-09 13:02
markkuk30-Dec-09 13:02 
GeneralRe: Pipe & Fork code - need help Pin
SummerBulb30-Dec-09 19:39
SummerBulb30-Dec-09 19:39 
QuestionWhere can I find a forum about windows device driver development with WinDDK? Pin
sashoalm29-Dec-09 23:20
sashoalm29-Dec-09 23:20 

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.