[NDISUIO]
authorCameron Gutman <aicommander@gmail.com>
Sun, 8 Jan 2012 06:23:53 +0000 (06:23 +0000)
committerCameron Gutman <aicommander@gmail.com>
Sun, 8 Jan 2012 06:23:53 +0000 (06:23 +0000)
- Fix incorrect device name offset

svn path=/branches/wlan-bringup/; revision=54876

drivers/network/ndisuio/ioctl.c

index 0ac2674..c76c5e9 100644 (file)
@@ -62,13 +62,12 @@ QueryBinding(PIRP Irp, PIO_STACK_LOCATION IrpSp)
             BytesCopied = sizeof(NDISUIO_QUERY_BINDING);
             if (AdapterContext->DeviceName.Length <= BindingLength - BytesCopied)
             {
-                BytesCopied += AdapterContext->DeviceName.Length;
-
                 QueryBinding->DeviceNameOffset = BytesCopied;
                 QueryBinding->DeviceNameLength = AdapterContext->DeviceName.Length;
                 RtlCopyMemory((PUCHAR)QueryBinding + QueryBinding->DeviceNameOffset,
                               AdapterContext->DeviceName.Buffer,
                               QueryBinding->DeviceNameLength);
+                BytesCopied += AdapterContext->DeviceName.Length;
 
                 /* FIXME: Copy description too */
                 QueryBinding->DeviceDescrOffset = BytesCopied;