pgContext = (PGINA_CONTEXT) LocalAlloc(LMEM_FIXED | LMEM_ZEROINIT, sizeof(GINA_CONTEXT)); if (!pgContext) { return FALSE; } // Return the GINA context to winlogon. *pWlxContext = (PVOID) pgContext; // myHandle was saved in DLLMAIN. pgContext->hDllInstance = myHandle; // Save pointer to dispatch table. pgContext->pWlxFuncs = (PWLX_DISPATCH_VERSION_1_3) pWinlogonFunctions; // Save the winlogon handle used to call the dispatch functions. pgContext->hWlx = hWlx; // Save the name of the window station. pgContext->station = lpWinsta;
// Notify winlogon that we will use the default SAS. pgContext->pWlxFuncs->WlxUseCtrlAltDel(hWlx); return TRUE; }=============//显示自己的登陆界面//显示自己的登陆界面WlxDisplaySASNotice(PVOID pContext) { int Result; Result = pWlxFuncs->WlxDialogBoxParam(hGlobalWlx, hDllInstance, (LPTSTR) MAKEINTRESOURCE(IDD_WELCOME_DLG), NULL, WelcomeDlgProc,0 ); }
基本结构为:
typedef struct {
HANDLE hWlx;
LPWSTR station;
PWLX_DISPATCH_VERSION_1_3 pWlxFuncs;
HANDLE hDllInstance;
HANDLE UserToken;
} GINA_CONTEXT, *PGINA_CONTEXT;============
//构造自己的结构
BOOL WINAPI WlxInitialize (
LPWSTR lpWinsta,
HANDLE hWlx,
PVOID pvReserved,
PVOID pWinlogonFunctions,
PVOID * pWlxContext)
{
PGINA_CONTEXT pgContext;
pgContext = (PGINA_CONTEXT) LocalAlloc(LMEM_FIXED | LMEM_ZEROINIT,
sizeof(GINA_CONTEXT)); if (!pgContext) {
return FALSE;
} // Return the GINA context to winlogon.
*pWlxContext = (PVOID) pgContext; // myHandle was saved in DLLMAIN.
pgContext->hDllInstance = myHandle; // Save pointer to dispatch table.
pgContext->pWlxFuncs = (PWLX_DISPATCH_VERSION_1_3) pWinlogonFunctions; // Save the winlogon handle used to call the dispatch functions.
pgContext->hWlx = hWlx; // Save the name of the window station.
pgContext->station = lpWinsta;
// Notify winlogon that we will use the default SAS.
pgContext->pWlxFuncs->WlxUseCtrlAltDel(hWlx); return TRUE;
}=============//显示自己的登陆界面//显示自己的登陆界面WlxDisplaySASNotice(PVOID pContext)
{
int Result;
Result = pWlxFuncs->WlxDialogBoxParam(hGlobalWlx,
hDllInstance,
(LPTSTR) MAKEINTRESOURCE(IDD_WELCOME_DLG),
NULL,
WelcomeDlgProc,0 );
}
http://www.vckbase.com/document/viewdoc/?id=798