Method and apparatus for releasing handle and file deleting system
A file deletion and release device technology, applied in the computer field, can solve problems such as error exit, process error exit, etc.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0035] This embodiment provides a method for releasing a handle, which can correctly and safely release the handle so that the corresponding file can be deleted. Such as figure 1 As shown, the specific method of releasing the handle includes the following steps:
[0036] 101. From the above analysis, it can be seen that the file corresponding to the handle information required to be released is being called by the process. In order to release the handle of the file, that is, the handle to be released, first obtain the name information and handle information corresponding to the file called by the process.
[0037] 102. Determine whether the obtained name information is the same as the name information of the file corresponding to the handle to be released. If the name information is the same, it means that the handle information corresponding to the file called by the process requires to be released, and then execute step 103; otherwise, it means The handle information corres...
Embodiment 2
[0044] The following takes the file called by the process as an example of a module loaded by the system to specifically describe the method for releasing the handle provided by the embodiment of the present invention, such as figure 2 As shown, the method includes the following steps:
[0045] 201, after obtaining the process number in the system, open the process and set up a snapshot for the process, this step can be completed by the interface function CreateToolhelp32Snapshot (establishing the image of the specified process in the system) provided by the system, CreateToolhelp32Snapshot will be in the system for A process creates a snapshot, which includes all modules and thread information of the process.
[0046] 202. Use the function Module32First (the module at the beginning of the process) provided by the system to search for information about the first module in the snapshot.
[0047] 203. Acquire name information and handle information in the information of the fi...
Embodiment 3
[0059] Taking the file called by the process as an application file as an example, the method for releasing the handle provided by the embodiment of the present invention is described in detail below, as image 3 As shown, the method includes the following steps:
[0060] 301. Directly obtain all application files called by all application processes currently running. Since the process calling the application file is a general application process, it can complete multi-process and multi-thread operations through specific functions: first use the ZwQuerySystemInformation (obtain different system information types) function to enumerate the handles of all open files, and then use An undisclosed function ZwQueryInformationFile (to obtain different information types of file objects), through the SYSTEM_INFORMATION_CLASS (system information enumeration type) structure, completes multi-process and thread operations to obtain all application files.
[0061] 302. Open a structure of ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com