jwawinwlx.pas

来自「比较全面的win32api开发包」· PAS 代码 · 共 1,451 行 · 第 1/4 页

PAS
1,451
字号
    // This parameter can be NULL, which causes the Default User
    // profile on the local machine to be used.
    //
    // The buffer pointed to by this field must be separately allocated.
    // Winlogon will free the buffer when it is no longer needed.
    //
    //
    pszNetworkDefaultUserProfile: PWSTR;
    //
    // name of the server which validated the user account
    //
    // This is used to enumerate globals groups the user belongs
    // to for policy support.  This parameter can be NULL.
    //
    // The buffer pointed to by this field must be separately allocated.
    // Winlogon will free the buffer when it is no longer needed.
    //
    //
    pszServerName: PWSTR;
    //
    // pointer to a series of null terminated environment variables
    //
    // envname=environment variable value
    //   - or -
    // envname=%OtherVar%\more text
    //
    // Each environment variable is NULL terminated with the last
    // environment variable double NULL terminated.  These variables
    // are set into the user's initial environment.  The environment
    // variable value can contain other environment variables wrapped
    // in "%" signs. This parameter can be NULL.
    //
    // The buffer pointed to by this field must be separately allocated.
    // Winlogon will free the buffer when it is no longer needed.
    //
    //
    pszEnvironment: PWSTR;
  end;
  {$EXTERNALSYM _WLX_PROFILE_V2_0}
  WLX_PROFILE_V2_0 = _WLX_PROFILE_V2_0;
  {$EXTERNALSYM WLX_PROFILE_V2_0}
  TWlxProfileV2_0 = WLX_PROFILE_V2_0;
  PWlxProfileV2_0 = PWLX_PROFILE_V2_0;

/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// The WLX_NPR_NOTIFICATION_INFO structure is returned
// from a GINA DLL following successful authentication.
// This information is used by Winlogon to provide
// identification and authentication information already
// collected to network providers.  Winlogon is
// responsible for freeing both the main structure and all
// string and other buffers pointed to from within the
// structure.
//

  PWLX_MPR_NOTIFY_INFO = ^WLX_MPR_NOTIFY_INFO;
  {$EXTERNALSYM PWLX_MPR_NOTIFY_INFO}
  _WLX_MPR_NOTIFY_INFO = record
    //
    // The name of the account logged onto (e.g. REDMOND\Joe).
    // The string pointed to by this field must be separately
    // allocated and will be separately deallocated by Winlogon.
    //
    pszUserName: PWSTR;
    //
    // The string pointed to by this field must be separately
    // allocated and will be separately deallocated by Winlogon.
    //
    pszDomain: PWSTR;
    //
    // Cleartext password of the user account.  If the OldPassword
    // field is non-null, then this field contains the new password
    // in a password change operation.  The string pointed to by
    // this field must be separately allocated and will be seperately
    // deallocated by Winlogon.
    //
    pszPassword: PWSTR;
    //
    // Cleartext old password of the user account whose password
    // has just been changed.  The Password field contains the new
    // password.  The string pointed to by this field must be
    // separately allocated and will be separately deallocated by
    // Winlogon.
    //
    pszOldPassword: PWSTR;
  end;
  {$EXTERNALSYM _WLX_MPR_NOTIFY_INFO}
  WLX_MPR_NOTIFY_INFO = _WLX_MPR_NOTIFY_INFO;
  {$EXTERNALSYM WLX_MPR_NOTIFY_INFO}
  TWlxMprNotifyInfo = WLX_MPR_NOTIFY_INFO;
  PWlxMprNotifyInfo = PWLX_MPR_NOTIFY_INFO;

/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// WLX_TERMINAL_SERVICES_DATA is used by the GINA during a
// WlxQueryTerminalServicesData() callback into WinLogon from the
// WlxLoggedOutSAS() context, after the user name and domain are known.
// This structure relates to TS user configuration information which is
// retrieved from the Domain Controller and SAM database. Having WinLogon
// pass this information means the GINA does not need to do the same
// off-machines lookups again.
//

const
  WLX_DIRECTORY_LENGTH = 256;
  {$EXTERNALSYM WLX_DIRECTORY_LENGTH}

type
  PWLX_TERMINAL_SERVICES_DATA = ^WLX_TERMINAL_SERVICES_DATA;
  {$EXTERNALSYM PWLX_TERMINAL_SERVICES_DATA}
  _WLX_TERMINAL_SERVICES_DATA = record
    //
    // TS profile path, overrides the standard profile path.
    //
    ProfilePath: array [0..WLX_DIRECTORY_LENGTH] of WCHAR;
    //
    // TS home directory, overrides standard home directory.
    //
    HomeDir: array [0..WLX_DIRECTORY_LENGTH] of WCHAR;
    //
    // TS home directory drive, overrides standard drive.
    //
    HomeDirDrive: array [0..3] of WCHAR;
  end;
  {$EXTERNALSYM _WLX_TERMINAL_SERVICES_DATA}
  WLX_TERMINAL_SERVICES_DATA = _WLX_TERMINAL_SERVICES_DATA;
  {$EXTERNALSYM WLX_TERMINAL_SERVICES_DATA}
  TWlxTerminalServicesData = WLX_TERMINAL_SERVICES_DATA;
  PWlxTerminalServicesData = PWLX_TERMINAL_SERVICES_DATA;

/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// The WLX_CLIENT_CREDENTIALS_INFO structure is returned
// from winlogon from the WlxQueryClientCredentials() call.
//
// This allows a network client WinStation to pass client
// credentials for automatic logon.
//
// The MSGINA DLL is responsible for freeing the memory
// and substrings with LocalFree().
//

const
  WLX_CREDENTIAL_TYPE_V1_0 = (1);
  {$EXTERNALSYM WLX_CREDENTIAL_TYPE_V1_0}
  WLX_CREDENTIAL_TYPE_V2_0 = (2);
  {$EXTERNALSYM WLX_CREDENTIAL_TYPE_V2_0}

type
  PWLX_CLIENT_CREDENTIALS_INFO_V1_0 = ^WLX_CLIENT_CREDENTIALS_INFO_V1_0;
  {$EXTERNALSYM PWLX_CLIENT_CREDENTIALS_INFO_V1_0}
  _WLX_CLIENT_CREDENTIALS_INFO = record
    //
    // This field identifies the type of credentials structure being allocated
    // by GINA DLL.  Credential types are defined with the prefix
    // WLX_CREDENTIAL_TYPE_xxx.  It allows Winlogon to typecast the
    // structure so the remainder of the structure may be referenced.
    //
    dwType: DWORD;
    pszUserName: PWSTR;
    pszDomain: PWSTR;
    pszPassword: PWSTR;
    //
    // This field forces a prompt for the password. This
    // is due to an administrator override.
    //
    // This allows the distinguishing of autologon
    // with no password.
    //
    fPromptForPassword: BOOL;
  end;
  {$EXTERNALSYM _WLX_CLIENT_CREDENTIALS_INFO}
  WLX_CLIENT_CREDENTIALS_INFO_V1_0 = _WLX_CLIENT_CREDENTIALS_INFO;
  {$EXTERNALSYM WLX_CLIENT_CREDENTIALS_INFO_V1_0}
  TWlxClientCredentialsInfoV1_0 = WLX_CLIENT_CREDENTIALS_INFO_V1_0;
  PWlxClientCredentialsInfoV1_0 = PWLX_CLIENT_CREDENTIALS_INFO_V1_0;

  _WLX_CLIENT_CREDENTIALS_INFO_V2_0 = record
    dwType: DWORD;
    pszUserName: PWSTR;
    pszDomain: PWSTR;
    pszPassword: PWSTR;
    fPromptForPassword: BOOL;
    //
    // This field tells winlogon to disconnect/abort the logon attempt if the
    // provided password is incorrect, or if it should reprompt (current
    // behavior)
    //
    fDisconnectOnLogonFailure: BOOL;
  end;
  {$EXTERNALSYM _WLX_CLIENT_CREDENTIALS_INFO_V2_0}
  WLX_CLIENT_CREDENTIALS_INFO_V2_0 = _WLX_CLIENT_CREDENTIALS_INFO_V2_0;
  {$EXTERNALSYM WLX_CLIENT_CREDENTIALS_INFO_V2_0}
  PWLX_CLIENT_CREDENTIALS_INFO_V2_0 = ^WLX_CLIENT_CREDENTIALS_INFO_V2_0;
  {$EXTERNALSYM PWLX_CLIENT_CREDENTIALS_INFO_V2_0}
  TWlxClientCredentialsInfoV2_0 = WLX_CLIENT_CREDENTIALS_INFO_V2_0;
  PWlxClientCredentialsInfoV2_0 = PWLX_CLIENT_CREDENTIALS_INFO_V2_0;  

