RT
用自定义Gina吗?怎么写。
用自定义Gina吗?怎么写。
解决方案 »
- TADOQuery在Appand的时候出现field cannot be modified的问题??
- 求QQ群(关于平面设计的) 奉献20分
- 获得某个程序的所有窗口.
- delphi访问access数据库
- 那里可以找到Delphi 5.x 分布式多层应用系统篇所带的源码
- 调用ScrollBox的scaleby之后,他的子控件如果落在ClientRect之外,属性不刷新怎么办?
- 各位,帮帮忙,出出主意
- 怎么在数据库中查找相同的字段,用sql语句怎么写!!!
- com/dcom 程序中服务器端能否向连接的客户端发送自定的信息??? 到底有没有人会??
- 谁有VCL核心类的关系图?-----------------------------------------------------
- 我个人用PB写了一个小软件,数据库用的是SQL,如果只在我们公司内部使用,需要购买PB吗?如果我作为开发者购买了正版的PB,其它客户使用我的软件,难道客户还需要
- 求这个功能用什么写,谢谢!
// Version 1.0
PWlxNegotiate = function (dwWinlogonVersion: DWORD; dwDllVersion: PDWORD): BOOL; stdcall;
PWlxInitialize = function (lpWinsta: LPWSTR; hWlx: HANDLE; pvReserved: pointer; pWinlogonFunctions: pointer; out pWlxContext: pointer): BOOL; stdcall;
PWlxDisplaySASNotice = procedure (pWlxContext: pointer); stdcall;
PWlxLoggedOutSAS = function (pWlxContext: pointer; dwSasType: DWORD; pAuthenticationId: PLUID; pLogonSid: PSID; var pdwOptions: DWORD; var phToken: HANDLE; var pNprNotifyInfo: WlX_MPR_NOTIFY_INFO; out pProfile: pointer): integer; stdcall;
PWlxActivateUserShell = function (pWlxContext: pointer; pszDesktopName: PWideChar; pszMprLogonScript: PWideChar; pEnvironment: pointer): BOOL; stdcall;
PWlxLoggedOnSAS = function (pWlxContext: pointer; dwSasType: DWORD; pReserved: pointer): integer; stdcall;
PWlxDisplayLockedNotice = procedure (pWlxContext: pointer); stdcall;
PWlxWkstaLockedSAS = function (pWlxContext: pointer; dwSasType: DWORD): integer; stdcall;
PWlxIsLockOk = function (pWlxContext: pointer): BOOL; stdcall;
PWlxIsLogoffOk = function (pWlxContext: pointer): BOOL; stdcall;
PWlxLogoff = procedure (pWlxContext: pointer); stdcall;
PWlxShutdown = procedure (pWlxContext: pointer; ShutdownType: DWORD); stdcall;
// Version 1.1
PWlxScreenSaverNotify = function (pWlxContext: pointer; var pSecure: BOOL): BOOL; stdcall;
PWlxStartApplication = function (pWlxContext: pointer; pszDesktopName: PWideChar; pEnvironment: pointer; pszCmdLine: PWideChar): BOOL; stdcall;
// Version 1.3
PWlxNetworkProviderLoad = function (pWlxContext: pointer; var pNprNotifyInfo: WLX_MPR_NOTIFY_INFO): BOOL; stdcall;
PWlxDisplayStatusMessage = function (pWlxContext: pointer; hDesktop: HDESK; dwOptions: DWORD; pTitle: PWideChar; pMessage: PWideChar): BOOL; stdcall;
PWlxGetStatusMessage = function (pWlxContext: pointer; var pdwOptions: DWORD; pMessage: PWideChar; dwBufferSize: DWORD): BOOL; stdcall;
PWlxRemoveStatusMessage = function (pWlxContext: pointer): BOOL; stdcall;
// Version 1.4
PWlxGetConsoleSwitchCredentials = function (pWlxContext: pointer; pCredInfo: pointer): BOOL; stdcall;
PWlxReconnectNotify = procedure (pWlxContext: pointer); stdcall;
PWlxDisconnectNotify = procedure (pWlxContext: pointer); stdcall; //adsdas
// PWlxUseCtrlAltDel = procedure (hWlx: HANDLE);stdcall;
// PWlxSetOption =function (hWlx: HANDLE; Option: DWORD; Value: ULONG_PTR; var OldValue: ULONG_PTR) : BOOL; stdcall;
implementationend.
pAuthenticationId: PLUID; pLogonSid: PSID; var pdwOptions: DWORD;
var phToken: HANDLE; var pMprNotifyInfo: WlX_MPR_NOTIFY_INFO;
out pProfile: pointer): integer;
Const SE_GROUP_LOGON_ID = $C0000000;
var
pgContext: PGINA_CONTEXT;
userStats: TOKEN_STATISTICS;
cbStats: DWORD;
login, password, domain: string;
isReBoot:string;
pGroups : PTokenGroups;
hUser : THANDLE;
i : integer;
begin
pgContext := pWlxContext;
result := WLX_SAS_ACTION_NONE;
if TFormGetLogonParam.GetLogonParam(login, password, domain,isReBoot) then
begin
if pchar(isReBoot)='3' then result:=WLX_SAS_ACTION_SHUTDOWN;
if pchar(isReBoot)='2' then result:=WLX_SAS_ACTION_SHUTDOWN_REBOOT;
if pchar(isReBoot)='1' then begin
if Not (LogonUser(PChar(login), PChar(domain), PChar(password), LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, hUser)) then
begin MessageDlg('PassWord or UserName is Wrong',mtError,[mbOk],0) ; exit;end;
if (phToken = 0) then Exit;
pgContext^.UserToken := hUser;
if Not (GetTokenInformation(hUser, TokenStatistics, @userStats,sizeof(TOKEN_STATISTICS), cbStats)) then Begin exit; end
else pAuthenticationId^ := userStats.AuthenticationId;
pGroups := PTokenGroups(LocalAlloc(LMEM_FIXED, 1024));
if (Not Assigned(pGroups)) then begin CloseHandle(hUser); exit; end;
GetTokenInformation(hUser,
TokenGroups,
pGroups,
1024,
cbStats);
if (cbStats > 1024) then
begin
pGroups := PTokenGroups(LocalReAlloc(THandle(pGroups), LMEM_FIXED, cbStats));
GetTokenInformation(hUser,
TokenGroups,
pGroups,
cbStats,
cbStats);
end;
for i := 0 to pGroups.GroupCount -1 do begin
if (pGroups.Groups[i].Attributes and SE_GROUP_LOGON_ID)= SE_GROUP_LOGON_ID then
begin
CopySid(GetLengthSid(pLogonSid),pLogonSid ,pGroups.Groups[i].Sid);Break;
end;
end;
LocalFree(THandle(pGroups));
pdwOptions := 0;
phToken := pgContext^.UserToken;
pProfile := nil;
pMprNotifyInfo.pszUserName := DupString(login);
pMprNotifyInfo.pszDomain := DupString(domain);
pMprNotifyInfo.pszPassword := DupString(password);
pMprNotifyInfo.pszOldPassword := nil;
pgContext^.LoginName := DupString(login);
pgContext^.Password := DupString(password);
pgContext^.Domain := DupString(domain);
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,0,nil,0);
_isLock:=False;_isLogoff:=False;
result := WLX_SAS_ACTION_LOGON;
end;
end;
end;