summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/compat/ndis/kern_ndis.c3
-rw-r--r--sys/compat/ndis/subr_ntoskrnl.c4
-rw-r--r--sys/compat/ndis/subr_pe.c6
3 files changed, 10 insertions, 3 deletions
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c
index 589742b..66c3017 100644
--- a/sys/compat/ndis/kern_ndis.c
+++ b/sys/compat/ndis/kern_ndis.c
@@ -1682,7 +1682,8 @@ ndis_unload_driver(arg)
sc = arg;
- free(sc->ndis_block->nmb_rlist, M_DEVBUF);
+ if (sc->ndis_block->nmb_rlist != NULL)
+ free(sc->ndis_block->nmb_rlist, M_DEVBUF);
ndis_flush_sysctls(sc);
diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c
index 4065147..ed6ce41 100644
--- a/sys/compat/ndis/subr_ntoskrnl.c
+++ b/sys/compat/ndis/subr_ntoskrnl.c
@@ -722,7 +722,7 @@ IoAllocateIrp(stsize, chargequota)
IoInitializeIrp(i, IoSizeOfIrp(stsize), stsize);
- return (NULL);
+ return (i);
}
__stdcall static irp *
@@ -2615,6 +2615,8 @@ image_patch_table ntoskrnl_functbl[] = {
IMPORT_FUNC(InterlockedPushEntrySList),
IMPORT_FUNC(ExInterlockedPopEntrySList),
IMPORT_FUNC(ExInterlockedPushEntrySList),
+ IMPORT_FUNC(ExAllocatePoolWithTag),
+ IMPORT_FUNC(ExFreePool),
IMPORT_FUNC(KefAcquireSpinLockAtDpcLevel),
IMPORT_FUNC(KefReleaseSpinLockFromDpcLevel),
IMPORT_FUNC_MAP(KeAcquireSpinLockRaiseToDpc, KfAcquireSpinLock),
diff --git a/sys/compat/ndis/subr_pe.c b/sys/compat/ndis/subr_pe.c
index 5a8d897f..a3f5071 100644
--- a/sys/compat/ndis/subr_pe.c
+++ b/sys/compat/ndis/subr_pe.c
@@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$");
#include <sys/errno.h>
#ifdef _KERNEL
#include <sys/systm.h>
+extern int ndis_strncasecmp(const char *, const char *, size_t);
+#define strncasecmp(a, b, c) ndis_strncasecmp(a, b, c)
#else
#include <stdio.h>
#include <stdlib.h>
@@ -431,6 +433,8 @@ pe_relocate(imgbase)
* may be linked against several modules, typically HAL.dll, ntoskrnl.exe
* and NDIS.SYS. For each module, there is a list of imported function
* names and their addresses.
+ *
+ * Note: module names are case insensitive!
*/
int
@@ -455,7 +459,7 @@ pe_get_import_descriptor(imgbase, desc, module)
while (imp_desc->iid_nameaddr) {
modname = (char *)pe_translate_addr(imgbase,
imp_desc->iid_nameaddr);
- if (!strncmp(module, modname, strlen(module))) {
+ if (!strncasecmp(module, modname, strlen(module))) {
bcopy((char *)imp_desc, (char *)desc,
sizeof(image_import_descriptor));
return(0);
OpenPOWER on IntegriCloud