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.

Inactive Publication Date: 2009-02-25
HUAWEI DIGITAL TECH (CHENGDU) CO LTD
View PDF0 Cites 23 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] In the process of implementing the present invention, the inventor found that the above-mentioned first method has at least the following disadvantages: the data content of the file is modified on the disk, but the handle has been loaded into the memory when the file is called, so only when the system is restarted After releasing the handle in the memory, the deletion function can be completed
[0007] In the process of realizin...

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and apparatus for releasing handle and file deleting system
  • Method and apparatus for releasing handle and file deleting system
  • Method and apparatus for releasing handle and file deleting system

Examples

Experimental program
Comparison scheme
Effect test

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 ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The embodiment of the invention discloses a method for releasing handles, a device and a file deletion system, relates to the technical field of releasing the handles of documents to be deleted, and solves the problem that a system needs restarting or leads error to occur to the process in the prior art of document deletion. In the embodiment, firstly, the handle information of the documents called during the process is searched for; if the handle information of the documents called during the process is the handle to be released, the process is informed of releasing the corresponding handle information, thereby completing the release of the handles. Corresponding handle information is released before documents infected with viruses are deleted in a virus-killing software system.

Description

technical field [0001] The invention relates to the field of computers, in particular to a method and device for releasing handles of files to be deleted in computers. Background technique [0002] Whether it is a malicious code that can infect the system or a hidden Trojan file, they generally load private code into the system when the system is started, thereby causing damage to the system. If a virus file is implanted in the operating system or in a running process in the above-mentioned manner, such a virus file cannot be deleted without the handle of the file being released. Some files being edited are accidentally terminated due to the process of loading the file, resulting in the handle of the file not being released, and the file cannot be deleted. If the virus file cannot be deleted, it will cause damage to the system, for example: malicious occupation of system resources, malicious restart of the computer, crash and so on. [0003] The prior art provides two meth...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F21/22G06F21/56
Inventor 云朋
Owner HUAWEI DIGITAL TECH (CHENGDU) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products