我用c仿照msdn的例子写了一个登录的应用程序,现在碰到一个奇怪的问题,系统启动以后,凡是在出现我自己定义的对话框的地方,只要没有输入响应(就是不敲击键盘,不移动鼠标),过一会儿,对话框就会没有了,移动鼠标敲击键盘后者按下三键都没有办法重新唤出这个对话框,请问做过gina的高手有没有碰到过这样的问题?主要是错在了什么地方啊,急!高分奉送

解决方案 »

  1.   

    默认的gina.dll显示登录对话框是有超时限制的.
    BOOL WlxSetTimeout(
      HANDLE hWlx,     
      DWORD Timeout  
    );
    Parameters
    hWlx 
    [in] Specifies the Winlogon handle passed to GINA in the WlxInitialize call. 
    Timeout 
    [in] Requested time-out, in seconds. 
    Return Values
    The WlxSetTimeout function returns one of the following values.
    Value Meaning 
    TRUE If the new time-out was accepted. 
    FALSE If the new time-out was not accepted. 
    为了在超时过后重新唤出对话框,你必须调用
    WlxSasNotify
    The WlxSasNotify function is called by GINA to notify Winlogon of a secure attention sequence (SAS) event.以下函数是gina.dll必须导出的函数
    A GINA DLL must export the following functions.Function Description 
    WlxActivateUserShell Activates the user shell program. 
    WlxDisplayLockedNotice Allows the GINA DLL to display lock information. 
    WlxDisplaySASNotice Winlogon calls this function when no user is logged on. 
    WlxDisplayStatusMessage Winlogon calls this function with a status message to display. 
    WlxGetConsoleSwitchCredentials Winlogon calls this function to read the currently logged on user's credentials to transparently transfer them to a target session. 
    WlxGetStatusMessage Winlogon calls this function to get the current status message. 
    WlxInitialize Initializes the GINA DLL for a specific window station. 
    WlxIsLockOk Verifies that workstation lock is okay. 
    WlxIslogoffOk Verifies that logoff is okay. 
    WlxLoggedOnSAS Winlogon calls this function when it receives a secure attention sequence (SAS) event while the user is logged on and the workstation is not locked. 
    WlxLoggedOutSAS Winlogon calls this function when it receives an SAS event while no user is logged on. 
    WlxLogoff Notifies the GINA DLL that a logoff operation was requested. 
    WlxNegotiate Indicates whether the current version of Winlogon can be used with the GINA DLL. 
    WlxNetworkProviderLoad Winlogon calls this function after it loads a network provider to collect valid authentication and identification information. 
    WlxRemoveStatusMessage Winlogon calls this function to tell the GINA DLL to stop displaying the status message. 
    WlxScreensaverNotify Allows the GINA to interact with the screen saver operation. 
    WlxShutdown Winlogon calls this function just before shutting down, allowing the GINA to perform any shutdown tasks, such as ejecting a smart card from a reader. 
    WlxStartApplication Winlogon calls this function when the system needs an application started in the user's context.  
    WlxWkstaLockedSAS Winlogon calls this function when it receives an SAS while the workstation is locked.  WlxSetTimeout
    The WlxSetTimeout function is called by GINA to change the time-out associated with a dialog box. The default time-out is two minutes.以下是由Win logon进程提供的可供gina.dll调用的函数.
    GINA DLLs can call the following Winlogon support functions.Function Called by GINA 
    WlxAssignShellProtection Requests protection for the shell program of a newly logged-on user. 
    WlxChangePasswordNotify Indicates that the user has changed a password. Used to notify all network providers. 
    WlxChangePasswordNotifyEx Indicates that the user has changed a password. Used to notify a single network provider or all network providers. 
    WlxCloseUserDesktop Closes a desktop for the user. 
    WlxCreateUserDesktop Creates a desktop for the user. 
    WlxDialogBox  Creates a modal dialog box from a dialog box template resource. 
    WlxDialogBoxIndirect Creates a modal dialog box from a dialog box template in memory. 
    WlxDialogBoxIndirectParam Initializes dialog box controls and then create a modal dialog box from a dialog box template in memory. 
    WlxDialogBoxParam Initializes dialog box controls and then create a modal dialog box from a dialog box template resource. 
    WlxDisconnect Disconnects a Terminal Services network session. 
    WlxGetOption Retrieves the current value of a specified option. 
    WlxGetSourceDesktop Determines the name and handle of the desktop that was active prior to Winlogon switching to the Winlogon desktop. 
    WlxMessageBox Creates, displays, and operates a message box. 
    WlxQueryClientCredentials Queries the credentials of a remote client that is not using an Internet connector license. 
    WlxQueryConsoleSwitchCredentials Queries the credentials transferred from the Winlogon of the temporary session to the Winlogon of the destination session. 
    WlxQueryInetConnectorCredentials Queries the credentials of a remote client that is using an Internet connector license. 
    WlxQueryTerminalServicesData Queries Terminal Services user configuration information. 
    WlxSasNotify Notifies Winlogon of a secure attention sequence (SAS) event. 
    WlxSetContextPointer Specifies the context pointer passed by Winlogon as the first parameter to all the GINA functions.  
    WlxSetOption Specifies a value for a specific option. 
    WlxSetReturnDesktop Specifies the desktop Winlogon will switch to once the current SAS event processing is complete. 
    WlxSetTimeout Changes the time-out associated with a dialog box. 
    WlxSwitchDesktopToUser Switches to the application desktop.  
    WlxSwitchDesktopToWinlogon Switches to the Winlogon desktop.  
    WlxWin31Migrate Completes the setup of the user (including migrating from Windows NT 3.51 settings to Windows NT 4.0 settings)  
    WlxUseCtrlAltDel Prompts Winlogon to use the standard CTRL+ALT+DEL key combination as a secure attention sequence (SAS). 
      

  2.   

    WlxUseCtrlAltDel
    这一个也不能少.
      

  3.   

    to yonghengdizhen(风儿她轻轻的吹) :
    有这样几个问题:
    1 我没有去设置对话框的时间,那么它应该默认为2分钟,可是我的对话框一般只有20-30秒就消失了阿,这个是怎么回事呢?
    2 你说的WlxUseCtrlAltDel不能少,是什么意思?应该怎么把他用到处理对话框时间的问题上来。
    3 msdn上的例子你一定是研究过的,它没有用到WlxSetTimeout,可是也不会出现我这样的问题,至于是不是两分钟以后会不会消失,我会尝试一下的。我的程序只是在原来的基础上作了很小的改动,怎么也会这样呢?
    急切的等待你的回复
    急切的等待你的回复
    急切的等待你的回复
    急切的等待你的回复
    急切的等待你的回复
      

  4.   

    我刚刚试过msdn的例子:
    第一个对话框“click here to begin” 是不会消失的,但是后面的对话框两分钟就会消失的。可能就是你说的问题。我自己再琢磨一下