.
Summary
TODO - a short description
C# Signature:
enum SetupUOInfFlags : uint { NONE = 0x0000, SUOI_FORCEDELETE = 0x0001 };
[DllImport("setupapi.dll", SetLastError = true)]
static extern bool SetupUninstallOEMInf(
string InfFileName,
SetupUOInfFlags Flags,
IntPtr Reserved
);
VB Signature:
Declare Function SetupUninstallOEMInf Lib "setupapi.dll" (TODO) As TODO
User-Defined Types:
None.
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
None.
Tips & Tricks:
Please add some!
Sample Code:
public bool UninstallInfByText(string text)
{
StringBuilder winDir = new StringBuilder(256);
if (0 == GetWindowsDirectory(winDir, winDir.Capacity)) return (false);
string infDir = winDir.ToString() + "\\inf";
string[] infFiles = Directory.GetFiles(infDir, "*.inf");
bool retval = true;
foreach (string infFile in infFiles)
{
string inf = File.ReadAllText(infFile);
if (inf.Contains(textBox1.Text))
{
string infFileName = infFile.Remove(0, infFile.LastIndexOf('\\') + 1);
retval = retval&& (SetupUninstallOEMInf(infFileName, SetupUOInfFlags.SUOI_FORCEDELETE, IntPtr.Zero));
}
}
return (retval);
}
Find the full demo application as part of the WinUSB component: http://AsyncOp.com
Documentation
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).