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.

102 lines
3.8 KiB

  1. /*---------------------------------------------------------------------------
  2. File: LSAUtils.h
  3. Comments: Utility functions to change the domain affiliation of a computer.
  4. (c) Copyright 1999, Mission Critical Software, Inc., All Rights Reserved
  5. Proprietary and confidential to Mission Critical Software, Inc.
  6. REVISION LOG ENTRY
  7. Revision By: Christy Boles
  8. Revised on 02/15/99 11:23:57
  9. ---------------------------------------------------------------------------
  10. */
  11. #include "ntsecapi.h"
  12. #ifndef STATUS_SUCCESS
  13. #define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
  14. #define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034L)
  15. #define STATUS_OBJECT_NAME_COLLISION ((NTSTATUS)0xC0000035L)
  16. #define STATUS_INVALID_SID ((NTSTATUS)0xC0000078L)
  17. #endif
  18. BOOL
  19. EstablishNullSession(
  20. LPCWSTR Server, // in - server name
  21. BOOL bEstablish // in - TRUE=connect,FALSE=disconnect
  22. );
  23. void
  24. InitLsaString(
  25. PLSA_UNICODE_STRING LsaString, // in - pointer to LSA string to initialize
  26. LPWSTR String // in - value to initialize string to
  27. );
  28. NTSTATUS
  29. OpenPolicy(
  30. LPWSTR ComputerName, // in - computer name
  31. DWORD DesiredAccess, // in - required access
  32. PLSA_HANDLE PolicyHandle // out- policy handle
  33. );
  34. BOOL
  35. GetDomainSid(
  36. LPWSTR DomainName, // in - domain name to acquire Sid of
  37. PSID * pDomainSid // out- points to allocated Sid on success
  38. );
  39. NTSTATUS
  40. SetWorkstationTrustedDomainInfo(
  41. LSA_HANDLE PolicyHandle, // in - policy handle
  42. PSID DomainSid, // in - Sid of domain to manipulate
  43. LPWSTR TrustedDomainName, // in - trusted domain name to add/update
  44. LPWSTR Password, // in - new trust password for trusted domain
  45. LPWSTR errOut // out- error text, if failure
  46. );
  47. NTSTATUS
  48. SetPrimaryDomain(
  49. LSA_HANDLE PolicyHandle, // in - policy handle
  50. PSID DomainSid, // in - SID for new primary domain
  51. LPWSTR TrustedDomainName // in - name of new primary domain
  52. );
  53. NTSTATUS
  54. QueryWorkstationTrustedDomainInfo(
  55. LSA_HANDLE PolicyHandle, // in - policy handle
  56. PSID DomainSid, // in - SID for new primary domain
  57. BOOL bNoChange // in - flag, no change mode
  58. );
  59. BOOL
  60. EstablishSession(
  61. LPCWSTR Server, // in - server name
  62. LPWSTR Domain, // in - domain for Username account
  63. LPWSTR Username, // in - username to connnect as
  64. LPWSTR Password, // in - password for Username account
  65. BOOL bEstablish // in - TRUE=connect, FALSE=disconnect
  66. );
  67. BOOL
  68. EstablishShare(
  69. LPCWSTR Server, // in - server name
  70. LPWSTR Share, // in - share name to connect to
  71. LPWSTR Domain, // in - domain for credentials
  72. LPWSTR UserName, // in - username to connect as
  73. LPWSTR Password, // in - password for credentials
  74. BOOL bEstablish // in - TRUE=connect, FALSE=disconnect
  75. );
  76. //
  77. // Password Functionality
  78. //
  79. DWORD __stdcall StorePassword(PCWSTR pszIdentifier, PCWSTR pszPassword);
  80. DWORD __stdcall RetrievePassword(PCWSTR pszIdentifier, PWSTR pszPassword, size_t cchPassword);
  81. DWORD __stdcall GeneratePasswordIdentifier(PWSTR pszIdentifier, size_t cchIdentifier);