From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 31544A04C9; Sun, 13 Sep 2020 23:39:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8D2961C01E; Sun, 13 Sep 2020 23:39:15 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id 4CE3B1C012 for ; Sun, 13 Sep 2020 23:39:13 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id w11so11298014lfn.2 for ; Sun, 13 Sep 2020 14:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SbxfRCa3aFoY/ctlUx0ypi3aiMaZclP7GSv39Gy8jZ8=; b=iryn5jDRo3fha7IgIiBVzYpx+0/2VC8RAg679Fht6VRuWKD6JDXYY8DyDRq4A5eEEF Fzowt43EGIX7f+gYIyaZp+KGGLtmmcAqETM/hLTA6BijT58Ddf+etJxnuc2YaToQKfox vFw0YyiMh2o4nMjsdAjfs1I7oNlaritRbt/kFlYsfv0DvjHBxe+x7OclYmcLM4RQ/4Rr ejlM7vD5WIGeBxhGfYPO5bKYnIh4LHKNJGS0Tp8ywz6A4I/vILhXQpJd3LTl4IDqCEHg TZUf1UkhNqbypfguqkr6wJUaGxm4fHnifd8sFULBe0OgziiV9lh9bpZhBDdfs2EIg3Je 8NKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SbxfRCa3aFoY/ctlUx0ypi3aiMaZclP7GSv39Gy8jZ8=; b=NnQBth6a7lFFGo96U07LemVQKelMXaPnhw+XiiP/CM4tqzk27f3BfRfcdCOXC3ksyf J62s+0Bi4bs9Ls8dt/92yCgMGzBG1XEPp/IvBOmTf6IyIa/h/BUv/WI0a3YNnX52EXWL WOhnIiVeuyrlykJEI+Tget0MqKYW3fmhGoP7CdX5whxTivdASLwxM/gjwnNCBmb82zDP y16ojDY6NSZHp8edwdsfuuiEzHe2y6KVBP01kL5+epnLr2BJSkWRFeEWBJy6eYii5oJo 29oFRFvfw1ZYWBWrqftBa71Yyh7C8VddkVHjEVXkx26hW7KRafoCPJOoZBW3THlbt9C2 Bldg== X-Gm-Message-State: AOAM532qGoW8xRUrc+WYQdQBknbqU6gQvojqtnmRKZEYwrEMLRej/TM2 +6qD2VfGq3mqvTuaOo2nrjA= X-Google-Smtp-Source: ABdhPJxuYfMX0GKToBeXkSlQGKa/ak35vC+IEC0CLhNZAbz7Jy/i/kjDV4BNxmwRVytvUVu9nbwMug== X-Received: by 2002:ac2:44a8:: with SMTP id c8mr3523090lfm.430.1600033153151; Sun, 13 Sep 2020 14:39:13 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id 71sm3173144lfb.73.2020.09.13.14.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 14:39:12 -0700 (PDT) Date: Mon, 14 Sep 2020 00:39:11 +0300 From: Dmitry Kozlyuk To: Narcisa Ana Maria Vasile Cc: dev@dpdk.org, thomas@monjalon.net, ocardona@microsoft.com, haramakr@linux.microsoft.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, dmitrym@microsoft.com, Narcisa Vasile , Harini Ramakrishnan Message-ID: <20200914003911.61bc4412@sovereign> In-Reply-To: <20200909185353.GA12124@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1597962235-4787-1-git-send-email-navasile@linux.microsoft.com> <20200824235344.5994cd13@sovereign> <20200909185353.GA12124@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] windows/netuio: add Windows NetUIO kernel driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 9 Sep 2020 11:53:53 -0700, Narcisa Ana Maria Vasile wrote: > On Mon, Aug 24, 2020 at 11:53:44PM +0300, Dmitry Kozlyuk wrote: > > On Thu, 20 Aug 2020 15:23:55 -0700, Narcisa Ana Maria Vasile wrote: [snip] > > > +ClassName = "Windows UIO" > > > +DiskName = "DPDK netUIO Installation Disk" > > > +netuio.DeviceDesc = "netuio Device" > > > +netuio.SVCDESC = "netuio Service" > > > + > > > + // Build symbolic link name as _BDF (bus/device/func) > > > + CHAR symbolic_link[64] = { 0 }; > > > + sprintf_s(symbolic_link, sizeof(symbolic_link), "%s_%04d%02d%02d", > > > + NETUIO_DEVICE_SYMBOLIC_LINK_ANSI, netuio_contextdata->addr.bus_num, > > > + netuio_contextdata->addr.dev_num, netuio_contextdata->addr.func_num); > > > + > > > + ANSI_STRING ansi_symbolic_link; > > > + RtlInitAnsiString(&ansi_symbolic_link, symbolic_link); > > > + > > > + status = RtlAnsiStringToUnicodeString(&netuio_symbolic_link, &ansi_symbolic_link, TRUE); > > > + if (!NT_SUCCESS(status)) > > > + return status; > > > > Why not use Unicode directly? > > > It looks like either way, a cast will be needed (for example, if I use wchar for symbolic_link and then > RtlInitUnicodeString()). I've left it as is, but let me know if there's an elegant solution that I didn't see. It's not that important, really, you can leave the code as-is. FWIW, I meant something like this: DECLARE_UNICODE_STRING_SIZE(symbolic_link_name, NETUIO_MAX_SYMLINK_LEN); RtlUnicodeStringPrintf( symbolic_link_name, NETUIO_DEVICE_SYMBOLIC_LINK_UNICODE, ...); https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntstrsafe/nf-ntstrsafe-rtlunicodestringprintf