From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: ray.ni@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Fri, 14 Jun 2019 01:23:49 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jun 2019 01:23:48 -0700 X-ExtLoop1: 1 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.16]) by fmsmga006.fm.intel.com with ESMTP; 14 Jun 2019 01:23:47 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Zhiguang Liu , Hao A Wu Subject: [PATCH] EmulatorPkg/Win: support running multiple WinHost.exe Date: Fri, 14 Jun 2019 16:23:27 +0800 Message-Id: <20190614082327.80128-1-ray.ni@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When running 2nd instance of WinHost.exe, below error is printed: ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd... The root cause is "RECOVERY.FD" is exclusively opened by the first instance of WinHost.exe. The patch changes to open "RECOVERY.FD" in shared way so that 2nd+ instance of WinHost.exe can still run successfully. Signed-off-by: Ray Ni Signed-off-by: Ray Ni Cc: Jordan Justen Cc: Andrew Fish Cc: Zhiguang Liu Cc: Hao A Wu --- EmulatorPkg/Win/Host/WinHost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHost.c index bd7662683a..5a354d084e 100644 --- a/EmulatorPkg/Win/Host/WinHost.c +++ b/EmulatorPkg/Win/Host/WinHost.c @@ -269,7 +269,7 @@ Returns: NtFileHandle = CreateFile ( FileName, GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE, - FILE_SHARE_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CreationDisposition, FILE_ATTRIBUTE_NORMAL, -- 2.21.0.windows.1