Source code of Windows XP (NT5)
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.

64 lines
1.5 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Windows NT Directory Service Property Pages
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 1999
  7. //
  8. // File: computer.cxx
  9. //
  10. // Contents: Computer object functionality.
  11. //
  12. // History: 07-July-97 EricB created
  13. //
  14. //-----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #include "proppage.h"
  17. #include "computer.h"
  18. //+----------------------------------------------------------------------------
  19. //
  20. // Function: ShComputerRole
  21. //
  22. // Synopsis: Handles the computer Role value for the shell computer general
  23. // page.
  24. //
  25. //-----------------------------------------------------------------------------
  26. HRESULT
  27. ShComputerRole(CDsPropPageBase * pPage, PATTR_MAP pAttrMap,
  28. PADS_ATTR_INFO pAttrInfo, LPARAM, PATTR_DATA,
  29. DLG_OP DlgOp)
  30. {
  31. TRACE_FUNCTION(ComputerRole);
  32. if (DlgOp != fInit)
  33. {
  34. return S_OK;
  35. }
  36. //
  37. // Set the computer role value.
  38. //
  39. PTSTR ptz;
  40. int id = IDS_ROLE_WKS; // UF_WORKSTATION_TRUST_ACCOUNT
  41. if (pAttrInfo && pAttrInfo->dwNumValues && pAttrInfo->pADsValues &&
  42. (pAttrInfo->pADsValues->Integer & UF_SERVER_TRUST_ACCOUNT))
  43. {
  44. id = IDS_ROLE_SVR;
  45. }
  46. if (!LoadStringToTchar(id, &ptz))
  47. {
  48. REPORT_ERROR(E_OUTOFMEMORY, pPage->GetHWnd());
  49. return E_OUTOFMEMORY;
  50. }
  51. SetDlgItemText(pPage->GetHWnd(), pAttrMap->nCtrlID, ptz);
  52. delete ptz;
  53. return S_OK;
  54. }