mirror of
https://github.com/mpv-player/mpv
synced 2024-12-19 21:31:52 +00:00
1000l
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12059 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e89e30c90c
commit
51457a2484
@ -8,6 +8,7 @@
|
|||||||
int main(int argc,char* argv[]){
|
int main(int argc,char* argv[]){
|
||||||
SC_HANDLE hSCManager;
|
SC_HANDLE hSCManager;
|
||||||
SC_HANDLE hService;
|
SC_HANDLE hService;
|
||||||
|
char path[MAX_PATH];
|
||||||
printf("dhasetup (c) 2004 Sascha Sommer\n");
|
printf("dhasetup (c) 2004 Sascha Sommer\n");
|
||||||
if(argc==1){
|
if(argc==1){
|
||||||
printf("usage:\n");
|
printf("usage:\n");
|
||||||
@ -16,10 +17,12 @@ int main(int argc,char* argv[]){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
|
hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
|
||||||
|
GetWindowsDirectory(path,MAX_PATH);
|
||||||
|
strcpy(path+strlen(path),"\\system32\\drivers\\dhahelper.sys");
|
||||||
if(!strcmp(argv[1],"install")){
|
if(!strcmp(argv[1],"install")){
|
||||||
printf("installing dhahelper\n");
|
printf("installing dhahelper\n");
|
||||||
CopyFile("dhahelper.sys","c:\\windows\\System32\\drivers\\dhahelper.sys",FALSE);
|
if(!CopyFile("dhahelper.sys",path,FALSE))
|
||||||
|
printf("can't find dhahelper.sys\n");
|
||||||
// Install the driver
|
// Install the driver
|
||||||
hService = CreateService(hSCManager,
|
hService = CreateService(hSCManager,
|
||||||
"DHAHELPER",
|
"DHAHELPER",
|
||||||
@ -28,7 +31,7 @@ int main(int argc,char* argv[]){
|
|||||||
SERVICE_KERNEL_DRIVER,
|
SERVICE_KERNEL_DRIVER,
|
||||||
SERVICE_SYSTEM_START,
|
SERVICE_SYSTEM_START,
|
||||||
SERVICE_ERROR_NORMAL,
|
SERVICE_ERROR_NORMAL,
|
||||||
"c:\\windows\\System32\\drivers\\dhahelper.sys",
|
path,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
@ -41,7 +44,7 @@ int main(int argc,char* argv[]){
|
|||||||
hService = OpenService(hSCManager, "DHAHELPER", SERVICE_ALL_ACCESS);
|
hService = OpenService(hSCManager, "DHAHELPER", SERVICE_ALL_ACCESS);
|
||||||
ControlService(hService, SERVICE_CONTROL_STOP, &ServiceStatus);
|
ControlService(hService, SERVICE_CONTROL_STOP, &ServiceStatus);
|
||||||
DeleteService(hService);
|
DeleteService(hService);
|
||||||
DeleteFile("c:\\windows\\System32\\drivers\\dhahelper.sys");
|
DeleteFile(path);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf("unknown parameter: %s\n",argv[1]);
|
printf("unknown parameter: %s\n",argv[1]);
|
||||||
|
Loading…
Reference in New Issue
Block a user