Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Calling Win32 API User mode functions from Kernel Mode

Reply
Thread Tools Display Modes

Calling Win32 API User mode functions from Kernel Mode

 
 
Manohara.K
Guest
Posts: n/a

 
      08-10-2004
Hi All,

Just wanted to know , If its possible , If yes ..how ?? .to call User Mode APIs/ Win32 APIs
from Kernel Mode/Device Drivers


regards,
Manohara

Calling Win32 API User mode functions from Kernel Mode

 
Reply With Quote
 
 
 
 
Ray Trent
Guest
Posts: n/a

 
      08-10-2004
There are some user-mode APIs that have equivalents in kernel mode, but
most don't. You can't directly call the user-mode APIs from kernel mode.

The only way to work around this in general is to have a user-mode
helper program (or service) that your driver triggers to call the Win32
APIs you need.

Manohara.K wrote:

> Hi All,
>
> Just wanted to know , If its possible , If yes ..how ?? .to call User
> Mode APIs/ Win32 APIs
> from Kernel Mode/Device Drivers
>
>
> regards,
> Manohara
>
> Calling Win32 API User mode functions from Kernel Mode
>

 
Reply With Quote
 
James Antognini [MSFT]
Guest
Posts: n/a

 
      08-11-2004
The short answer is, as Ray said, No.

The longer answer is that even if you could finagle the imports and effect the call (not impossible), the stuff you're calling isn't written to accommodate the environment a kernel-mode caller brings along with itself. You'd probably get a BSOD, and that would be the good outcome. The bad outcome would be damage to the process or to the OS without a BSOD.

--
James Antognini
Windows DDK Support

This posting is provided "AS IS" with no warranties, and confers no rights.

"Manohara.K" <> wrote in message news:...
Hi All,

Just wanted to know , If its possible , If yes ..how ?? .to call User Mode APIs/ Win32 APIs
from Kernel Mode/Device Drivers


regards,
Manohara

Calling Win32 API User mode functions from Kernel Mode

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
share memory in kernel mode and user mode Vivek Gupta Windows Vista Drivers 2 07-21-2004 02:24 PM
Share memory between user mode and kernel mode Pascal Windows Vista Drivers 1 02-27-2004 09:07 PM
communication between user mode and kernel mode Monty Windows Vista Drivers 1 02-16-2004 01:12 PM
How to get the PUNICODE_STRING from Kernel mode to User mode? Siva Prakash Windows Vista Drivers 0 12-13-2003 01:25 PM
Re: How detect USER Mode Application is loaded in kernel mode driver William Ingle Windows Vista Drivers 5 07-02-2003 01:14 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59