About SetupDiSelectDevice...

Hi,all,
I have a problem about SetupDiSelectDevice , when I call this function , it display a dialog with all device list in INF file for user select. I want to install just a special device in the INF file and don’t want SetupDiSelect dispaly Device select dialog , how I can do it?

Thanks for help!
Regards!

???Crasher
???guodongzi@163.net
???2001-11-07
(???r??z{e?˛???m?m?{]z???&j)@u?Ӣ?칻?&ޱ??i?Z?G?j)m?W???u?칻-E?"?Ǧm??(Z?X???,??&

Hi,
First thing is that, a Class installer should
call the SetupDiSelectDevice( ) only if, what driver
is to be loaded for the current device is a unknown.
In that case the display is thrown to the user so as
to select the driver for his device.
If ever the driver for the device is clear, then,
there is no need for the class installer to show up
the UI.
So, your question becomes void. Use the following
set of function to load the driver / Write a class
installer.

* SetupCopyOEMInf
* SetupOpenInfFile
* SetupDiGetINFClass
* SetupDiGetClassDevs / SetupDiCreateDeviceInfoList
* SetupDiCreateDeviceInfo
* SetupDiSetDeviceRegistryProperty
* SetupDiCallClassInstaller
* UpdateDriverForPlugAndPlayDevices

Rest the DDK will guide you.

Cheers,
Jay

— Crasher wrote:
> Hi,all,
> I have a problem about SetupDiSelectDevice , when I
> call this function , it display a dialog with all
> device list in INF file for user select. I want to
> install just a special device in the INF file and
> don’t want SetupDiSelect dispaly Device select
> dialog , how I can do it?
>
> Thanks for help!
> Regards!
>
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Crasher
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡guodongzi@163.net
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2001-11-07
>
b‹š­ç.®·§¶\¬¹»®&ÞvÚ’µ×¯jɧ¬šuëòj(r‰“¢éì¹»®&Þ±éÝi¹ZžG¦j)m¢Wš½éíuëùïžI–±²‹+r‰

__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Use the combination of SetupDiEnumDriverInfo() and
SetupDiSetSelectedDriver().

SetupDiEnumDriverInfo(DeviceInfoSet, &DeviceInfoData,
SPDIT_CLASSDRIVER, 0,&DriverInfoData);
fRC = SetupDiSetSelectedDriver(DeviceInfoSet,
&DeviceInfoData,&DriverInfoData);

The SetupDiSelectDevice() is used for UI.

Joe McCloskey
Gamry Instruments, Inc.
xxxxx@gamry.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Crasher
Sent: Wednesday, November 07, 2001 5:40 AM
To: NT Developers Interest List
Subject: [ntdev] About SetupDiSelectDevice…

Hi,all,
I have a problem about SetupDiSelectDevice , when I call this function , it
display a dialog with all device list in INF file for user select. I want to
install just a special device in the INF file and don’t want SetupDiSelect
dispaly Device select dialog , how I can do it?

Thanks for help!
Regards!

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Crasher
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡guodongzi@163.net
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2001-11-07
b­®¶¹®vµjq²ÉN²rzuj™¶jµçV¶­


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi,Joe,
Thanks for you help! Please see there code:

SP_DRVINFO_DATA sp_DrvInfo;
sp_DrvInfo.cbSize = sizeof(sp_DrvInfo);

bSuccess = SetupDiEnumDriverInfo(hDevInfo, &spDevInfo,
SPDIT_CLASSDRIVER , 0,&sp_DrvInfo);
if (FALSE == bSuccess)
{
//…Windows NT 4.0 occur error here ,last error:1784(The supplied user buffer is not valid for the requested operation. )
}
bSuccess = SetupDiSetSelectedDriver(hDevInfo,
&spDevInfo,&sp_DrvInfo);

The code can run normally in windows 2000/XP ,but in windows NT4.0(sp6) it occur error 1784 when call SetupDiEnumDriverInfo(…),could you tell me why ?

Thank you for you help!
Regards.

Crasher
guodongzi@163.net
2001-11-08
???

=================================

Use the combination of SetupDiEnumDriverInfo() and
SetupDiSetSelectedDriver().

SetupDiEnumDriverInfo(DeviceInfoSet, &DeviceInfoData,
SPDIT_CLASSDRIVER, 0,&DriverInfoData);
fRC = SetupDiSetSelectedDriver(DeviceInfoSet,
&DeviceInfoData,&DriverInfoData);

The SetupDiSelectDevice() is used for UI.

