home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / winnt / netapi / nullsess / readme.txt < prev   
Encoding:
Text File  |  1996-07-11  |  1.9 KB  |  41 lines

  1. Networking (LAN Manager) API Sample
  2.  
  3.  
  4. This module illustrates how to use a Null session to overcome access
  5. problems during network related query operations.
  6.  
  7. One example of the scenario this approach addresses is as follows:
  8.  
  9. User logs onto workstation A as the local administrator.
  10.  
  11. Administrator tries to query user information using the NetUserGetInfo()
  12. API call on server B.  This call fails with ERROR_ACCESS_DENIED.
  13.  
  14. The reason this problem occurs is that the administrator password on
  15. workstation A does not match the administrator password on server B.
  16.  
  17. During the network query operation, the default behavior is to establish
  18. a connection to the remote server using the credentials of the logged-in
  19. user.  In some scenarios, this behavior is not appropriate, and the
  20. solution is to establish a connection using either known credentials,
  21. or the Null credentials.  Null credentials are suitable for most query
  22. operations against a remote machine.  However, if administrator
  23. related actions are necessary, it is necessary to supply credentials
  24. which have administrative privilege on the remote machine.  Valid
  25. credentials consist of a username, password, and optional domain name.
  26.  
  27. Establishing a connection in this manner requires that no existing
  28. connections exist to the remote machine tied to the current logon
  29. session.
  30.  
  31. Note: Null sessions are those where the user credentials passed in the
  32. session setup SMB are null.  This sample only implements a function to
  33. establish a Null session, rather than a session with specific credentials.
  34.  
  35. Processes and Services running in the Local System account security context
  36. have Null credentials by default, so establishing Null sessions in this
  37. scenario is not required.
  38.  
  39. Applications that run only on Windows NT 4.0 and above can use
  40. WNetAddConnection2() rather than NetUseAdd() to establish a Null session.
  41.