Click here to Skip to main content
15,892,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Testing my first C driver Pin
candogu2-Apr-13 2:22
candogu2-Apr-13 2:22 
GeneralRe: Testing my first C driver Pin
Richard MacCutchan2-Apr-13 2:30
mveRichard MacCutchan2-Apr-13 2:30 
GeneralRe: Testing my first C driver Pin
Erudite_Eric3-Apr-13 0:46
Erudite_Eric3-Apr-13 0:46 
GeneralRe: Testing my first C driver Pin
Jochen Arndt2-Apr-13 3:05
professionalJochen Arndt2-Apr-13 3:05 
GeneralRe: Testing my first C driver Pin
Erudite_Eric3-Apr-13 3:34
Erudite_Eric3-Apr-13 3:34 
QuestionRe: Testing my first C driver Pin
David Crow2-Apr-13 4:34
David Crow2-Apr-13 4:34 
AnswerRe: Testing my first C driver Pin
Erudite_Eric3-Apr-13 0:45
Erudite_Eric3-Apr-13 0:45 
AnswerRe: Testing my first C driver Pin
Erudite_Eric3-Apr-13 0:58
Erudite_Eric3-Apr-13 0:58 
Good job you cant build it because it will BSOD anyway.

You need to do this for starters in DriverEntry:

C++
for (Index = 0 ; Index <= IRP_MJ_MAXIMUM_FUNCTION ; Index++)
{
    DriverObject->MajorFunction[Index] = MyDispatch;
}

DriverObject->DriverExtension->AddDevice            = 0; // non PnP so dont set this

DriverObject->DriverUnload                          = MyUnload;


Your MyDispatch actually needs to do something with the Irps, set Information to 0, the status block to success and return success.



C++
Irp->IoStatus.Status     = STATUS_SUCCESS;
Irp->IoStatus.Information    = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;



You then need to make sure you are using the DDK (of WDK) compiler, as in actually install the entire DDK (WDK). I dont know what CodeBlocks is, I dont care, the DDK compiler is the one you must use.

You need to get your SORCES file right, look at some of the samples that ship with the DDK (WDK).


You then need a service entry in the registry in order to start your driver, either inf file or do it manually, then start it with 'net srart'.
==============================

Nothing to say.

Questioncode conversion MATLAB to c Pin
Member 99587781-Apr-13 21:12
Member 99587781-Apr-13 21:12 
AnswerRe: code conversion MATLAB to c Pin
Chris Losinger2-Apr-13 7:49
professionalChris Losinger2-Apr-13 7:49 
QuestionAccessing Win32 APIs from WinRT app through Win32 Dll Pin
msr_codeproject1-Apr-13 4:21
msr_codeproject1-Apr-13 4:21 
AnswerRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
Richard MacCutchan1-Apr-13 21:37
mveRichard MacCutchan1-Apr-13 21:37 
GeneralRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
msr_codeproject1-Apr-13 23:17
msr_codeproject1-Apr-13 23:17 
AnswerRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
MicroVirus1-Apr-13 23:43
MicroVirus1-Apr-13 23:43 
GeneralRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
msr_codeproject2-Apr-13 1:03
msr_codeproject2-Apr-13 1:03 
GeneralRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
MicroVirus3-Apr-13 10:41
MicroVirus3-Apr-13 10:41 
QuestionCreating an array of global Labels at runtime Pin
Douglas Kirk31-Mar-13 12:08
Douglas Kirk31-Mar-13 12:08 
GeneralRe: Creating an array of global Labels at runtime Pin
Richard MacCutchan31-Mar-13 13:54
mveRichard MacCutchan31-Mar-13 13:54 
GeneralRe: Creating an array of global Labels at runtime Pin
Douglas Kirk31-Mar-13 14:08
Douglas Kirk31-Mar-13 14:08 
GeneralRe: Creating an array of global Labels at runtime Pin
NotPolitcallyCorrect31-Mar-13 14:12
NotPolitcallyCorrect31-Mar-13 14:12 
GeneralRe: Creating an array of global Labels at runtime Pin
Douglas Kirk31-Mar-13 14:28
Douglas Kirk31-Mar-13 14:28 
GeneralRe: Creating an array of global Labels at runtime Pin
NotPolitcallyCorrect31-Mar-13 15:16
NotPolitcallyCorrect31-Mar-13 15:16 
QuestionWhere to post/share example? Pin
ReturnVoid30-Mar-13 1:45
ReturnVoid30-Mar-13 1:45 
AnswerRe: Where to post/share example? Pin
NotPolitcallyCorrect30-Mar-13 2:29
NotPolitcallyCorrect30-Mar-13 2:29 
AnswerRe: Where to post/share example? Pin
Captain Price30-Mar-13 3:27
professionalCaptain Price30-Mar-13 3:27 

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.