Everhart, Glenn From: Tony Mason [Mason@osr.com] Sent: Saturday, February 20, 1999 12:18 PM To: 'Raul Carmenate Moreno'; ntfsd@atria.com Cc: ntdev@atria.com Subject: [ntdev] RE: [ntfsd] calling user mode code ... While you cannot directly call a user mode DLL from your kernel mode filter, you can build a mechanism that accomplished the same basic effect. When I teach about this I call it the "inverted call model". Specifically, you build an NT service - the service can call the DLL since they are both in user mode. You then create threads within the service and have them call your driver (I like DeviceIoControl, but you can do this via any IRP_MJ function...) In your driver, when you get these calls from your service, you take the IRPs, mark them as pending and place them on a queue. Later, when you need to have the user mode DLL perform work you remove an IRP from the queue. In the OUTPUT buffer, you build a "request block" containing the information necessary for your user mode service to call the DLL. Then, when you complete that IRP the thread in the service returns from the DeviceIoControl. It looks at the data in the output buffer and (based upon that information) calls the DLL. The results from the DLL are then returned by the thread by making another DeviceIoControl (the "response" is in the INPUT buffer.) In order to match up the "response" with the "request" I usually use a request ID. I hope this helps. Regards, Tony Tony Mason Consulting Partner OSR Open Systems Resources, Inc. http://www.osr.com Specializing in consulting, development, and training for Windows NT systems software, notably file systems and device drivers. > -----Original Message----- > From: Raul Carmenate Moreno [mailto:rcm@seg.inf.cu] > Sent: Friday, February 19, 1999 7:53 AM > To: ntfsd@atria.com > Cc: ntdev@atria.com > Subject: [ntfsd] calling user mode code ... > > > Hello All > > In my filter driver I need to detect openning of files , call > a user mode > DLL routine to check that file an according to the result let > the openning > go on or fail. How can I Call a user mode DLL from my filter > Driver ?? or > what technique I can use, may be signaling some way my DLL and waiting > on a Semaphore ?? > > Thanks in advance > > --Raul > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > [ To unsubscribe, send email to ntfsd-request@atria.com with body > UNSUBSCRIBE (the subject is ignored). ] > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]