关于kernel object的问题!!帮忙
最近正在看programming applications with microsoft windows这本书,以前对于这些知识所知太少!!
呵呵,汗!
问题如下:
主要是我对下面这一段话,不是很理解,原文贴上
Because the kernel object data structures are accessible only by the kernel, it is impossible for an application to locate these data structures in memory and directly alter their contents. Microsoft enforces this restriction deliberately to ensure that the kernel object structures maintain a consistent state. This restriction also allows Microsoft to add, remove, or change the members in these structures without breaking any applications.
If we cannot alter these structures directly, how do our applications manipulate these kernel objects? The answer is that Windows offers a set of functions that manipulate these structures in well-defined ways. These kernel objects are always accessible via these functions. When you call a function that creates a kernel object, the function returns a handle that identifies the object. Think of this handle as an opaque value that can be used by any thread in your process. You pass this handle to the various Windows functions so that the system knows which kernel object you want to manipulate. We'll talk a lot more about these handles later in this chapter.
To make the operating system robust, these handle values are process-relative. So if you were to pass this handle value to a thread in another process (using some form of interprocess communication), the calls that this other process would make using your process's handle value would fail.
-----------------------------------------------------------------------------------
1.既然核心对象只能由核心层进行管理,那么为什么句柄又和进程相关呢(To make the operating system robust, these handle values are process-relative.)为什么这样就具有鲁棒性啦?
2.还有核心对象和核心(kernel)究竟应当怎么理解呢?这本书还提到file也是核心对象,怎么我感觉我可以操作它啊,以该文的意思,我必须得通过句柄访问,不可以直接进行操作吗?
呵呵,谢谢。