summaryrefslogtreecommitdiffstats
path: root/vidix
diff options
context:
space:
mode:
authorfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-17 21:53:16 +0000
committerfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-17 21:53:16 +0000
commit966b005fe5e406c500b210e7c42e509748572227 (patch)
tree5a2be8983c4bdcc921361e0785fe11946d156b6f /vidix
parent04145051ba62227a6e1ccb3a48994f367937b004 (diff)
downloadmpv-966b005fe5e406c500b210e7c42e509748572227.tar.bz2
mpv-966b005fe5e406c500b210e7c42e509748572227.tar.xz
it is no longer necessary to reboot the system after the dhahelperwin installation (based on code by Romain Lievin from the tilp project)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24562 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'vidix')
-rw-r--r--vidix/dhahelperwin/dhasetup.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/vidix/dhahelperwin/dhasetup.c b/vidix/dhahelperwin/dhasetup.c
index 6e16fde53c..d51f0015df 100644
--- a/vidix/dhahelperwin/dhasetup.c
+++ b/vidix/dhahelperwin/dhasetup.c
@@ -1,9 +1,29 @@
-/* dhahelper setup program (c) 2004 Sascha Sommer */
-/* compile with gcc -o dhasetup.exe dhasetup.c */
-/* LICENSE: GPL */
+/* dhasetup - dhahelper setup program
+ *
+ * Copyright (c) 2004 - 2007 Sascha Sommer (MPlayer)
+ *
+ * Some parts from dhasetup.c source code <http://svn.tilp.info/cgi-bin/viewcvs.cgi/libticables/trunk/src/win32/dha/>
+ *
+ * Copyright (C) 2007 Romain Lievin (tilp)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
#include <windows.h>
#include <stdio.h>
+#include <winioctl.h>
static void print_last_error(char *s){
LPTSTR lpMsgBuf;
@@ -14,6 +34,8 @@ static void print_last_error(char *s){
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) & lpMsgBuf, 0, NULL);
+ if(strlen(lpMsgBuf) >= 2)
+ lpMsgBuf[strlen(lpMsgBuf)-2] = 0;
printf("%s (%i -> %s)\n", s, GetLastError(), lpMsgBuf);
LocalFree(lpMsgBuf);
@@ -57,6 +79,11 @@ int main(int argc,char* argv[]){
print_last_error("Unable to register DhaHelper Service");
return 1;
}
+
+ if(!StartService(hService, 0, NULL)){
+ print_last_error("Error while starting service");
+ return 1;
+ }
printf("Success!\n");
}
@@ -81,6 +108,5 @@ int main(int argc,char* argv[]){
}
CloseServiceHandle(hService);
CloseServiceHandle(hSCManager);
- printf("Please reboot to let the changes take effect.\n");
return 0;
}