Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Runtime.InteropServices;
  4.  
  5. namespace MyDriver
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11.  
  12. if (args.Count() == 0)
  13. {
  14. Console.WriteLine("Please specify filename!");
  15. return;
  16. }
  17.  
  18.  
  19. int result= DriverPackagePreinstall(args[0], 0);
  20.  
  21.  
  22. if (result == 0)
  23. {
  24. Console.WriteLine("Success");
  25. } else {
  26. Console.WriteLine("Error: 0x{0}", result.ToString("X8"));
  27. }
  28.  
  29. }
  30.  
  31. [DllImport("DIFxAPI.dll", CharSet = CharSet.Auto, SetLastError = true)]
  32. public static extern Int32 DriverPackagePreinstall(
  33. [MarshalAs(UnmanagedType.LPTStr)] string DriverPackageInfPath,
  34. Int32 Flags);
  35.  
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement