From: Rolf K. <lab...@us...> - 2004-06-10 22:49:18
|
Update of /cvsroot/opengtoolkit/portIO/c_source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9816/c_source Modified Files: ogportiodll.c ogportiodll.h Log Message: Created an additional VI to install the driver specifically and added a short documentation of the user VIs in form of a html file to the built tree. Changed the DLL to allow to select to install the driver with system autostart enabled. Index: ogportiodll.c =================================================================== RCS file: /cvsroot/opengtoolkit/portIO/c_source/ogportiodll.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ogportiodll.c 10 Mar 2004 12:42:32 -0000 1.2 --- ogportiodll.c 10 Jun 2004 22:49:09 -0000 1.3 *************** *** 33,37 **** #endif ! static DWORD InstallPortIODriver(SC_HANDLE hSCManager); --- 33,37 ---- #endif ! static DWORD InstallPortIODriver(SC_HANDLE hSCManager, BOOL autostart); *************** *** 58,62 **** } ! DWORD LibAPI StartPortIODriver(void) { SC_HANDLE hSCManager; --- 58,62 ---- } ! DWORD LibAPI StartPortIODriver(BOOL autostart) { SC_HANDLE hSCManager; *************** *** 94,98 **** return err; case ERROR_SERVICE_DOES_NOT_EXIST: ! err = InstallPortIODriver(hSCManager); if (err) return err; --- 94,98 ---- return err; case ERROR_SERVICE_DOES_NOT_EXIST: ! err = InstallPortIODriver(hSCManager, autostart); if (err) return err; *************** *** 103,109 **** /* Start the PortIO driver. Errors will occur here if OGPortIO.sys file doesn't exist */ ! ret = StartService (hService, /* service identifier */ ! 0, /* number of arguments */ ! NULL); /* pointer to arguments */ if (!ret) --- 103,109 ---- /* Start the PortIO driver. Errors will occur here if OGPortIO.sys file doesn't exist */ ! ret = StartService(hService, /* service identifier */ ! 0, /* number of arguments */ ! NULL); /* pointer to arguments */ if (!ret) *************** *** 122,126 **** } ! static DWORD InstallPortIODriver(SC_HANDLE hSCManager) { SC_HANDLE hService; --- 122,126 ---- } ! static DWORD InstallPortIODriver(SC_HANDLE hSCManager, BOOL autostart) { SC_HANDLE hService; *************** *** 166,171 **** SERVICE_ALL_ACCESS, /* desired access */ SERVICE_KERNEL_DRIVER, /* service type */ ! SERVICE_DEMAND_START, /* start type */ ! SERVICE_ERROR_NORMAL, /* error control type */ "System32\\Drivers\\OGPortIO.sys", /* service's binary */ NULL, /* no load ordering group */ --- 166,173 ---- SERVICE_ALL_ACCESS, /* desired access */ SERVICE_KERNEL_DRIVER, /* service type */ ! autostart ? ! SERVICE_SYSTEM_START : /* start type */ ! SERVICE_DEMAND_START, /* start type */ ! SERVICE_ERROR_IGNORE, /* error control type */ "System32\\Drivers\\OGPortIO.sys", /* service's binary */ NULL, /* no load ordering group */ *************** *** 238,242 **** } ! DWORD LibAPI PortIOOpen(void) { DWORD err = ERROR_SUCCESS; --- 240,244 ---- } ! DWORD LibAPI PortIOOpen(BOOL autostart) { DWORD err = ERROR_SUCCESS; *************** *** 253,257 **** { /* Start or install the Driver */ ! err = StartPortIODriver(); if (!err) { --- 255,259 ---- { /* Start or install the Driver */ ! err = StartPortIODriver(autostart); if (!err) { *************** *** 292,296 **** if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(); if (err) return err; } --- 294,298 ---- if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(FALSE); if (err) return err; } *************** *** 327,331 **** if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(); if (err) return err; } --- 329,333 ---- if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(FALSE); if (err) return err; } *************** *** 383,387 **** if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(); if (err) return err; } --- 385,389 ---- if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(FALSE); if (err) return err; } *************** *** 435,439 **** if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(); if (err) return err; } --- 437,441 ---- if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(FALSE); if (err) return err; } *************** *** 488,492 **** if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(); if (err) return err; } --- 490,494 ---- if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(FALSE); if (err) return err; } *************** *** 540,544 **** if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(); if (err) return err; } --- 542,546 ---- if (hDevice == INVALID_HANDLE_VALUE) { ! err = PortIOOpen(FALSE); if (err) return err; } Index: ogportiodll.h =================================================================== RCS file: /cvsroot/opengtoolkit/portIO/c_source/ogportiodll.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ogportiodll.h 10 Mar 2004 12:42:32 -0000 1.2 --- ogportiodll.h 10 Jun 2004 22:49:10 -0000 1.3 *************** *** 29,36 **** ! DWORD LibAPI StartPortIODriver(void); DWORD LibAPI RemovePortIO(void); ! DWORD LibAPI PortIOOpen(void); DWORD LibAPI PortIOClose(void); DWORD LibAPI PortIOGetVersion(unsigned long *version); --- 29,36 ---- ! DWORD LibAPI StartPortIODriver(BOOL autostart); DWORD LibAPI RemovePortIO(void); ! DWORD LibAPI PortIOOpen(BOOL autostart); DWORD LibAPI PortIOClose(void); DWORD LibAPI PortIOGetVersion(unsigned long *version); |