[wdmaudiodev] Re: About Unload in MSVAD

  • From: karthiksharmasg@xxxxxxx
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 12 Mar 2009 00:50:09 -0400

Hi,
???? i am working on XP, and i have a pointer to my unload routine defined in 
the DRIVERENTRY like this



DriverEntry
( 
??? IN? PDRIVER_OBJECT????????? pDriverObject,
??? IN? PUNICODE_STRING???????? pRegistryPathName
).
{
.....
ntStatus =? 
??????? PcInitializeAdapterDriver
??????? ( 
??????????? pDriverObject,
??????????? pRegistryPathName,
??????????? AddDevice 
??????? );
..
..
..
..
if (NT_SUCCESS(ntStatus)) // if PcInitializeAdapterDriver is successfull
?{
??pDriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = MExtender_IoControl;
??pDriverObject->MajorFunction[IRP_MJ_CREATE] = MExtender_Create;
??pDriverObject->MajorFunction[IRP_MJ_WRITE] = MExtender_Write;
??pDriverObject->MajorFunction[IRP_MJ_READ] = MExtender_Read;
??pDriverObject->MajorFunction[IRP_MJ_CLOSE] = MExtender_Close;
??pDriverObject->DriverUnload = MExtender_Unload;
?}
..
..
..
..
..
..
}


VOID
MExtender_Unload
(
?IN PDRIVER_OBJECT???pDriverObject
)
{
..
..
..
..
RtlInitUnicodeString(&uniDOSString, s_wcMEDOSNameBuffer);
IoDeleteSymbolicLink(&uniDOSString);
IoDeleteDevice(pDriverObject->DeviceObject);
.......
}


i have created an device? in add device like this after the PcAddAdapterDevice

ntStatus = 
??IoCreateDevice
??(
???pDriverObject,
???sizeof(ME_SOUND_DEVICE_EXTENSION),
???&uniNameString,
???FILE_DEVICE_SOUND,
???0,
???FALSE,
???&s_pMEDeviceObject);


need to set a pointer to your unload function in the driver object:?



-----Original Message-----
From: Daniel E. Germann <deg@xxxxxxxx>
To: wdmaudiodev@xxxxxxxxxxxxx
Sent: Wed, 11 Mar 2009 6:35 pm
Subject: [wdmaudiodev] Re: About Unload in MSVAD


Hi, Karthik.?
?
For DriverUnload to be called, you need to set a pointer to your unload 
function in the driver object:?
?
DriverObject->DriverUnload = YourUnloadDriver;?
?
In a PortCls driver, I believe this must be done *after* the call to 
PcInitializeAdapterDriver().?
?
You should also save the previous value of DriverObject->DriverUnload, and call 
it at the end of your unload function (if it isn't NULL), to allow PortCls to 
do its cleanup.?
?
-Dan?
?
----- Original Message -----?
> Subject: [wdmaudiodev] About Unload in MSVAD?
> Date: Tue, 10 Mar 2009 23:38:01 -0400?
> From: karthiksharmasg@xxxxxxx?
>?
> Hi all,?
> ?????????? I have created an device in the MSVAD, and the device driver is > 
> working very good?with my application, but only one problem is? i am not > 
> able to delete the device what i have created (it requires restart after > 
> uninstalling the driver), i.e, for me Unload is not beeing called,?
> ???????????I know that Unload to be called,?
> ?????????????? 1. Their should be no IRp pending?
> ???????????????2. Driver entry should not return error code(false)?
>?
> In my case both are working properly but i dont know why Unload is not > 
> beeing called.?
> can any one put some light on this issue.?
>?
> Regards?
> Karthik SG?
?
******************?
?
WDMAUDIODEV addresses:?
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx?
Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe?
Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe?
Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx?
?
URL to WDMAUDIODEV page:?
http://www.wdmaudiodev.com/?
?

Other related posts: