Hi All !
Anyone has worked with Numega Studio to write a Driver ?
I must write a Driver filter for Com Port and synchronize system time
between 2 computer via Com port ( call them Server and Client ). In the
server side , there is one User application to active the driver and User
can click on a Button in application to tell the Driver to implement
synchronization time with the Client .
In the Client side , There is no application , only Install Driver . And the
Driver in the client side must use a Thread to detect when the Signal from
server has come .
SO, My task now is that I must create a Thread in Driver in order to detect
when the signal has come to the Port .
Pls explain , how can i do this work? I have create a Thread and put it in
the DispatchCreate ( I use Numega to write driver ) . So now , How can I
detect the Signal came to the Port by this Thread?
Pls explain the Mechanism !
Thanks in advance !

Re: Thread in driver ?? by Maxim

Maxim
Sun May 30 09:48:24 CDT 2004

Why drivers? This task can be done in user mode only.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


"Alex" <Chipheo2k@hotmail.com> wrote in message
news:uww3oJlREHA.3944@TK2MSFTNGP11.phx.gbl...
> Hi All !
> Anyone has worked with Numega Studio to write a Driver ?
> I must write a Driver filter for Com Port and synchronize system time
> between 2 computer via Com port ( call them Server and Client ). In the
> server side , there is one User application to active the driver and User
> can click on a Button in application to tell the Driver to implement
> synchronization time with the Client .
> In the Client side , There is no application , only Install Driver . And the
> Driver in the client side must use a Thread to detect when the Signal from
> server has come .
> SO, My task now is that I must create a Thread in Driver in order to detect
> when the signal has come to the Port .
> Pls explain , how can i do this work? I have create a Thread and put it in
> the DispatchCreate ( I use Numega to write driver ) . So now , How can I
> detect the Signal came to the Port by this Thread?
> Pls explain the Mechanism !
> Thanks in advance !
>
>
>



Re: Thread in driver ?? by Alex

Alex
Sun May 30 22:26:14 CDT 2004

But my teacher requires me to do it in Kernel mode , By Driver . This is a
project for my Subject " system programming "



"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:eIQJRTlREHA.3944@TK2MSFTNGP11.phx.gbl...
> Why drivers? This task can be done in user mode only.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>
> "Alex" <Chipheo2k@hotmail.com> wrote in message
> news:uww3oJlREHA.3944@TK2MSFTNGP11.phx.gbl...
> > Hi All !
> > Anyone has worked with Numega Studio to write a Driver ?
> > I must write a Driver filter for Com Port and synchronize system time
> > between 2 computer via Com port ( call them Server and Client ). In the
> > server side , there is one User application to active the driver and
User
> > can click on a Button in application to tell the Driver to implement
> > synchronization time with the Client .
> > In the Client side , There is no application , only Install Driver . And
the
> > Driver in the client side must use a Thread to detect when the Signal
from
> > server has come .
> > SO, My task now is that I must create a Thread in Driver in order to
detect
> > when the signal has come to the Port .
> > Pls explain , how can i do this work? I have create a Thread and put it
in
> > the DispatchCreate ( I use Numega to write driver ) . So now , How can I
> > detect the Signal came to the Port by this Thread?
> > Pls explain the Mechanism !
> > Thanks in advance !
> >
> >
> >
>
>



Re: Thread in driver ?? by Maxim

Maxim
Sun May 30 12:02:24 CDT 2004

Then why creating threads? Just call ZwCreateFile on \\.\COM1 or such, and
then ZwReadFile.
This will work, and will be enough to satisfy the teacher.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


