Bug 1525152 - Use correct dll name for GetProcessImageFileName; r=ahal

This code is infrequently used, but has always failed because it references
the wrong dll name - corrected here.

Differential Revision: https://phabricator.services.mozilla.com/D118215
This commit is contained in:
Geoff Brown 2021-06-22 20:51:26 +00:00
Родитель 56e7baaf05
Коммит a9987ae72c
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -418,14 +418,14 @@ if mozinfo.isWin:
# actually Firefox.
namesize = 1024
pName = ctypes.create_string_buffer(namesize)
namelen = ctypes.windll.kernel32.GetProcessImageFileNameA(
namelen = ctypes.windll.psapi.GetProcessImageFileNameA(
pHandle, pName, namesize
)
if namelen == 0:
# Still an active process, so conservatively assume it's Firefox.
return True
return pName.value.endswith(("firefox.exe", "plugin-container.exe"))
return pName.value.endswith((b"firefox.exe", b"plugin-container.exe"))
finally:
ctypes.windll.kernel32.CloseHandle(pHandle)