Can user mode client call export driver api's?

I have user mode dll which I want to port to kernel mode to support kernel mode clients but I don’t want to change the interfaces as it would impact the existing user mode clients. So for backward compatibility I still want to maintain the user mode dll interfaces. I came across export drivers and was considering porting user mode DLL to kernel mode export drivers and export the same interfaces. But I am not sure if user mode clients would still be able to link to kernel mode DLL and call the interfaces. User mode clients link to user mode dll using "Load-time dynamic linking " method. Any suggestions if this would work? Would user clients be agnostic of this change if I convert user mode dll to kernel mode export driver? Would user mode clients be able to call the export driver api’s?

Thanks in advance,
Ruby

you will have two versions of your library. One DLL for use in user-mode, one .SYS export driver for use in kernel-mode

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, July 3, 2014 10:39 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Can user mode client call export driver api’s?

I have user mode dll which I want to port to kernel mode to support kernel mode clients but I don’t want to change the interfaces as it would impact the existing user mode clients. So for backward compatibility I still want to maintain the user mode dll interfaces. I came across export drivers and was considering porting user mode DLL to kernel mode export drivers and export the same interfaces. But I am not sure if user mode clients would still be able to link to kernel mode DLL and call the interfaces. User mode clients link to user mode dll using "Load-time dynamic linking " method. Any suggestions if this would work? Would user clients be agnostic of this change if I convert user mode dll to kernel mode export driver? Would user mode clients be able to call the export driver api’s?

Thanks in advance,
Ruby


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

no way. User mode client can’t call kernel mode function directly. You can move your user mode functions to kernel, that is implementable. But you don’t need to make your kernel driver to be export type. A good method is to build a new user mode DLL with the same API interface exported(stub DLL), and the stub DLL communicate with your kernel driver with really implement your function. You can easily use a serial of IOCTLs to in/out kernel.

Date: Fri, 4 Jul 2014 01:39:08 -0400
From: xxxxx@gmail.com
To: xxxxx@lists.osr.com
Subject: [ntdev] Can user mode client call export driver api’s?

I have user mode dll which I want to port to kernel mode to support kernel mode clients but I don’t want to change the interfaces as it would impact the existing user mode clients. So for backward compatibility I still want to maintain the user mode dll interfaces. I came across export drivers and was considering porting user mode DLL to kernel mode export drivers and export the same interfaces. But I am not sure if user mode clients would still be able to link to kernel mode DLL and call the interfaces. User mode clients link to user mode dll using "Load-time dynamic linking " method. Any suggestions if this would work? Would user clients be agnostic of this change if I convert user mode dll to kernel mode export driver? Would user mode clients be able to call the export driver api’s?

Thanks in advance,
Ruby


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

xxxxx@gmail.com wrote:

I have user mode dll which I want to port to kernel mode to support kernel mode clients but I don’t want to change the interfaces as it would impact the existing user mode clients. So for backward compatibility I still want to maintain the user mode dll interfaces. I came across export drivers and was considering porting user mode DLL to kernel mode export drivers and export the same interfaces. But I am not sure if user mode clients would still be able to link to kernel mode DLL and call the interfaces. User mode clients link to user mode dll using "Load-time dynamic linking " method. Any suggestions if this would work? Would user clients be agnostic of this change if I convert user mode dll to kernel mode export driver? Would user mode clients be able to call the export driver api’s?

No. There is a field in the PE header called “subsystem” that has
either “Windows GUI”, “Windows Console”, or “Native”. The DLL must be
marked “Native” in order to load in kernel mode, and must NOT be marked
“Native” in order to load in user mode.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

>The DLL must be
marked “Native” in order to load in kernel mode, and must NOT be marked
“Native” in order to load in user mode

I don’t think so. “Native” EXEs (like the boot disk check) run in user mode, too, though without Win32 aid.

xxxxx@broadcom.com wrote:

> The DLL must be marked “Native” in order to load in kernel mode, and must NOT be marked
> “Native” in order to load in user mode
I don’t think so. “Native” EXEs (like the boot disk check) run in user mode, too, though without Win32 aid.

To be more specific, a DLL that is marked “native” cannot be loaded into
a process with an EXE that is not native. I actually tried this before
I made my original post.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.