Using OLE in Services in Windows NT 3.51

Last reviewed: April 5, 1996
Article ID: Q149571
The information in this article applies to:
  • Microsoft OLE libraries included with Microsoft Windows NT version 3.51

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 reference words: 2 OLE2 2.0 2.00
KBCategory: kbprg
KBSubcategory: LeTwoArc



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 5, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.