diff options
author | wpaul <wpaul@FreeBSD.org> | 2005-10-24 05:05:09 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2005-10-24 05:05:09 +0000 |
commit | 34370764e1451f12b13f1388c1ac1c024004908f (patch) | |
tree | 301bcabcf16b61dd8f4fb74511037b5f38d207c8 /sys/compat | |
parent | e13083b2ae1575623467a19ccc6985e60b41b656 (diff) | |
download | FreeBSD-src-34370764e1451f12b13f1388c1ac1c024004908f.zip FreeBSD-src-34370764e1451f12b13f1388c1ac1c024004908f.tar.gz |
Fix handling of message table messages that got broken when I
converted NdisWriteErrorLogEntry() to use the RtlXXX unicode/ansi
conversion routines.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/ndis/subr_ndis.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 8e4d640..03a277b 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -1051,13 +1051,12 @@ NdisWriteErrorLogEntry(ndis_handle adapter, ndis_error_code code, int i, error; char *str = NULL; uint16_t flags; - char msgbuf[ERRMSGLEN]; device_t dev; driver_object *drv; struct ndis_softc *sc; struct ifnet *ifp; unicode_string us; - ansi_string as; + ansi_string as = { 0, 0, NULL }; block = (ndis_miniport_block *)adapter; dev = block->nmb_physdeviceobj->do_devext; @@ -1069,11 +1068,12 @@ NdisWriteErrorLogEntry(ndis_handle adapter, ndis_error_code code, code, &str, &i, &flags); if (error == 0 && flags & MESSAGE_RESOURCE_UNICODE && ifp->if_flags & IFF_DEBUG) { - RtlInitUnicodeString(&us, (uint16_t *)msgbuf); + RtlInitUnicodeString(&us, (uint16_t *)str); if (RtlUnicodeStringToAnsiString(&as, &us, TRUE)) return; str = as.as_buf; - } + } else + str = NULL; device_printf (dev, "NDIS ERROR: %x (%s)\n", code, str == NULL ? "unknown error" : str); @@ -1087,7 +1087,7 @@ NdisWriteErrorLogEntry(ndis_handle adapter, ndis_error_code code, va_end(ap); } - if (str != NULL) + if (as.as_len) RtlFreeAnsiString(&as); return; |