summaryrefslogtreecommitdiffstats
path: root/libdha/dhahelperwin/dhasetup.c
diff options
context:
space:
mode:
authorben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-06 15:20:49 +0000
committerben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-06 15:20:49 +0000
commit51ba40dcd64518c8d5f9ce586171c8fb347a42c0 (patch)
tree590b1ce6d17f2126b67d1a5cb1576cdd7e8dea5c /libdha/dhahelperwin/dhasetup.c
parent3099d0da16505cbc0aaab34f9299404e9ec19241 (diff)
downloadmpv-51ba40dcd64518c8d5f9ce586171c8fb347a42c0.tar.bz2
mpv-51ba40dcd64518c8d5f9ce586171c8fb347a42c0.tar.xz
merged libdha and libvidix, moved all files from libdha to vidix directory
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22918 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha/dhahelperwin/dhasetup.c')
-rw-r--r--libdha/dhahelperwin/dhasetup.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/libdha/dhahelperwin/dhasetup.c b/libdha/dhahelperwin/dhasetup.c
deleted file mode 100644
index 7113499961..0000000000
--- a/libdha/dhahelperwin/dhasetup.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* 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;
- char path[MAX_PATH];
- printf("dhasetup (c) 2004 Sascha Sommer\n");
- GetWindowsDirectory(path,MAX_PATH);
- strcpy(path+strlen(path),"\\system32\\drivers\\dhahelper.sys");
- if(argc==1){
- printf("Usage:\n");
- printf("dhasetup install - Copies dhahelper.sys from the current directory to\n%s and configures it to start at boot.\n", path);
- printf("dhasetup remove - Removes the dhahelper utility.\n");
- return 0;
- }
- hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
- if(!strcmp(argv[1],"install")){
- printf("Installing dhahelper...\n");
- if(!CopyFile("dhahelper.sys",path,FALSE)){
- printf("Copying dhahelper.sys failed.\nEither dhahelper.sys is not in the current directory or you lack sufficient\nprivileges to write to %s.", path);
- return 1;
- }
- // Install the driver
- hService = CreateService(hSCManager,
- "DHAHELPER",
- "DHAHELPER",
- SERVICE_ALL_ACCESS,
- SERVICE_KERNEL_DRIVER,
- SERVICE_SYSTEM_START,
- SERVICE_ERROR_NORMAL,
- path,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL);
- if(!hService){
- printf("Unable to register DHAHELPER Service (0x%x).\n",GetLastError());
- }
- }
- 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(path);
- }
- else {
- printf("unknown parameter: %s\n",argv[1]);
- }
- CloseServiceHandle(hService);
- CloseServiceHandle(hSCManager);
- printf("Please reboot to let the changes take effect.\n");
- return 0;
-}