JwaSubAuth.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:20k
源码类别:

Windows编程

开发平台:

Delphi

  1. {******************************************************************************}
  2. {                                                                       }
  3. { Subauthentication packages API interface Unit for Object Pascal              }
  4. {                                                                       }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
  6. { Corporation. All Rights Reserved.                                            }
  7. {                 }
  8. { The original file is: subauth.h, released June 2000. The original Pascal     }
  9. { code is: SubAuth.pas, released December 2000. The initial developer of the   }
  10. { Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
  11. {                                                                              }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
  13. { Marcel van Brakel. All Rights Reserved.                                      }
  14. {                 }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  16. {                }
  17. { You may retrieve the latest version of this file at the Project JEDI home    }
  18. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  19. { http://members.chello.nl/m.vanbrakel2                                        }
  20. {                }
  21. { The contents of this file are used with permission, subject to the Mozilla   }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at      }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  25. {                                                                              }
  26. { Software distributed under the License is distributed on an "AS IS" basis,   }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License.    }
  29. {                                                                              }
  30. { Alternatively, the contents of this file may be used under the terms of the  }
  31. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  32. { provisions of the LGPL License are applicable instead of those above.        }
  33. { If you wish to allow use of your version of this file only under the terms   }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting  the provisions above and  }
  36. { replace  them with the notice and other provisions required by the LGPL      }
  37. { License.  If you do not delete the provisions above, a recipient may use     }
  38. { your version of this file under either the MPL or the LGPL License.          }
  39. {                 }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. {                 }
  42. {******************************************************************************}
  43. unit JwaSubAuth;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "subauth.h"'}
  47. {$HPPEMIT ''}
  48. {$I WINDEFINES.INC}
  49. interface
  50. uses
  51.   JwaWinType;
  52. type
  53.   SAM_HANDLE = PVOID;
  54.   {$EXTERNALSYM SAM_HANDLE}
  55.   PSAM_HANDLE = ^SAM_HANDLE;
  56.   {$EXTERNALSYM PSAM_HANDLE}
  57.   POLD_LARGE_INTEGER = ^OLD_LARGE_INTEGER;
  58.   {$EXTERNALSYM POLD_LARGE_INTEGER}
  59.   _OLD_LARGE_INTEGER = record
  60.     LowPart: ULONG;
  61.     HighPart: LONG;
  62.   end;
  63.   {$EXTERNALSYM _OLD_LARGE_INTEGER}
  64.   OLD_LARGE_INTEGER = _OLD_LARGE_INTEGER;
  65.   {$EXTERNALSYM OLD_LARGE_INTEGER}
  66.   TOldLargeInteger = OLD_LARGE_INTEGER;
  67.   POldLargeInteger = POLD_LARGE_INTEGER;
  68. //
  69. // User account control flags...
  70. //
  71. const
  72.   USER_ACCOUNT_DISABLED                = ($00000001);
  73.   {$EXTERNALSYM USER_ACCOUNT_DISABLED}
  74.   USER_HOME_DIRECTORY_REQUIRED         = ($00000002);
  75.   {$EXTERNALSYM USER_HOME_DIRECTORY_REQUIRED}
  76.   USER_PASSWORD_NOT_REQUIRED           = ($00000004);
  77.   {$EXTERNALSYM USER_PASSWORD_NOT_REQUIRED}
  78.   USER_TEMP_DUPLICATE_ACCOUNT          = ($00000008);
  79.   {$EXTERNALSYM USER_TEMP_DUPLICATE_ACCOUNT}
  80.   USER_NORMAL_ACCOUNT                  = ($00000010);
  81.   {$EXTERNALSYM USER_NORMAL_ACCOUNT}
  82.   USER_MNS_LOGON_ACCOUNT               = ($00000020);
  83.   {$EXTERNALSYM USER_MNS_LOGON_ACCOUNT}
  84.   USER_INTERDOMAIN_TRUST_ACCOUNT       = ($00000040);
  85.   {$EXTERNALSYM USER_INTERDOMAIN_TRUST_ACCOUNT}
  86.   USER_WORKSTATION_TRUST_ACCOUNT       = ($00000080);
  87.   {$EXTERNALSYM USER_WORKSTATION_TRUST_ACCOUNT}
  88.   USER_SERVER_TRUST_ACCOUNT            = ($00000100);
  89.   {$EXTERNALSYM USER_SERVER_TRUST_ACCOUNT}
  90.   USER_DONT_EXPIRE_PASSWORD            = ($00000200);
  91.   {$EXTERNALSYM USER_DONT_EXPIRE_PASSWORD}
  92.   USER_ACCOUNT_AUTO_LOCKED             = ($00000400);
  93.   {$EXTERNALSYM USER_ACCOUNT_AUTO_LOCKED}
  94.   USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED = ($00000800);
  95.   {$EXTERNALSYM USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED}
  96.   USER_SMARTCARD_REQUIRED              = ($00001000);
  97.   {$EXTERNALSYM USER_SMARTCARD_REQUIRED}
  98.   USER_TRUSTED_FOR_DELEGATION          = ($00002000);
  99.   {$EXTERNALSYM USER_TRUSTED_FOR_DELEGATION}
  100.   USER_NOT_DELEGATED                   = ($00004000);
  101.   {$EXTERNALSYM USER_NOT_DELEGATED}
  102.   USER_USE_DES_KEY_ONLY                = ($00008000);
  103.   {$EXTERNALSYM USER_USE_DES_KEY_ONLY}
  104.   USER_DONT_REQUIRE_PREAUTH            = ($00010000);
  105.   {$EXTERNALSYM USER_DONT_REQUIRE_PREAUTH}
  106.   USER_PASSWORD_EXPIRED                = ($00020000);
  107.   {$EXTERNALSYM USER_PASSWORD_EXPIRED}
  108.   USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = ($00040000);
  109.   {$EXTERNALSYM USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION}
  110.   NEXT_FREE_ACCOUNT_CONTROL_BIT        = (USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION shl 1);
  111.   {$EXTERNALSYM NEXT_FREE_ACCOUNT_CONTROL_BIT}
  112.   USER_MACHINE_ACCOUNT_MASK = USER_INTERDOMAIN_TRUST_ACCOUNT or USER_WORKSTATION_TRUST_ACCOUNT or USER_SERVER_TRUST_ACCOUNT;
  113.   {$EXTERNALSYM USER_MACHINE_ACCOUNT_MASK}
  114.   USER_ACCOUNT_TYPE_MASK    = USER_TEMP_DUPLICATE_ACCOUNT or USER_NORMAL_ACCOUNT or USER_MACHINE_ACCOUNT_MASK;
  115.   {$EXTERNALSYM USER_ACCOUNT_TYPE_MASK}
  116.   USER_COMPUTED_ACCOUNT_CONTROL_BITS = USER_ACCOUNT_AUTO_LOCKED or USER_PASSWORD_EXPIRED;
  117.   {$EXTERNALSYM USER_COMPUTED_ACCOUNT_CONTROL_BITS}
  118. //
  119. // Logon times may be expressed in day, hour, or minute granularity.
  120. //
  121. //              Days per week    = 7
  122. //              Hours per week   = 168
  123. //              Minutes per week = 10080
  124. //
  125.   SAM_DAYS_PER_WEEK    = (7);
  126.   {$EXTERNALSYM SAM_DAYS_PER_WEEK}
  127.   SAM_HOURS_PER_WEEK   = (24 * SAM_DAYS_PER_WEEK);
  128.   {$EXTERNALSYM SAM_HOURS_PER_WEEK}
  129.   SAM_MINUTES_PER_WEEK = (60 * SAM_HOURS_PER_WEEK);
  130.   {$EXTERNALSYM SAM_MINUTES_PER_WEEK}
  131. type
  132.   PLOGON_HOURS = ^LOGON_HOURS;
  133.   {$EXTERNALSYM PLOGON_HOURS}
  134.   _LOGON_HOURS = record
  135.     UnitsPerWeek: USHORT;
  136.     //
  137.     // UnitsPerWeek is the number of equal length time units the week is
  138.     // divided into.  This value is used to compute the length of the bit
  139.     // string in logon_hours.  Must be less than or equal to
  140.     // SAM_UNITS_PER_WEEK (10080) for this release.
  141.     //
  142.     // LogonHours is a bit map of valid logon times.  Each bit represents
  143.     // a unique division in a week.  The largest bit map supported is 1260
  144.     // bytes (10080 bits), which represents minutes per week.  In this case
  145.     // the first bit (bit 0, byte 0) is Sunday, 00:00:00 - 00-00:59; bit 1,
  146.     // byte 0 is Sunday, 00:01:00 - 00:01:59, etc.  A NULL pointer means
  147.     // DONT_CHANGE for SamSetInformationUser() calls.
  148.     //
  149.     LogonHours: PUCHAR;
  150.   end;
  151.   {$EXTERNALSYM _LOGON_HOURS}
  152.   LOGON_HOURS = _LOGON_HOURS;
  153.   {$EXTERNALSYM LOGON_HOURS}
  154.   TLogonHours = LOGON_HOURS;
  155.   PLogonHours = PLOGON_HOURS;
  156.   PSR_SECURITY_DESCRIPTOR = ^SR_SECURITY_DESCRIPTOR;
  157.   {$EXTERNALSYM PSR_SECURITY_DESCRIPTOR}
  158.   _SR_SECURITY_DESCRIPTOR = record
  159.     Length: ULONG;
  160.     SecurityDescriptor: PUCHAR;
  161.   end;
  162.   {$EXTERNALSYM _SR_SECURITY_DESCRIPTOR}
  163.   SR_SECURITY_DESCRIPTOR = _SR_SECURITY_DESCRIPTOR;
  164.   {$EXTERNALSYM SR_SECURITY_DESCRIPTOR}
  165.   TSrSecurityDescriptor = SR_SECURITY_DESCRIPTOR;
  166.   PSrSecurityDescriptor = PSR_SECURITY_DESCRIPTOR;
  167. // #include "pshpack4.h"
  168.   PUSER_ALL_INFORMATION = ^USER_ALL_INFORMATION;
  169.   {$EXTERNALSYM PUSER_ALL_INFORMATION}
  170.   _USER_ALL_INFORMATION = record
  171.     LastLogon: LARGE_INTEGER;
  172.     LastLogoff: LARGE_INTEGER;
  173.     PasswordLastSet: LARGE_INTEGER;
  174.     AccountExpires: LARGE_INTEGER;
  175.     PasswordCanChange: LARGE_INTEGER;
  176.     PasswordMustChange: LARGE_INTEGER;
  177.     UserName: UNICODE_STRING;
  178.     FullName: UNICODE_STRING;
  179.     HomeDirectory: UNICODE_STRING;
  180.     HomeDirectoryDrive: UNICODE_STRING;
  181.     ScriptPath: UNICODE_STRING;
  182.     ProfilePath: UNICODE_STRING;
  183.     AdminComment: UNICODE_STRING;
  184.     WorkStations: UNICODE_STRING;
  185.     UserComment: UNICODE_STRING;
  186.     Parameters: UNICODE_STRING;
  187.     LmPassword: UNICODE_STRING;
  188.     NtPassword: UNICODE_STRING;
  189.     PrivateData: UNICODE_STRING;
  190.     SecurityDescriptor: SR_SECURITY_DESCRIPTOR;
  191.     UserId: ULONG;
  192.     PrimaryGroupId: ULONG;
  193.     UserAccountControl: ULONG;
  194.     WhichFields: ULONG;
  195.     LogonHours: LOGON_HOURS;
  196.     BadPasswordCount: USHORT;
  197.     LogonCount: USHORT;
  198.     CountryCode: USHORT;
  199.     CodePage: USHORT;
  200.     LmPasswordPresent: ByteBool;
  201.     NtPasswordPresent: ByteBool;
  202.     PasswordExpired: ByteBool;
  203.     PrivateDataSensitive: ByteBool;
  204.   end;
  205.   {$EXTERNALSYM _USER_ALL_INFORMATION}
  206.   USER_ALL_INFORMATION = _USER_ALL_INFORMATION;
  207.   {$EXTERNALSYM USER_ALL_INFORMATION}
  208.   TUserAllInformation = USER_ALL_INFORMATION;
  209.   PUserAllInformation = PUSER_ALL_INFORMATION;
  210. // #include "poppack.h"
  211. const
  212.   USER_ALL_PARAMETERS = $00200000;
  213.   {$EXTERNALSYM USER_ALL_PARAMETERS}
  214.   CLEAR_BLOCK_LENGTH = 8;
  215.   {$EXTERNALSYM CLEAR_BLOCK_LENGTH}
  216. type
  217.   PCLEAR_BLOCK = ^CLEAR_BLOCK;
  218.   {$EXTERNALSYM PCLEAR_BLOCK}
  219.   _CLEAR_BLOCK = record
  220.     data: array [0..CLEAR_BLOCK_LENGTH - 1] of CHAR;
  221.   end;
  222.   {$EXTERNALSYM _CLEAR_BLOCK}
  223.   CLEAR_BLOCK = _CLEAR_BLOCK;
  224.   {$EXTERNALSYM CLEAR_BLOCK}
  225.   TClearBlock = CLEAR_BLOCK;
  226.   PClearBlock = PCLEAR_BLOCK;
  227. const
  228.   CYPHER_BLOCK_LENGTH = 8;
  229.   {$EXTERNALSYM CYPHER_BLOCK_LENGTH}
  230. type
  231.   PCYPHER_BLOCK = ^CYPHER_BLOCK;
  232.   {$EXTERNALSYM PCYPHER_BLOCK}
  233.   _CYPHER_BLOCK = record
  234.     data: array [0..CYPHER_BLOCK_LENGTH - 1] of CHAR;
  235.   end;
  236.   {$EXTERNALSYM _CYPHER_BLOCK}
  237.   CYPHER_BLOCK = _CYPHER_BLOCK;
  238.   {$EXTERNALSYM CYPHER_BLOCK}
  239.   TCypherBlock = CYPHER_BLOCK;
  240.   PCypherBlock = PCYPHER_BLOCK;
  241.   PLM_OWF_PASSWORD = ^LM_OWF_PASSWORD;
  242.   {$EXTERNALSYM PLM_OWF_PASSWORD}
  243.   _LM_OWF_PASSWORD = record
  244.     data: array [0..1] of CYPHER_BLOCK;
  245.   end;
  246.   {$EXTERNALSYM _LM_OWF_PASSWORD}
  247.   LM_OWF_PASSWORD = _LM_OWF_PASSWORD;
  248.   {$EXTERNALSYM LM_OWF_PASSWORD}
  249.   TLmOwfPassword = LM_OWF_PASSWORD;
  250.   PLmOwfPassword = PLM_OWF_PASSWORD;
  251.   LM_CHALLENGE = CLEAR_BLOCK;
  252.   {$EXTERNALSYM LM_CHALLENGE}
  253.   PLM_CHALLENGE = ^LM_CHALLENGE;
  254.   {$EXTERNALSYM PLM_CHALLENGE}
  255.   NT_OWF_PASSWORD = LM_OWF_PASSWORD;
  256.   {$EXTERNALSYM NT_OWF_PASSWORD}
  257.   PNT_OWF_PASSWORD = ^NT_OWF_PASSWORD;
  258.   {$EXTERNALSYM PNT_OWF_PASSWORD}
  259.   NT_CHALLENGE = LM_CHALLENGE;
  260.   {$EXTERNALSYM NT_CHALLENGE}
  261.   PNT_CHALLENGE = ^NT_CHALLENGE;
  262.   {$EXTERNALSYM PNT_CHALLENGE}
  263. const
  264.   USER_SESSION_KEY_LENGTH = (CYPHER_BLOCK_LENGTH * 2);
  265.   {$EXTERNALSYM USER_SESSION_KEY_LENGTH}
  266. type
  267.   PUSER_SESSION_KEY = ^USER_SESSION_KEY;
  268.   {$EXTERNALSYM PUSER_SESSION_KEY}
  269.   _USER_SESSION_KEY = record
  270.     data: array [0..1] of CYPHER_BLOCK;
  271.   end;
  272.   {$EXTERNALSYM _USER_SESSION_KEY}
  273.   USER_SESSION_KEY = _USER_SESSION_KEY;
  274.   {$EXTERNALSYM USER_SESSION_KEY}
  275.   TUserSessionKey = USER_SESSION_KEY;
  276.   PUserSessionKey = PUSER_SESSION_KEY;
  277.   _NETLOGON_LOGON_INFO_CLASS = (
  278.     NetlogonFiller0,
  279.     NetlogonInteractiveInformation,
  280.     NetlogonNetworkInformation,
  281.     NetlogonServiceInformation,
  282.     NetlogonGenericInformation,
  283.     NetlogonInteractiveTransitiveInformation,
  284.     NetlogonNetworkTransitiveInformation,
  285.     NetlogonServiceTransitiveInformation);
  286.   {$EXTERNALSYM _NETLOGON_LOGON_INFO_CLASS}
  287.   NETLOGON_LOGON_INFO_CLASS = _NETLOGON_LOGON_INFO_CLASS;
  288.   {$EXTERNALSYM NETLOGON_LOGON_INFO_CLASS}
  289.   PNETLOGON_LOGON_IDENTITY_INFO = ^NETLOGON_LOGON_IDENTITY_INFO;
  290.   {$EXTERNALSYM PNETLOGON_LOGON_IDENTITY_INFO}
  291.   _NETLOGON_LOGON_IDENTITY_INFO = record
  292.     LogonDomainName: UNICODE_STRING;
  293.     ParameterControl: ULONG;
  294.     LogonId: OLD_LARGE_INTEGER;
  295.     UserName: UNICODE_STRING;
  296.     Workstation: UNICODE_STRING;
  297.   end;
  298.   {$EXTERNALSYM _NETLOGON_LOGON_IDENTITY_INFO}
  299.   NETLOGON_LOGON_IDENTITY_INFO = _NETLOGON_LOGON_IDENTITY_INFO;
  300.   {$EXTERNALSYM NETLOGON_LOGON_IDENTITY_INFO}
  301.   TNetlogonLogonIdentityInfo = NETLOGON_LOGON_IDENTITY_INFO;
  302.   PNetlogonLogonIdentityInfo = PNETLOGON_LOGON_IDENTITY_INFO;
  303.   PNETLOGON_INTERACTIVE_INFO = ^NETLOGON_INTERACTIVE_INFO;
  304.   {$EXTERNALSYM PNETLOGON_INTERACTIVE_INFO}
  305.   _NETLOGON_INTERACTIVE_INFO = record
  306.     Identity: NETLOGON_LOGON_IDENTITY_INFO;
  307.     LmOwfPassword: LM_OWF_PASSWORD;
  308.     NtOwfPassword: NT_OWF_PASSWORD;
  309.   end;
  310.   {$EXTERNALSYM _NETLOGON_INTERACTIVE_INFO}
  311.   NETLOGON_INTERACTIVE_INFO = _NETLOGON_INTERACTIVE_INFO;
  312.   {$EXTERNALSYM NETLOGON_INTERACTIVE_INFO}
  313.   TNetlogonInteractiveInfo = NETLOGON_INTERACTIVE_INFO;
  314.   PNetlogonInteractiveInfo = PNETLOGON_INTERACTIVE_INFO;
  315.   PNETLOGON_SERVICE_INFO = ^NETLOGON_SERVICE_INFO;
  316.   {$EXTERNALSYM PNETLOGON_SERVICE_INFO}
  317.   _NETLOGON_SERVICE_INFO = record
  318.     Identity: NETLOGON_LOGON_IDENTITY_INFO;
  319.     LmOwfPassword: LM_OWF_PASSWORD;
  320.     NtOwfPassword: NT_OWF_PASSWORD;
  321.   end;
  322.   {$EXTERNALSYM _NETLOGON_SERVICE_INFO}
  323.   NETLOGON_SERVICE_INFO = _NETLOGON_SERVICE_INFO;
  324.   {$EXTERNALSYM NETLOGON_SERVICE_INFO}
  325.   TNetlogonServiceInfo = NETLOGON_SERVICE_INFO;
  326.   PNetlogonServiceInfo = PNETLOGON_SERVICE_INFO;
  327.   PNETLOGON_NETWORK_INFO = ^NETLOGON_NETWORK_INFO;
  328.   {$EXTERNALSYM PNETLOGON_NETWORK_INFO}
  329.   _NETLOGON_NETWORK_INFO = record
  330.     Identity: NETLOGON_LOGON_IDENTITY_INFO;
  331.     LmChallenge: LM_CHALLENGE;
  332.     NtChallengeResponse: STRING;
  333.     LmChallengeResponse: STRING;
  334.   end;
  335.   {$EXTERNALSYM _NETLOGON_NETWORK_INFO}
  336.   NETLOGON_NETWORK_INFO = _NETLOGON_NETWORK_INFO;
  337.   {$EXTERNALSYM NETLOGON_NETWORK_INFO}
  338.   TNetlogonNetworkInfo = NETLOGON_NETWORK_INFO;
  339.   PNetlogonNetworkInfo = PNETLOGON_NETWORK_INFO;
  340.   PNETLOGON_GENERIC_INFO = ^NETLOGON_GENERIC_INFO;
  341.   {$EXTERNALSYM PNETLOGON_GENERIC_INFO}
  342.   _NETLOGON_GENERIC_INFO = record
  343.     Identity: NETLOGON_LOGON_IDENTITY_INFO;
  344.     PackageName: UNICODE_STRING;
  345.     DataLength: ULONG;
  346.     LogonData: PUCHAR;
  347.   end;
  348.   {$EXTERNALSYM _NETLOGON_GENERIC_INFO}
  349.   NETLOGON_GENERIC_INFO = _NETLOGON_GENERIC_INFO;
  350.   {$EXTERNALSYM NETLOGON_GENERIC_INFO}
  351.   TNetlogonGenericInfo = NETLOGON_GENERIC_INFO;
  352.   PNetlogonGenericInfo = PNETLOGON_GENERIC_INFO;
  353. // Values for Flags
  354. const
  355.   MSV1_0_PASSTHRU    = $01;
  356.   {$EXTERNALSYM MSV1_0_PASSTHRU}
  357.   MSV1_0_GUEST_LOGON = $02;
  358.   {$EXTERNALSYM MSV1_0_GUEST_LOGON}
  359. //function Msv1_0SubAuthenticationRoutine(LogonLevel: NETLOGON_LOGON_INFO_CLASS;
  360. //  LogonInformation: PVOID; Flags: ULONG; UserAll: PUSER_ALL_INFORMATION;
  361. //  WhichFields, UserFlags: PULONG; Authoritative: PBOOLEAN; LogoffTime,
  362. //  KickoffTime: PLARGE_INTEGER): NTSTATUS; stdcall;
  363. //{$EXTERNALSYM Msv1_0SubAuthenticationRoutine}
  364. type
  365.   PMSV1_0_VALIDATION_INFO = ^MSV1_0_VALIDATION_INFO;
  366.   {$EXTERNALSYM PMSV1_0_VALIDATION_INFO}
  367.   _MSV1_0_VALIDATION_INFO = record
  368.     LogoffTime: LARGE_INTEGER;
  369.     KickoffTime: LARGE_INTEGER;
  370.     LogonServer: UNICODE_STRING;
  371.     LogonDomainName: UNICODE_STRING;
  372.     SessionKey: USER_SESSION_KEY;
  373.     Authoritative: ByteBool;
  374.     UserFlags: ULONG;
  375.     WhichFields: ULONG;
  376.     UserId: ULONG;
  377.   end;
  378.   {$EXTERNALSYM _MSV1_0_VALIDATION_INFO}
  379.   MSV1_0_VALIDATION_INFO = _MSV1_0_VALIDATION_INFO;
  380.   {$EXTERNALSYM MSV1_0_VALIDATION_INFO}
  381.   TMsv10ValidationInfo = MSV1_0_VALIDATION_INFO;
  382.   PMsv10ValidationInfo = PMSV1_0_VALIDATION_INFO;
  383. // values for WhichFields
  384. const
  385.   MSV1_0_VALIDATION_LOGOFF_TIME  = $00000001;
  386.   {$EXTERNALSYM MSV1_0_VALIDATION_LOGOFF_TIME}
  387.   MSV1_0_VALIDATION_KICKOFF_TIME = $00000002;
  388.   {$EXTERNALSYM MSV1_0_VALIDATION_KICKOFF_TIME}
  389.   MSV1_0_VALIDATION_LOGON_SERVER = $00000004;
  390.   {$EXTERNALSYM MSV1_0_VALIDATION_LOGON_SERVER}
  391.   MSV1_0_VALIDATION_LOGON_DOMAIN = $00000008;
  392.   {$EXTERNALSYM MSV1_0_VALIDATION_LOGON_DOMAIN}
  393.   MSV1_0_VALIDATION_SESSION_KEY  = $00000010;
  394.   {$EXTERNALSYM MSV1_0_VALIDATION_SESSION_KEY}
  395.   MSV1_0_VALIDATION_USER_FLAGS   = $00000020;
  396.   {$EXTERNALSYM MSV1_0_VALIDATION_USER_FLAGS}
  397.   MSV1_0_VALIDATION_USER_ID      = $00000040;
  398.   {$EXTERNALSYM MSV1_0_VALIDATION_USER_ID}
  399. // legal values for ActionsPerformed
  400.   MSV1_0_SUBAUTH_ACCOUNT_DISABLED = $00000001;
  401.   {$EXTERNALSYM MSV1_0_SUBAUTH_ACCOUNT_DISABLED}
  402.   MSV1_0_SUBAUTH_PASSWORD         = $00000002;
  403.   {$EXTERNALSYM MSV1_0_SUBAUTH_PASSWORD}
  404.   MSV1_0_SUBAUTH_WORKSTATIONS     = $00000004;
  405.   {$EXTERNALSYM MSV1_0_SUBAUTH_WORKSTATIONS}
  406.   MSV1_0_SUBAUTH_LOGON_HOURS      = $00000008;
  407.   {$EXTERNALSYM MSV1_0_SUBAUTH_LOGON_HOURS}
  408.   MSV1_0_SUBAUTH_ACCOUNT_EXPIRY   = $00000010;
  409.   {$EXTERNALSYM MSV1_0_SUBAUTH_ACCOUNT_EXPIRY}
  410.   MSV1_0_SUBAUTH_PASSWORD_EXPIRY  = $00000020;
  411.   {$EXTERNALSYM MSV1_0_SUBAUTH_PASSWORD_EXPIRY}
  412.   MSV1_0_SUBAUTH_ACCOUNT_TYPE     = $00000040;
  413.   {$EXTERNALSYM MSV1_0_SUBAUTH_ACCOUNT_TYPE}
  414.   MSV1_0_SUBAUTH_LOCKOUT          = $00000080;
  415.   {$EXTERNALSYM MSV1_0_SUBAUTH_LOCKOUT}
  416. //function Msv1_0SubAuthenticationRoutineEx(LogonLevel: NETLOGON_LOGON_INFO_CLASS;
  417. //  LogonInformation: PVOID; Flags: ULONG; UserAll: PUSER_ALL_INFORMATION;
  418. //  UserHandle: SAM_HANDLE; ValidationInfo: PMSV1_0_VALIDATION_INFO;
  419. //  ActionsPerformed: PULONG): NTSTATUS; stdcall;
  420. //{$EXTERNALSYM Msv1_0SubAuthenticationRoutineEx}
  421. //function Msv1_0SubAuthenticationRoutineGeneric(SubmitBuffer: PVOID;
  422. //  SubmitBufferLength: ULONG; ReturnBufferLength: PULONG;
  423. //  ReturnBuffer: PPVOID): NTSTATUS; stdcall;
  424. //{$EXTERNALSYM Msv1_0SubAuthenticationRoutineGeneric}
  425. //function Msv1_0SubAuthenticationFilter(LogonLevel: NETLOGON_LOGON_INFO_CLASS;
  426. //  LogonInformation: PVOID; Flags: ULONG; UserAll: PUSER_ALL_INFORMATION;
  427. //  WhichFields, UserFlags: PULONG; Authoritative: PBOOLEAN; LogoffTime,
  428. //  KickoffTime: PLARGE_INTEGER): NTSTATUS; stdcall;
  429. //{$EXTERNALSYM Msv1_0SubAuthenticationFilter}
  430. const
  431.   STATUS_SUCCESS                = NTSTATUS($00000000);
  432.   {$EXTERNALSYM STATUS_SUCCESS}
  433.   STATUS_INVALID_INFO_CLASS     = NTSTATUS($C0000003);
  434.   {$EXTERNALSYM STATUS_INVALID_INFO_CLASS}
  435.   STATUS_NO_SUCH_USER           = NTSTATUS($C0000064);
  436.   {$EXTERNALSYM STATUS_NO_SUCH_USER}
  437.   STATUS_WRONG_PASSWORD         = NTSTATUS($C000006A);
  438.   {$EXTERNALSYM STATUS_WRONG_PASSWORD}
  439.   STATUS_PASSWORD_RESTRICTION   = NTSTATUS($C000006C);
  440.   {$EXTERNALSYM STATUS_PASSWORD_RESTRICTION}
  441.   STATUS_LOGON_FAILURE          = NTSTATUS($C000006D);
  442.   {$EXTERNALSYM STATUS_LOGON_FAILURE}
  443.   STATUS_ACCOUNT_RESTRICTION    = NTSTATUS($C000006E);
  444.   {$EXTERNALSYM STATUS_ACCOUNT_RESTRICTION}
  445.   STATUS_INVALID_LOGON_HOURS    = NTSTATUS($C000006F);
  446.   {$EXTERNALSYM STATUS_INVALID_LOGON_HOURS}
  447.   STATUS_INVALID_WORKSTATION    = NTSTATUS($C0000070);
  448.   {$EXTERNALSYM STATUS_INVALID_WORKSTATION}
  449.   STATUS_PASSWORD_EXPIRED       = NTSTATUS($C0000071);
  450.   {$EXTERNALSYM STATUS_PASSWORD_EXPIRED}
  451.   STATUS_ACCOUNT_DISABLED       = NTSTATUS($C0000072);
  452.   {$EXTERNALSYM STATUS_ACCOUNT_DISABLED}
  453.   STATUS_INSUFFICIENT_RESOURCES = NTSTATUS($C000009A);
  454.   {$EXTERNALSYM STATUS_INSUFFICIENT_RESOURCES}
  455.   STATUS_ACCOUNT_EXPIRED        = NTSTATUS($C0000193);
  456.   {$EXTERNALSYM STATUS_ACCOUNT_EXPIRED}
  457.   STATUS_PASSWORD_MUST_CHANGE   = NTSTATUS($C0000224);
  458.   {$EXTERNALSYM STATUS_PASSWORD_MUST_CHANGE}
  459.   STATUS_ACCOUNT_LOCKED_OUT     = NTSTATUS($C0000234);
  460.   {$EXTERNALSYM STATUS_ACCOUNT_LOCKED_OUT}
  461. implementation
  462. end.