How to suspend an user mode , by using Normal kernel APC or User mode APC.

Recently , I am reading <> and confused about some statements in it . Hope to discuss with you .

In chapter 4 , section of Other Kernel-Mode Synchronization Primitives , there is a statement saying : Thread suspension involves an APC, so user-mode code can?t suspend your thread if you disallow user-mode APCs. …

So, I suppose that a thread suspension is implemented by the delivery of an user-mode APC.

However , there is an different description of the thread suspension , published by MS , http://download.microsoft.com/download/e/b/a/eba1050f-a31d-436b-9281-92cdfeae4b45/synch_table.doc. It says :

? Normal kernel APCs are used for thread suspension and hard error pop-ups unless delivery has been disabled using KeEnterCriticalRegion. They run in kernel mode at PASSIVE_LEVEL.

My question , thread suspension is implemented by User mode APC or Normal Kernel mode APC.

How to modify the title ? ? ??

Sorry ,the title should be changed to How to suspend an user mode thread, by using Normal kernel APC or User mode APC ?

> My question , thread suspension is implemented by User mode APC or Normal Kernel mode APC.

I would say by the kernel-mode one - this is the reason why APC delivery to a thread that holds kernel-level synch construct that allows preemption should be disabled. Just a couple days ago we discussed a scenario when thread gets suspended by UM app while running in the KM, which may result in a deadlock if it holds synch construct that allows preemption at the moment ( I just could not miss my chance
to criticize Windows yet another time, could I)…

Anton Bassov

xxxxx@hotmail.com wrote:
( I just could not miss my chance

to criticize Windows yet another time, could I)…

Sure you could not :~ But this target keeps moving fast while you aim to it.
Take care.
– pa

> But this target keeps moving fast while you aim to it.

Well, you seem to have have rather peculiar understanding of “fast-moving target” - this particular target does not seem to move faster than an inch per day…

Anton Bassov

xxxxx@hotmail.com wrote:

> But this target keeps moving fast while you aim to it.

Well, you seem to have have rather peculiar understanding of “fast-moving target” - this particular target does not seem to move faster than an inch per day…

How do you know how fast they’re going? Have sources in MS Research? :slight_smile:

  • pa

> How do you know how fast they’re going? Have sources in MS Research? :

Actually, I think it would be a better idea to move this discussion to NTTALK - I don’t really think it belongs on NTDEV…

Anton Bassov