English 中文(简体)
完全删除Windows XP的司机档案
原标题:Complete removal of the driver files in Windows XP

I m 开发一个涉及安装某些项目专用硬件装置的申请。 在安装申请时,Im利用difxAPI将司机的卷宗推到司机仓库。 但是,在使用二恶英进行洗劫之后,在《香港法》的窗口登记处仍有一些参考资料。 这些装置的出现往往是一个问题,因为设备已经列出并显示其进入设备管理员的COM港科。 这是我用来抓捕司机:

DriverPackageUninstall(infName, DRIVER_PACKAGE_DELETE_FILES, ptrInstallerInfo, out fNeedReboot);

我再次想从方案上清除这些登记条目,因为我理解,我应当为获取特定钥匙设定准入许可。 这是我做的:

    RegistryAccessRule regAccess = new RegistryAccessRule("Everyone", RegistryRights.FullControl, AccessControlType.Allow);
    RegistrySecurity regSecurity = new RegistrySecurity();
    regSecurity.AddAccessRule(regAccess);                        
    Registry.LocalMachine.OpenSubKey(@"SYSTEMCurrentControlSetEnumUSB", true).SetAccessControl(regSecurity);

但是,这部法典正在提出一个例外,因为它不允许我以方案方式控制出入。 在一个Windows XP机器中,能够自行确定登记处编辑的许可。 在XP中,我是否能够以高效的方式彻底清除司机档案?

问题回答

它奇怪。 DifxAPI应当删除(a) 司机包裹,(b) 安装的驾驶员。 您是否相信这些旧装置(载于/code>)正在使用你重新拆除的驱动器,或可能是其旧版本。 INF文档或内容?

基本上,虽然Microsoft不希望你与Enum和不断变化的ACL。 因此,他们请你通过Windows DDK(见devcon 样本)查到并清除装置。

I ve lately wrote code to do just that: all my devices share the same custom device class so they were easy to enumerate, and then I blindly removed them following the code from devcon.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签