Very nice! I vaguely remembered something in SetupApi that did that. Glad
to know that it works for you!
Unfortunately, I’m still not convinced that I should even dare fooling with
that. Sounds like risky territory 
Mat
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of PaoloC
Sent: Monday, September 20, 2004 3:23 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Uninstall for good
To remove the OEM_XXX.INF I use something like this:
HKEY hKey = SetupDiOpenDevRegKey(
DeviceInfoSet, // IN HDEVINFO DeviceInfoSet,
&DeviceInfoData, // IN PSP_DEVINFO_DATA DeviceInfoData,
DICS_FLAG_GLOBAL, // IN DWORD Scope,
0, // IN DWORD HwProfile,
DIREG_DRV, // IN DWORD KeyType,
KEY_QUERY_VALUE); // IN REGSAM samDesired
RegQueryValueEx(
hKey, // HKEY hKey,
TEXT(“InfPath”), // LPCTSTR lpValueName,
NULL, // LPDWORD lpReserved,
&dwType, // LPDWORD lpType,
(LPBYTE)szInfPath, // LPBYTE lpData,
&dwSize); // LPDWORD lpcbData
TCHAR szInfFullPath[MAX_PATH];
int iLen = wsprintf( szInfFullPath, TEXT(“%s\Inf\%s”), _tgetenv(
TEXT(“WINDIR”) ), szInfPath );
if (!DeleteFile( szInfFullPath ) && GetLastError() != ERROR_FILE_NOT_FOUND)
DisplayError(TEXT(“DeleteFile .INF”));
PaoloC
----- Original Message -----
From: “Mathieu Routhier”
To: “Windows System Software Devs Interest List”
Sent: Monday, September 20, 2004 9:01 PM
Subject: [ntdev] Uninstall for good
> Most companies will want to ship a driver with a nice installation wizard.
> It is easy from there to do the installation job in one step, by calling
> UpdateDriverForPlugAndPlayDevices().
>
> Why is there no symmetrical function for uninstalling a driver?
>
> In the uninstaller for my driver, I’d like not only to remove the device
> from the device manager but also to remove all files that have been
created
> during the installation. Unfortunately, this is a difficult thing to do,
if
> at all possible, because one would need to remove the driver file (ok,
let’s
> reasonably assume it was copied into system32\drivers) but also the INF
> which has been renamed as OEM_XXX.INF. I’m not even referring to the
> various registry keys that are created.
>
> How should one proceed to completely remove the footprint of a driver, or
at
> least the files it created, when uninstalling? I’m working on a virtual
> device driver and it makes a lot of sense to uninstall it when
uninstalling
> the associated application.
>
> Mat
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@tin.it
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@encentrus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com