Dear Konstantin,
actually I’m writing a scsi miniport driver. Here if I put the create thread
call in driverentry or any other places the call hangs… only it works
for SCSIOP_READ call and that is also if the call comes while system boot
up… so not getting where to put the ‘_VWIN32_CreateRing0Thread’
function to create a thread.
here goes the source for function for which I’m creating the thread…
VOID __stdcall Ring0ThreadFunction(DWORD dwStartParam)
{
// …
// Here you can put your thread function
// …
while(1)
{
Wait_Semaphore( hSemHandle , BLOCK_THREAD_IDLE);
//check = 1;
Destroy_Semaphore ( hSemHandle );
hSemHandle = 0;
ReadFromFile(ThreadData.luExtension, ThreadData.sectors, ThreadData.bsize,
0);
if ( ThreadData.luExtension->IsFileOpened == 0 )
{
ThreadData.luExtension->ActiveLuRequest->DataTransferLength = 0;
}
if ( ThreadData.luExtension->BadBlock == 1)
{
ThreadData.Srb->SrbStatus = SRB_STATUS_ERROR;
FillSenseInfo(ThreadData.luExtension,ThreadData.Srb,4);
}
else
{
ThreadData.Srb->ScsiStatus = SCSISTAT_GOOD;
ThreadData.Srb->SrbStatus = SRB_STATUS_SUCCESS;
}
ThreadData.luExtension->BadBlock = 0;
if ( DataFinished == 2 )
DataFinished = 1;
Signal_Semaphore( hSemHandle1 );
hSemHandle = Create_Semaphore( 0 );
}
return;
}
Thanks in advance…
som
----- Original Message -----
From: “Konstantin Manurin”
To: “NT Developers Interest List”
Sent: Thursday, January 24, 2002 5:27 PM
Subject: [ntdev] Re: _VWIN32_CreateRing0Thread
> Could you send me your thread function source code? I used this service
and
> everything was fine. I also used VMMCreateThreadEx() service.
>
> ----- Original Message -----
> From: “Somsubhra Raj”
> To: “NT Developers Interest List”
> Sent: Thursday, January 24, 2002 2:01 PM
> Subject: [ntdev] Re: _VWIN32_CreateRing0Thread
>
>
> > dear Konstantin,
> >
> > I’ve tried the code sent by you… but here also system hangs at
> VxdCall
> > ( _VWIN32_CreateRing0Thread)… I debugged it with softice ver1.5
> > … any suggestion is welcome from anybody…
> >
> > thanks
> >
> > som
> > ----- Original Message -----
> > From: “Konstantin Manurin”
> > To: “NT Developers Interest List”
> > Sent: Thursday, January 24, 2002 2:08 PM
> > Subject: [ntdev] Re: _VWIN32_CreateRing0Thread
> >
> >
> > > Hi.
> > >
> > > This is my own sample source code. Think it’ll help you.
> > >
> > > //===================================================================
> > > typedef
> > > VOID
> > > (__stdcall *PRING0_PROC)(
> > > DWORD dwStartParam
> > > );
> > >
> > > typedef struct _RING_THREAD_HANDLES {
> > > DWORD Ring3ThreadHandle;
> > > PTCB Ring0ThreadHandle;
> > > } RING_THREAD_HANDLES,*PRING_THREAD_HANDLES;
> > >
> > > RING_THREAD_HANDLES VXDINLINE
> > > _VWIN32_CreateRing0Thread(DWORD dwRing3StackSize,PRING0_PROC
> > > Ring0StartFunc,PRING0_PROC FailCallback,DWORD dwStartParam)
> > > {
> > >__asm push ebx
> > > asm push esi
> > > asm mov ecx,[dwRing3StackSize]
> > > __asm mov edx,[dwStartParam]
> > >__asm mov ebx,[Ring0StartFunc]
> > > __asm mov esi,[FailCallback]
> > > VxDCall(_VWIN32_CreateRing0Thread)
> > >__asm pop esi
> > > asm pop ebx
> > > }
> > > //===================================================================
> > > //
> > > //===================================================================
> > > VOID stdcall Ring0ThreadFunction(DWORD dwStartParam)
> > > {
> > > // …
> > > // Here you can put your thread function
> > > // …
> > > }
> > > //===================================================================
> > > //
> > > //===================================================================
> > > VOID __stdcall CreateRing0Thread(PRING0_PROC ThreadFunction)
> > > {
> > > RING_THREAD_HANDLES ThreadHandles;
> > > PTCB Ring0Thread;
> > >
> > >
ThreadHandles=_VWIN32_CreateRing0Thread(4096,ThreadFunction,NULL,0);
> > > Ring0Thread=ThreadHandles.Ring0ThreadHandle;
> > >
> > > if (Ring0Thread == NULL)
> > > {
> > > KdPrint((“THREAD: CreateRing0Thread(): thread creation
> > failed\n”));
> > > }
> > >
> > > else
> > > {
> > > KdPrint((“THREAD: CreateRing0Thread(): Ring0Thread:
> > > 0x%08X\n”,Ring0Thread));
> > > Set_Thread_Win32_Pri(Ring0Thread,4);
> > > Adjust_Thread_Exec_Priority(Ring0Thread,0);
> > > }
> > > }
> > >
> > >
> > >
> > > Konstantin Manurin (aka NizeG)
> > > Programmer
> > > Nival Interactive
> > > mailto:xxxxx@nival.com
> > >
> > > 10a bld. 5, 1st Volokolamsky proezd
> > > Moscow 123060 Russia
> > > Tel: +7 (095) 363-9630
> > > Tel: +7 (095) 363 9636
> > > http://www.nival.com
> > >
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@yahoo.com
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@nival.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@yahoo.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com