"Alex" <Chipheo2k@hotmail.com> wrote in message
news:uu2ciJmREHA.1160@TK2MSFTNGP09.phx.gbl...
> But my teacher requires me to do it in Kernel mode , By Driver . This is a
> project for my Subject " system programming "
>
>
>
> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> news:eIQJRTlREHA.3944@TK2MSFTNGP11.phx.gbl...
> > Why drivers? This task can be done in user mode only.
> >
> > --
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > maxim@storagecraft.com
> > http://www.storagecraft.com
> >
> >
> > "Alex" <Chipheo2k@hotmail.com> wrote in message
> > news:uww3oJlREHA.3944@TK2MSFTNGP11.phx.gbl...
> > > Hi All !
> > > Anyone has worked with Numega Studio to write a Driver ?
> > > I must write a Driver filter for Com Port and synchronize system time
> > > between 2 computer via Com port ( call them Server and Client ). In the
> > > server side , there is one User application to active the driver and
> User
> > > can click on a Button in application to tell the Driver to implement
> > > synchronization time with the Client .
> > > In the Client side , There is no application , only Install Driver . And
> the
> > > Driver in the client side must use a Thread to detect when the Signal
> from
> > > server has come .
> > > SO, My task now is that I must create a Thread in Driver in order to
> detect
> > > when the signal has come to the Port .
> > > Pls explain , how can i do this work? I have create a Thread and put it
> in
> > > the DispatchCreate ( I use Numega to write driver ) . So now , How can I
> > > detect the Signal came to the Port by this Thread?
> > > Pls explain the Mechanism !
> > > Thanks in advance !
> > >
> > >
> > >
> >
> >
>
>



Re: Thread in driver ?? by Alex

Alex
Sun May 30 23:30:59 CDT 2004

OK , thanks!
I have tried to open like that ! But it was not opened !
Pls tell me why !
Thanks !


HANDLE fileOpen;
OBJECT_ATTRIBUTES objAttr;
UNICODE_STRING sLinkName;
#define COM_NAME L"\\DosDevices\\COM1"
RtlInitUnicodeString( &sLinkName, COM_NAME);



InitializeObjectAttributes(
&objAttr,
&sLinkName,
OBJ_INHERIT | OBJ_PERMANENT | OBJ_EXCLUSIVE | OBJ_CASE_INSENSITIVE
|OBJ_OPENIF,
NULL,
NULL);
LARGE_INTEGER nSize;
IO_STATUS_BLOCK ioStat;


NTSTATUS statusOpen = ZwCreateFile(
OUT &fileOpen,
IN FILE_READ_DATA,
IN &objAttr,
OUT &ioStat,
&nSize,
IN FILE_ATTRIBUTE_NORMAL,
IN FILE_SHARE_READ,
IN FILE_OPEN,
IN FILE_WRITE_THROUGH,
IN NULL,
IN 0
);






Thanks!


"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:eWfbJemREHA.1312@TK2MSFTNGP12.phx.gbl...
> Then why creating threads? Just call ZwCreateFile on \\.\COM1 or such,
and
> then ZwReadFile.
> This will work, and will be enough to satisfy the teacher.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>
> "Alex" <Chipheo2k@hotmail.com> wrote in message
> news:uu2ciJmREHA.1160@TK2MSFTNGP09.phx.gbl...
> > But my teacher requires me to do it in Kernel mode , By Driver . This
is a
> > project for my Subject " system programming "
> >
> >
> >
> > "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> > news:eIQJRTlREHA.3944@TK2MSFTNGP11.phx.gbl...
> > > Why drivers? This task can be done in user mode only.
> > >
> > > --
> > > Maxim Shatskih, Windows DDK MVP
> > > StorageCraft Corporation
> > > maxim@storagecraft.com
> > > http://www.storagecraft.com
> > >
> > >
> > > "Alex" <Chipheo2k@hotmail.com> wrote in message
> > > news:uww3oJlREHA.3944@TK2MSFTNGP11.phx.gbl...
> > > > Hi All !
> > > > Anyone has worked with Numega Studio to write a Driver ?
> > > > I must write a Driver filter for Com Port and synchronize system
time
> > > > between 2 computer via Com port ( call them Server and Client ). In
the
> > > > server side , there is one User application to active the driver and
> > User
> > > > can click on a Button in application to tell the Driver to implement
> > > > synchronization time with the Client .
> > > > In the Client side , There is no application , only Install Driver .
And
> > the
> > > > Driver in the client side must use a Thread to detect when the
Signal
> > from
> > > > server has come .
> > > > SO, My task now is that I must create a Thread in Driver in order to
> > detect
> > > > when the signal has come to the Port .
> > > > Pls explain , how can i do this work? I have create a Thread and put
it
> > in
> > > > the DispatchCreate ( I use Numega to write driver ) . So now , How
can I
> > > > detect the Signal came to the Port by this Thread?
> > > > Pls explain the Mechanism !
> > > > Thanks in advance !
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: Thread in driver ?? by Pavel

Pavel
Sun May 30 14:06:17 CDT 2004

pardon for jumping in... but do you have a teacher?
Isn't she payed for teaching you?

--PA

"Alex" <Chipheo2k@hotmail.com> wrote in message news:eMNputmREHA.3124@TK2MSFTNGP12.phx.gbl...
> OK , thanks!
> I have tried to open like that ! But it was not opened !
> Pls tell me why !
> Thanks !
>
>
> HANDLE fileOpen;
> OBJECT_ATTRIBUTES objAttr;
> UNICODE_STRING sLinkName;
> #define COM_NAME L"\\DosDevices\\COM1"
> RtlInitUnicodeString( &sLinkName, COM_NAME);
>
>
>
> InitializeObjectAttributes(
> &objAttr,
> &sLinkName,
> OBJ_INHERIT | OBJ_PERMANENT | OBJ_EXCLUSIVE | OBJ_CASE_INSENSITIVE
> |OBJ_OPENIF,
> NULL,
> NULL);
> LARGE_INTEGER nSize;
> IO_STATUS_BLOCK ioStat;
>
>
> NTSTATUS statusOpen = ZwCreateFile(
> OUT &fileOpen,
> IN FILE_READ_DATA,
> IN &objAttr,
> OUT &ioStat,
> &nSize,
> IN FILE_ATTRIBUTE_NORMAL,
> IN FILE_SHARE_READ,
> IN FILE_OPEN,
> IN FILE_WRITE_THROUGH,
> IN NULL,
> IN 0
> );
>
>
>
>
>
>
> Thanks!
>
>
> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> news:eWfbJemREHA.1312@TK2MSFTNGP12.phx.gbl...
> > Then why creating threads? Just call ZwCreateFile on \\.\COM1 or such,
> and
> > then ZwReadFile.
> > This will work, and will be enough to satisfy the teacher.
> >
> > --
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > maxim@storagecraft.com
> > http://www.storagecraft.com
> >
> >
> > "Alex" <Chipheo2k@hotmail.com> wrote in message
> > news:uu2ciJmREHA.1160@TK2MSFTNGP09.phx.gbl...
> > > But my teacher requires me to do it in Kernel mode , By Driver . This
> is a
> > > project for my Subject " system programming "
> > >
> > >
> > >
> > > "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> > > news:eIQJRTlREHA.3944@TK2MSFTNGP11.phx.gbl...
> > > > Why drivers? This task can be done in user mode only.
> > > >
> > > > --
> > > > Maxim Shatskih, Windows DDK MVP
> > > > StorageCraft Corporation
> > > > maxim@storagecraft.com
> > > > http://www.storagecraft.com
> > > >
> > > >
> > > > "Alex" <Chipheo2k@hotmail.com> wrote in message
> > > > news:uww3oJlREHA.3944@TK2MSFTNGP11.phx.gbl...
> > > > > Hi All !
> > > > > Anyone has worked with Numega Studio to write a Driver ?
> > > > > I must write a Driver filter for Com Port and synchronize system
> time
> > > > > between 2 computer via Com port ( call them Server and Client ). In
> the
> > > > > server side , there is one User application to active the driver and
> > > User
> > > > > can click on a Button in application to tell the Driver to implement
> > > > > synchronization time with the Client .
> > > > > In the Client side , There is no application , only Install Driver .
> And
> > > the
> > > > > Driver in the client side must use a Thread to detect when the
> Signal
> > > from
> > > > > server has come .
> > > > > SO, My task now is that I must create a Thread in Driver in order to
> > > detect
> > > > > when the signal has come to the Port .
> > > > > Pls explain , how can i do this work? I have create a Thread and put
> it
> > > in
> > > > > the DispatchCreate ( I use Numega to write driver ) . So now , How
> can I
> > > > > detect the Signal came to the Port by this Thread?
> > > > > Pls explain the Mechanism !
> > > > > Thanks in advance !
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: Thread in driver ?? by Alex

Alex
Mon May 31 02:49:29 CDT 2004


"Pavel A." <pavel_a@geeklife.com> wrote in message
news:#7V7BknREHA.644@tk2msftngp13.phx.gbl...
> pardon for jumping in... but do you have a teacher?
> Isn't she payed for teaching you?
>

Thanks Pavel !
But my Teacher have never answered stupid questions like those (He says that
's not her task !). So i must find help from u !
by the way , I have a fragment of code like here . But I don't know why it
could not open the file !
Thanks for your help !


#define FILE_NAME L"c:\\1.out"
KUstring fileName((PCWSTR)FILE_NAME);
KFile m_File ;
NTSTATUS openStatus = m_File.OpenCreate(
fileName,
NULL,
FILE_GENERIC_READ | SYNCHRONIZE,
OBJ_CASE_INSENSITIVE,
0,
FILE_SHARE_READ,
FILE_OPEN,
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT
);
if( !NT_SUCCESS( openStatus ) )
DbgPrint("Error open file ");



Re: Thread in driver ?? by Alex

Alex
Sun May 30 16:54:03 CDT 2004


"Alex" <Chipheo2k@hotmail.com> wrote in message
news:Oya8qcoREHA.1396@TK2MSFTNGP12.phx.gbl...
>
> "Pavel A." <pavel_a@geeklife.com> wrote in message
> news:#7V7BknREHA.644@tk2msftngp13.phx.gbl...
> > pardon for jumping in... but do you have a teacher?
> > Isn't she payed for teaching you?

Tell your teacher that there are no stupid questions....but most sertanly
there are stupid people.
:-)

> >
>
> Thanks Pavel !
> But my Teacher have never answered stupid questions like those (He says
that
> 's not her task !). So i must find help from u !
> by the way , I have a fragment of code like here . But I don't know why it
> could not open the file !
> Thanks for your help !
>
>
> #define FILE_NAME L"c:\\1.out"
> KUstring fileName((PCWSTR)FILE_NAME);
> KFile m_File ;
> NTSTATUS openStatus = m_File.OpenCreate(
> fileName,
> NULL,
> FILE_GENERIC_READ | SYNCHRONIZE,
> OBJ_CASE_INSENSITIVE,
> 0,
> FILE_SHARE_READ,
> FILE_OPEN,
> FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT
> );
> if( !NT_SUCCESS( openStatus ) )
> DbgPrint("Error open file ");
>
>



Re: Thread in driver ?? by Pavel

Pavel
Mon May 31 08:25:56 CDT 2004

"Alex" <AlX@a> wrote in message news:%23F5wiCpREHA.1396@TK2MSFTNGP12.phx.gbl...
>
> "Alex" <Chipheo2k@hotmail.com> wrote in message
> news:Oya8qcoREHA.1396@TK2MSFTNGP12.phx.gbl...
> >
> > "Pavel A." <pavel_a@geeklife.com> wrote in message
> > news:#7V7BknREHA.644@tk2msftngp13.phx.gbl...
> > > pardon for jumping in... but do you have a teacher?
> > > Isn't she payed for teaching you?
>
> Tell your teacher that there are no stupid questions....but most sertanly
> there are stupid people.
> :-)

