Update of /cvsroot/com0com/com0com/setup
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv3265
Modified Files:
setup.cpp
Log Message:
Added disable and enable options
Index: setup.cpp
===================================================================
RCS file: /cvsroot/com0com/com0com/setup/setup.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** setup.cpp 19 Oct 2007 16:09:55 -0000 1.21
--- setup.cpp 27 Nov 2007 16:32:54 -0000 1.22
***************
*** 20,23 ****
--- 20,26 ----
*
* $Log$
+ * Revision 1.22 2007/11/27 16:32:54 vfrolov
+ * Added disable and enable options
+ *
* Revision 1.21 2007/10/19 16:09:55 vfrolov
* Implemented --detail-prms option
***************
*** 519,522 ****
--- 522,560 ----
SetupPromptReboot(NULL, NULL, FALSE);
+ return 0;
+ }
+ ///////////////////////////////////////////////////////////////
+ int Disable(InfFile &infFile)
+ {
+ BOOL rebootRequired = FALSE;
+
+ DevProperties devProperties;
+ if (!devProperties.DevId(C0C_BUS_DEVICE_ID))
+ return 1;
+
+ if (!DisableDevices(infFile, &devProperties, &rebootRequired, NULL))
+ return 1;
+
+ if (rebootRequired)
+ SetupPromptReboot(NULL, NULL, FALSE);
+
+ return 0;
+ }
+ ///////////////////////////////////////////////////////////////
+ int Enable(InfFile &infFile)
+ {
+ BOOL rebootRequired = FALSE;
+
+ DevProperties devProperties;
+ if (!devProperties.DevId(C0C_BUS_DEVICE_ID))
+ return 1;
+
+ if (!EnableDevices(infFile, &devProperties, &rebootRequired)) {
+ return 1;
+ }
+
+ if (rebootRequired)
+ SetupPromptReboot(NULL, NULL, FALSE);
+
return 0;
}
***************
*** 923,926 ****
--- 961,966 ----
" identifiers " C0C_PREF_PORT_NAME_A "<n> and "
C0C_PREF_PORT_NAME_B "<n>\n"
+ " disable all - disable all ports in current hardware profile\n"
+ " enable all - enable all ports in current hardware profile\n"
" change <portid> <prms> - set parameters <prms> for port with\n"
" identifier <portid>\n"
***************
*** 1062,1065 ****
--- 1102,1119 ----
}
else
+ if (argc == 3 && !lstrcmpi(argv[1], "disable")) {
+ SetTitle(C0C_SETUP_TITLE " (DISABLE)");
+
+ if (!lstrcmpi(argv[2], "all"))
+ return Disable(infFile);
+ }
+ else
+ if (argc == 3 && !lstrcmpi(argv[1], "enable")) {
+ SetTitle(C0C_SETUP_TITLE " (ENABLE)");
+
+ if (!lstrcmpi(argv[2], "all"))
+ return Enable(infFile);
+ }
+ else
if (argc == 2 && !lstrcmpi(argv[1], "preinstall")) {
SetTitle(C0C_SETUP_TITLE " (PREINSTALL)");
|