diff --git a/driver/vhci_ude/vhci_plugin.c b/driver/vhci_ude/vhci_plugin.c index 3f1abaac..d9763e9c 100644 --- a/driver/vhci_ude/vhci_plugin.c +++ b/driver/vhci_ude/vhci_plugin.c @@ -262,14 +262,8 @@ vusb_plugin(pctx_vhci_t vhci, pvhci_pluginfo_t pluginfo) vusb = TO_VUSB(ude_usbdev); vusb->vhci = vhci; - if (eptype == UdecxEndpointTypeSimple) { - vusb->is_simple_ep_alloc = TRUE; - create_endpoints(ude_usbdev, pluginfo); - } - else { - vusb->is_simple_ep_alloc = FALSE; - vusb->ep_default = NULL; - } + vusb->ep_default = NULL; + vusb->is_simple_ep_alloc = (eptype == UdecxEndpointTypeSimple) ? TRUE : FALSE; UDECX_USB_DEVICE_PLUG_IN_OPTIONS_INIT(&opts); opts.Usb20PortNumber = pluginfo->port; @@ -279,6 +273,9 @@ vusb_plugin(pctx_vhci_t vhci, pvhci_pluginfo_t pluginfo) return NULL; } + if (vusb->is_simple_ep_alloc) + create_endpoints(ude_usbdev, pluginfo); + status = UdecxUsbDevicePlugIn(ude_usbdev, &opts); if (NT_ERROR(status)) { TRE(PLUGIN, "failed to plugin a new device %!STATUS!", status);