Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Runtime.InteropServices;
- namespace MyDriver
- {
- class Program
- {
- static void Main(string[] args)
- {
- if (args.Count() == 0)
- {
- Console.WriteLine("Please specify filename!");
- return;
- }
- int result= DriverPackagePreinstall(args[0], 0);
- if (result == 0)
- {
- Console.WriteLine("Success");
- } else {
- Console.WriteLine("Error: 0x{0}", result.ToString("X8"));
- }
- }
- [DllImport("DIFxAPI.dll", CharSet = CharSet.Auto, SetLastError = true)]
- public static extern Int32 DriverPackagePreinstall(
- [MarshalAs(UnmanagedType.LPTStr)] string DriverPackageInfPath,
- Int32 Flags);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement