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.

96 lines
2.2 KiB

  1. #ifndef UNICODE
  2. #define UNICODE
  3. #define _UNICODE
  4. #endif
  5. //+---------------------------------------------------------------------------------------------------------
  6. //
  7. // Includes
  8. //
  9. //+---------------------------------------------------------------------------------------------------------
  10. #include<stdio.h>
  11. #include<stdlib.h>
  12. #include<windows.h>
  13. #include<winuser.h>
  14. #include<ntsecapi.h>
  15. #include<Winnetwk.h>
  16. #include<lmserver.h>
  17. #include<lmcons.h>
  18. #include<lm.h>
  19. //+---------------------------------------------------------------------------------------------------------
  20. //
  21. // Definitions
  22. //
  23. //+---------------------------------------------------------------------------------------------------------
  24. // from NTSTATUS.H
  25. #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) // ntsubauth
  26. #define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034L)
  27. // local definitions
  28. #define MAX_STRING 255
  29. #define WINLOGON_REGKEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"
  30. //
  31. // define whether we want the public version, or the private version.
  32. // in the public version:
  33. // - we don't display the LSASecret when we retrieve it on a -l call
  34. // - we make the remote registry calls requesting FULL CONTROL so that
  35. // you will need to be an admin on the target machine to run this.
  36. //
  37. #define PRIVATE_VERSION
  38. //+---------------------------------------------------------------------------------------------------------
  39. //
  40. // Prototypes
  41. //
  42. //+---------------------------------------------------------------------------------------------------------
  43. // from shared.c
  44. VOID
  45. DisplayMessage(
  46. WCHAR *MessageText);
  47. WCHAR*
  48. GetErrorString(
  49. DWORD dwErrorCode);
  50. DWORD
  51. GetRegValueSZ(
  52. WCHAR *RegValue,
  53. WCHAR *ValueName);
  54. DWORD
  55. ClearRegPassword();
  56. DWORD
  57. SetRegValueSZ(
  58. WCHAR *ValueName,
  59. WCHAR *ValueData);
  60. DWORD
  61. GetRegistryHandle(
  62. HKEY *hKey,
  63. REGSAM samDesired);
  64. DWORD
  65. GetPolicyHandle(
  66. LSA_HANDLE *LsaPolicyHandle);
  67. DWORD
  68. SetSecret(
  69. WCHAR *Password,
  70. BOOL bClearSecret);
  71. DWORD
  72. GetSecret(
  73. WCHAR *Password);
  74. DWORD
  75. GetMajorNTVersion(
  76. WCHAR *Server);