Google
 

Tuesday, July 17, 2007

Objects and Handles

In the Windows operating system, an object is a single, run-time instance of a statically defined object type. An object type comprises a system-defined data type, functions that operate on instances of the data type, and a set of object attributes. If you write Windows applications, you might encounter process, thread, file, and event objects, to name just a few examples. These objects are based on lower-level objects that Windows creates and manages.

An object attribute is a field of data in an object that partially defines the object's state.

Object methods, the means for manipulating objects, usually read or change the object attributes.

The most fundamental difference between an object and an ordinary data structure is that the internal structure of an object is hidden.

Objects provide a convenient means for accomplishing the following four important operating system tasks:

  • Providing human-readable names for system resources

  • Sharing resources and data among processes

  • Protecting resources from unauthorized access

  • Reference tracking, which allows the system to know when an object is no longer in use so that it can be automatically deallocated

Not all data structures in the Windows operating system are objects. Only data that needs to be shared, protected, named, or made visible to user-mode programs (via system services) is placed in objects. Structures used by only one component of the operating system to implement internal functions are not objects.

No comments: