[wdmaudiodev] Re: KS Filter

  • From: Anthony Palomba <APalomba@xxxxxxxxxxxx>
  • To: "'wdmaudiodev@xxxxxxxxxxxxx'" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Fri, 10 Jan 2003 10:07:42 -0600


I have a problem I was wondering if someone could help we with.
My audio driver is trying to register a device interface so that 
another driver can find its symbolic name and open a connection
to it. The external driver calls IoGetDeviceInterfaces and then 
calls ZwCreateFile with the symbolic name returned from
IoGetDeviceInterfaces.
The problem is ZwCreateFile always return STATUS_OBJECT_NAME_NOT_FOUND. 
This is what I am doing(I have removed error checking so that I can paste it
all here)


PHANDLE FileHandle = NULL;
OBJECT_ATTRIBUTES oa;
IO_STATUS_BLOCK IoStatusBlock;
UNICODE_STRING  Ustr;
PFILE_OBJECT  FileObject;
PDEVICE_OBJECT  DeviceObject;

IoGetDeviceInterfaces(&FOOBAR_DEVICE_INTERFACE, NULL, 0, &SymbolicLinkList);
RtlInitUnicodeString(&Ustr, SymbolicLinkList);
InitializeObjectAttributes(&oa, &Ustr, 
        OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL);

ntStatus = ZwCreateFile(FileHandle, GENERIC_READ | GENERIC_WRITE,
        &oa, &IoStatusBlock, NULL, FILE_ATTRIBUTE_NORMAL, 0, FILE_OPEN, 0,
NULL, 0);


FOOBAR_DEVICE_INTERFACE is a guid that my audio driver registers as an 
interface with IoRegisterDeviceInterface. It then enables it with 
IoSetDeviceInterfaceState. When we call IoGetDeviceInterfaces from 
my external driver we get a list of symbolic names. Each name is 
separated by a NULL terminator with the whole list ending with an extra 
NULL terminator. My code only handles the first entry in the list, 
which is all right because we are the only device using this interface. 
So the link between my audio driver and the registered interface definitely 
exists because I am getting my devices symbolic name. The 
question is, where is ZwCreateFile looking to resolve the symbolic name?




Anthony



******************

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.de/

Other related posts: