How to :Calling DLL(User mode) functions from a Driver(Kernel mode)

Hi Everybody,

How to access Functions exported from a User mode DLL from a Kernel
Driver for eg. Filesystem Filter Driver.

The senario is : I have a DLL whcih exports API’s to Encrypt and Decrypt
data , i want to use them in my Filter Driver.How to do it??

Tanking you in advance for the help.

Biswaroop

You cannot do this, at most you can create a service and use an
inverted call model (http://www.osronline.com/article.cfm?id=94)
to call it. But be aware you can hit some nasty recursion issues.
If this is encrypt and decrypt why do you need to do this is user
mode, I would look at translating these to kernel mode.

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

----- Original Message -----
From: “Biswaroop Banerjee”
To: “Windows File Systems Devs Interest List”
Sent: Saturday, October 18, 2003 6:22 AM
Subject: [ntfsd] How to :Calling DLL(User mode) functions from a
Driver(Kernel mode)

>
> Hi Everybody,
>
> How to access Functions exported from a User mode DLL from a Kernel
> Driver for eg. Filesystem Filter Driver.
>
> The senario is : I have a DLL whcih exports API’s to Encrypt and Decrypt
> data , i want to use them in my Filter Driver.How to do it??
>
> Tanking you in advance for the help.
>
> Biswaroop
>
> —
> You are currently subscribed to ntfsd as: xxxxx@acm.org
> To unsubscribe send a blank email to xxxxx@lists.osr.com

using one of Crypto API from user mode could be a quite serious reason
to do this?

btw, I haven’t heard about calling CryptoAPI from kernel directly, only
through helper Win32 service (like NTFS EFS do). What’s about future
versions of Windows I don’t know.

Regards,
Valery Boronin

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Saturday, October 18, 2003 5:56 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Re: How to :Calling DLL(User mode) functions
from a Driver(Kernel mode)

You cannot do this, at most you can create a service and use
an inverted call model (http://www.osronline.com/article.cfm?id=94)
to call it. But be aware you can hit some nasty recursion
issues. If this is encrypt and decrypt why do you need to do
this is user mode, I would look at translating these to kernel mode.

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

----- Original Message -----
From: “Biswaroop Banerjee”
> To: “Windows File Systems Devs Interest List”
> Sent: Saturday, October 18, 2003 6:22 AM
> Subject: [ntfsd] How to :Calling DLL(User mode) functions
> from a Driver(Kernel mode)
>
>
> >
> > Hi Everybody,
> >
> > How to access Functions exported from a User mode DLL
> from a Kernel
> > Driver for eg. Filesystem Filter Driver.
> >
> > The senario is : I have a DLL whcih exports API’s to
> Encrypt and Decrypt
> > data , i want to use them in my Filter Driver.How to do it??
> >
> > Tanking you in advance for the help.
> >
> > Biswaroop
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@acm.org
> > To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@plesk.ru
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

You cannot. Port the DLL to kernel mode.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Biswaroop Banerjee”
To: “Windows File Systems Devs Interest List”
Sent: Saturday, October 18, 2003 2:22 PM
Subject: [ntfsd] How to :Calling DLL(User mode) functions from a Driver(Kernel
mode)

>
> Hi Everybody,
>
> How to access Functions exported from a User mode DLL from a Kernel
> Driver for eg. Filesystem Filter Driver.
>
> The senario is : I have a DLL whcih exports API’s to Encrypt and Decrypt
> data , i want to use them in my Filter Driver.How to do it??
>
> Tanking you in advance for the help.
>
> Biswaroop
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

> btw, I haven’t heard about calling CryptoAPI from kernel directly, only

through helper Win32 service (like NTFS EFS do).

Try to monitor the IRP traffic to FIPS.SYS.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks, Maxim

I will do this monitoring in the nearest future.

But who are clients of this FIPS component?
And why NTFS doesn’t use it instead of calling user mode if it’s already
available in the kernel?

Regards,
Valery Boronin

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim
S. Shatskih
Sent: Monday, October 20, 2003 9:13 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Re: How to :Calling DLL(User mode) functions
from a Driver(Kernel mode)

> btw, I haven’t heard about calling CryptoAPI from kernel directly,
> only through helper Win32 service (like NTFS EFS do).

Try to monitor the IRP traffic to FIPS.SYS.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


You are currently subscribed to ntfsd as: xxxxx@plesk.ru
To unsubscribe send a blank email to xxxxx@lists.osr.com