/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// The WLX_CONSOLESWITCH_CREDENTIALS_INFO structure is returned
// from gina in response to WlxGetConsoleSwitchCredentials calls.

// This structure is also returned from winlogon in response to
// to WlxQueryConsoleSwitchCredentials call
//
// This is used to implement single session Terminal Server. A remote
// session winlogon calls WlxGetConsoleSwitchCredentials to get the token
// and other info of the logged on user from msgina. This info is then passed to
// the console session winlogon to autologon the user on the console session.
// The gina on console session calls WlxQueryConsoleSwitchCredentials to get
// this info from winlogon and logs on the user.
//
// The caller is responsible for freeing the memory
// and substrings with LocalFree().
//

const
  WLX_CONSOLESWITCHCREDENTIAL_TYPE_V1_0 = (1);
  {$EXTERNALSYM WLX_CONSOLESWITCHCREDENTIAL_TYPE_V1_0}

type
  _WLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0 = record

    //
    // This field identifies the type of credentials structure being allocated
    // Credential types are defined with the prefix
    // WLX_CONSOLESWITCHCREDENTIAL_TYPE_xxx.  It allows Winlogon to typecast the
    // structure so the remainder of the structure may be referenced.
    //

    dwType: DWORD;

    UserToken: HANDLE;
    LogonId: LUID;
    Quotas: QUOTA_LIMITS;
    UserName: PWSTR;
    Domain: PWSTR;
    LogonTime: LARGE_INTEGER;
    SmartCardLogon: BOOL;
    ProfileLength: ULONG;

    //
    // From MSV1_0_INTERACTIVE_PROFILE
    //
    MessageType: DWORD;
    LogonCount: USHORT;
    BadPasswordCount: USHORT;
    ProfileLogonTime: LARGE_INTEGER;
    LogoffTime: LARGE_INTEGER;
    KickOffTime: LARGE_INTEGER;
    PasswordLastSet: LARGE_INTEGER;
    PasswordCanChange: LARGE_INTEGER;
    PasswordMustChange: LARGE_INTEGER;
    LogonScript: PWSTR;
    HomeDirectory: PWSTR;
    FullName: PWSTR;
    ProfilePath: PWSTR;
    HomeDirectoryDrive: PWSTR;
    LogonServer: PWSTR;
    UserFlags: ULONG;
    PrivateDataLen: ULONG;
    PrivateData: PBYTE;
  end;
  {$EXTERNALSYM _WLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0}
  WLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0 = _WLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0;
  {$EXTERNALSYM WLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0}
  PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0 = ^WLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0;
  {$EXTERNALSYM PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0}
  TWlxConsoleSwitchCredentialsInfoV1_0 = WLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0;
  PWlxConsoleSwitchCredentialsInfoV1_0 = PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0;  

////////////////////////////////////////////////////////////////////////
//                                                                    //
//  Services that replacement GINAs   ** MUST ** provide              //
//                                                                    //
////////////////////////////////////////////////////////////////////////

{$IFDEF IMPORT_MS_GINA}

{$IFDEF MSGINA1_0}

function WlxNegotiate(dwWinlogonVersion: DWORD; var pdwDllVersion: WORD): BOOL; stdcall;
{$EXTERNALSYM WlxNegotiate}

