ntobjfs.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 
00020  //
00021  // Explorer clone
00022  //
00023  // ntobjfs.h
00024  //
00025  // Martin Fuchs, 31.01.2004
00026  //
00027 
00028 
00029 enum OBJECT_TYPE {
00030     DIRECTORY_OBJECT, SYMBOLICLINK_OBJECT,
00031     MUTANT_OBJECT, SECTION_OBJECT, EVENT_OBJECT, SEMAPHORE_OBJECT,
00032     TIMER_OBJECT, KEY_OBJECT, EVENTPAIR_OBJECT, IOCOMPLETITION_OBJECT,
00033     DEVICE_OBJECT, FILE_OBJECT, CONTROLLER_OBJECT, PROFILE_OBJECT,
00034     TYPE_OBJECT, DESKTOP_OBJECT, WINDOWSTATION_OBJECT, DRIVER_OBJECT,
00035     TOKEN_OBJECT, PROCESS_OBJECT, THREAD_OBJECT, ADAPTER_OBJECT, PORT_OBJECT,
00036 
00037     UNKNOWN_OBJECT_TYPE=-1
00038 };
00039 
00040 struct RtlAnsiString {
00041     WORD    string_len;
00042     WORD    alloc_len;
00043     LPSTR   string_ptr;
00044 };
00045 
00046 struct RtlUnicodeString {
00047     WORD    string_len;
00048     WORD    alloc_len;
00049     LPWSTR  string_ptr;
00050 };
00051 
00052 struct NtObjectInfo {
00053     RtlUnicodeString name;
00054     RtlUnicodeString type;
00055     BYTE    padding[16];
00056 };
00057 
00058 struct OpenStruct {
00059     DWORD   size;
00060     DWORD   _1;
00061     RtlUnicodeString* string;
00062     DWORD   _3;
00063     DWORD   _4;
00064     DWORD   _5;
00065 };
00066 
00067 struct NtObject {
00068     DWORD   _0;
00069     DWORD   _1;
00070     DWORD   handle_count;
00071     DWORD   reference_count;
00072     DWORD   _4;
00073     DWORD   _5;
00074     DWORD   _6;
00075     DWORD   _7;
00076     DWORD   _8;
00077     DWORD   _9;
00078     DWORD   _A;
00079     DWORD   _B;
00080     FILETIME creation_time;
00081 };
00082 
00083 
00084  /// NtObj file system file-entry
00085 struct NtObjEntry : public Entry
00086 {
00087     NtObjEntry(Entry* parent, OBJECT_TYPE type) : Entry(parent, ET_NTOBJS), _type(type) {}
00088 
00089     OBJECT_TYPE _type;
00090 
00091 protected:
00092     NtObjEntry(OBJECT_TYPE type) : Entry(ET_NTOBJS), _type(type) {}
00093 
00094     virtual bool get_path(PTSTR path, size_t path_count) const;
00095     virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow);
00096 };
00097 
00098 
00099  /// NtObj file system directory-entry
00100 struct NtObjDirectory : public NtObjEntry, public Directory
00101 {
00102     NtObjDirectory(LPCTSTR root_path)
00103      :  NtObjEntry(DIRECTORY_OBJECT)
00104     {
00105         _path = _tcsdup(root_path);
00106     }
00107 
00108     NtObjDirectory(Entry* parent, LPCTSTR path)
00109      :  NtObjEntry(parent, DIRECTORY_OBJECT)
00110     {
00111         _path = _tcsdup(path);
00112     }
00113 
00114     ~NtObjDirectory()
00115     {
00116         free(_path);
00117         _path = NULL;
00118     }
00119 
00120     virtual void read_directory(int scan_flags=0);
00121     virtual Entry* find_entry(const void*);
00122 };

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage