INFO: Services and Redirected Drives

Last reviewed: April 11, 1997
Article ID: Q115848
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows NT versions 3.51, 4.0

SUMMARY

When you write a service, do not use WNetAddConnectionXXX() to redirect drives to remote shares because the redirector does not allow the interactive user to see or enumerate the redirected drive.

MORE INFORMATION

WNetAddConnectionXXX() creates a global symbolic link describing the drive. Therefore, users can change to the drive at the command prompt if they have the proper security access to the share. However, WNetOpenEnum(), WNetEnumResource(), and the "net use" command fail to list the drive connection that was created by the service. This happens because an interactive user does not have an active session to the remote connection, so the redirector will not let the interactive user see the remote share.

Windows NT File Manager and Windows NT Explorer can see the redirected drive because they call GetDriveType() on each drive and they put up an icon for each drive found. Windows NT File Manager and Windows NT Explorer create an icon for redirected drives created from a service because there is a global symbolic link to that drive. However, the interactive user cannot use Windows NT File Manager or Windows NT Explorer to disconnect the drive because the drive was created by the service, not the interactive user.

If the service is running in the security context of the LocalSystem account, then only that service or another process running in the LocalSystem account can call WNetCancelConnection() to disconnect the drive.


Keywords : BseService kbprg NtwkWinnet
Version : 3.51 4.0
Platform : NT WINDOWS
Issue type : kbinfo


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 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.