Joe McCloskey
Gamry Instruments, Inc.
xxxxx@gamry.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Crasher
Sent: Wednesday, November 07, 2001 5:40 AM
To: NT Developers Interest List
Subject: [ntdev] About SetupDiSelectDevice…

Hi,all,
I have a problem about SetupDiSelectDevice , when I call this function , it
display a dialog with all device list in INF file for user select. I want to
install just a special device in the INF file and don’t want SetupDiSelect
dispaly Device select dialog , how I can do it?

Thanks for help!
Regards!

???Crasher
???guodongzi@163.net
???2001-11-07


You are currently subscribed to ntdev as: guodongzi@163.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

= = = = = = = = = = = = = = = = = = = =
b???.???????&?v?'?ׯj?.n?Qyȩf??]?:.?˛???m??֛???zf???%y?ޞ?^?˛??^r*Lzfެ?…???l??ܢ

Crasher,

That means the SetupApi.DLL is not recognizing your data structure. That
error comes with one of two ways: the sizeof(sp_DrvInfo) is incorrect or a
field of sp_DrvInfo is not allocated to the proper size (like a buffer fo
name). What do you try SP_DRVINFO_DATA_V1 for the SP_DRVINFO_DATA of
sp_DrvInfo? .i.e.

SP_DRVINFO_DATA_V1 sp_DrvInfo;
sp_DrvInfo.cbSize = sizeof(sp_DrvInfo);

bSuccess = SetupDiEnumDriverInfo(hDevInfo, &spDevInfo,
SPDIT_CLASSDRIVER , 0,&sp_DrvInfo);
if (FALSE == bSuccess)
{
//…Windows NT 4.0 occur error here ,last error:1784(The supplied
user buffer is not valid for the requested operation. )
}
bSuccess = SetupDiSetSelectedDriver(hDevInfo,
&spDevInfo,&sp_DrvInfo);

See what happens with that. . . .

Joe McCloskey
Gamry Instruments, Inc.
xxxxx@gamry.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Crasher
Sent: Thursday, November 08, 2001 4:53 AM
To: NT Developers Interest List
Subject: [ntdev] RE: About SetupDiSelectDevice…

Hi,Joe,
Thanks for you help! Please see there code:

SP_DRVINFO_DATA sp_DrvInfo;
sp_DrvInfo.cbSize = sizeof(sp_DrvInfo);

bSuccess = SetupDiEnumDriverInfo(hDevInfo, &spDevInfo,
SPDIT_CLASSDRIVER , 0,&sp_DrvInfo);
if (FALSE == bSuccess)
{
//…Windows NT 4.0 occur error here ,last error:1784(The supplied
user buffer is not valid for the requested operation. )
}
bSuccess = SetupDiSetSelectedDriver(hDevInfo,
&spDevInfo,&sp_DrvInfo);

The code can run normally in windows 2000/XP ,but in windows NT4.0(sp6) it
occur error 1784 when call SetupDiEnumDriverInfo(…),could you tell me why
?

Thank you for you help!
Regards.

Crasher
guodongzi@163.net
2001-11-08
¡¡¡¡

=================================

Use the combination of SetupDiEnumDriverInfo() and
SetupDiSetSelectedDriver().

SetupDiEnumDriverInfo(DeviceInfoSet, &DeviceInfoData,
SPDIT_CLASSDRIVER, 0,&DriverInfoData);
fRC = SetupDiSetSelectedDriver(DeviceInfoSet,
&DeviceInfoData,&DriverInfoData);

The SetupDiSelectDevice() is used for UI.

Joe McCloskey
Gamry Instruments, Inc.
xxxxx@gamry.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Crasher
Sent: Wednesday, November 07, 2001 5:40 AM
To: NT Developers Interest List
Subject: [ntdev] About SetupDiSelectDevice…

Hi,all,
I have a problem about SetupDiSelectDevice , when I call this function , it
display a dialog with all device list in INF file for user select. I want
to
install just a special device in the INF file and don’t want SetupDiSelect
dispaly Device select dialog , how I can do it?

Thanks for help!
Regards!

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Crasher
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡guodongzi@163.net
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2001-11-07


You are currently subscribed to ntdev as: guodongzi@163.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

= = = = = = = = = = = = = = = = = = = =
b‹š­ç.®·§¶\¬¹??Þv?µ×¯jÈæqÉh²G²©«ÉÊ&N‹§²æìr¸›zǧu¦åjy™¨¥¶‰^j÷§µ×
¯ç?VX¬¶?­Ê&


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com