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.

115 lines
2.3 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<nt.h>
  13. #include<ntrtl.h>
  14. #include<nturtl.h>
  15. #include<windows.h>
  16. #define SECURITY_WIN32
  17. #include<security.h>
  18. #include<ntsecapi.h>
  19. #include<Winnetwk.h>
  20. #include<lmserver.h>
  21. #include<lmcons.h>
  22. #include<lm.h>
  23. //+---------------------------------------------------------------------------------------------------------
  24. //
  25. // Definitions
  26. //
  27. //+---------------------------------------------------------------------------------------------------------
  28. // local definitions
  29. #define MAX_STRING 255
  30. #define MAX_NUM_STRING 15
  31. #define WINLOGON_REGKEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"
  32. //+---------------------------------------------------------------------------------------------------------
  33. //
  34. // Prototypes
  35. //
  36. //+---------------------------------------------------------------------------------------------------------
  37. // from common.c
  38. VOID
  39. DisplayMessage(
  40. WCHAR *MessageText);
  41. WCHAR*
  42. GetErrorString(
  43. DWORD dwErrorCode);
  44. DWORD
  45. GetRegValueSZ(
  46. WCHAR *RegValue,
  47. WCHAR *ValueName,
  48. size_t RegValueLength);
  49. DWORD
  50. GetRegValueDWORD(
  51. WCHAR *ValueName,
  52. DWORD *RegValue);
  53. DWORD
  54. ClearRegValue(
  55. WCHAR* ValueName);
  56. DWORD
  57. SetRegValueSZ(
  58. WCHAR *ValueName,
  59. WCHAR *ValueData);
  60. DWORD
  61. SetRegValueDWORD(
  62. WCHAR *ValueName,
  63. DWORD dwValue);
  64. DWORD
  65. GetRegistryHandle(
  66. HKEY *hKey,
  67. REGSAM samDesired);
  68. DWORD
  69. GetPolicyHandle(
  70. LSA_HANDLE *LsaPolicyHandle);
  71. DWORD
  72. SetSecret(
  73. WCHAR *Secret,
  74. BOOL bClearSecret,
  75. WCHAR* SecretName);
  76. DWORD
  77. GetSecret(
  78. WCHAR *Secret,
  79. size_t SecretLength,
  80. WCHAR* SecretName);
  81. NET_API_STATUS
  82. GetMajorNTVersion(
  83. DWORD* Version,
  84. WCHAR* Server);
  85. DWORD GetUserNameAndPassword();
  86. DWORD
  87. GetConsoleStr(
  88. WCHAR* buf,
  89. DWORD buflen,
  90. BOOL hide,
  91. WCHAR* message,
  92. PDWORD len
  93. );