gina的问题 linuxping, luckyso888请进,搞好久了 搞不定,帮定有分,分不够再加 ( 积分: 300 )

  • 主题发起人 主题发起人 cyf_00002
  • 开始时间 开始时间
C

cyf_00002

Unregistered / Unconfirmed
GUEST, unregistred user!
引用了linuxping的GinaFunctionDeclare单元,只是修改了下函数申明,除了WlxActivateUserShell把所有的MY去掉了(省心),<br>我的代码如下<br>function&nbsp;WlxActivateUserShell(pWlxContext:&nbsp;pointer;&nbsp;pszDesktopName:&nbsp;PWideChar;&nbsp;pszMprLogonScript:&nbsp;PWideChar;&nbsp;pEnvironment:&nbsp;pointer):&nbsp;BOOL;&nbsp;stdcall;<br>var<br>sinfo:TStartupInfo;<br>pinfo:TProcessInformation&nbsp;;<br>bRet:Bool;<br>begin<br><br>&nbsp;&nbsp;ShowMessage(PGINA_CONTEXT(pWlxContext)^.LoginName);<br>&nbsp;&nbsp;ShowMessage(PGINA_CONTEXT(pWlxContext)^.Password);<br><br><br>&nbsp;&nbsp;sInfo.cb:=SizeOf(TStartupInfo);<br>&nbsp;&nbsp;sInfo.lpDesktop:=pszDesktopName;<br>&nbsp;&nbsp;ShowMessage(IntToStr(PGINA_CONTEXT(pWlxContext)^.UserToken));<br><br>&nbsp;&nbsp;bRet:=CreateProcessAsUser(PGINA_CONTEXT(pWlxContext)^.UserToken,'a.exe','',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nil,nil,false,CREATE_UNICODE_ENVIRONMENT,pEnvironment,NIL,sInfo,pInfo);<br>&nbsp;&nbsp;if&nbsp;bRet&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;ShowMessage('yes')<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;ShowMessage(PChar('CreateProcessAsUser'&nbsp;+&nbsp;SysErrorMessage(GetLastError)));<br><br>&nbsp;Result:=MyWlxActivateUserShell(pWlxContext,&nbsp;pszDesktopName,&nbsp;pszMprLogonScript,&nbsp;pEnvironment);<br><br>end;<br>想创建个用户权限的进程。运行发现<br>&nbsp;PGINA_CONTEXT(pWlxContext)^.UserToken总是等于0,没有权限执行。<br>PGINA_CONTEXT(pWlxContext)^.LoginName是乱码,PGINA_CONTEXT(pWlxContext)^.Password是空
 
后退
顶部