Re: data exchange betwen driver and gui aplication

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Yes I know I must reference it but I dont't even get it.
I never get to use the handle.
But instead if I define a structure sometthing like
typedef struct _data
{
char stuff[100];
}DATA;
and I send this to kernel the "stuff " variable arrives OK but if I
define it like this

typedef struct _data
{
char stuff[100];
HANDLE hEvent;
}DATA;

I get the error:
I mean the Irp->UserBuffer is not a valid address.



Don Burn wrote:
When you say you send a handle and then get memory invalid, is this on
saving the handle or using it? If it is on using the handle it is probably
because you are no longer in the context of the process for the handle, you
should be using ObReferenceObjectByHandle in the DeviceIoControl routine to
get the event. If you haven't done so take a look at the event sample in
the current ddk under src\general\event


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply



<euacela@xxxxxxxxx> wrote in message
news:1154176326.304975.192930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I want to know how can it be done corectly.
I can't seem to find any documentation on this.
For example how can I tell if the buffer was sent to the driver in the
Type3InputBuffer variable or Irp->UserBuffer.
I know it depends on how you define your control codes.
I mean: METHOD bufered => the buffer will come in Irp->UserBuffer for
example.
Can someone clear this out for me a little or tell me where I can find
documentation.
I am trying to send a handle of an event in kernel mode and it always
tells me that the memory is not valid but if I am sending a string it
works.
Please help me.
Thanks in advance


.



Relevant Pages