Content deleted Content added
AsceticRose (talk | contribs) m Reverted 1 edit by 60.240.3.70 (talk) to last revision by Faizan. (TW) |
m Fixed typo |
||
(43 intermediate revisions by 30 users not shown) | |||
Line 1:
{{Short description|Windows NT subsystem}}
[[File:Object Manager (Windows) screenshot.png|thumb|right|'''Object Manager''' in Windows, categorized hierarchically using ''namespaces'']]▼
{{About|the Windows Executive subsystem|the general concept|Object manager}}
'''Object Manager''' (internally called '''Ob''') is a subsystem implemented as part of the [[Windows Executive]] which manages Windows ''resources''. Each resource, which are surfaced as logical ''objects'', resides in a namespace for categorization. Resources can be physical devices, files or folders on volumes, [[Windows Registry|Registry]] entries or even running processes. All objects representing resources have an <code>Object Type</code> property and other metadata about the resource. Object Manager is a shared resource, and all subsystems that deal with the resources have to pass through the Object Manager.▼
{{Refimprove|date=March 2019}}
▲[[File:Object Manager (Windows) screenshot.png|thumb|
▲'''Object Manager''' (internally called '''Ob''') is a subsystem implemented as part of the [[Windows Executive]] which manages Windows ''resources''.
==Architecture==
[[File:Windows_2000_architecture.svg|thumb|The Object Manager in the [[architecture of Windows NT]]]]
Object Manager is the centralized resource broker in the [[Windows NT]] line of
Objects can either be ''Kernel objects'' or ''Executive objects''. Kernel objects
Whenever an object is created or opened, a reference to the instance,
The types of Executive objects exposed by Windows NT are:
{| class="wikitable" align="center"
|-
!Type !!Description !![[System call]] to get handle
|-
!Directory
| A container holds other kernel objects. Multiple levels of nested directories organize all kernel objects into a single tree.
|NtCreateDirectoryObject<br />NtOpenDirectoryObject
|-
![[Process (computing)|Process]]
| A collection of executable [[thread (computing)|threads]] along with [[virtual address]]ing and control information.
|NtCreateProcess<br />NtOpenProcess
|-
![[Thread (computing)|Thread]]
| An entity containing code in execution, inside a process.
|NtCreateThread<br />NtOpenThread
|-
!Job
| A collection of processes.
|NtCreateJobObject<br />NtOpenJobObject
|-
!File
| An open [[
|NtCreateFile<br />NtOpenFile
|-
!Section
| A region of memory
|NtCreateSection<br />NtOpenSection
|-
!Access token
| The identity, properties, privileges and access rights
|NtCreateToken<br />NtDuplicateToken<br />NtOpenProcessToken<br />NtOpenThreadToken
|-
!Event
| An object which encapsulates some information, to be used for notifying processes of something.
|NtCreateEvent<br />NtOpenEvent
|-
![[Semaphore (programming)|Semaphore]]/[[Mutex]]
| Objects which [[serialization|serialize]] access to other resources.
|NtCreateSemaphore<br />NtOpenSemaphore
|-
!Timer
| An
|NtCreateTimer<br />NtOpenTimer
|-
!Key
| A [[Windows Registry|registry]] key.
|NtCreateKey<br />NtOpenKey
|-
!Desktop
| A logical display surface to contain [[GUI]] elements.
|None
|-
![[Clipboard (software)|Clipboard]]
| A temporary repository for other objects.
|None
|-
!WindowStation
| An object containing a group of Desktop objects, one Clipboard and other user objects.
|None
|-
!
| A reference to
|NtCreateSymbolicLinkObject<br />NtOpenSymbolicLinkObject
|}
Line 61 ⟶ 85:
A <code>Type</code> object contains properties unique to the type of the object as well as static methods that implement the services offered by the object. Objects managed by Object Manager must at least provide a predefined set of services: <code>Close</code> (which closes a handle to an object), <code>Duplicate</code> (create another handle to the object with which another process can gain shared access to the object), <code>Query object</code> (gather information about its attributes and properties), <code>Query security</code> (get the [[security descriptor]] of the object), <code>Set security</code> (change the security access), and <code>Wait</code> (to synchronize with one or more objects via certain events). Type objects also have some common attributes, including the type name, whether they are to be allocated in non-paged memory, access rights, and synchronization information. All instances of the same type share the same type object, and the type object is instantiated only once. A new object type can be created by endowing an object with Properties to expose its state and methods to expose the services it offers.
<code>Object name</code> is used to give a descriptive identity to an object, to aid in object lookup. Object Manager maintains the list of names already assigned to objects being managed, and maps the names to the instances. Since most object accesses occur via handles, it is not always necessary to look up the name to resolve into the object reference. Lookup is only performed when an object is created (to make sure the new object has a unique name), or a process accesses an object by its name explicitly. <code>Object directories</code> are used to categorize them according to the types. Predefined directories include <code>\??</code> alias <code>\DosDevices</code> (device names), <code>\BaseNamedObjects</code> (
OBJECT_ATTRIBUTES structure:
<syntaxhighlight lang="c">
ULONG Length;
HANDLE RootDirectory;
Line 71 ⟶ 96:
PSECURITY_DESCRIPTOR SecurityDescriptor;
PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService;
} OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
</syntaxhighlight>
The Attributes member can be zero, or a combination of the following flags:
OBJ_INHERIT
OBJ_PERMANENT
OBJ_EXCLUSIVE
OBJ_CASE_INSENSITIVE
Line 82 ⟶ 108:
OBJ_KERNEL_HANDLE
== Usage ==
Object Manager paths are available to many Windows API file functions, although Win32 names like {{tt|\\?\}} and {{tt|\\.\}} for the local namespaces suffice for most uses.<ref>{{cite web |title=Naming Files, Paths, and Namespaces - Win32 apps |url=https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file |website=docs.microsoft.com |date=28 August 2024 |language=en-us}}</ref> Using the former in Win32 user-mode functions translates directly to {{tt|\??}}, but using {{tt|\??}} is still different as this NT form does not turn off pathname expansion.<ref>{{cite web |title=winapi - Is there a difference between \??\ and \\?\ paths? |url=https://stackoverflow.com/questions/25090101/is-there-a-difference-between-and-paths |website=Stack Overflow}}</ref>
Tools that serve as explorers in the Object Manager namespaces are available. These include the 32-bit WinObj from [[Sysinternals]]<ref>{{cite web |title=WinObj - Windows Sysinternals |url=https://docs.microsoft.com/en-us/sysinternals/downloads/winobj |website=docs.microsoft.com |date=26 July 2023 |language=en-us}}</ref> and the 64-bit WinObjEx64.<ref>{{cite web |title=hfiref0x/WinObjEx64: Windows Object Explorer 64-bit |url=https://github.com/hfiref0x/WinObjEx64 |website=GitHub |date=20 February 2020}}</ref>
==See also==
*[[Architecture of Windows NT]]
* [[Process group|Process groups]] and [[control groups|cgroups]]{{snd}} the equivalent [[POSIX]] and [[Linux]] concepts to the ‘Job’ object type discussed above
==References==
{{Reflist}}
{{refbegin}}
* {{cite book
| title = Microsoft Windows Internals
| edition = 4th
| chapter = Chapter 3: System Mechanisms
| pages = [https://archive.org/details/isbn_9780735619173/page/124 124–149]
| last = Russinovich
| first = Mark
|
|
| year = 2005
| publisher = Microsoft Press
|
| url-access = registration
| url = https://archive.org/details/isbn_9780735619173/page/124
}}
{{refend}}
|