The information in this article applies to:
SUMMARYAn OLE server that is launched by an OLE client in Windows NT will get the SYSTEM environment and not the USER environment. This does not occur in Windows 95 where the SYSTEM environment and the USER environment are the same. MORE INFORMATION
This behavior is by design and is because the OLE server is actually
started by the OLE service. However this can cause the server to work
differently when it is started by the user from the way it behaves when it
is started by an OLE client. For example, if the server loads a DLL using
LoadLibrary without the full path and the DLL is located in a directory in
the USER path but not in the SYSTEM path, the DLL will be found when the
server is run by the user but won't be found when the server is launched by
an OLE client. Many applications do not run into this problem because they
statically link to DLLs and those DLLs are in the same directory as the
.exe file.
OLE will also set the current working directory of the server to the
SYSTEM32 directory when it launches it. The location of the server's .exe
file can be found by using GetModuleFileName() in the server.The server can determine if it was launched by OLE by looking for -Embedding or /Embedding in the command line arguments. With Service Pack 3, local OLE servers on NT 4 that are set to start under the "Launching User" identity (the default setting,) will inherit the USER environment. Note that this does not apply to servers set to start under a "RunAs" identity (either Interactive User or a specific user). Also it does not apply to remote servers, only to local machine activations. With this change, the default behavior for OLE servers (as far as inheriting environments is concerned) under NT4 becomes identical to that of Windows 95. Additional query words:
Keywords : kbole kbNTOS351 kbServer kbGrpCom kbDSupport LeTwoArc |
Last Reviewed: October 26, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |