Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Communication between 2 kernel-mode driver

364 views
Skip to first unread message

Thomas CHARLE

unread,
Mar 29, 1999, 3:00:00 AM3/29/99
to
I have a 2 kernel-mode drivers and i want to one check if the other is
present...

How do i ?
Where can i found an example of communication between 2 kernel-mode
driver... using event, timer ... ?
Is it possible to use a DeviceIoControl fonction in Kernel mode ?

Thanks,

Tom

(And excuse my for my bad english)

love...@hotmail.com

unread,
Mar 30, 1999, 3:00:00 AM3/30/99
to

>i want to one check if the other is
> present...
IoGetDeviceObjectPointer

> Is it possible to use a DeviceIoControl fonction in Kernel mode ?

KeInitializeEvent(&hComplete,NotificationEvent,FALSE);
pIrp = IoBuildDeviceIoControlRequest(
uIOCTL,
pDevObject,
pParams,sizeof(PARAMS),
NULL,0,FALSE,&hComplete,&IoStatusBlock);
IoCallDriver(pDevObject,pIrp);
KeWaitForSingleObject(&hComplete,Executive,KernelMode,FALSE,NULL);
return IoStatusBlock.Status;

In article <yFQL2.10735$Ib4....@news21.bellglobal.com>,

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Oleksandr Bublyk

unread,
Mar 30, 1999, 3:00:00 AM3/30/99
to

Thomas CHARLE wrote in message ...

>I have a 2 kernel-mode drivers and i want to one check if the other is
>present...
>
>How do i ?
>Where can i found an example of communication between 2 kernel-mode
>driver... using event, timer ... ?


See ASYNC sample from DDK and use it by analogy.

>Is it possible to use a DeviceIoControl fonction in Kernel mode ?


Yes, it's possible.
Use such functions in such sequence:
IoGetDeviceObjectPointer
IoBuildDeviceIoControlRequest
IoCallDriver

...as below, for example.

UNICODE_STRING uszDeviceName;
PFILE_OBJECT pFileObject=NULL;
PDEVICE_OBJECT pDeviceObject=NULL;

RtlInitUnicodeString(&uszDeviceName, L"\\DosDevices\\"KRN_DRV_NAME_U);

if ((status=IoGetDeviceObjectPointer(&uszDeviceName,
FILE_ALL_ACCESS,
&pFileObject,
&pDeviceObject))!=STATUS_SUCCESS)
return status;

KEVENT event;
IO_STATUS_BLOCK ioStatus;
KeInitializeEvent(&event,NotificationEvent,FALSE);

PIRP pIrp=IoBuildDeviceIoControlRequest(
IOCTL_ME_INIT,
g_pDeviceObject,
pCbfa,
sizeof(CallBackFnAddrs),
NULL,
0,
FALSE,
&event,
&ioStatus);

status=IoCallDriver(g_pDeviceObject,pIrp);

if (status==STATUS_PENDING)
KeWaitForSingleObject(&event,Suspended,KernelMode,FALSE,NULL);
else
ioStatus.Status=status;


Thomas CHARLE

unread,
Mar 30, 1999, 3:00:00 AM3/30/99
to
Thank you !!
Tom


Oleksandr Bublyk wrote in message <92277729...@jet.ncc.icyb.kiev.ua>...

Gary Little

unread,
Mar 30, 1999, 3:00:00 AM3/30/99
to
Have you looked at the DDK? This is one of it's major topics.

Thomas CHARLE <thomas...@sympatico.ca> wrote in message
news:yFQL2.10735$Ib4....@news21.bellglobal.com...


> I have a 2 kernel-mode drivers and i want to one check if the other is
> present...
>
> How do i ?
> Where can i found an example of communication between 2 kernel-mode
> driver... using event, timer ... ?

> Is it possible to use a DeviceIoControl fonction in Kernel mode ?
>

Torsten Wagner

unread,
Apr 3, 1999, 3:00:00 AM4/3/99
to
Why not using IoGetDeviceObjectPointer() ?


0 new messages