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.

45 lines
1.8 KiB

  1. #if !defined(AFX_REMOTEENV_H__1B164072_460A_432a_99C0_26941B44FC53__INCLUDED_)
  2. #define AFX_REMOTEENV_H__1B164072_460A_432a_99C0_26941B44FC53__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. #include "stdafx.h"
  7. /////////////////////////////////////////////////////////////////////////////
  8. class CRemoteExpandEnvironmentStrings
  9. {
  10. public:
  11. CRemoteExpandEnvironmentStrings();
  12. ~CRemoteExpandEnvironmentStrings();
  13. BOOL SetMachineName(IN LPCTSTR szMachineName);
  14. BOOL SetUserName(IN LPCTSTR szUserName);
  15. BOOL SetUserPassword(IN LPCTSTR szUserPassword);
  16. BOOL NewRemoteEnvironment();
  17. void DeleteRemoteEnvironment();
  18. NET_API_STATUS RemoteExpandEnvironmentStrings(IN LPCTSTR UnexpandedString,OUT LPTSTR * ExpandedString);
  19. protected:
  20. PVOID m_pEnvironment;
  21. LPTSTR m_lpszUncServerName;
  22. LPTSTR m_lpszUserName;
  23. LPTSTR m_lpszUserPasswordEncrypted;
  24. DWORD m_cbUserPasswordEncrypted;
  25. private:
  26. DWORD SetOtherEnvironmentValues(void **pEnv);
  27. BOOL SetEnvironmentVariables(void **pEnv);
  28. BOOL IsLocalMachine(LPCTSTR psz);
  29. BOOL SetEnvironmentVariableInBlock(void **pEnv, LPTSTR lpVariable,LPTSTR lpValue, BOOL bOverwrite);
  30. BOOL SetUserEnvironmentVariable(void **pEnv, LPTSTR lpVariable, LPTSTR lpValue, BOOL bOverwrite);
  31. BOOL BuildEnvironmentPath(void **pEnv, LPTSTR lpPathVariable, LPTSTR lpPathValue);
  32. DWORD ExpandUserEnvironmentStrings(void *pEnv, LPTSTR lpSrc, LPTSTR lpDst, DWORD nSize);
  33. DWORD GetRegKeyMaxSizes(IN HKEY WinRegHandle,OUT LPDWORD MaxKeywordSize OPTIONAL,OUT LPDWORD MaxValueSize OPTIONAL);
  34. };
  35. /////////////////////////////////////////////////////////////////////////////
  36. #endif // !defined(AFX_REMOTEENV_H__1B164072_460A_432a_99C0_26941B44FC53__INCLUDED_)