64位系统下的驱动安装

cziy122 2009-08-04 05:28:34
64位系统下的驱动安装包
HDEVINFO DeviceInfoSet = 0;
SP_DEVINFO_DATA DeviceInfoData;
GUID ClassGUID;
TCHAR ClassName[MAX_CLASS_NAME_LEN];
DWORD err;

// Use the INF File to extract the Class GUID.
//
if (!SetupDiGetINFClass(INFFile,&ClassGUID,ClassName,sizeof(ClassName),0))
{
::MessageBox( NULL, "GetInfoClass", "Error", MB_OK );
return DisplayError(TEXT("GetINFClass"));
}

//
// Create the container for the to-be-created Device Information Element.
DeviceInfoSet = SetupDiCreateDeviceInfoList(&ClassGUID,0);
if(DeviceInfoSet == INVALID_HANDLE_VALUE)
{
::MessageBox( NULL, "CreateDeviceInfoList", "Error", MB_OK );
return DisplayError(TEXT("CreateDeviceInfoList"));
}

//
// Now create the element.
// Use the Class GUID and Name from the INF file.
DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
if (!SetupDiCreateDeviceInfo(DeviceInfoSet, ClassName, &ClassGUID, NULL, 0, DICD_GENERATE_ID, &DeviceInfoData))
{
::MessageBox( NULL, "CreateDeviceInfo", "Error", MB_OK );
DisplayError(TEXT("CreateDeviceInfo"));
goto cleanup_DeviceInfo;
}

// Transform the registry element into an actual devnode
// in the PnP HW tree.
//
if (!SetupDiCallClassInstaller(DIF_REGISTERDEVICE, DeviceInfoSet, &DeviceInfoData))
{
::MessageBox( NULL, "CallClassInstaller(REGISTERDEVICE)", "Error", MB_OK );
DisplayError(TEXT("CallClassInstaller(REGISTERDEVICE)"));
goto cleanup_DeviceInfo;
}


到 SetupDiCallClassInstaller 就失败了,请教高手指点
...全文
211 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
huoyanming 2009-08-05
  • 打赏
  • 举报
回复
谢谢分享……
cziy122 2009-08-05
  • 打赏
  • 举报
回复
多谢了,我已经解决了,想办法使用64位的编译环境编译之后就可以了
驱动首先需要签名,其次你的安装程序需要是64位编译的
flyhua1010 2009-08-05
  • 打赏
  • 举报
回复
帮顶了。。。。。。。。。。。。。。。。。。。。。
fairchild811 2009-08-05
  • 打赏
  • 举报
回复
不签名的话,可以在安全模式下,继续安装未签名的驱动

6,849

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