Поделиться через


Process ID Functions (Windows Embedded CE 6.0)

1/6/2010

There are several process ID functions in Windows Embedded CE 6.0. This topic covers each one of these in detail. New functions added in CE 6.0 are marked as such. The following table describes these functions.

Function Description

GetCurrentProcess

This is a pseudo handle value which is always a constant value used to refer to the currently active process in which context the calling thread is running. This function is the same as previous versions of Windows Embedded CE.

GetCurrentProcessId

This is the ID of the process in which context the calling thread is running. If the calling thread is not in a PSL or in an API call, this process ID should be same as the current thread owner process ID. This function is the same as previous versions of Windows Embedded CE.

GetCallerProcess

From user mode. This is the ID of the process that made the call to the current context of the calling thread. This always excludes kernel from the callstack chain.

GetCallerProcess

New. From kernel mode. This is the ID of the process that made the call to the current context of the calling thread. Functionality is the same as GetDirectCallerProcessId.

GetDirectCallerProcessId

New. From user mode. This is the ID of the process that made the call to the current context of the calling thread. The main difference between this function and GetCallerProcess comes when the caller is the same as the owner process of the calling thread.

GetDirectCallerProcessId

New. From kernel mode. If the direct call bit is set, this function reterns the kernel process ID. If the direct call bit is not set, this function returns the process ID of the currently active virtual memory (VM).

GetCallerVMProcessId

New. From user mode. If the direct call bit is set, this function reterns the kernel process ID. If the direct call bit is not set, this function returns the process ID of the currently active VM. Functionality is the same as GetDirectCallerProcessId.

GetCallerVMProcessId

New. From kernel mode. This is the ID of the process whose VM is currently active.

Process ID

The following table compares these functions in different situations.

Scenario

GetCallerProcess

GetDirectCallerProcessID

GetCallerVMProcessID

1

NULL

User A

User A

2

Kernel

Kernel

Kernel

3

Kernel

Kernel

Kernel

4

Active VM process

Active VM process

Active VM process

5

User B

User B

User B

6a

Kernel

Kernel

Active VM process

6b

Active VM process

Active VM process

Active VM process

7

User A

User A

User A

8

Active VM process

Active VM process

Active VM process

The following are the scenario descriptions:

1. User-mode thread with no outgoing calls to any other process.

2. Kernel-mode thread with no outgoing calls to any other process.

3. Kernel-mode thread calling into a user-mode PSL/driver.

4. User-mode thread calling into kernel PSL/driver.

5. Kernel-mode thread calling into a user-mode PSL/driver, which in turn calls another user-mode PSL/driver.

6a. User-mode thread calling into a kernel PSL/driver, which in turn calls another kernel PSL/driver with the direct call bit set.

6b. User-mode thread calling into a kernel PSL/driver, which in turn calls another kernel PSL/driver with the direct call bit not set.

7. User-mode thread calling into another user-mode PSL/driver through the kernel. This scenario is same as 5.

8. Kernel-mode thread calling into a user-mode PSL, which in turn calls a kernel-mode PSL/driver. This scenario is same as 4.

See Also

Concepts

Processes