Hmm.... self criticism has limits, doesn't it? ;)

--



Re: Thread in driver ?? by Alex

Alex
Mon May 31 19:37:25 CDT 2004

No , pavel !
I only fall into Deadlock , dishoped ... I am about stopping studying at
School , because of this work...help me ,if you can ! don't curse me !
regards!


"Pavel A." <pavel_a@geeklife.com> wrote in message
news:eLp$SKxREHA.628@TK2MSFTNGP11.phx.gbl...
> "Alex" <AlX@a> wrote in message
news:%23F5wiCpREHA.1396@TK2MSFTNGP12.phx.gbl...
> >
> > "Alex" <Chipheo2k@hotmail.com> wrote in message
> > news:Oya8qcoREHA.1396@TK2MSFTNGP12.phx.gbl...
> > >
> > > "Pavel A." <pavel_a@geeklife.com> wrote in message
> > > news:#7V7BknREHA.644@tk2msftngp13.phx.gbl...
> > > > pardon for jumping in... but do you have a teacher?
> > > > Isn't she payed for teaching you?
> >
> > Tell your teacher that there are no stupid questions....but most
sertanly
> > there are stupid people.
> > :-)
>
> Hmm.... self criticism has limits, doesn't it? ;)
>
> --
>
>



Re: Thread in driver ?? by Alex

Alex
Mon May 31 09:29:43 CDT 2004

There are 2 of Alex, look at the e-mail addresses...

"Pavel A." <pavel_a@geeklife.com> wrote in message
news:eLp$SKxREHA.628@TK2MSFTNGP11.phx.gbl...
> "Alex" <AlX@a> wrote in message
news:%23F5wiCpREHA.1396@TK2MSFTNGP12.phx.gbl...
> >
> > "Alex" <Chipheo2k@hotmail.com> wrote in message
> > news:Oya8qcoREHA.1396@TK2MSFTNGP12.phx.gbl...
> > >
> > > "Pavel A." <pavel_a@geeklife.com> wrote in message
> > > news:#7V7BknREHA.644@tk2msftngp13.phx.gbl...
> > > > pardon for jumping in... but do you have a teacher?
> > > > Isn't she payed for teaching you?
> >
> > Tell your teacher that there are no stupid questions....but most
sertanly
> > there are stupid people.
> > :-)
>
> Hmm.... self criticism has limits, doesn't it? ;)
>
> --
>
>



Re: Thread in driver ?? by Pavel

Pavel
Mon May 31 15:59:46 CDT 2004

Ok then maybe check out Google answers service http://answers.google.com
with all my sympathy.
P.

"Alex" <Chipheo2k@hotmail.com> wrote in message news:Oiet8PxREHA.1448@TK2MSFTNGP11.phx.gbl...
> No , pavel !
> I only fall into Deadlock , dishoped ... I am about stopping studying at
> School , because of this work...help me ,if you can ! don't curse me !
> regards!
>
>
> "Pavel A." <pavel_a@geeklife.com> wrote in message
> news:eLp$SKxREHA.628@TK2MSFTNGP11.phx.gbl...
> > "Alex" <AlX@a> wrote in message
> news:%23F5wiCpREHA.1396@TK2MSFTNGP12.phx.gbl...
> > >
> > > "Alex" <Chipheo2k@hotmail.com> wrote in message
> > > news:Oya8qcoREHA.1396@TK2MSFTNGP12.phx.gbl...
> > > >
> > > > "Pavel A." <pavel_a@geeklife.com> wrote in message
> > > > news:#7V7BknREHA.644@tk2msftngp13.phx.gbl...
> > > > > pardon for jumping in... but do you have a teacher?
> > > > > Isn't she payed for teaching you?
> > >
> > > Tell your teacher that there are no stupid questions....but most
> sertanly
> > > there are stupid people.
> > > :-)
> >
> > Hmm.... self criticism has limits, doesn't it? ;)
> >
> > --
> >
> >
>
>