| 1169 | |
| 1170 | @staticmethod |
| 1171 | def _add_source_to_registry(appname, dllname, logtype): |
| 1172 | import winreg |
| 1173 | |
| 1174 | key_path = f"SYSTEM\\CurrentControlSet\\Services\\EventLog\\{logtype}\\{appname}" |
| 1175 | |
| 1176 | with winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, key_path) as key: |
| 1177 | if dllname: |
| 1178 | winreg.SetValueEx(key, "EventMessageFile", 0, winreg.REG_EXPAND_SZ, dllname) |
| 1179 | winreg.SetValueEx(key, "TypesSupported", 0, winreg.REG_DWORD, 7) # All types are supported |
| 1180 | |
| 1181 | def getMessageID(self, record): |
| 1182 | """ |