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.

109 lines
2.8 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // ezlogon.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Describes the abbreviated IAS version of LsaLogonUser.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 08/15/1998 Original version.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #ifndef _EZLOGON_H_
  19. #define _EZLOGON_H_
  20. #if _MSC_VER >= 1000
  21. #pragma once
  22. #endif
  23. #include <ntmsv1_0.h>
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. //////////
  28. // Handle to the IAS Logon Process.
  29. //////////
  30. extern LSA_HANDLE theLogonProcess;
  31. //////////
  32. // The MSV1_0 authentication package.
  33. //////////
  34. extern ULONG theMSV1_0_Package;
  35. DWORD
  36. WINAPI
  37. IASLogonInitialize( VOID );
  38. VOID
  39. WINAPI
  40. IASLogonShutdown( VOID );
  41. VOID
  42. WINAPI
  43. IASInitAuthInfo(
  44. IN PVOID AuthInfo,
  45. IN DWORD FixedLength,
  46. IN PCWSTR UserName,
  47. IN PCWSTR Domain,
  48. OUT PBYTE* Data
  49. );
  50. DWORD
  51. WINAPI
  52. IASLogonUser(
  53. IN PVOID AuthInfo,
  54. IN ULONG AuthInfoLength,
  55. OPTIONAL OUT PMSV1_0_LM20_LOGON_PROFILE *Profile,
  56. OUT PHANDLE Token
  57. );
  58. ///////////////////////////////////////////////////////////////////////////////
  59. //
  60. // Assorted macros to initialize self-relative logon information.
  61. //
  62. ///////////////////////////////////////////////////////////////////////////////
  63. // Copy a Unicode string into a UNICODE_STRING.
  64. #define IASInitUnicodeString(str, buf, src) \
  65. { (str).Length = (USHORT)(wcslen(src) * sizeof(WCHAR)); \
  66. (str).MaximumLength = (str).Length; \
  67. (str).Buffer = (PWSTR)memcpy((buf), (src), (str).MaximumLength); \
  68. (buf) += (str).MaximumLength; }
  69. // Copy a ANSI string into a STRING.
  70. #define IASInitAnsiString(str, buf, src) \
  71. { (str).Length = (USHORT)(strlen(src) * sizeof(CHAR)); \
  72. (str).MaximumLength = (str).Length; \
  73. (str).Buffer = (PSTR)memcpy((buf), (src), (str).MaximumLength); \
  74. (buf) += (str).MaximumLength; }
  75. // Copy an octet string into a STRING.
  76. #define IASInitOctetString(str, buf, src, srclen) \
  77. { (str).Length = (USHORT)(srclen); \
  78. (str).MaximumLength = (str).Length; \
  79. (str).Buffer = (PSTR)memcpy((buf), (src), (str).MaximumLength); \
  80. (buf) += (str).MaximumLength; }
  81. // Copy an ANSI string into a UNICODE_STRING.
  82. #define IASInitUnicodeStringFromAnsi(str, buf, src) \
  83. { (str).MaximumLength = (USHORT)(sizeof(WCHAR) * ((src).Length + 1)); \
  84. (str).Buffer = (PWSTR)(buf); \
  85. RtlAnsiStringToUnicodeString(&(str), &(src), FALSE); \
  86. (buf) += ((str).MaximumLength = (str).Length); }
  87. // Copy a fixed-size array into a fixed-size array of the same size.
  88. #define IASInitFixedArray(dst, src) \
  89. { memcpy((dst), (src), sizeof(dst)); }
  90. #ifdef __cplusplus
  91. }
  92. #endif
  93. #endif // _EZLOGON_H_