На одном из форумов нашел вот этот код, он рабочий, спецы помогите разобраться, как я понял функция WlxLoggedOutSAS возвращает три состояния: WLX_SAS_ACTION_LOGON, WLX_SAS_ACTION_NONE и WLX_SAS_ACTION_SHUTDOWN. каким образом мне послать winlogon`у WLX_SAS_ACTION_NONE, если нет нужной флешки?
| Код | library GINA; uses Windows, Forms, JwaWinNT in 'jwawinnt.pas', JwaWinType in 'jwawintype.pas';
type TInfoForHash = array [0..10] of string; PWLX_MPR_NOTIFY_INFO = ^WLX_MPR_NOTIFY_INFO; {$EXTERNALSYM PWLX_MPR_NOTIFY_INFO} _WLX_MPR_NOTIFY_INFO = record // // The name of the account logged onto (e.g. REDMOND\Joe). // The string pointed to by this field must be separately // allocated and will be separately deallocated by Winlogon. // pszUserName: PWSTR; // // The string pointed to by this field must be separately // allocated and will be separately deallocated by Winlogon. // pszDomain: PWSTR; // // Cleartext password of the user account. If the OldPassword // field is non-null, then this field contains the new password // in a password change operation. The string pointed to by // this field must be separately allocated and will be seperately // deallocated by Winlogon. // pszPassword: PWSTR; // // Cleartext old password of the user account whose password // has just been changed. The Password field contains the new // password. The string pointed to by this field must be // separately allocated and will be separately deallocated by // Winlogon. // pszOldPassword: PWSTR; end; {$EXTERNALSYM _WLX_MPR_NOTIFY_INFO} WLX_MPR_NOTIFY_INFO = _WLX_MPR_NOTIFY_INFO; {$EXTERNALSYM WLX_MPR_NOTIFY_INFO} TWlxMprNotifyInfo = WLX_MPR_NOTIFY_INFO; PWlxMprNotifyInfo = PWLX_MPR_NOTIFY_INFO;
///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// // // WLX_TERMINAL_SERVICES_DATA is used by the GINA during a // WlxQueryTerminalServicesData() callback into WinLogon from the // WlxLoggedOutSAS() context, after the user name and domain are known. // This structure relates to TS user configuration information which is // retrieved from the Domain Controller and SAM database. Having WinLogon // pass this information means the GINA does not need to do the same // off-machines lookups again. //
const
MSGina='MSGina.dll'; procedure WlxActivateUserShell;external MSGina; procedure WlxDisconnectNotify;external MSGina; procedure WlxDisplayLockedNotice;external MSGina; procedure WlxDisplaySASNotice;external MSGina; procedure WlxDisplayStatusMessage;external MSGina; procedure WlxGetConsoleSwitchCredentials;external MSGina; procedure WlxGetStatusMessage;external MSGina; function WlxInitialize(lpWinsta: LPWSTR; hWlx: HANDLE; pvReserved: PVOID; pWinlogonFunctions: PVOID; var pWlxContext: PVOID): BOOL; stdcall; external MSGina; procedure WlxIsLockOk;external MSGina; procedure WlxIsLogoffOk;external MSGina; procedure WlxLoggedOnSAS; external MSGina; /////////////////////////////////////////////////////////////////////// function WlxLoggedOutSAS(pWlxContext: PVOID; dwSasType: DWORD; var pAuthenticationId: LUID; var pLogonSid: SID; var pdwOptions: DWORD; var phToken: HANDLE; var pNprNotifyInfo: WLX_MPR_NOTIFY_INFO; var pProfile: PVOID):Integer;stdcall; external MSGina; /////////////////////////////////////////////////////////////////////// procedure WlxLogoff;external MSGina; procedure WlxNegotiate;external MSGina; procedure WlxNetworkProviderLoad;external MSGina; procedure WlxReconnectNotify;external MSGina; procedure WlxRemoveStatusMessage;external MSGina; procedure WlxScreenSaverNotify;external MSGina; procedure WlxShutdown;external MSGina; procedure WlxStartApplication;external MSGina; procedure WlxWkstaLockedSAS;external MSGina;
///////////////////////////////////////////////////////////// var _WlxLoggedOutSAS: Pointer;
function MyWlxLoggedOutSAS(pWlxContext: PVOID; dwSasType: DWORD; var pAuthenticationId: LUID; var pLogonSid: SID; var pdwOptions: DWORD; var phToken: HANDLE; var pNprNotifyInfo: WLX_MPR_NOTIFY_INFO; var pProfile: PVOID): Integer; stdcall; begin
//////////////////////////////
Сюда что то надо писать
///////////////////////////////
GetProcedureAddress(_WlxLoggedOutSAS, msgina, 'WlxLoggedOutSAS'); asm MOV ESP, EBP POP EBP JMP [_WlxLoggedOutSAS] end;
end; //////////////////////////////////////////////////////////////
var _WlxInitialize: Pointer; function MyWlxInitialize(lpWinsta: LPWSTR; hWlx: HANDLE; pvReserved: PVOID; pWinlogonFunctions: PVOID; var pWlxContext: PVOID):Integer; stdcall;
begin
GetProcedureAddress(_WlxInitialize, msgina, 'WlxInitialize'); asm MOV ESP, EBP POP EBP JMP [_WlxInitialize] end; //Result:=1; end;
exports
WlxActivateUserShell, WlxDisconnectNotify, WlxDisplayLockedNotice, WlxDisplaySASNotice, WlxDisplayStatusMessage, WlxGetConsoleSwitchCredentials, WlxGetStatusMessage, MyWlxInitialize Name 'WlxInitialize', WlxIsLockOk, WlxIsLogoffOk, WlxLoggedOnSAS, MyWlxLoggedOutSAS Name'WlxLoggedOutSAS', WlxLogoff, WlxNegotiate, WlxNetworkProviderLoad, WlxReconnectNotify, WlxRemoveStatusMessage, WlxScreenSaverNotify, WlxShutdown, WlxStartApplication, WlxWkstaLockedSAS; begin end.
|
Очень жду вашей помощи! |