-
-
[旧帖]
卸载驱动失败 帮忙看看哪里写错了
0.00雪花
-
发表于:
2016-2-13 01:06
2961
-
[旧帖] 卸载驱动失败 帮忙看看哪里写错了
0.00雪花
hSCM = NULL;
hSCM=OpenSCManagerW(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if (hSCM != NULL)
{
MessageBoxW(hWnd, TEXT(""), TEXT("打开SCM"), 0);
ScH_Service = NULL;
ScH_Service=OpenService(hSCM,TEXT("Yservice"), SC_MANAGER_ALL_ACCESS);
if (ScH_Service != NULL)
{
MessageBoxW(hWnd, TEXT(""), TEXT("打开服务"), 0);
if (ControlService(ScH_Service, SERVICE_CONTROL_STOP, NULL))
{
MessageBoxW(hWnd, TEXT(""), TEXT("1"), 0);
}
else
{
dLastError=GetLastError();
wsprintf(szbuffer,TEXT("%d"),dLastError);
MessageBoxW(hWnd, szbuffer, szbuffer, 0);
}
if (DeleteService(ScH_Service))
{
MessageBoxW(hWnd, TEXT(""), TEXT("2"), 0);
}
}
else
{
MessageBoxW(hWnd, TEXT(""), TEXT("打开服务失败"), 0);
}
CloseServiceHandle(hSCM);
}
break;
上面的代码 ControlService出错 GetLastError输出487 然后驱动还在系统中 谢谢各位大神
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课