Hi all,
I have written a simple device driver that is loaded at boot time. The
driver needs to read MemBase and MemLen from the registry when
initialised.

I use the pointer that I receive in XXX_Init( PVOID Context) to open
the device key ( hnd = OpenDeviceKey( (LPCTSTR)Context ); ) and that
seems to work.
However, when I call DDKReg_GetWindowinfo() with the returned handle
it returns ERROR_INVALID_PARAMETER. According to MSDN this "Indicates
a problem with the populated DDKWINDOWINFO structure." What does this
mean?
My registry entry looks like this:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\GDU]
"MemBase"=dword:40100000
"MemLen"=dword:40
"Prefix"="GDU"
"Dll"="gdudev.dll"
"Order"=dword:22


Any ideas are much appreciated.

Thanks,
Rickard

Re: DDKReg_GetWindowInfo() returns ERROR_INVALID_PARAMETER by Dean

Dean
Fri May 09 05:21:57 PDT 2008

You probably didn't initialize the cbSize parameter of the structure before
making the call...

--
Dean Ramsier - eMVP
BSQUARE Corporation


"RickardF" <rickard.fahlquist@gmail.com> wrote in message
news:b8b535c2-6216-4b49-bb9c-e2622cfe0641@27g2000hsf.googlegroups.com...
> Hi all,
> I have written a simple device driver that is loaded at boot time. The
> driver needs to read MemBase and MemLen from the registry when
> initialised.
>
> I use the pointer that I receive in XXX_Init( PVOID Context) to open
> the device key ( hnd = OpenDeviceKey( (LPCTSTR)Context ); ) and that
> seems to work.
> However, when I call DDKReg_GetWindowinfo() with the returned handle
> it returns ERROR_INVALID_PARAMETER. According to MSDN this "Indicates
> a problem with the populated DDKWINDOWINFO structure." What does this
> mean?
> My registry entry looks like this:
>
> [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\GDU]
> "MemBase"=dword:40100000
> "MemLen"=dword:40
> "Prefix"="GDU"
> "Dll"="gdudev.dll"
> "Order"=dword:22
>
>
> Any ideas are much appreciated.
>
> Thanks,
> Rickard



Re: DDKReg_GetWindowInfo() returns ERROR_INVALID_PARAMETER by RickardF

RickardF
Tue May 13 00:50:32 PDT 2008

On May 9, 2:21 pm, "Dean Ramsier" <ramsiernos...@nospam.com> wrote:
> You probably didn't initialize the cbSize parameter of the structure before
> making the call...
>
> --
> Dean Ramsier - eMVP
> BSQUARE Corporation
>
> "RickardF" <rickard.fahlqu...@gmail.com> wrote in message
>
> news:b8b535c2-6216-4b49-bb9c-e2622cfe0641@27g2000hsf.googlegroups.com...
>
> > Hi all,
> > I have written a simple device driver that is loaded at boot time. The
> > driver needs to read MemBase and MemLen from the registry when
> > initialised.
>
> > I use the pointer that I receive in XXX_Init( PVOID Context) to open
> > the device key ( hnd = OpenDeviceKey( (LPCTSTR)Context ); ) and that
> > seems to work.
> > However, when I call DDKReg_GetWindowinfo() with the returned handle
> > it returns ERROR_INVALID_PARAMETER. According to MSDN this "Indicates
> > a problem with the populated DDKWINDOWINFO structure." What does this
> > mean?
> > My registry entry looks like this:
>
> > [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\GDU]
> > "MemBase"=dword:40100000
> > "MemLen"=dword:40
> > "Prefix"="GDU"
> > "Dll"="gdudev.dll"
> > "Order"=dword:22
>
> > Any ideas are much appreciated.
>
> > Thanks,
> > Rickard

Yup, that solved it. Many thanks!