Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.9 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. * prompt.hxx
  7. *
  8. * SERVER_WITH_PASSWORD_PROMPT // in this file
  9. *
  10. * FILE HISTORY:
  11. * Yi-HsinS 8/15/91 Created
  12. * ChuckC 2/5/93 Split off from sharebas.hxx
  13. */
  14. #ifndef _APROMPT_HXX_
  15. #define _APROMPT_HXX_
  16. #include <lmoesh.hxx> // for SHARE2_ENUM_ITER
  17. #include <lmosrv.hxx> // for SERVER_2
  18. #include <prompt.hxx> // for PROMPT_AND_CONNECT
  19. #include <netname.hxx> // for NET_NAME
  20. /*************************************************************************
  21. NAME: SERVER_WITH_PASSWORD_PROMPT
  22. SYNOPSIS: This class is derived from SERVER_2 and will attempt to
  23. call GetInfo using SERVER_2. If the user does not
  24. have enough privilege, it will prompt a dialog
  25. asking the user for password. It will then make a
  26. connection to the server ADMIN$ share with the password
  27. and will retain the connection as long as this object
  28. is not destructed. If the connection made is successful,
  29. it will call GetInfo using SERVER_2 and it should succeed
  30. because we have already made the connection to the ADMIN$
  31. share.
  32. INTERFACE: SERVER_WITH_PASSWORD_PROMPT() - Constructor
  33. QueryName() - Returns the name of the server.
  34. Will return EMPTY_STRING if the
  35. server is the local machine.
  36. IsUserLevel() - Returns TRUE if the server has user-level
  37. security. FALSE otherwise.
  38. IsShareLevel() - Returns TRUE if the server has share-level
  39. security. FALSE otherwise.
  40. PARENT: SERVER_2
  41. USES: PROMPT_AND_CONNECT
  42. CAVEATS:
  43. NOTES:
  44. HISTORY:
  45. Yi-HsinS 10/5/91 Created
  46. **************************************************************************/
  47. class SERVER_WITH_PASSWORD_PROMPT: public SERVER_2
  48. {
  49. private:
  50. // Handle of parent window for use when trying to prompt password
  51. HWND _hwndParent;
  52. // Prompt password and connect
  53. PROMPT_AND_CONNECT *_pprompt;
  54. // Help context base
  55. ULONG _ulHelpContextBase;
  56. protected:
  57. virtual APIERR I_GetInfo( VOID );
  58. public:
  59. SERVER_WITH_PASSWORD_PROMPT( const TCHAR *pszServer,
  60. HWND hwndParent,
  61. ULONG ulHelpContextBase );
  62. ~SERVER_WITH_PASSWORD_PROMPT();
  63. virtual const TCHAR *QueryName( VOID ) const;
  64. BOOL IsNT( VOID ) const;
  65. BOOL IsUserLevel( VOID ) const
  66. { return QuerySecurity() == SV_USERSECURITY; }
  67. BOOL IsShareLevel( VOID ) const
  68. { return QuerySecurity() == SV_SHARESECURITY; }
  69. };
  70. #endif