ref: 77ea97c6277cc7261e332deec5d48fbddd88821a
parent: 1398c8aed38b0d42e7081410ae1710858d335f7e
author: Simon Howard <[email protected]>
date: Sat Feb 27 13:57:46 EST 2010
When loading driver, pass the full path to the ioperm.sys file. Subversion-branch: /branches/opl-branch Subversion-revision: 1874
--- a/opl/ioperm_sys.c
+++ b/opl/ioperm_sys.c
@@ -93,6 +93,7 @@
int IOperm_InstallDriver(void)
{
+ wchar_t driver_path[MAX_PATH];
int error;
int result = 1;
@@ -106,20 +107,26 @@
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)
{
error = GetLastError();
@@ -228,6 +235,10 @@
error);
result = 0;
+ }
+ else
+ {
+ printf("IOperm_InstallDriver: ioperm driver uninstalled.\n");
}
}