How to create a thread in storminiport

Hi all,

I want to create a thread in my storminiport driver.I didnt find storxxx function to create a thread.shall i use PsCreateSystemthread to launch a thread in the miniport driver ?..or their is some other way to do this…

Thanks in adavance,

Why do you want to create thread in miniport? What are you exactly trying to
do? If you want to time outstanding SRBs or do some watchdog kind of thing,
you shall go for timer-routine (*StorPortNotification -
RequestTimerCall,… + HwStorTimer*).

Regards,
Gokul T V

On Tue, Apr 13, 2010 at 11:43 AM, wrote:

> Hi all,
>
> I want to create a thread in my storminiport driver.I didnt find storxxx
> function to create a thread.shall i use PsCreateSystemthread to launch a
> thread in the miniport driver ?..or their is some other way to do this…
>
> Thanks in adavance,
>
>
> —
> NTDEV is sponsored by OSR
>
> 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
>

In OSR article http://www.osronline.com/article.cfm?article=543 I see it
uses PsCreateSystemThread to do it in Virtual Storport Miniport. So I
think it’s safe.

Thanks
Wayne

Ok… Things are different between virtual storport miniport and (physical)
storport miniport. Which one you are developing?

If it is physical storport miniport (i.e., your miniport directly handles
the hardware), you should use only StorportXXX APIs (
http://msdn.microsoft.com/en-us/library/ff566993(VS.85).aspx). For
Virtual storport miniport, you are free to use WDM APIs.

Regards,
Gokul T V

On Tue, Apr 13, 2010 at 12:21 PM, wayne gong wrote:

> In OSR article http://www.osronline.com/article.cfm?article=543 I see it
> uses PsCreateSystemThread to do it in Virtual Storport Miniport. So I think
> it’s safe.
>
> Thanks
> Wayne
>
>
> —
> NTDEV is sponsored by OSR
>
> 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
>

Hi All,
Thanks for your replies…BTW what would be the concreate reason behind the storminiport cannt create a threads…if i want to create it…how can i accomplish it in anyother way…

Thanks in advance,

StorPort miniport driver could use only StorPortXXXX functions. If you see some limitation in using only StorPortXXXX functions you need to choose another model for your storage driver. For example, you may use a Virtual miniport StorPort driver where you could use others function of WDK including PsCreateSystemthread.

Igor Sharovar

DDK Stroage miniport “Design Guide” says:

The best practice for storage miniport drivers is to avoid calling operating
system routines other than the routines that the port driver support
libraries provide. For example, storage miniport drivers should not call
Ke…

What haven’t been said is “if you do that, we could revoke your logos, yank
your driver out of the box…”

Is that concrete enough?

Calvin

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@rediffmail.com
Sent: Sunday, April 18, 2010 2:33 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How to create a thread in storminiport

Hi All,
Thanks for your replies…BTW what would be the concreate reason behind the
storminiport cannt create a threads…if i want to create it…how can i
accomplish it in anyother way…

Thanks in advance,


NTDEV is sponsored by OSR

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

The classical reason why a storport miniport can’t create at thread is
because for crash dumps a second instance of the same driver/device is
created, and during crash dump processing there is no thread scheduling.

The storport API is designed in such a limited way that a correctly written
storport miniport will (almost) just work as a crash dump driver, which is a
VERY constrained execution environment. During a crash dump you run at
HIGH_IRQL, there are no interrupts and no thread scheduling or DPC’s, memory
may be damaged so calling almost any OS API may cause random loss of control
(so no pool allocation allowed).

The WHQL test requirements were oriented toward this.

Jan

Hi All,
Thanks for your replies…BTW what would be the concreate reason behind
the storminiport cannt create a threads…if i want to create it…how
can i accomplish it in anyother way…