Bagikan melalui


Using the SessionShim Fix

Applies To: Windows 7, Windows Vista

This section includes information about using the SessionShim compatibility fix, including the associated issues, the intercepted APIs, the available command-line options and usage, and the recommended fix for a permanent solution.

SessionShim

SessionShim enables an application to function properly even if it is attempting to use the Session0 (Global Session) service, which is no longer available for use by applications in the Windows Vista operating system.

This compatibility fix attempts to resolve this issue by intercepting calls to create several common kernel-mode objects. SessionShim first attempts to open the object after specifying the Global\ namespace. If that fails, the fix tries again, by using the Local\ namespace. Finally, if that too fails, the fix will return the value from the original API, without any additional modification.

Investigating the Issue

The SessionShim compatibility fix should be considered as a possible resolution if an application is attempting to explicitly interact with a service by using kernel-mode objects and if the communication fails with Windows Vista.

Intercepted APIs

The following APIs are intercepted by the SessionShim compatibility fix.

  • OpenEventA

  • OpenEventW

  • OpenMutexA

  • OpenMutexW

  • OpenSemaphoreA

  • OpenSemaphoreW

  • OpenWaitableTimerA

  • OpenWaitableTimerW

  • OpenJobObjectA

  • OpenJobObjectW

  • OpenFileMappingA

  • OpenFileMappingW

Command-Line Options

If you create a "\\" delimited list of object names, then this compatibility fix will only apply the Global, Local, and Default logic to the specified objects. Otherwise, all objects will have this logic applied.

Fixing Your Code

Applications should be modified so that they use the client and server remote procedure call (RPC) mechanisms, such as RPC protocols or named pipes, to communicate between services and applications. If kernel-mode objects must be shared, you must explicitly create them by using the Global\ or Local\ namespace prefix, according to your requirements.

See Also

Concepts

Windows Vista and Windows 7 Operating Systems