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.

91 lines
2.3 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Scheduling Agent Service
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  7. //
  8. // File: atacct.cxx
  9. //
  10. // Classes: None.
  11. //
  12. // Functions: SetNetScheduleAccountInformation
  13. // GetNetScheduleAccountInformation
  14. //
  15. // History: 13-Aug-96 MarkBl Created.
  16. //
  17. //-----------------------------------------------------------------------------
  18. #include "..\pch\headers.hxx"
  19. #pragma hdrstop
  20. #include "..\inc\debug.hxx"
  21. #include "atacct.h"
  22. #include "SASecRPC.h" // SASetNSAccountInformation RPC definition.
  23. #include <misc.hxx> // SchedMapRpcError
  24. //+----------------------------------------------------------------------------
  25. //
  26. // Function: SetNetScheduleAccountInformation
  27. //
  28. // Synopsis:
  29. //
  30. //-----------------------------------------------------------------------------
  31. STDAPI
  32. SetNetScheduleAccountInformation(
  33. LPCWSTR pwszServerName,
  34. LPCWSTR pwszAccount,
  35. LPCWSTR pwszPassword)
  36. {
  37. HRESULT hr;
  38. RpcTryExcept
  39. {
  40. hr = SASetNSAccountInformation(pwszServerName,
  41. pwszAccount,
  42. pwszPassword);
  43. }
  44. RpcExcept(1)
  45. {
  46. DWORD Status = RpcExceptionCode();
  47. schDebugOut((DEB_ERROR,
  48. "SASetNSAccountInformation exception(0x%x)\n",
  49. Status));
  50. hr = SchedMapRpcError(Status);
  51. }
  52. RpcEndExcept;
  53. return(hr);
  54. }
  55. //+----------------------------------------------------------------------------
  56. //
  57. // Function: GetNetScheduleAccountInformation
  58. //
  59. // Synopsis:
  60. //
  61. //-----------------------------------------------------------------------------
  62. STDAPI
  63. GetNetScheduleAccountInformation(
  64. LPCWSTR pwszServerName,
  65. DWORD ccAccount,
  66. WCHAR wszAccount[])
  67. {
  68. HRESULT hr;
  69. RpcTryExcept
  70. {
  71. hr = SAGetNSAccountInformation(pwszServerName, ccAccount, wszAccount);
  72. }
  73. RpcExcept(1)
  74. {
  75. DWORD Status = RpcExceptionCode();
  76. schDebugOut((DEB_ERROR,
  77. "SAGetNSAccountInformation exception(0x%x)\n",
  78. Status));
  79. hr = SchedMapRpcError(Status);
  80. }
  81. RpcEndExcept;
  82. return(hr);
  83. }