diff options
author | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-03-23 10:41:04 +0000 |
---|---|---|
committer | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-03-23 10:41:04 +0000 |
commit | e89e30c90cbb96fa605d6b3f75907b096fc31aec (patch) | |
tree | 6adf0ef989e044748a8dcfccd41b454f578b52b5 /libdha/dhahelperwin/dhasetup.c | |
parent | 543c00752d19e74fcde0c6139eee985d3c1476c0 (diff) | |
download | mpv-e89e30c90cbb96fa605d6b3f75907b096fc31aec.tar.bz2 mpv-e89e30c90cbb96fa605d6b3f75907b096fc31aec.tar.xz |
Windows XP support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12058 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha/dhahelperwin/dhasetup.c')
-rw-r--r-- | libdha/dhahelperwin/dhasetup.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libdha/dhahelperwin/dhasetup.c b/libdha/dhahelperwin/dhasetup.c new file mode 100644 index 0000000000..f55b81d5db --- /dev/null +++ b/libdha/dhahelperwin/dhasetup.c @@ -0,0 +1,53 @@ +/*dhahelper setup program (c) 2004 Sascha Sommer*/ +/*compile with gcc -o dhasetup.exe dhasetup.c */ +/*LICENSE: GPL */ + +#include <windows.h> +#include <stdio.h> + +int main(int argc,char* argv[]){ + SC_HANDLE hSCManager; + SC_HANDLE hService; + printf("dhasetup (c) 2004 Sascha Sommer\n"); + if(argc==1){ + printf("usage:\n"); + printf("dhasetup install - copys dhahelper.sys from the current dir to windows/system32/drivers and configures it to start at system start\n"); + printf("dhasetup remove - removes the dhahelper util\n"); + return 0; + } + hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + + if(!strcmp(argv[1],"install")){ + printf("installing dhahelper\n"); + CopyFile("dhahelper.sys","c:\\windows\\System32\\drivers\\dhahelper.sys",FALSE); + // Install the driver + hService = CreateService(hSCManager, + "DHAHELPER", + "DHAHELPER", + SERVICE_ALL_ACCESS, + SERVICE_KERNEL_DRIVER, + SERVICE_SYSTEM_START, + SERVICE_ERROR_NORMAL, + "c:\\windows\\System32\\drivers\\dhahelper.sys", + NULL, + NULL, + NULL, + NULL, + NULL); + } + else if(!strcmp(argv[1],"remove")){ + SERVICE_STATUS ServiceStatus; + printf("removing dhahelper\n"); + hService = OpenService(hSCManager, "DHAHELPER", SERVICE_ALL_ACCESS); + ControlService(hService, SERVICE_CONTROL_STOP, &ServiceStatus); + DeleteService(hService); + DeleteFile("c:\\windows\\System32\\drivers\\dhahelper.sys"); + } + else { + printf("unknown parameter: %s\n",argv[1]); + } + CloseServiceHandle(hService); + CloseServiceHandle(hSCManager); + printf("please reboot to let the changes take effect\n"); + return 0; +} |