Hi,
I have installed my mirror driver using devcon.exe, available in WDK
version 7600.16385.1 and it is getting installed without any error message.
I can see my driver in device manager, also it’s entry is available in
HKLM\Hardware\Devicemap\video list but some how enumDisplayDevicesA() is not
able to detect the driver.
My code is:
foo()
{
…
HMODULE hUser32=LoadLibrary(“USER32”);
pd = (pEnumDisplayDevices)GetProcAddress( hUser32,
“EnumDisplayDevicesA”);
while (result = (*pd)(NULL,devNum, &dd, 0))
{
if (strcmp((const char *)&dd.DeviceString[0], driverName) == 0)
{
}
…
}
}
I am having few doubts:
1.) EnumDisplayDevices() must be reading the data from some data base why
installer is not able to update the list? Is my devcon not pnp installer?
2.) If I restart the system after installation then it is getting listed,
why restart is required? Other 3rd party driver is not having such
requirement.
3.) Issues is coming mostly with win7, so is there any known issue in win7 +
EnumDisplayDevicesA()?
Please help me it is very urgent.
Thanks in advance.
/sarbojit
Sarbojit Sarkar wrote:
I have installed my mirror driver using devcon.exe, available in WDK
version 7600.16385.1 and it is getting installed without any error
message. I can see my driver in device manager, also it’s entry is
available in HKLM\Hardware\Devicemap\video list but some how
enumDisplayDevicesA() is not able to detect the driver.
My code is:
foo()
{
…
HMODULE hUser32=LoadLibrary(“USER32”);
pd = (pEnumDisplayDevices)GetProcAddress( hUser32,
“EnumDisplayDevicesA”);
while (result = (*pd)(NULL,devNum, &dd, 0))
Why on earth would you go through GetProcAddress, instead of just
calling the API directly?
while( result = EnumDisplayDevices(NULL, devNum, &dd, 0) )
EnumDisplayDevices has been available since Windows 2000, so unless you
need to support Win98, it’s silly to use GetProcAddress. It’s
especially silly because you aren’t checking the results of GetProcAddress.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Hi Tim,
thanks a lot for your reply. With the suggested change I tried but issue did
not reproduce, since this issue is very intermittent out of 10-20 trial it
reproduces only once or twice, so I am not sure whether this was the fault.
Do you think because of this I was facing that behavior?
Thanks
/sarbojit
On Wed, Feb 9, 2011 at 11:27 PM, Tim Roberts wrote:
> Sarbojit Sarkar wrote:
> >
> >
> > I have installed my mirror driver using devcon.exe, available in WDK
> > version 7600.16385.1 and it is getting installed without any error
> > message. I can see my driver in device manager, also it’s entry is
> > available in HKLM\Hardware\Devicemap\video list but some how
> > enumDisplayDevicesA() is not able to detect the driver.
> >
> > My code is:
> >
> > foo()
> >
> > {
> >
> > …
> >
> > HMODULE hUser32=LoadLibrary(“USER32”);
> >
> > pd = (pEnumDisplayDevices)GetProcAddress( hUser32,
> > “EnumDisplayDevicesA”);
> >
> > while (result = (*pd)(NULL,devNum, &dd, 0))
> >
>
> Why on earth would you go through GetProcAddress, instead of just
> calling the API directly?
> while( result = EnumDisplayDevices(NULL, devNum, &dd, 0) )
>
> EnumDisplayDevices has been available since Windows 2000, so unless you
> need to support Win98, it’s silly to use GetProcAddress. It’s
> especially silly because you aren’t checking the results of GetProcAddress.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
On failure if you go to device manager and rescan hardware does your
program work?
Mark Roddy
On Thu, Feb 10, 2011 at 4:38 AM, Sarbojit Sarkar wrote:
> Hi Tim,
> thanks a lot for your reply. With the suggested change I tried but issue did
> not reproduce, since this issue is very?intermittent out of 10-20 trial it
> reproduces only once or twice, so I am not sure whether this was the fault.
> Do you think because of this I was facing that behavior?
> Thanks
> /sarbojit
> On Wed, Feb 9, 2011 at 11:27 PM, Tim Roberts wrote:
>>
>> Sarbojit Sarkar wrote:
>> >
>> >
>> > ? I have installed my mirror driver using devcon.exe, available in WDK
>> > version 7600.16385.1 and it is getting installed without any error
>> > message. I can see my driver in device manager, also it’s entry is
>> > available in HKLM\Hardware\Devicemap\video list but some how
>> > enumDisplayDevicesA() is not able to detect the driver.
>> >
>> > My code is:
>> >
>> > foo()
>> >
>> > {
>> >
>> > …
>> >
>> > ? ?HMODULE hUser32=LoadLibrary(“USER32”);
>> >
>> > ? ?pd = (pEnumDisplayDevices)GetProcAddress( hUser32,
>> > “EnumDisplayDevicesA”);
>> >
>> > ? ?while (result = (*pd)(NULL,devNum, &dd, 0))
>> >
>>
>> Why on earth would you go through GetProcAddress, instead of just
>> calling the API directly?
>> ? ?while( result = EnumDisplayDevices(NULL, devNum, &dd, 0) )
>>
>> EnumDisplayDevices has been available since Windows 2000, so unless you
>> need to support Win98, it’s silly to use GetProcAddress. ?It’s
>> especially silly because you aren’t checking the results of
>> GetProcAddress.
>>
>> –
>> Tim Roberts, xxxxx@probo.com
>> Providenza & Boekelheide, Inc.
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the
> List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
Sarbojit Sarkar wrote:
Hi Tim,
thanks a lot for your reply. With the suggested change I tried but
issue did not reproduce, since this issue is very intermittent out of
10-20 trial it reproduces only once or twice, so I am not sure whether
this was the fault.
Do you think because of this I was facing that behavior?
No. What I pointed out was merely a style issue, not a functionality
issue. You could (rightly so) scold me for making style comments when
you are trying to solve real functional problems.
Is it possible you simply have a timing problem? Does it matter how
long you wait before doing the enumeration?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Mark,
Actually when issue reproduces I can see my driver in device manager, do
you still want me to do h/w scan? I will check and let you know.
Tim,
I doubt if it is a timing issue because between two tries I am taking
almost 4/5 mins time delay.
I am still clue less on following
- Why after reboot it is getting resolved?
- Can it be because of Devcon.exe?
- From where EnumDisplayDevices() is getting info? I mean, is there any
database which I can check. I have confirmed, my driver entry was present
in HKLM\Hardware\Devicemap\Video list.
On Thu, Feb 10, 2011 at 11:04 PM, Tim Roberts wrote:
> Sarbojit Sarkar wrote:
> > Hi Tim,
> > thanks a lot for your reply. With the suggested change I tried but
> > issue did not reproduce, since this issue is very intermittent out of
> > 10-20 trial it reproduces only once or twice, so I am not sure whether
> > this was the fault.
> > Do you think because of this I was facing that behavior?
>
> No. What I pointed out was merely a style issue, not a functionality
> issue. You could (rightly so) scold me for making style comments when
> you are trying to solve real functional problems.
>
> Is it possible you simply have a timing problem? Does it matter how
> long you wait before doing the enumeration?
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>