diff options
author | wpaul <wpaul@FreeBSD.org> | 2005-02-24 17:58:27 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2005-02-24 17:58:27 +0000 |
commit | 6e74cf6e34565f42c3fe52a8caf126f7048941d4 (patch) | |
tree | 3ee1480dc3222ce58578974d3aa8308bbe7bae95 /sys/compat/ndis/subr_pe.c | |
parent | 6b720fc020784b0af1438e87abde56f5ff37ae79 (diff) | |
download | FreeBSD-src-6e74cf6e34565f42c3fe52a8caf126f7048941d4.zip FreeBSD-src-6e74cf6e34565f42c3fe52a8caf126f7048941d4.tar.gz |
Couple of lessons learned during USB driver testing:
- In kern_ndis.c:ndis_unload_driver(), test that ndis_block->nmb_rlist
is not NULL before trying to free() it.
- In subr_pe.c:pe_get_import_descriptor(), do a case-insensitive
match on the import module name. Most drivers I have encountered
link against "ntoskrnl.exe" but the ASIX USB ethernet driver I'm
testing with wants "NTOSKRNL.EXE."
- In subr_ntoskrnl.c:IoAllocateIrp(), return a pointer to the IRP
instead of NULL. (Stub code leftover.)
- Also in subr_ntoskrnl.c, add ExAllocatePoolWithTag() and ExFreePool()
to the function table list so they'll get exported to drivers properly.
Diffstat (limited to 'sys/compat/ndis/subr_pe.c')
-rw-r--r-- | sys/compat/ndis/subr_pe.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |