Kernel/user mode threads, semaphores, mutexes, msg queue, events

Kernel/user mode threads, semaphores, mutexes, msg queue, events

Post by TmluYSBQaG » Wed, 20 Aug 2008 05:52:08


Hi,

In CE 6.0, I would like to know how kernel-mode driver and application can
use/change threads' priority, or semaphores, mutexes, or msg queues, events
of each other. Can we pass the handles via ioctl, or we need to do some
specials steps? Thanks.

Nina
 
 
 

Kernel/user mode threads, semaphores, mutexes, msg queue, events

Post by Bruce Eitm » Wed, 20 Aug 2008 06:02:29

That is a BIG question that you have there.

1. Thread priority - Why do you want to change the thread priority of a
driver from an application? Typically, if the thread priority is adjustable
it is in the registry and read when the driver starts.
2. Semaphores, Mutexes, Events... - I assume that you are asking how the
application and driver can use the same name. There are certainly many ways
to do this, but an easy way would be to put the name in a header file, put
the header file in the SDK, include the same header file in the driver and
the app.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://www.yqcomputer.com/

EuroTech Inc.
www.EuroTech.com

 
 
 

Kernel/user mode threads, semaphores, mutexes, msg queue, events

Post by Paul G. To » Wed, 20 Aug 2008 06:03:50

Well, there are a lot of questions there with little about why you want to
do things...

CeSetThreadPriority() is the basic thread priority change answer.

I don't quite follow, "...or semaphores, mutexes, or msg queues, events of
each other." What do you mean by that?

No, generally you can't pass handles from process to process and have them
mean anything. However, the driver could be written to take the handle and
pass it to DuplicateHandle() using GetOwnerProcess() (I think that's right),
for global objects like mutexes that might be passed via IOCTL.

Paul T.