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)
> 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
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 <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 ?
>