再不影响windows正常的登陆身份认证功能的前提下,为了实现自己的身份认证系统,我加载了一个自己的MyGina.dll,当然MyGina.dll里的大部分函数都是调用真正的msgina.dll里的函数。
我在WlxLoggedOutSAS()函数里的WLX_SAS_ACTION_LOGON消息下,弹出我的认证对话框。
现在的问题是,当对话框弹出来等待用户输入密码的时候,按下Ctrl+ctrl+del,我的登陆认证对话框就消失了,然后就自动进入系统了有谁遇到过这样的问题,还请帮我多多分析一下,请高手啊。很急,在线等待。(最好能不用底层键盘钩子来做)

解决方案 »

  1.   

    当然MyGina.dll里的大部分函数都是调用真正的msgina.dll里的函数。
    ====================================>
    一共22个,必须实现的也有18个
    你重载了哪几个?
      

  2.   

    //((PWLX_DISPATCH_VERSION_1_3) g_pWinlogon)->WlxSetOption(hWlx,WLX_OPTION_USE_CTRL_ALT_DEL,g_bLockCtrlAltDel ? 0 : 1,&ulOldSAS);WlxSetOption可以设定是否使用SAS组合(CTRL+ALT+DEL)//((PWLX_DISPATCH_VERSION_1_3) g_pWinlogon)->WlxSasNotify(hWlx, MY_SAS);
    WlxSasNotify可以指定新的SAS组合键
      

  3.   

    The WlxLoggedOutSAS function must be implemented by a replacement GINA DLL. Winlogon calls this function when it receives a secure attention sequence (SAS) event while no user is logged on.int WlxLoggedOutSAS(
      PVOID pWlxContext,
      DWORD dwSasType,
      PLUID pAuthenticationId,
      PSID pLogonSid,
      PDWORD pdwOptions,
      PHANDLE phToken,
      PWLX_MPR_NOTIFY_INFO pNprNotifyInfo,
      PVOID* pProfile
    );Parameters
    pWlxContext 
    [in] Pointer to the GINA context associated with this window station. The GINA returns this context value when Winlogon calls WlxInitialize for 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 using values greater than WLX_SAS_TYPE_MAX_MSFT_VALUE.
    The following SAS types are predefined.Value Meaning 
    WLX_SAS_TYPE_CTRL_ALT_DEL Indicates that a user has typed the standard CTRL+ALT+DEL SAS. 
    WLX_SAS_TYPE_SC_INSERT Indicates that a smart card has been inserted into a compatible device. 
    WLX_SAS_TYPE_SC_REMOVE Indicates that a smart card has been removed from a compatible device. 
    WLX_SAS_TYPE_TIMEOUT Indicates that no user input was received within the specified time-out period. pAuthenticationId 
    [out] Specifies the authentication identifier associated with the current logon session. You can get this value by calling GetTokenInformation to obtain a TOKEN_STATISTICS structure for the token returned by the LogonUser function. 
    pLogonSid 
    [in, out] On input, this parameter points to a security identifier (SID) that is unique to the current logon session. Winlogon uses 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 an SID. You can also get the SID by using the GetTokenInformation function to retrieve a TOKEN_GROUPS structure for the token returned by the LogonUser function. To do this, search the array returned in the TOKEN_GROUPS structure for the group with the SE_GROUP_LOGON_ID attribute.pdwOptions 
    [out] Pointer to a DWORD that contains the set of logon options. The following option is defined.Value Meaning 
    WLX_LOGON_OPT_NO_PROFILE Indicates that Winlogon must not load a profile for the logged-on user. Either the GINA DLL will take care of this activity, or the user does not need a profile. phToken 
    [out] Points to a handle variable. When the logon operation succeeds, set this handle to a token that represents the logged-on user. Use the LogonUser function to get this token, then, when the user logs off, Winlogon closes this handle and calls the WlxLogoff function.
    If you need this handle during your WlxLogoff, make a duplicate of the handle before returning it to Winlogon.pNprNotifyInfo 
    [out] Points to an WLX_MPR_NOTIFY_INFO structure 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. Use LocalAlloc to 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, the pProfile parameter points to either a WLX_PROFILE_V1_0 or a WLX_PROFILE_V2_0 structure. The first DWORD in 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.   

    The WlxLoggedOutSAS function must be implemented by a replacement GINA DLL. Winlogon calls this function when it receives a secure attention sequence (SAS) event while no user is logged on.int WlxLoggedOutSAS(
      PVOID pWlxContext,
      DWORD dwSasType,
      PLUID pAuthenticationId,
      PSID pLogonSid,
      PDWORD pdwOptions,
      PHANDLE phToken,
      PWLX_MPR_NOTIFY_INFO pNprNotifyInfo,
      PVOID* pProfile
    );Parameters
    pWlxContext 
    [in] Pointer to the GINA context associated with this window station. The GINA returns this context value when Winlogon calls WlxInitialize for 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 using values greater than WLX_SAS_TYPE_MAX_MSFT_VALUE.
    The following SAS types are predefined.Value Meaning 
    WLX_SAS_TYPE_CTRL_ALT_DEL Indicates that a user has typed the standard CTRL+ALT+DEL SAS. 
    WLX_SAS_TYPE_SC_INSERT Indicates that a smart card has been inserted into a compatible device. 
    WLX_SAS_TYPE_SC_REMOVE Indicates that a smart card has been removed from a compatible device. 
    WLX_SAS_TYPE_TIMEOUT Indicates that no user input was received within the specified time-out period. pAuthenticationId 
    [out] Specifies the authentication identifier associated with the current logon session. You can get this value by calling GetTokenInformation to obtain a TOKEN_STATISTICS structure for the token returned by the LogonUser function. 
    pLogonSid 
    [in, out] On input, this parameter points to a security identifier (SID) that is unique to the current logon session. Winlogon uses 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 an SID. You can also get the SID by using the GetTokenInformation function to retrieve a TOKEN_GROUPS structure for the token returned by the LogonUser function. To do this, search the array returned in the TOKEN_GROUPS structure for the group with the SE_GROUP_LOGON_ID attribute.pdwOptions 
    [out] Pointer to a DWORD that contains the set of logon options. The following option is defined.Value Meaning 
    WLX_LOGON_OPT_NO_PROFILE Indicates that Winlogon must not load a profile for the logged-on user. Either the GINA DLL will take care of this activity, or the user does not need a profile. phToken 
    [out] Points to a handle variable. When the logon operation succeeds, set this handle to a token that represents the logged-on user. Use the LogonUser function to get this token, then, when the user logs off, Winlogon closes this handle and calls the WlxLogoff function.
    If you need this handle during your WlxLogoff, make a duplicate of the handle before returning it to Winlogon.pNprNotifyInfo 
    [out] Points to an WLX_MPR_NOTIFY_INFO structure 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. Use LocalAlloc to 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, the pProfile parameter points to either a WLX_PROFILE_V1_0 or a WLX_PROFILE_V2_0 structure. The first DWORD in 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.