Wlxloggedoutsas In the Gina example in msdn in February 20

Source: Internet
Author: User

The login part occurs in wlxloggedoutsas
In the Gina example in msdn, wlxloggedoutsas first calls
Result = pwlxfuncs-> wlxdialogboxparam (hglobalwlx,
Hdllinstance,
(Lptstr) makeintresource (idd_logon_dialog ),
Null,
Logondlgproc,
(Lparam) pglobals );

Generate a login dialog box, which is usually seen. (lparam) pglobals is passed in from wlxloggedoutsas. It is estimated that the username and password entered during login will be put in it, pglobals-> paccount.
Then, call the function in the column.
Result = attemptlogon (pglobals, pglobals-> paccount,
Plogonsid, pauthenticationid );
After entering is
Int
Attemptlogon (
Pglobals,
Pminiaccount paccount,
Psid plogonsid,
Pluid plogonid)
Then call
Logonuser (paccount-> pszusername,
Paccount-> pszdomain,
Paccount-> pszpassword,
Logon32_logon_interactive,
Logon32_provider_default,
& Huser)
This function is in advapi32.dll. The huser is used to return the token obtained after verification. The token type is handle. It is strange that in the Windows document, the lsalogonuser is called, you only need to get or forge this token. I want to use a ring 0 program to forge this token,
... Later, we can see that l32plogonuser is called in logonuser, fill in the logon token group list in it, and then lsalogonuser is called.
After the token is obtained
Gettokeninformation (huser,
Tokenstatistics,
& Tstats,
Sizeof (tstats ),
& Size );

* Plogonid = tstats. authenticationid;
Msdn:
Authenticationid

Specifies an luid assigned to the session this token represents. There can be used tokens representing a single logon session.

This parameter is returned,

//
// The tricky part. We need to get the logon Sid from the token,
// Since that is what Winlogon will use to protect the windowstation
// And desktop.
//

Gettokeninformation (huser,
Tokengroups,
Pgroups,
1024,
& Size );

If (size> 1024)
{
Pgroups = localrealloc (pgroups, lmem_fixed, size );
Gettokeninformation (huser,
Tokengroups,
Pgroups,
Size,
& Size );
}

For (I = 0; I <pgroups-> groupcount; I ++)
{
If (pgroups-> groups [I]. Attributes & se_group_logon_id) = se_group_logon_id)
{
Copysid (getlengthsid (plogonsid ),
Plogonsid,
Pgroups-> groups [I]. Sid );
Break;
}
}

Localfree (pgroups );
The purpose of this part is to add the SID of each group to the access-control list entry of the token. I don't know what to say. I still don't know about these structures.
Msdn:

TheToken_groupsStructure contains information about the group SIDS in an access token.

An application can useCopysidFunction to make a copy of a Sid in an access token (inToken_groupsStructure, for instance) to use in an access-control entry.

... Unfinished

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.