#include "windows.h"
#include "stdio.h"
#include "stdlib.h"
BOOL LoadDriver(SC_HANDLE schSCManager, //SCM Handle
LPCSTR lpszDriverName, //Driver Name
LPCSTR lpszServiceFullPath); //full-qualified path
BOOL RemoveDriver(SC_HANDLE schSCManager, //SCM handle
LPCTSTR lpszDriverName); //Driver Name
BOOL StartDriver(SC_HANDLE schSCManager,
LPCTSTR lpszDriverName);
BOOL StopService(SC_HANDLE schSCManager,
LPCTSTR lpszDriverName);
int main()
{
char szFilePath[MAX_PATH];
char* pszFileName;
OPENFILENAMEA stOpenFileName;
BOOL zRet;
SC_HANDLE schSCManager;
RtlZeroMemory(&stOpenFileName ,sizeof(OPENFILENAME));
RtlZeroMemory(szFilePath ,sizeof(char)*MAX_PATH);
stOpenFileName.lStructSize = sizeof(OPENFILENAME);;
stOpenFileName.lpstrFilter = "驱动(*.sys)\0\0";
stOpenFileName.lpstrFile = szFilePath;
stOpenFileName.nMaxFile = MAX_PATH;
stOpenFileName.Flags = OFN
加载驱动程序的代码
最新推荐文章于 2023-03-24 09:54:57 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)