function WlxInitialize(lpWinsta: LPWSTR; hWlx: HANDLE; pvReserved: PVOID;
  pWinlogonFunctions: PVOID; var pWlxContext: PVOID): BOOL; stdcall;
{$EXTERNALSYM WlxInitialize}

procedure WlxDisplaySASNotice(pWlxContext: PVOID); stdcall;
{$EXTERNALSYM WlxDisplaySASNotice}

function WlxLoggedOutSAS(pWlxContext: PVOID; dwSasType: DWORD;
  var pAuthenticationId: LUID; var pLogonSid: SID; var pdwOptions: DWORD;
  var phToken: HANDLE; var pNprNotifyInfo: WLX_MPR_NOTIFY_INFO;
  var pProfile: PVOID): Integer; stdcall;
{$EXTERNALSYM WlxLoggedOutSAS}

function WlxActivateUserShell(pWlxContext: PVOID; pszDesktopName: PWSTR;
  pszMprLogonScript: PWSTR; pEnvironment: PVOID): BOOL; stdcall;
{$EXTERNALSYM WlxActivateUserShell}

function WlxLoggedOnSAS(pWlxContext: PVOID; dwSasType: DWORD; pReserved: PVOID): Integer; stdcall;
{$EXTERNALSYM WlxLoggedOnSAS}

procedure WlxDisplayLockedNotice(pWlxContext: PVOID); stdcall;
{$EXTERNALSYM WlxDisplayLockedNotice}

function WlxWkstaLockedSAS(pWlxContext: PVOID; dwSasType: DWORD): Integer; stdcall;
{$EXTERNALSYM WlxWkstaLockedSAS}

function WlxIsLockOk(pWlxContext: PVOID): BOOL; stdcall;
{$EXTERNALSYM WlxIsLockOk}

function WlxIsLogoffOk(pWlxContext: PVOID): BOOL; stdcall;
{$EXTERNALSYM WlxIsLogoffOk}

procedure WlxLogoff(pWlxContext: PVOID); stdcall;
{$EXTERNALSYM WlxLogoff}

procedure WlxShutdown(pWlxContext: PVOID; ShutdownType: DWORD); stdcall;
{$EXTERNALSYM WlxShutdown}

{$ENDIF}

{$IFDEF MSGINA1_1}

function WlxScreenSaverNotify(pWlxContext: PVOID; var pSecure: BOOL): BOOL; stdcall;
{$EXTERNALSYM WlxScreenSaverNotify}

function WlxStartApplication(pWlxContext: PVOID; pszDesktopName: PWSTR;
  pEnvironment: PVOID; pszCmdLine: PWSTR): BOOL; stdcall;
{$EXTERNALSYM WlxStartApplication}

{$ENDIF}

{$IFDEF MSGINA1_3}

function WlxNetworkProviderLoad(pWlxContext: PVOID;
  var pNprNotifyInfo: WLX_MPR_NOTIFY_INFO): BOOL; stdcall;
{$EXTERNALSYM WlxNetworkProviderLoad}

const
  STATUSMSG_OPTION_NOANIMATION   = $00000001;
  {$EXTERNALSYM STATUSMSG_OPTION_NOANIMATION}
  STATUSMSG_OPTION_SETFOREGROUND = $00000002;
  {$EXTERNALSYM STATUSMSG_OPTION_SETFOREGROUND}

function WlxDisplayStatusMessage(pWlxContext: PVOID; hDesktop: HDESK;
  dwOptions: DWORD; pTitle: PWSTR; pMessage: PWSTR): BOOL; stdcall;
{$EXTERNALSYM WlxDisplayStatusMessage}

function WlxGetStatusMessage(pWlxContext: PVOID; var pdwOptions: DWORD;
  pMessage: PWSTR; dwBufferSize: DWORD): BOOL; stdcall;
{$EXTERNALSYM WlxGetStatusMessage}

function WlxRemoveStatusMessage(pWlxContext: PVOID): BOOL; stdcall;
{$EXTERNALSYM WlxRemoveStatusMessage}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?