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.

104 lines
2.8 KiB

  1. // Shell.h : This file contains the
  2. // Created: Feb '98
  3. // Author : a-rakeba
  4. // History:
  5. // Copyright (C) 1998 Microsoft Corporation
  6. // All rights reserved.
  7. // Microsoft Confidential
  8. #if !defined( _SHELL_H_ )
  9. #define _SHELL_H_
  10. #include <CmnHdr.h>
  11. #include <TChar.h>
  12. #define LENGTH_OF_PATH_EQUALS 5
  13. class CSession;
  14. class CShell
  15. {
  16. CSession* m_pSession;
  17. HANDLE m_hCurrUserKey;
  18. LPVOID m_lpEnv;
  19. HANDLE m_hTempProcess;
  20. HANDLE m_hProcess;
  21. //handles for library modules
  22. HINSTANCE hUserEnvLib;
  23. bool m_bIsLocalHost;
  24. UCHAR *m_pucDataFromCmd;
  25. OVERLAPPED m_oReadFromCmd;
  26. DWORD m_dwDataSizeFromCmd;
  27. HANDLE m_hReadFromCmd;
  28. HANDLE m_hWriteByCmd;
  29. LPWSTR pHomeDir;
  30. LPWSTR pHomeDrive;
  31. LPWSTR pLogonScriptPath;
  32. LPWSTR pProfilePath;
  33. LPWSTR pServerName;
  34. LPWSTR m_pwszAppDataDir;
  35. bool GetDomainController( LPWSTR, LPWSTR );
  36. BOOL AreYouHostingTheDomain( LPTSTR , LPTSTR );
  37. bool CreateIOHandles();
  38. void DoFESpecificProcessing();
  39. void GetScriptName( LPWSTR *, LPWSTR * );
  40. #ifdef ENABLE_LOGON_SCRIPT
  41. void GetUserScriptName( LPWSTR *, LPWSTR );
  42. #endif
  43. bool StartProcess();
  44. void LoadLibNGetProc( );
  45. bool LoadTheProfile();
  46. bool GetNFillUserPref(LPWSTR, LPWSTR );
  47. bool GetUsersHomeDirectory( LPWSTR );
  48. bool GetNameOfTheComputer();
  49. bool CancelNetConnections();
  50. void ExportEnvVariables();
  51. void GetEnvVarData();
  52. void SetEnvVariables();
  53. #ifdef ENABLE_LOGON_SCRIPT
  54. BOOL InjectUserScriptPathIntoPath( TCHAR [] );
  55. #endif
  56. bool GetSystemDrive();
  57. bool GetTheSystemDirectory( LPWSTR * );
  58. bool IssueReadFromCmd();
  59. protected:
  60. void Init( CSession * );
  61. bool StartUserSession();
  62. void Shutdown();
  63. void FreeInitialVariables();
  64. bool OnDataFromCmdPipe();
  65. public:
  66. CShell();
  67. virtual ~CShell();
  68. };
  69. #define DC_LOGON_SCRIPT_PATH L"\\NetLogon\\"
  70. #define LOCALHOST_LOGON_SCRIPT_PATH L"\\repl\\import\\scripts\\"
  71. #define AND L"&&"
  72. #define QUOTE_AND_SPACE L"\" "
  73. #define EXIT_CMD L"exit"
  74. #define ENV_HOMEPATH L"HOMEPATH="
  75. #define ENV_HOMEDRIVE L"HOMEDRIVE="
  76. #define ENV_TERM L"TERM="
  77. #define ENV_APPDATA L"APPDATA="
  78. #define ENV_USERNAME L"USERNAME="
  79. #define ENV_USERDOMAIN L"USERDOMAIN="
  80. #define ENV_USERPROFILE L"USERPROFILE="
  81. #define UNICODE_STR_SIZE(x) ((sizeof(x) - sizeof(WCHAR)) / sizeof(WCHAR))
  82. void PutStringInEnv( LPTSTR lpStr, LPTSTR *lpSrcEnv, LPTSTR *lpDstEnv, bool bOverwrite);
  83. #endif // _SHELL_H_