Method and system of accessing a target file in a computer system with an operating system with file locking implemented at file-open time
Abstract
The present invention provides a method and system of accessing at least one target file in a computer system with an operating system with file locking implemented at file-open time. In an exemplary embodiment, the method and system include (1) obtaining a set of handles that corresponds to a set of all files that are open in the computer system, (2) determining within the kernel of the operating system a set of file identifiers that corresponds to the set of handles, (3) identifying from the set of file identifiers a file identifier that corresponds to the target file, (4) sending within the kernel to the file system driver of the operating system a read request packet that corresponds to the identified file identifier, and (5) receiving from the file system driver data that corresponds to the target file.

Term
Term ended
Projected expiry passed 10 December 2024, 1.8 years ago.
- Priority
- Filed
- Published
- Projected expiry
- Today
19 claims: 2 independent, 17 dependent
- 1A method of accessing at least one target file in a computer system with an operating system with file locking implemented at file-open time, the method comprising:obtaining (210) a set of handles that corresponds to a set of all files that are open in the computer system;determining (212) within the kernel of the operating system a set of file identifiers that corresponds to the set of handles;identifying (214) from the set of file identifiers a file identifier that corresponds to the target file;and sending (216) within the kernel to the file system driver of the operating system a read request packet that corresponds to the identified file identifier.
- 10A system of accessing at least one target file in a computer system with an operating system with file locking implemented at file-open time, the system comprising:an obtaining module configured to obtain (210) a set of handles that corresponds to a set of all files that are open in the computer system;a determining module configured to determine (212) within the kernel of the operating system a set of file identifiers that corresponds to the set of handles;an identifying module configured to identify (214) from the set of file identifiers a file identifier that corresponds to the target file;and a sending module configured to send (216) within the kernel to the file system driver of the operating system a read request packet that corresponds to the identified file identifier.
Independent claims2
70 paragraphs, as filed
Technical field
The present invention relates to operating systems, and particularly relates to a method and system of accessing at least one target file in a computer system with an operating system with file locking implemented at file-open time.
Background art
Operating system kernels and programs can have the ability to protect files from being opened and read by other processes. This is done by opening a file and not granting specific permissions (such as read) to other processes. As long as this process holds the file open, other processes are subject to the permissions granted by this process. Attempts to open such a file by other processes will result in Windows "sharing violations", and the data in the file cannot be read. An example of such an operating system and programs is the Microsoft Windows (hereinafter "Windows") kernel and Windows programs (Windows is a trademark of Microsoft Corporation).
<u>Need to Access Open Files</u>
However, the data in these files can be extremely important to many applications, especially backup applications. For example, it is important for backup applications to be able to read and backup every file on a machine. In addition, some of these protected files are files containing registry information and are therefore necessary for the correct operation of a restored backup image.
<u>Prior Art Systems</u>
Currently, backup applications take one of two approaches to get around this problem.
<u>Sector-Wise Copy</u>
In the first prior art approach, as shown in prior art Figure 1A, an application would (1) do a sector-wise copy of data on the drive, as step 112, and (2) generate an entire image of the disk, as step 114. Unfortunately, this method produces a monolithic copy of the drive. In addition, this technique produces a disk image in which it is difficult to locate the sectors of an individual file. This makes a "single file restore" from this image very difficult.
<u>Shutdown and Preboot</u>
The second prior art approach that applications use, as shown in prior art Figure 1B, is to (1) shutdown the machine, as step 122, and (2) bring it up in a "preboot" environment, as step 124, where the (3) file copy can be performed, as step 126. The machine is either rebooted again, or finishes booting to Windows. This method is poor because it requires a reboot to be able to copy these files. In addition, a backup while the machine is running is impossible.
Therefore, a method and system of accessing at least one target file in a computer system with an operating system with file locking implemented at file-open time is needed.
Disclosure of the invention
The present invention provides a method and system of accessing at least one target file in a computer system with an operating system with file locking implemented at file-open time. In an exemplary embodiment, the method and system include (1) obtaining a set of handles that corresponds to a set of all files that are open in the computer system, (2) determining within the kernel of the operating system a set of file identifiers that corresponds to the set of handles, (3) identifying from the set of file identifiers a file identifier that corresponds to the target file, (4) sending within the kernel to the file system driver of the operating system a read request packet that corresponds to the identified file identifier, and (5) receiving from the file system driver data that corresponds to the target file.
In an exemplary embodiment, the obtaining includes (a) issuing an NtQuerySystemlnformation to the kernel, where the NtQuerySystemlnformation asks for all information about each handle in the set of handles, and (b) obtaining from the kernel an array of SYSTEM_HANDLE_INFORMATION for each handle in the set of handles, where the SYSTEM_HANDLE_INFORMATION includes a pointer to a FILE_OBJECT, where the FILE_OBJECT includes file identifier information.
In an exemplary embodiment, the determining includes, for each handle in the set of handles, passing a pointer to the FILE_OBJECT corresponding to the each handle to the kernel. In a further embodiment, the determining includes, for the each handle in the set of handles, outputting from within the kernel a file identifier corresponding to the passed FILE_OBJECT.
In an exemplary embodiment, the identifying includes identifying the FILE _OBJECT corresponding to the identified file identifier that corresponds to the target file.
In an exemplary embodiment, the sending includes (a) passing the identified FILE_OBJECT to the kernel and (b) requesting from the kernel a reading of data from the target file corresponding to the identified FILE_OBJECT via the read request packet, where the read request packet includes an Interrupt Request Packet (IRP). In a further embodiment, the requesting includes (i) generating within the kernel an IRP corresponding to the identified FILE_OBJECT at a certain offset and a certain length and (ii) passing the IRP to the file system driver of the operating system.
In an exemplary embodiment, the receiving includes (a) receiving within the kernel from the file system driver the data from the target file corresponding to the identified FILE_OBJECT and (b) obtaining the data from the target file corresponding to the identified FILE_OBJECT from the kernel.
In an exemplary embodiment, the method and system include (1) obtaining a set of handles that corresponds to a set of all files that are open in the computer system, (2) determining within the kernel of the operating system a set of file identifiers that corresponds to the set of handles, (3) identifying from the set of file identifiers a file identifier that corresponds to the target file, and (4) sending within the kernel to the file system driver of the operating system a read request packet that corresponds to the identified file identifier.
The present invention also provides a computer program product usable with a programmable computer having readable program code embodied therein of accessing at least one target file in a computer system with an operating system with file locking implemented at file-open time. In an exemplary embodiment, the computer program product includes (1) computer readable code for obtaining a set of handles that corresponds to a set of all files that are open in the computer system, (2) computer readable code for determining within the kernel of the operating system a set of file identifiers that corresponds to the set of handles, (3) computer readable code for identifying from the set of file identifiers a file identifier that corresponds to the target file, (4) computer readable code for sending within the kernel to the file system driver of the operating system a read request packet that corresponds to the identified file identifier, and (5) computer readable code for receiving from the file system driver data that corresponds to the target file.
In an exemplary embodiment, the computer program product includes (1) computer readable code for obtaining a set of handles that corresponds to a set of all files that are open in the computer system, (2) computer readable code for determining within the kernel of the operating system a set of file identifiers that corresponds to the set of handles, (3) computer readable code for identifying from the set of file identifiers a file identifier that corresponds to the target file, and (4) computer readable code for sending within the kernel to the file system driver of the operating system a read request packet that corresponds to the identified file identifier.
Brief description of the drawings
Figure 1A is a flowchart of a prior art technique.
Figure 1B is a flowchart of a prior art technique.
Figure 2 is a flowchart in accordance with an exemplary embodiment of the present invention.
Figure 3 is a flowchart of the obtaining step of Figure 2 in accordance with an exemplary embodiment of the present invention.
Figure 4A is a flowchart of the determining step of Figure 2 in accordance with an exemplary embodiment of the present invention.
Figure 4B is a flowchart of the determining step of Figure 2 in accordance with a further embodiment of the present invention.
Figure 5 is a flowchart of the identifying step of Figure 2 in accordance with an exemplary embodiment of the present invention.
Figure 6A is a flowchart of the sending step of Figure 2 in accordance with an exemplary embodiment of the present invention.
Figure 6B is a flowchart of the sending step of Figure 2 in accordance with a further embodiment of the present invention.
Figure 7 is a flowchart of the receiving step of Figure 2 in accordance with an exemplary embodiment of the present invention.
Best mode for carrying out the invention
The present invention provides a method and system of accessing at least one target file in a computer system with an operating system with file locking implemented at file-open time. In an exemplary embodiment, the present invention provides a method and system of reading the contents of protected files while the operating system remains running. The exemplary embodiment describes a method and system of reading the contents of protected Windows files while the Windows operating system remains running, although the invention is not restricted to Windows files and the Windows operating system. The present invention provides a method and system of accessing at least one target file in a computer system with an operating system with file locking implemented at file-open time. In an exemplary embodiment, the method and system include (1) obtaining a set of handles that corresponds to a set of all files that are open in the computer system, (2) determining within the kernel of the operating system a set of file identifiers that corresponds to the set of handles, (3) identifying from the set of file identifiers a file identifier that corresponds to the target file, (4) sending within the kernel to the file system driver of the operating system a read request packet that corresponds to the identified file identifier, and (5) receiving from the file system driver data that corresponds to the target file.
Referring to Figure 2, in an exemplary embodiment, the present invention includes a step 210 of obtaining a set of handles that corresponds to a set of all files that are open in the computer system, a step 212 of determining within the kernel of the operating system a set of file identifiers that corresponds to the set of handles, a step 214 of identifying from the set of file identifiers a file identifier that corresponds to the target file, a step 216 of sending within the kernel to the file system driver of the operating system a read request packet that corresponds to the identified file identifier, and a step 218 of receiving from the file system driver data that corresponds to the target file.
<u>General</u>
The present invention reads protected Windows files via two programs which work in tandem, sending data back and forth between each other. At a high level, one of these programs (e.g. wam.sys) runs in the kernel and does the actual reading, while the other program (e.g. bam.exe) runs in user space, deduces information about the file, passes that information to the kernel program in order to give it enough information to know where to read. The kernel program then returns the read data back to the user level program.
<u>Obtaining a Set of Handles</u>
Specifically, the user level program issues an NtQuerySystemlnformation call to the kernel asking for all information about open file handles. The NtQuerySystemlnformation function retrieves various kinds of system information. This function is documented in various documents originating from Microsoft Corp. Including the msdn Library at http://www.msdn.microsoft.com. The value SYSTEM_HANDLE_INFORMATION, indicating the kind of system information to be retrieved, is used as the parameter to the call. This means that the call will return an array of SYSTEM_HANDLE_INFORMATION structures for each open handle in the kernel. Each SYSTEM_HANDLE_INFORMATION structure has the following layout.
typedef struct _SYSTEM_HANDLE_INFORMATION {
ULONG NumberOfHandles;
SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles[ 1 ];
} SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
Each of the SYSTEM_HANDLE_TABLE_ENTRY_INFO arrays has the following layout.
typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO {
ULONG UniqueProcessld;
UCHAR ObjectTypelndex;
UCHAR HandleAttributes;
USHORT HandleValue;
PVOID Object;
ACCESS_MASH GrantedAccess;
} SYSTEM_HANDLE_TABLE_ENTRY_INFO, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO;
Referring to Figure 3, in an exemplary embodiment, obtaining step 210 includes a step 310 of issuing an NtQuerySystemlnformation to the kernel, where the NtQuerySystemlnformation asks for all information about each handle in the set of handles, and a step 312 of obtaining from the kernel an array of SYSTEM_HANDLE_INFORMATION for each handle in the set of handles, where the SYSTEM_HANDLE_INFORMATION includes a pointer to a FILE_OBJECT, where the FILE_OBJECT includes file identifier information.
<u>Determining a Set of File Identifiers Corresponding to the Set of Handles</u>
However, a correspondence between file handles and filenames is still needed. Finding out which handle is a handle for the target file is still needed. One piece of information in this SYSTEM_HANDLE_INFORMATION is a pointer (PVOID Object) to a FILE_OBJECT. FILE_OBJECTs contain filename information. However, the memory storing FILE_OBJECTs can only be used in the kernel.
Therefore, the user level program passes a pointer to this memory into the kernel level program. Then, the kernel level program passes back out the filename that this FILE_OBJECT describes.
Referring to Figure 4A, in an exemplary embodiment, determining step 212 includes a step 412 of, for each handle in the set of handles, passing a pointer to the FILE_OBJECT corresponding to the each handle to the kernel. In a further embodiment, as shown in Figure 4B, determining step 212 further includes, for the each handle in the set of handles, a step 422 of outputting from within the kernel a file identifier corresponding to the passed FILE_OBJECT.
<u>Identifying a File Identifier Corresponding to the Target File</u>
The user level program continues to perform this way until the filename it is looking for is returned from the kernel. It now has a handle to the protected file, the target file, that is desired to be read. Essentially, a file open has been performed.
Referring to Figure 5, in an exemplary embodiment, identifying step 214 includes a step 512 of identifying the FILE _OBJECT corresponding to the identified file identifier that corresponds to the target file.
<u>Sending a Read Request Packet</u>
It should be possible to read directly using a handle in user space. However, this handle is still constrained by the permissions that the original protecting process had placed upon it, and an attempted read on this handle would generate a sharing violation.
Therefore, the kernel level program passes this FILE_OBJECT back into the kernel program and asks it to read data from the file described by this FILE_OBJECT at a certain offset and a PAGE_SIZE (usually 4096 bytes) length. Simply issuing a ZwReadFile from the kernel also fails with a sharing violation for the reasons described above.
Data from this file is extracted through generating an Interrupt Request Packet (IRP) in the kernel and passing it down to the underlying filesystem (NTFS, FAT32, etc) where this FILE_OBJECT resides.
Referring to Figure 6A, in an exemplary embodiment, sending step 216 includes a step 612 of passing the identified FILE_OBJECT to the kernel and a step 614 of requesting from the kernel a reading of data from the target file corresponding to the identified FILE_OBJECT via the read request packet, where the read request packet includes an Interrupt Request Packet (IRP). In a further embodiment, as shown in Figure 6B, requesting 614 includes a step 622 of generating within the kernel an IRP corresponding to the identified FILE_OBJECT at a certain offset and a certain length and a step 624 of passing the IRP to the file system driver of the operating system.
<u>Receiving Data Corresponding to the Target File</u>
The filesystem responds with the requested data, and the kernel program passes that data back up to user space. A read has been performed on a protected file. Repeating these reads at different offsets until the end of the file is reached will yield a perfect copy of the data for this file on disk.
Referring to Figure 7, in an exemplary embodiment, receiving step 218 includes a step 712 of receiving within the kernel from the file system driver the data from the target file corresponding to the identified FILE_OBJECT and a step 714 of obtaining the data from the target file corresponding to the identified FILE_OBJECT from the kernel.
11 sheets
Sheet 1 Sheet 2 Sheet 3 Sheet 4 Sheet 5 Sheet 6 Sheet 7 Sheet 8 Sheet 9 Sheet 10 Sheet 11
Every citation, both waysCites: the store holds 2 of 3
| Document | Relation | Office | Cited during |
|---|---|---|---|
| WO2011117921A1 | Cited by | World Intellectual Property Organization (WIPO) | International search |
| US2002120791A1 | Cites | United States of America | Search report |
| US5675725A | Cites | United States of America | Applicant |
10 members in 6 offices
Priority claims5
| Document | Office | Kind | Date |
|---|---|---|---|
| 737581 | United States of America | – | |
| 73758103 | United States of America | A | |
| 73758103 | United States of America | A | |
| 737581 | – | – | – |
| US20030737581 | – | – | – |
Members10
| Document | Office | Kind | |
|---|---|---|---|
| US2005131960A1 | United States of America | A1 | |
| KR20050059989A | Republic of Korea | A | |
| EP1544735A2This record | European Patent Office (EPO) | A2 | |
| WO2005059673A2 | World Intellectual Property Organization (WIPO) | A2 | |
| JP2005182800A | Japan | A | |
| CN1667608A | China | A | |
| KR100695188B1 | Republic of Korea | B1 | |
| JP4149434B2 | Japan | B2 | |
| EP1544735A3 | European Patent Office (EPO) | A3 | |
| CN1667608B | China | B |
21 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Application refused18R | 18R | |
| Information on the status of an ep patent application or granted ep patentGrantedSTATUS: THE APPLICATION HAS BEEN REFUSEDSTAA | STAA | |
| Appeal procedure closedAppealORIGINAL CODE: EPIDOSNNOA9EAPBT | APBT | |
| Receipt of observations in appeal recordedAppealORIGINAL CODE: EPIDOSNOBA4EAPBZ | APBZ | |
| Invitation to file observations in appeal sentAppealORIGINAL CODE: EPIDOSNOBA2EAPBX | APBX | |
| Appeal reference modifiedAppealORIGINAL CODE: EPIDOSCREFNEAPAF | APAF | |
| Date of receipt of statement of grounds of appeal recordedAppealORIGINAL CODE: EPIDOSNNOA3EAPBR | APBR | |
| Appeal reference recordedAppealORIGINAL CODE: EPIDOSNREFNEAPBK | APBK | |
| Date of receipt of notice of appeal recordedAppealORIGINAL CODE: EPIDOSNNOA2EAPBN | APBN | |
| Designation fees paidAKX | AKX | |
| First examination report despatched17Q | 17Q | |
| Request for examination filed17P | 17P | |
| Designated contracting statesAK | AK | |
| Request for extension of the european patentAX | AX | |
| Search report despatchedORIGINAL CODE: 0009013PUAL | PUAL | |
| Information provided on ipc code assigned before grantRIC1 | RIC1 | |
| Information provided on ipc code assigned before grantRIC1 | RIC1 | |
| Party data changed (applicant data changed or rights of an application transferred)RAP1 | RAP1 | |
| Designated contracting statesAK | AK | |
| Request for extension of the european patentAX | AX | |
| Public reference made under article 153(3) epc to a published international application that has entered the european phaseORIGINAL CODE: 0009012PUAI | PUAI |
Numbers
- Publication
- 1544735
- Publication, DOCDB
- 1544735
- Publication, EPODOC
- EP1544735
- Application
- 4257684
- Application, DOCDB
- 04257684
- Application, EPODOC
- EP20040257684
Titles3
- German
- Verfahren und System zum Zugriff auf eine Zieldatei in einem Computersystem mit einem Betriebssystem mit zur Dateiöffnungszeit implementierter Dateiverriegelung
- English
- Method and system of accessing a target file in a computer system with an operating system with file locking implemented at file-open time
- French
- Procédé et système d'accès a un fichier destination dans un système informatique avec un système d'exploitation avec verrouillage de fichier implémenté au moment d'ouvrir le fichier
Classification
- CPC, 5
- G06F9/52
- G06F9/06
- G06F11/1466
- G06F17/30171
- G06F16/1774
- IPC, 4
- G06F9 46
- G06F12 00
- G06F9 06
- G06F11 14
Designated states36
- Contracting states, 30
- Austria
- Belgium
- Bulgaria
- Switzerland
- Cyprus
- Czechia
- Germany
- Denmark
- Estonia
- Spain
- Finland
- France
- United Kingdom
- Greece
- Hungary
- Ireland
- Iceland
- Italy
- Liechtenstein
- Lithuania
- Luxembourg
- Monaco
- Netherlands (Kingdom of the)
- Poland
and 6 moreShow fewer
- Portugal
- Romania
- Sweden
- Slovenia
- Slovakia
- Türkiye
- Extension states, 6
- Albania
- Bosnia and Herzegovina
- Croatia
- Latvia
- North Macedonia
- Yugoslavia, later Serbia and Montenegro (until 2006)