You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

  1. #nullable enable
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace IPA.AntiMalware.WinAPI
  9. {
  10. [Guid("82d29c2e-f062-44e6-b5c9-3d9a2f24a2df")]
  11. [ComVisible(true)]
  12. internal interface IAntimalware
  13. {
  14. void Scan([In] IAmsiStream stream, [Out] out AmsiResult result, [Out] out IAntimalwareProvider provider);
  15. void CloseSession([In] ulong session);
  16. }
  17. [Guid("3e47f2e5-81d4-4d3b-897f-545096770373")]
  18. [ComVisible(true)]
  19. internal interface IAmsiStream
  20. {
  21. unsafe void GetAttribute([In] AmsiAttribute attribute, [In] uint dataSize, [Out] byte* buffer, out uint writtenData);
  22. unsafe void Read([In] ulong position, [In] uint dataSize, [Out] byte* buffer, out uint readSize);
  23. }
  24. [Guid("b2cabfe3-fe04-42b1-a5df-08d483d4d125")]
  25. [ComVisible(true)]
  26. internal interface IAntimalwareProvider
  27. {
  28. [return: MarshalAs(UnmanagedType.LPWStr)] string DisplayName();
  29. AmsiResult Scan([In] IAmsiStream stream);
  30. void CloseSession([In] ulong session);
  31. }
  32. internal enum AmsiAttribute
  33. {
  34. AppName = 0,
  35. ContentName = 1,
  36. ContentSize = 2,
  37. ContentAddress = 3,
  38. Session = 4,
  39. RedirectChainSize = 5,
  40. RedirectChainAddress = 6,
  41. AllSize = 7,
  42. AllAddress = 8,
  43. }
  44. }