diff options
author | Simon Howard | 2010-02-27 18:57:46 +0000 |
---|---|---|
committer | Simon Howard | 2010-02-27 18:57:46 +0000 |
commit | 77ea97c6277cc7261e332deec5d48fbddd88821a (patch) | |
tree | ae9160893f177c09dfd0b130af341e7716146797 | |
parent | 1398c8aed38b0d42e7081410ae1710858d335f7e (diff) | |
download | chocolate-doom-77ea97c6277cc7261e332deec5d48fbddd88821a.tar.gz chocolate-doom-77ea97c6277cc7261e332deec5d48fbddd88821a.tar.bz2 chocolate-doom-77ea97c6277cc7261e332deec5d48fbddd88821a.zip |
When loading driver, pass the full path to the ioperm.sys file.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1874
-rw-r--r-- | opl/ioperm_sys.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/opl/ioperm_sys.c b/opl/ioperm_sys.c index 37512b63..4c06d97a 100644 --- a/opl/ioperm_sys.c +++ b/opl/ioperm_sys.c @@ -93,6 +93,7 @@ int IOperm_EnablePortRange(unsigned int from, unsigned int num, int turn_on) int IOperm_InstallDriver(void) { + wchar_t driver_path[MAX_PATH]; int error; int result = 1; @@ -106,19 +107,25 @@ int IOperm_InstallDriver(void) return 0; } - svc = CreateService(scm, - TEXT("ioperm"), - TEXT("I/O port access driver"), - SERVICE_ALL_ACCESS, - SERVICE_KERNEL_DRIVER, - SERVICE_AUTO_START, - SERVICE_ERROR_NORMAL, - "ioperm.sys", - NULL, - NULL, - NULL, - NULL, - NULL); + // Get the full path to the driver file. + + GetFullPathNameW(L"ioperm.sys", MAX_PATH, driver_path, NULL); + + // Create the service. + + svc = CreateServiceW(scm, + L"ioperm", + L"ioperm support for Cygwin driver", + SERVICE_ALL_ACCESS, + SERVICE_KERNEL_DRIVER, + SERVICE_AUTO_START, + SERVICE_ERROR_NORMAL, + driver_path, + NULL, + NULL, + NULL, + NULL, + NULL); if (svc == NULL) { @@ -229,6 +236,10 @@ int IOperm_UninstallDriver(void) result = 0; } + else + { + printf("IOperm_InstallDriver: ioperm driver uninstalled.\n"); + } } // Close handles. |