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 3162AA04B1; Fri, 14 Aug 2020 01:23:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 547601C12D; Fri, 14 Aug 2020 01:22:54 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id 066781C0D4 for ; Fri, 14 Aug 2020 01:22:45 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1059) id E687220B4920; Thu, 13 Aug 2020 16:22:43 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E687220B4920 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1597360963; bh=aOf8EmcQn/hUQI5C+ip9HjlbSfVaBbC7WRgOSOVlVS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TX3H7oa5THthqxR8V+nqa97TJDfo8AeqZ5HWZH5yrvzZ8BrPXoIvE2R/9FWjAZMmh uOMynMFM1yyGt6NYiYSrF+tbUmzg9BnaWJBvmlnX+C9FRN8ycoNek97lI121P3VDzl /KfFHLFHN5pBcL+DH4eG8cXEjfKTj7IqmcIx8t28= From: Narcisa Ana Maria Vasile To: dev@dpdk.org, thomas@monjalon.net, haramakr@linux.microsoft.com, ocardona@microsoft.com, pallavi.kadam@intel.com, dmitry.kozliuk@gmail.com Cc: ranjit.menon@intel.com, dmitrym@microsoft.com, Harini Ramakrishnan Date: Thu, 13 Aug 2020 16:21:33 -0700 Message-Id: <1597360905-74106-11-git-send-email-navasile@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1597360905-74106-1-git-send-email-navasile@linux.microsoft.com> References: <1597360905-74106-1-git-send-email-navasile@linux.microsoft.com> Subject: [dpdk-dev] [PATCH 10/22] uio: move SDDL string to INF on Windows 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" From: Harini Ramakrishnan --- kernel/windows/netuio/netuio.inf | 7 +++++++ kernel/windows/netuio/netuio_dev.c | 15 +++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/kernel/windows/netuio/netuio.inf b/kernel/windows/netuio/netuio.inf index 0453b371a..b1696cc50 100644 --- a/kernel/windows/netuio/netuio.inf +++ b/kernel/windows/netuio/netuio.inf @@ -62,6 +62,13 @@ CopyFiles=Drivers_Dir [Drivers_Dir] netuio.sys +[netuio_Device.NT.HW] +AddReg=Device.HW.Registry + +[Device.HW.Registry] +; Ensure that only administrators can access our device object. +HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GA;;;BA)" + ;-------------- Service installation [netuio_Device.NT.Services] AddService = netuio,%SPSVCINST_ASSOCSERVICE%, netuio_Service_Inst diff --git a/kernel/windows/netuio/netuio_dev.c b/kernel/windows/netuio/netuio_dev.c index f5d41cb65..a1fe447f7 100644 --- a/kernel/windows/netuio/netuio_dev.c +++ b/kernel/windows/netuio/netuio_dev.c @@ -33,18 +33,13 @@ netuio_create_device(_Inout_ PWDFDEVICE_INIT DeviceInit) PAGED_CODE(); - // Ensure that only administrators can access our device object. - status = WdfDeviceInitAssignSDDLString(DeviceInit, &SDDL_DEVOBJ_SYS_ALL_ADM_ALL); + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, NETUIO_CONTEXT_DATA); - if (NT_SUCCESS(status)) { - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, NETUIO_CONTEXT_DATA); - - // Set the device context cleanup callback. - // This function will be called when the WDF Device Object associated to the current device is destroyed - deviceAttributes.EvtCleanupCallback = netuio_evt_device_context_cleanup; + // Set the device context cleanup callback. + // This function will be called when the WDF Device Object associated to the current device is destroyed + deviceAttributes.EvtCleanupCallback = netuio_evt_device_context_cleanup; - status = WdfDeviceCreate(&DeviceInit, &deviceAttributes, &device); - } + status = WdfDeviceCreate(&DeviceInit, &deviceAttributes, &device); if (NT_SUCCESS(status)) { // Create a device interface so that applications can find and talk to us. -- 2.23.0.vfs.1.1.63.g5a5ad7f