We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Windows Store apps: use app title as product name instead of wwahost
**Reported by nvdakor on 2014-07-07 13:10**
Hi,
Currently, when invoking appModule.productName for a Windows Store app, NVDA says "Windows operating system". Although this is fine for built-in apps such as Bing Weather and Windows Store, this may confuse users and developers when they are testing accessibility of Store apps (both existing ones and apps to be created in the future). As a way of providing actual product name for debugging purposes and for people to tell us which app they are having issues with, I propose using app title for productName.
Before:
1. Go to Windows Store app such as Weather.
2. Once the app opens, press NVDA+F1 to show developer info. Look under appModule.productName.
After:
1. Open any Windows Store app.
2. Press NVDA+F1 to open developer info. appModule.productName tells you the title of the app.
Implementation:
1. In appModules.wwahost.py, override _get_productName to return the title (api.getForegroundObject().name).
2. wwahost.AppModule.productName will contain the actual title of the app.
Thanks.

**Blocked by #4569**

Load specific app modules for apps hosted by wwahost.exe
**Reported by jteh on 2014-10-23 07:35**
wwahost.exe hosts many Windows Store apps (though it seems some do have their own executables). To allow for application specific customisation, we should identify the specific application in the app module name.

I think we can use GetApplicationUserModelId (in kernel32) for this purpose. This includes a "!" character, so we'll need to check whether Python will cope with this and replace if not.
**Blocked by #4360**
**Blocking #4259**


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `source/appModules/wwahost.py`
Content:
```
1 #A part of NonVisual Desktop Access (NVDA)
2 #This file is covered by the GNU General Public License.
3 #See the file COPYING for more details.
4 #Copyright (C) 2012 NV Access Limited
5 
6 from comtypes import COMError
7 import IAccessibleHandler
8 from NVDAObjects.IAccessible.MSHTML import Body
9 import appModuleHandler
10 import controlTypes
11 import winUser
12 
13 class AppModule(appModuleHandler.AppModule):
14 
15 	def event_NVDAObject_init(self,obj):
16 		#The root document of HTML Metro Apps must be treeted as an application. 
17 		if isinstance(obj,Body) and obj.windowClassName=="Internet Explorer_Server":
18 			try:
19 				paccParent=obj.IAccessibleObject.accParent.accParent
20 				identity=IAccessibleHandler.getIAccIdentity(paccParent,0)
21 			except (COMError,AttributeError):
22 				identity=None
23 			if identity:
24 				windowHandle=identity.get('windowHandle')
25 				if windowHandle and winUser.getClassName(windowHandle)=="Web Platform Embedding":
26 					obj.role=controlTypes.ROLE_APPLICATION
27
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/source/appModules/wwahost.py b/source/appModules/wwahost.py
--- a/source/appModules/wwahost.py
+++ b/source/appModules/wwahost.py
@@ -1,26 +1,40 @@
-#A part of NonVisual Desktop Access (NVDA)
-#This file is covered by the GNU General Public License.
-#See the file COPYING for more details.
-#Copyright (C) 2012 NV Access Limited
+# A part of NonVisual Desktop Access (NVDA)
+# This file is covered by the GNU General Public License.
+# See the file COPYING for more details.
+# Copyright (C) 2012-2020 NV Access Limited, Joseph Lee
 
-from comtypes import COMError
-import IAccessibleHandler
-from NVDAObjects.IAccessible.MSHTML import Body
+"""App module host for Windows 8.x and 10 apps hosted by wwahost.exe.
+In Windows 8, apps written in Javascript are executed inside WWAHost, including some WinRT apps.
+In Windows 10, progressive web apps (PWA) and friends are hosted inside this process.
+App modules wishing to support apps hosted inside this process must subclass the AppModule class.
+"""
+
+import ctypes
 import appModuleHandler
-import controlTypes
-import winUser
+import winKernel
+
+
+def getAppNameFromHost(processId):
+	# Some apps that come with Windows 8 and 8.1 are hosted by wwahost.exe.
+	# App modules for these are named after the hosted app name.
+	processHandle = winKernel.openProcess(
+		winKernel.SYNCHRONIZE | winKernel.PROCESS_QUERY_INFORMATION, False, processId
+	)
+	length = ctypes.c_uint()
+	winKernel.kernel32.GetApplicationUserModelId(processHandle, ctypes.byref(length), None)
+	appModel = ctypes.create_unicode_buffer(length.value)
+	winKernel.kernel32.GetApplicationUserModelId(processHandle, ctypes.byref(length), appModel)
+	winKernel.closeHandle(processHandle)
+	# Sometimes app model might be empty, so raise errors and fall back to wwahost.
+	if not appModel.value:
+		raise LookupError
+	# App model is shown as familyName!appName,
+	# and importing files with the exclamation point in the middle of the name isn't supported.
+	# Therefore return only the app name portion.
+	# Convert this into lowercase to make the file name consistent with other NVDA app modules.
+	return appModel.value.split("!")[-1].lower()
 
 class AppModule(appModuleHandler.AppModule):
 
-	def event_NVDAObject_init(self,obj):
-		#The root document of HTML Metro Apps must be treeted as an application. 
-		if isinstance(obj,Body) and obj.windowClassName=="Internet Explorer_Server":
-			try:
-				paccParent=obj.IAccessibleObject.accParent.accParent
-				identity=IAccessibleHandler.getIAccIdentity(paccParent,0)
-			except (COMError,AttributeError):
-				identity=None
-			if identity:
-				windowHandle=identity.get('windowHandle')
-				if windowHandle and winUser.getClassName(windowHandle)=="Web Platform Embedding":
-					obj.role=controlTypes.ROLE_APPLICATION
+	# WWAHost app content is treated as part of an app, not a browse mode document.
+	disableBrowseModeByDefault = True

{"golden_diff": "diff --git a/source/appModules/wwahost.py b/source/appModules/wwahost.py\n--- a/source/appModules/wwahost.py\n+++ b/source/appModules/wwahost.py\n@@ -1,26 +1,40 @@\n-#A part of NonVisual Desktop Access (NVDA)\r\n-#This file is covered by the GNU General Public License.\r\n-#See the file COPYING for more details.\r\n-#Copyright (C) 2012 NV Access Limited\r\n+# A part of NonVisual Desktop Access (NVDA)\r\n+# This file is covered by the GNU General Public License.\r\n+# See the file COPYING for more details.\r\n+# Copyright (C) 2012-2020 NV Access Limited, Joseph Lee\r\n \r\n-from comtypes import COMError\r\n-import IAccessibleHandler\r\n-from NVDAObjects.IAccessible.MSHTML import Body\r\n+\"\"\"App module host for Windows 8.x and 10 apps hosted by wwahost.exe.\r\n+In Windows 8, apps written in Javascript are executed inside WWAHost, including some WinRT apps.\r\n+In Windows 10, progressive web apps (PWA) and friends are hosted inside this process.\r\n+App modules wishing to support apps hosted inside this process must subclass the AppModule class.\r\n+\"\"\"\r\n+\r\n+import ctypes\r\n import appModuleHandler\r\n-import controlTypes\r\n-import winUser\r\n+import winKernel\r\n+\r\n+\r\n+def getAppNameFromHost(processId):\r\n+\t# Some apps that come with Windows 8 and 8.1 are hosted by wwahost.exe.\r\n+\t# App modules for these are named after the hosted app name.\r\n+\tprocessHandle = winKernel.openProcess(\r\n+\t\twinKernel.SYNCHRONIZE | winKernel.PROCESS_QUERY_INFORMATION, False, processId\r\n+\t)\r\n+\tlength = ctypes.c_uint()\r\n+\twinKernel.kernel32.GetApplicationUserModelId(processHandle, ctypes.byref(length), None)\r\n+\tappModel = ctypes.create_unicode_buffer(length.value)\r\n+\twinKernel.kernel32.GetApplicationUserModelId(processHandle, ctypes.byref(length), appModel)\r\n+\twinKernel.closeHandle(processHandle)\r\n+\t# Sometimes app model might be empty, so raise errors and fall back to wwahost.\r\n+\tif not appModel.value:\r\n+\t\traise LookupError\r\n+\t# App model is shown as familyName!appName,\r\n+\t# and importing files with the exclamation point in the middle of the name isn't supported.\r\n+\t# Therefore return only the app name portion.\r\n+\t# Convert this into lowercase to make the file name consistent with other NVDA app modules.\r\n+\treturn appModel.value.split(\"!\")[-1].lower()\r\n \r\n class AppModule(appModuleHandler.AppModule):\r\n \r\n-\tdef event_NVDAObject_init(self,obj):\r\n-\t\t#The root document of HTML Metro Apps must be treeted as an application. \r\n-\t\tif isinstance(obj,Body) and obj.windowClassName==\"Internet Explorer_Server\":\r\n-\t\t\ttry:\r\n-\t\t\t\tpaccParent=obj.IAccessibleObject.accParent.accParent\r\n-\t\t\t\tidentity=IAccessibleHandler.getIAccIdentity(paccParent,0)\r\n-\t\t\texcept (COMError,AttributeError):\r\n-\t\t\t\tidentity=None\r\n-\t\t\tif identity:\r\n-\t\t\t\twindowHandle=identity.get('windowHandle')\r\n-\t\t\t\tif windowHandle and winUser.getClassName(windowHandle)==\"Web Platform Embedding\":\r\n-\t\t\t\t\tobj.role=controlTypes.ROLE_APPLICATION\r\n+\t# WWAHost app content is treated as part of an app, not a browse mode document.\r\n+\tdisableBrowseModeByDefault = True\n", "issue": "Windows Store apps: use app title as product name instead of wwahost\n**Reported by nvdakor on 2014-07-07 13:10**\nHi,\nCurrently, when invoking appModule.productName for a Windows Store app, NVDA says \"Windows operating system\". Although this is fine for built-in apps such as Bing Weather and Windows Store, this may confuse users and developers when they are testing accessibility of Store apps (both existing ones and apps to be created in the future). As a way of providing actual product name for debugging purposes and for people to tell us which app they are having issues with, I propose using app title for productName.\nBefore:\n1. Go to Windows Store app such as Weather.\n2. Once the app opens, press NVDA+F1 to show developer info. Look under appModule.productName.\nAfter:\n1. Open any Windows Store app.\n2. Press NVDA+F1 to open developer info. appModule.productName tells you the title of the app.\nImplementation:\n1. In appModules.wwahost.py, override _get_productName to return the title (api.getForegroundObject().name).\n2. wwahost.AppModule.productName will contain the actual title of the app.\nThanks.\n\n**Blocked by #4569**\n\nLoad specific app modules for apps hosted by wwahost.exe\n**Reported by jteh on 2014-10-23 07:35**\nwwahost.exe hosts many Windows Store apps (though it seems some do have their own executables). To allow for application specific customisation, we should identify the specific application in the app module name.\n\nI think we can use GetApplicationUserModelId (in kernel32) for this purpose. This includes a \"!\" character, so we'll need to check whether Python will cope with this and replace if not.\n**Blocked by #4360**\n**Blocking #4259**\n\n", "before_files": [{"content": "#A part of NonVisual Desktop Access (NVDA)\r\n#This file is covered by the GNU General Public License.\r\n#See the file COPYING for more details.\r\n#Copyright (C) 2012 NV Access Limited\r\n\r\nfrom comtypes import COMError\r\nimport IAccessibleHandler\r\nfrom NVDAObjects.IAccessible.MSHTML import Body\r\nimport appModuleHandler\r\nimport controlTypes\r\nimport winUser\r\n\r\nclass AppModule(appModuleHandler.AppModule):\r\n\r\n\tdef event_NVDAObject_init(self,obj):\r\n\t\t#The root document of HTML Metro Apps must be treeted as an application. \r\n\t\tif isinstance(obj,Body) and obj.windowClassName==\"Internet Explorer_Server\":\r\n\t\t\ttry:\r\n\t\t\t\tpaccParent=obj.IAccessibleObject.accParent.accParent\r\n\t\t\t\tidentity=IAccessibleHandler.getIAccIdentity(paccParent,0)\r\n\t\t\texcept (COMError,AttributeError):\r\n\t\t\t\tidentity=None\r\n\t\t\tif identity:\r\n\t\t\t\twindowHandle=identity.get('windowHandle')\r\n\t\t\t\tif windowHandle and winUser.getClassName(windowHandle)==\"Web Platform Embedding\":\r\n\t\t\t\t\tobj.role=controlTypes.ROLE_APPLICATION\r\n", "path": "source/appModules/wwahost.py"}], "after_files": [{"content": "# A part of NonVisual Desktop Access (NVDA)\r\n# This file is covered by the GNU General Public License.\r\n# See the file COPYING for more details.\r\n# Copyright (C) 2012-2020 NV Access Limited, Joseph Lee\r\n\r\n\"\"\"App module host for Windows 8.x and 10 apps hosted by wwahost.exe.\r\nIn Windows 8, apps written in Javascript are executed inside WWAHost, including some WinRT apps.\r\nIn Windows 10, progressive web apps (PWA) and friends are hosted inside this process.\r\nApp modules wishing to support apps hosted inside this process must subclass the AppModule class.\r\n\"\"\"\r\n\r\nimport ctypes\r\nimport appModuleHandler\r\nimport winKernel\r\n\r\n\r\ndef getAppNameFromHost(processId):\r\n\t# Some apps that come with Windows 8 and 8.1 are hosted by wwahost.exe.\r\n\t# App modules for these are named after the hosted app name.\r\n\tprocessHandle = winKernel.openProcess(\r\n\t\twinKernel.SYNCHRONIZE | winKernel.PROCESS_QUERY_INFORMATION, False, processId\r\n\t)\r\n\tlength = ctypes.c_uint()\r\n\twinKernel.kernel32.GetApplicationUserModelId(processHandle, ctypes.byref(length), None)\r\n\tappModel = ctypes.create_unicode_buffer(length.value)\r\n\twinKernel.kernel32.GetApplicationUserModelId(processHandle, ctypes.byref(length), appModel)\r\n\twinKernel.closeHandle(processHandle)\r\n\t# Sometimes app model might be empty, so raise errors and fall back to wwahost.\r\n\tif not appModel.value:\r\n\t\traise LookupError\r\n\t# App model is shown as familyName!appName,\r\n\t# and importing files with the exclamation point in the middle of the name isn't supported.\r\n\t# Therefore return only the app name portion.\r\n\t# Convert this into lowercase to make the file name consistent with other NVDA app modules.\r\n\treturn appModel.value.split(\"!\")[-1].lower()\r\n\r\nclass AppModule(appModuleHandler.AppModule):\r\n\r\n\t# WWAHost app content is treated as part of an app, not a browse mode document.\r\n\tdisableBrowseModeByDefault = True\r\n", "path": "source/appModules/wwahost.py"}]}