summaryrefslogtreecommitdiff
path: root/opl
diff options
context:
space:
mode:
authorSimon Howard2010-02-27 18:57:46 +0000
committerSimon Howard2010-02-27 18:57:46 +0000
commit77ea97c6277cc7261e332deec5d48fbddd88821a (patch)
treeae9160893f177c09dfd0b130af341e7716146797 /opl
parent1398c8aed38b0d42e7081410ae1710858d335f7e (diff)
downloadchocolate-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
Diffstat (limited to 'opl')
-rw-r--r--opl/ioperm_sys.c37
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.