Using OLE in Services in Windows NT 3.51

ID: Q149571

3.51 WINDOWS NT kbprg

The information in this article applies to:

SUMMARY

OLE cannot be used between processes running in different security contexts in Windows NT 3.51 and earlier versions. It can be used between processes running in the same security context. For example, OLE cannot be used between a process running in a user's account and a service logged on the LocalSystem account (even if the service interacts with the desktop). However OLE can be used between a process running in a user's account and a service logged on to the same account.

MORE INFORMATION

A service can easily implement an OLE client because any OLE server that it launches will run in the same security context as the client. However a service that implements an OLE client will not be able to bind to a running server in a different security context. The service will be able to bind to a running server in the same security context using the Running Object Table.

A service that implements an OLE server must run in the same security context as the client that uses it. If the client is a process that runs in a user's account, the service must also log on to that user's account. This can be done by using the Services control-panel application as follows:

Or this can be done programatically by specifying the appropriate values for the lpServiceStartName and lpPassword parameters of CreateService(). Make sure that the service lists the OLE service as a dependency. The service can be configured to run automatically when the machine boots, or it can be launched manually. The client can create a new object in the service by using CoCreateInstance if the service is running and if it has registered a multiple-use class factory. OLE will not launch the service, so the service must be running before CoCreateInstance is called. The client can bind to a running object in the service by using IRunningObjectTable::GetObject or GetActiveObject if the service has registered the object in the Running Object Table.

The next version of Windows NT will allow processes in different security contexts to communicate using OLE.

Additional reference words: 2 OLE2 2.0 2.00 KBCategory: kbprg KBSubcategory: LeTwoArc

Keywords          : LeTwoArc 
Version           : 3.51
Platform          : NT WINDOWS

Last Reviewed: April 6, 1996