Microsoft KB Archive/149571

= Using OLE in Services in Windows NT 3.51 =

Article ID: 149571

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft OLE 4.0, when used with:
 * Microsoft Windows NT 3.51 Service Pack 5

-



This article was previously published under Q149571



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:


 * Select the service and select the StartUp button. This will bring up the Service dialog.
 * Select 'Log On As This Account' and specify the user account name in the form of "DomainName\Username" and the password of that user account.

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 query words: 2 OLE2 2.0 2.00

Keywords: KB149571

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.