Allocate VPB in file system filter driver

Is there some way to allocate a new VPB in a file system filter driver. I
tried the next but it doesn’t work:

NewVpb = ExAllocatePool( NonPagedPoolMustSucceed, sizeof( VPB );
RtlZeroMemory( NewVpb, sizeof( VPB ) );
IoAcquireVpbSpinLock( &SavedIrql );
NewVpb->Type = IO_TYPE_VPB;
NewVpb->Size = sizeof( VPB );
NewVpb->RealDevice = MyRealDeviceObject;
NewVpb->DeviceObject = NULL;
NewVpb->Flags &= ~VPB_MOUNTED;
IoReleaseVpbSpinLock( SavedIrql );

Do you have any ideas ???

Get Your Private, Free E-mail from MSN Hotmail at

Share information about yourself, create your own public profile at