(Felisberto Coimbra) wrote:
>
>Well I´m learning how wdm drivers work and reading Walter Oney´s book,
>I was testing the driver and I can create a handle to the driver
>normaly but when I try to read or to write to the driver I receive an
>error.
>an the getlasterror function returns me 1 (Incorrect function).
>I have already added the driver into the system with the inf file.
>What it is missing? or what could be the mistake?
ReadFile goes almost directly to the IRP_MJ_READ handler in your driver.
Have you implemented such a handler? Many sample drivers only implement an
ioctl handler.
I believe user-mode error 1 maps to an NTSTATUS of
STATUS_INVALID_PARAMETER. Does your ReadFile function validate its
parameters in any way? Does it ever return STATUS_INVALID_PARAMETER?
--
- Tim Roberts,
Providenza & Boekelheide, Inc.