Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > RE: AddDevice is not called.

Reply
Thread Tools Display Modes

RE: AddDevice is not called.

 
 
dracipmot
Guest
Posts: n/a

 
      10-25-2009
does driverentry return true?
--
Tom Picard


"POnga" wrote:

> Hi All,
>
> I'm a newbie in driver development, and I'm compile a driver with a
> simple AddDevice call, but after I load the driver, the system call
> the DriverEntry function and after the DriverUnload function is
> called. the AddDevice is never called.
>
> NTSTATUS
> DriverEntry(
> __in PDRIVER_OBJECT DriverObject,
> __in PUNICODE_STRING RegistryPath
> )
> {
> NTSTATUS nts = STATUS_SUCCESS;
>
> KdPrint(("03AddDevice_DriverEntry\n"));
> //
> // Connect the ToasterAddDevice routine that is implemented in
> this stage of
> // the function driver. The system calls ToasterAddDevice when a
> new instance
> // of Toaster class hardware is connected to the computer.
> //
> DriverObject->DriverExtension->AddDevice = AddDevice_AddDevice;
>
> //
> // Connect the ToasterUnload routine that is implemented in this
> stage of the
> // function driver. The system calls ToasterUnload when no more
> instances of
> // Toaster class hardware are connected to the computer.
> //
> DriverObject->DriverUnload = AddDevice_Unload;
>
> //
> // Connect the dispatch routines which are implemented in this
> stage of the
> // function driver, including PnP, Power Management and WMI. The
> system calls
> // these dispatch routines to handle PnP, Power and WMI
> operations.
> //
> DriverObject->MajorFunction[IRP_MJ_PNP] =
> AddDevice_DispatchPnp;
> DriverObject->MajorFunction[IRP_MJ_POWER] =
> AddDevice_DispatchPower;
> DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
> AddDevice_SystemControl;
>
> //
> // Connect the new dispatch routines implemented in this stage of
> the function
> // driver that support communication from applications.
> ToasterDispatchIO
> // initially processes read, write, and device control operations.
> These
> // operations are the result of user-mode calls to ReadFile,
> WriteFile, or
> // DeviceIoControl.
> //
> DriverObject->MajorFunction[IRP_MJ_CREATE] =
> AddDevice_CreateClose;
> DriverObject->MajorFunction[IRP_MJ_CLOSE] =
> AddDevice_CreateClose;
> DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] =
> AddDevice_ReadWrite;
> DriverObject->MajorFunction[IRP_MJ_READ] =
> AddDevice_ReadWrite;
> DriverObject->MajorFunction[IRP_MJ_WRITE] =
> AddDevice_ReadWrite;
>
> return nts;
> }
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: AddDevice is not called. Don Burn Windows Vista Drivers 0 10-22-2009 01:44 PM
Why isn't there an account called "games".... Man-wai Chang ToDie Windows Vista Games 9 02-21-2008 01:23 AM
Why are folders containing users' files called Documents? Edward Windows Vista File Management 2 02-16-2008 11:23 PM
I called Microsoft Mike Windows Vista Installation 14 02-14-2007 02:53 PM
So called Vista Upgrade Advisor Lies to Sell OEM Vista (no recovery mechanism when you buy) Chad Harris Windows Vista Installation 1 09-10-2006 11:26 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59