"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.05.0-linux-x86_64/include/freebasic/win/subauth.bi" (31 Jan 2016, 10070 Bytes) of package /linux/privat/FreeBASIC-1.05.0-linux-x86_64.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' FreeBASIC binding for mingw-w64-v4.0.4
    2 ''
    3 '' based on the C header files:
    4 ''   DISCLAIMER
    5 ''   This file has no copyright assigned and is placed in the Public Domain.
    6 ''   This file is part of the mingw-w64 runtime package.
    7 ''
    8 ''   The mingw-w64 runtime package and its code is distributed in the hope that it 
    9 ''   will be useful but WITHOUT ANY WARRANTY.  ALL WARRANTIES, EXPRESSED OR 
   10 ''   IMPLIED ARE HEREBY DISCLAIMED.  This includes but is not limited to 
   11 ''   warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   12 ''
   13 '' translated to FreeBASIC by:
   14 ''   Copyright © 2015 FreeBASIC development team
   15 
   16 #pragma once
   17 
   18 extern "Windows"
   19 
   20 #define _NTSUBAUTH_
   21 
   22 type _OLD_LARGE_INTEGER
   23     LowPart as ULONG
   24     HighPart as LONG
   25 end type
   26 
   27 type OLD_LARGE_INTEGER as _OLD_LARGE_INTEGER
   28 type POLD_LARGE_INTEGER as _OLD_LARGE_INTEGER ptr
   29 #define NT_SUCCESS(Status) (cast(NTSTATUS, (Status)) >= 0)
   30 type SAM_HANDLE as PVOID
   31 type PSAM_HANDLE as PVOID ptr
   32 #define _NTSAM_SAM_HANDLE_
   33 const USER_ACCOUNT_DISABLED = &h00000001
   34 const USER_HOME_DIRECTORY_REQUIRED = &h00000002
   35 const USER_PASSWORD_NOT_REQUIRED = &h00000004
   36 const USER_TEMP_DUPLICATE_ACCOUNT = &h00000008
   37 const USER_NORMAL_ACCOUNT = &h00000010
   38 const USER_MNS_LOGON_ACCOUNT = &h00000020
   39 const USER_INTERDOMAIN_TRUST_ACCOUNT = &h00000040
   40 const USER_WORKSTATION_TRUST_ACCOUNT = &h00000080
   41 const USER_SERVER_TRUST_ACCOUNT = &h00000100
   42 const USER_DONT_EXPIRE_PASSWORD = &h00000200
   43 const USER_ACCOUNT_AUTO_LOCKED = &h00000400
   44 const USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED = &h00000800
   45 const USER_SMARTCARD_REQUIRED = &h00001000
   46 const USER_TRUSTED_FOR_DELEGATION = &h00002000
   47 const USER_NOT_DELEGATED = &h00004000
   48 const USER_USE_DES_KEY_ONLY = &h00008000
   49 const USER_DONT_REQUIRE_PREAUTH = &h00010000
   50 const USER_PASSWORD_EXPIRED = &h00020000
   51 const USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = &h00040000
   52 const USER_NO_AUTH_DATA_REQUIRED = &h00080000
   53 const NEXT_FREE_ACCOUNT_CONTROL_BIT = USER_NO_AUTH_DATA_REQUIRED shl 1
   54 const USER_MACHINE_ACCOUNT_MASK = (USER_INTERDOMAIN_TRUST_ACCOUNT or USER_WORKSTATION_TRUST_ACCOUNT) or USER_SERVER_TRUST_ACCOUNT
   55 const USER_ACCOUNT_TYPE_MASK = (USER_TEMP_DUPLICATE_ACCOUNT or USER_NORMAL_ACCOUNT) or USER_MACHINE_ACCOUNT_MASK
   56 const USER_COMPUTED_ACCOUNT_CONTROL_BITS = USER_ACCOUNT_AUTO_LOCKED or USER_PASSWORD_EXPIRED
   57 const SAM_DAYS_PER_WEEK = 7
   58 const SAM_HOURS_PER_WEEK = 24 * SAM_DAYS_PER_WEEK
   59 const SAM_MINUTES_PER_WEEK = 60 * SAM_HOURS_PER_WEEK
   60 
   61 type _LOGON_HOURS
   62     UnitsPerWeek as USHORT
   63     LogonHours as PUCHAR
   64 end type
   65 
   66 type LOGON_HOURS as _LOGON_HOURS
   67 type PLOGON_HOURS as _LOGON_HOURS ptr
   68 
   69 type _SR_SECURITY_DESCRIPTOR
   70     Length as ULONG
   71     SecurityDescriptor as PUCHAR
   72 end type
   73 
   74 type SR_SECURITY_DESCRIPTOR as _SR_SECURITY_DESCRIPTOR
   75 type PSR_SECURITY_DESCRIPTOR as _SR_SECURITY_DESCRIPTOR ptr
   76 #define _NTSAM_USER_ACCOUNT_FLAG_
   77 
   78 type _USER_ALL_INFORMATION field = 4
   79     LastLogon as LARGE_INTEGER
   80     LastLogoff as LARGE_INTEGER
   81     PasswordLastSet as LARGE_INTEGER
   82     AccountExpires as LARGE_INTEGER
   83     PasswordCanChange as LARGE_INTEGER
   84     PasswordMustChange as LARGE_INTEGER
   85     UserName as UNICODE_STRING
   86     FullName as UNICODE_STRING
   87     HomeDirectory as UNICODE_STRING
   88     HomeDirectoryDrive as UNICODE_STRING
   89     ScriptPath as UNICODE_STRING
   90     ProfilePath as UNICODE_STRING
   91     AdminComment as UNICODE_STRING
   92     WorkStations as UNICODE_STRING
   93     UserComment as UNICODE_STRING
   94     Parameters as UNICODE_STRING
   95     LmPassword as UNICODE_STRING
   96     NtPassword as UNICODE_STRING
   97     PrivateData as UNICODE_STRING
   98     SecurityDescriptor as SR_SECURITY_DESCRIPTOR
   99     UserId as ULONG
  100     PrimaryGroupId as ULONG
  101     UserAccountControl as ULONG
  102     WhichFields as ULONG
  103     LogonHours as LOGON_HOURS
  104     BadPasswordCount as USHORT
  105     LogonCount as USHORT
  106     CountryCode as USHORT
  107     CodePage as USHORT
  108     LmPasswordPresent as WINBOOLEAN
  109     NtPasswordPresent as WINBOOLEAN
  110     PasswordExpired as WINBOOLEAN
  111     PrivateDataSensitive as WINBOOLEAN
  112 end type
  113 
  114 type USER_ALL_INFORMATION as _USER_ALL_INFORMATION
  115 type PUSER_ALL_INFORMATION as _USER_ALL_INFORMATION ptr
  116 #define _NTSAM_USER_ALL_INFO_
  117 const USER_ALL_PARAMETERS = &h00200000
  118 #define _NTSAM_SAM_USER_PARMS_
  119 const CLEAR_BLOCK_LENGTH = 8
  120 
  121 type _CLEAR_BLOCK
  122     data as zstring * 8
  123 end type
  124 
  125 type CLEAR_BLOCK as _CLEAR_BLOCK
  126 type PCLEAR_BLOCK as CLEAR_BLOCK ptr
  127 const CYPHER_BLOCK_LENGTH = 8
  128 
  129 type _CYPHER_BLOCK
  130     data as zstring * 8
  131 end type
  132 
  133 type CYPHER_BLOCK as _CYPHER_BLOCK
  134 type PCYPHER_BLOCK as CYPHER_BLOCK ptr
  135 
  136 type _LM_OWF_PASSWORD
  137     data(0 to 1) as CYPHER_BLOCK
  138 end type
  139 
  140 type LM_OWF_PASSWORD as _LM_OWF_PASSWORD
  141 type PLM_OWF_PASSWORD as LM_OWF_PASSWORD ptr
  142 type LM_CHALLENGE as CLEAR_BLOCK
  143 type PLM_CHALLENGE as LM_CHALLENGE ptr
  144 type NT_OWF_PASSWORD as LM_OWF_PASSWORD
  145 type PNT_OWF_PASSWORD as NT_OWF_PASSWORD ptr
  146 type NT_CHALLENGE as LM_CHALLENGE
  147 type PNT_CHALLENGE as NT_CHALLENGE ptr
  148 const USER_SESSION_KEY_LENGTH = CYPHER_BLOCK_LENGTH * 2
  149 
  150 type _USER_SESSION_KEY
  151     data(0 to 1) as CYPHER_BLOCK
  152 end type
  153 
  154 type USER_SESSION_KEY as _USER_SESSION_KEY
  155 type PUSER_SESSION_KEY as USER_SESSION_KEY ptr
  156 
  157 type _NETLOGON_LOGON_INFO_CLASS as long
  158 enum
  159     NetlogonInteractiveInformation = 1
  160     NetlogonNetworkInformation
  161     NetlogonServiceInformation
  162     NetlogonGenericInformation
  163     NetlogonInteractiveTransitiveInformation
  164     NetlogonNetworkTransitiveInformation
  165     NetlogonServiceTransitiveInformation
  166 end enum
  167 
  168 type NETLOGON_LOGON_INFO_CLASS as _NETLOGON_LOGON_INFO_CLASS
  169 
  170 type _NETLOGON_LOGON_IDENTITY_INFO
  171     LogonDomainName as UNICODE_STRING
  172     ParameterControl as ULONG
  173     LogonId as OLD_LARGE_INTEGER
  174     UserName as UNICODE_STRING
  175     Workstation as UNICODE_STRING
  176 end type
  177 
  178 type NETLOGON_LOGON_IDENTITY_INFO as _NETLOGON_LOGON_IDENTITY_INFO
  179 type PNETLOGON_LOGON_IDENTITY_INFO as _NETLOGON_LOGON_IDENTITY_INFO ptr
  180 
  181 type _NETLOGON_INTERACTIVE_INFO
  182     Identity as NETLOGON_LOGON_IDENTITY_INFO
  183     LmOwfPassword as LM_OWF_PASSWORD
  184     NtOwfPassword as NT_OWF_PASSWORD
  185 end type
  186 
  187 type NETLOGON_INTERACTIVE_INFO as _NETLOGON_INTERACTIVE_INFO
  188 type PNETLOGON_INTERACTIVE_INFO as _NETLOGON_INTERACTIVE_INFO ptr
  189 
  190 type _NETLOGON_SERVICE_INFO
  191     Identity as NETLOGON_LOGON_IDENTITY_INFO
  192     LmOwfPassword as LM_OWF_PASSWORD
  193     NtOwfPassword as NT_OWF_PASSWORD
  194 end type
  195 
  196 type NETLOGON_SERVICE_INFO as _NETLOGON_SERVICE_INFO
  197 type PNETLOGON_SERVICE_INFO as _NETLOGON_SERVICE_INFO ptr
  198 
  199 type _NETLOGON_NETWORK_INFO
  200     Identity as NETLOGON_LOGON_IDENTITY_INFO
  201     LmChallenge as LM_CHALLENGE
  202     NtChallengeResponse as STRING_
  203     LmChallengeResponse as STRING_
  204 end type
  205 
  206 type NETLOGON_NETWORK_INFO as _NETLOGON_NETWORK_INFO
  207 type PNETLOGON_NETWORK_INFO as _NETLOGON_NETWORK_INFO ptr
  208 
  209 type _NETLOGON_GENERIC_INFO
  210     Identity as NETLOGON_LOGON_IDENTITY_INFO
  211     PackageName as UNICODE_STRING
  212     DataLength as ULONG
  213     LogonData as PUCHAR
  214 end type
  215 
  216 type NETLOGON_GENERIC_INFO as _NETLOGON_GENERIC_INFO
  217 type PNETLOGON_GENERIC_INFO as _NETLOGON_GENERIC_INFO ptr
  218 const MSV1_0_PASSTHRU = &h01
  219 const MSV1_0_GUEST_LOGON = &h02
  220 declare function Msv1_0SubAuthenticationRoutine(byval LogonLevel as NETLOGON_LOGON_INFO_CLASS, byval LogonInformation as PVOID, byval Flags as ULONG, byval UserAll as PUSER_ALL_INFORMATION, byval WhichFields as PULONG, byval UserFlags as PULONG, byval Authoritative as PBOOLEAN, byval LogoffTime as PLARGE_INTEGER, byval KickoffTime as PLARGE_INTEGER) as NTSTATUS
  221 
  222 type _MSV1_0_VALIDATION_INFO
  223     LogoffTime as LARGE_INTEGER
  224     KickoffTime as LARGE_INTEGER
  225     LogonServer as UNICODE_STRING
  226     LogonDomainName as UNICODE_STRING
  227     SessionKey as USER_SESSION_KEY
  228     Authoritative as WINBOOLEAN
  229     UserFlags as ULONG
  230     WhichFields as ULONG
  231     UserId as ULONG
  232 end type
  233 
  234 type MSV1_0_VALIDATION_INFO as _MSV1_0_VALIDATION_INFO
  235 type PMSV1_0_VALIDATION_INFO as _MSV1_0_VALIDATION_INFO ptr
  236 const MSV1_0_VALIDATION_LOGOFF_TIME = &h00000001
  237 const MSV1_0_VALIDATION_KICKOFF_TIME = &h00000002
  238 const MSV1_0_VALIDATION_LOGON_SERVER = &h00000004
  239 const MSV1_0_VALIDATION_LOGON_DOMAIN = &h00000008
  240 const MSV1_0_VALIDATION_SESSION_KEY = &h00000010
  241 const MSV1_0_VALIDATION_USER_FLAGS = &h00000020
  242 const MSV1_0_VALIDATION_USER_ID = &h00000040
  243 const MSV1_0_SUBAUTH_ACCOUNT_DISABLED = &h00000001
  244 const MSV1_0_SUBAUTH_PASSWORD = &h00000002
  245 const MSV1_0_SUBAUTH_WORKSTATIONS = &h00000004
  246 const MSV1_0_SUBAUTH_LOGON_HOURS = &h00000008
  247 const MSV1_0_SUBAUTH_ACCOUNT_EXPIRY = &h00000010
  248 const MSV1_0_SUBAUTH_PASSWORD_EXPIRY = &h00000020
  249 const MSV1_0_SUBAUTH_ACCOUNT_TYPE = &h00000040
  250 const MSV1_0_SUBAUTH_LOCKOUT = &h00000080
  251 
  252 declare function Msv1_0SubAuthenticationRoutineEx(byval LogonLevel as NETLOGON_LOGON_INFO_CLASS, byval LogonInformation as PVOID, byval Flags as ULONG, byval UserAll as PUSER_ALL_INFORMATION, byval UserHandle as SAM_HANDLE, byval ValidationInfo as PMSV1_0_VALIDATION_INFO, byval ActionsPerformed as PULONG) as NTSTATUS
  253 declare function Msv1_0SubAuthenticationRoutineGeneric(byval SubmitBuffer as PVOID, byval SubmitBufferLength as ULONG, byval ReturnBufferLength as PULONG, byval ReturnBuffer as PVOID ptr) as NTSTATUS
  254 declare function Msv1_0SubAuthenticationFilter(byval LogonLevel as NETLOGON_LOGON_INFO_CLASS, byval LogonInformation as PVOID, byval Flags as ULONG, byval UserAll as PUSER_ALL_INFORMATION, byval WhichFields as PULONG, byval UserFlags as PULONG, byval Authoritative as PBOOLEAN, byval LogoffTime as PLARGE_INTEGER, byval KickoffTime as PLARGE_INTEGER) as NTSTATUS
  255 
  256 const STATUS_SUCCESS = cast(NTSTATUS, &h00000000)
  257 const STATUS_INVALID_INFO_CLASS = cast(NTSTATUS, &hC0000003)
  258 const STATUS_NO_SUCH_USER = cast(NTSTATUS, &hC0000064)
  259 const STATUS_WRONG_PASSWORD = cast(NTSTATUS, &hC000006A)
  260 const STATUS_PASSWORD_RESTRICTION = cast(NTSTATUS, &hC000006C)
  261 const STATUS_LOGON_FAILURE = cast(NTSTATUS, &hC000006D)
  262 const STATUS_ACCOUNT_RESTRICTION = cast(NTSTATUS, &hC000006E)
  263 const STATUS_INVALID_LOGON_HOURS = cast(NTSTATUS, &hC000006F)
  264 const STATUS_INVALID_WORKSTATION = cast(NTSTATUS, &hC0000070)
  265 const STATUS_PASSWORD_EXPIRED = cast(NTSTATUS, &hC0000071)
  266 const STATUS_ACCOUNT_DISABLED = cast(NTSTATUS, &hC0000072)
  267 const STATUS_INSUFFICIENT_RESOURCES = cast(NTSTATUS, &hC000009A)
  268 const STATUS_ACCOUNT_EXPIRED = cast(NTSTATUS, &hC0000193)
  269 const STATUS_PASSWORD_MUST_CHANGE = cast(NTSTATUS, &hC0000224)
  270 const STATUS_ACCOUNT_LOCKED_OUT = cast(NTSTATUS, &hC0000234)
  271 
  272 end extern