IoRegisterDeviceInterface Problem

hello,everyone,please help me.

in “sfilter.c”, before code " for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) ", I insert IoRegisterDeviceInterface, but symName is NULL, why ???

thx

DriverEntry(…
{

IoRegisterDeviceInterface( gSFilterControlDeviceObject, &MY_DRV_GUID, NULL,&symName );
IoSetDeviceInterfaceState( &symName, TRUE );

for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) {

DriverObject->MajorFunction[i] = SfPassThrough;
}

}

Probably because you did not initialize it. You need to allocate a
UNICODE_STRING structure and pass the addess of it to the call. The fields
of the structure will be initialized by the call.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntfsd…
> hello,everyone,please help me.
>
> in “sfilter.c”, before code " for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION;
> i++) ", I insert IoRegisterDeviceInterface, but symName is NULL, why ???
>
> thx
>
>
>
>
>
> DriverEntry(…
> {
> …
>
> IoRegisterDeviceInterface( gSFilterControlDeviceObject, &MY_DRV_GUID,
> NULL,&symName );
> IoSetDeviceInterfaceState( &symName, TRUE );
>
> for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) {
>
> DriverObject->MajorFunction[i] = SfPassThrough;
> }
> …
> }
>

> IoRegisterDeviceInterface( gSFilterControlDeviceObject, &MY_DRV_GUID,

NULL,&symName );

You must pass a PDO as the first paramemter. PDO is a device reported to the
PnP Manager through IRP_MJ_PNP-QueryDeviceRealtion-BusRealtions request, I
am sure that the control device object has not been reported to the PnP
Manager and doesn’t have an associated DeviceNode.


Slava Imameyev, xxxxx@hotmail.com

wrote in message news:xxxxx@ntfsd…
> hello,everyone,please help me.
>
> in “sfilter.c”, before code " for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION;
> i++) ", I insert IoRegisterDeviceInterface, but symName is NULL, why ???
>
> thx
>
>
>
>
>
> DriverEntry(…
> {
> …
>
> IoRegisterDeviceInterface( gSFilterControlDeviceObject, &MY_DRV_GUID,
> NULL,&symName );
> IoSetDeviceInterfaceState( &symName, TRUE );
>
> for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) {
>
> DriverObject->MajorFunction[i] = SfPassThrough;
> }
> …
> }
>