# HG changeset patch
# User faust3
# Date 1190065996 0
# Node ID a36693ffbb178473579dec04d274165a4648d219
# Parent 173d35b7aca33777aac83e80a15f6df1bfe19bb6
it is no longer necessary to reboot the system after the dhahelperwin installation (based on code by Romain Lievin from the tilp project)
diff -r 173d35b7aca3 -r a36693ffbb17 vidix/dhahelperwin/dhasetup.c
--- a/vidix/dhahelperwin/dhasetup.c Mon Sep 17 21:12:29 2007 +0000
+++ b/vidix/dhahelperwin/dhasetup.c Mon Sep 17 21:53:16 2007 +0000
@@ -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
+ *
+ * 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
#include
+#include
static void print_last_error(char *s){
LPTSTR lpMsgBuf;
@@ -14,6 +34,8 @@
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 @@
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 @@
}
CloseServiceHandle(hService);
CloseServiceHandle(hSCManager);
- printf("Please reboot to let the changes take effect.\n");
return 0;
}