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