Windows 以编程方式安装筛选器驱动程序? 我尝试编写C++代码以编程方式安装NDIS 6轻量级过滤器驱动程序。在查看Windk、在线示例和MSDN文档之后,我最终得到了下面的代码示例 ************** hr = InstallSpecifiedComponent( ModuleFileName, L"MS_NdisLwf", &GUID_DEVCLASS_NETSERVICE ); ************** hr = HrInstallNetComponent( pnc, lpszPnpID, pguidClass, lpszInfFile ); ************** if ( !SetupCopyOEMInfW(lpszInfFullPath, DirWithDrive, // Other files are in the same dir.as primary INF SPOST_PATH, // SPOST_NONE, //First param is path to INF 0, // Default copy style NULL,// Name of the INF after it's copied to %windir%\inf 0, // Max buf. size for the above NULL, // Required size if non-null NULL) // Optionally get the filename part of Inf name after it is copied. ) { ---- } *************** hr = HrInstallComponent( pnc, lpszComponentId, pguidClass ); *************** hr = pnc->QueryNetCfgClass ( pguidClass, IID_INetCfgClassSetup, (void**)&pncClassSetup ); if ( hr == S_OK ) { wprintf(L"\n No Test\n"); hr = pncClassSetup->Install( szComponentId, &OboToken, 0, 0, // Upgrade from build number. NULL, // Answerfile name NULL, // Answerfile section name &pncc ); // Reference after the component if ( S_OK == hr ) { ... } // is installed.

Windows 以编程方式安装筛选器驱动程序? 我尝试编写C++代码以编程方式安装NDIS 6轻量级过滤器驱动程序。在查看Windk、在线示例和MSDN文档之后,我最终得到了下面的代码示例 ************** hr = InstallSpecifiedComponent( ModuleFileName, L"MS_NdisLwf", &GUID_DEVCLASS_NETSERVICE ); ************** hr = HrInstallNetComponent( pnc, lpszPnpID, pguidClass, lpszInfFile ); ************** if ( !SetupCopyOEMInfW(lpszInfFullPath, DirWithDrive, // Other files are in the same dir.as primary INF SPOST_PATH, // SPOST_NONE, //First param is path to INF 0, // Default copy style NULL,// Name of the INF after it's copied to %windir%\inf 0, // Max buf. size for the above NULL, // Required size if non-null NULL) // Optionally get the filename part of Inf name after it is copied. ) { ---- } *************** hr = HrInstallComponent( pnc, lpszComponentId, pguidClass ); *************** hr = pnc->QueryNetCfgClass ( pguidClass, IID_INetCfgClassSetup, (void**)&pncClassSetup ); if ( hr == S_OK ) { wprintf(L"\n No Test\n"); hr = pncClassSetup->Install( szComponentId, &OboToken, 0, 0, // Upgrade from build number. NULL, // Answerfile name NULL, // Answerfile section name &pncc ); // Reference after the component if ( S_OK == hr ) { ... } // is installed.,windows,networking,driver,device-driver,ndis,Windows,Networking,Driver,Device Driver,Ndis,使用INetCfgClassSetup::Install的路径无效 它采用“具有磁盘浏览选项”中的默认路径 例如:我的inf文件路径是C:\Users\Mani\Desktop\sagar\objchk\u win7\u x86\i386\netlwf.inf 但它在havedisk菜单中请求默认路径(第一个条目) d:\softwares\filter\u驱动程序 与图像类似==> 它总是要求相同的sys文件 有什么遗漏吗?你的问题已经提出一年多了,我希望你已经找到了解决办法。为了让开发者面对

使用INetCfgClassSetup::Install的路径无效

它采用“具有磁盘浏览选项”中的默认路径

例如:我的inf文件路径是C:\Users\Mani\Desktop\sagar\objchk\u win7\u x86\i386\netlwf.inf

但它在havedisk菜单中请求默认路径(第一个条目)

d:\softwares\filter\u驱动程序

与图像类似==>

它总是要求相同的sys文件


有什么遗漏吗?

你的问题已经提出一年多了,我希望你已经找到了解决办法。为了让开发者面对同样的问题,我发布了这个答案

从ndis.com上的ProtInstall项目开始

您可能需要进行一些更改:包括头文件、库;还有一些调试


除此之外,该项目还可以运行,我已通过该项目成功安装和卸载了ndislwf 6.0示例项目。

您也可以共享INF吗?请查看链接“我的INF是文件”的性质几乎相似