![]() However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Microsoft support engineers can help explain the functionality of a particular procedure. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. ![]() This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. Microsoft provides programming examples for illustration only, without warranty either expressed or implied. To use this application, follow these steps. The following Win32 console application is an example of an application that cleans the registry. To do this, you must change the DiskClassesToClean definition in the following sample code. Note In some scenarios, you may have to clean the registry not only for the GUID_DEVCLASS_DISKDRIVE and GUID_DEVCLASS_VOLUME disk class GUIDs, but also for the GUID_DEVCLASS_SCSIADAPTER and GUID_DEVCLASS_VOLUMESNAPSHOT disk class GUIDs. When all the devices in the current class have been handled, call the SetupDiDestroyDeviceInfoList function to clean up. ![]() Call the SetupDiCallClassInstaller(DIF_REMOVE, …) function to remove the information from the registry. Optionally, for an absent device, call the CM_Get_Device_ID function to obtain the device instance ID and to display the ID before you remove the information.įor the absent device, use the class information that you obtained in step 1 and the instance information that you obtained in step 2. Determine whether the function status is equal to CR_NO_SUCH_DEVINST or to CR_NO_SUCH_VALUE. The following steps and the code example in step 7 are provided only for informational purposes.Ĭall the SetupDiGetClassDevs function to obtain information for the class that is associated with the GUID.Ĭall the SetupDiEnumDeviceInfo function to obtain instance information for each device in the current class.Ĭall the CM_Get_DevNode_Status function to see whether the current device information represents an absent device. Note We recommend that you use the DevNodeClean utility for this task. To clean the registry for the GUID_DEVCLASS_DISKDRIVE disk class GUID and for the GUID_DEVCLASS_VOLUME disk class GUID, follow these steps. How to build for Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, and Visual Studio 2005 You can do this by using the Microsoft DevNodeClean utility. To resolve this limitation in Plug and Play functionality, you may want to remove device information from the registry when the device is a hard disk drive that is no longer present. For example, because indexes for Plug and Play functionality use four-digit decimal values, a problem may occur when device 10,001 is connected. Not only do these entries occupy space in the registry, these entries may eventually cause operational problems. In this situation, the registry may contain entries for devices that may never appear again. For example, a device might be identified by a serial number or by SCSI pages 0x80 and 0x83. ![]() However, after a storage device is presented by a LUN through a fiber channel or through iSCSI, the device may never be encountered again by the computer. For most devices, this procedure does not pose a problem. When a new device is connected to a computer, Windows records information about the device in the system registry. For example, if backup software is mounting logical unit numbers (LUNs) for backup purposes and then unmounting the LUNs, it would be the responsibility of the backup software to clean up the LUN information from Windows, because the same storage device will no longer be used again by Windows. But the software that establishes the connection typically does know this. This process is necessary because Windows does not know when a storage device is removed temporarily or permanently. It is the responsibility of the software that establishes the connection between the storage device and Windows to properly clean up the information for the device. This article describes how to remove this information from the system registry. Over time, the registry may contain many entries for devices that will never be used again. When a storage device is connected to Windows, even if only briefly, windows creates registry information for the device.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |