Thread: UserMgr Plugin
View Single Post
Old 2nd September 2009, 19:46   #42
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
I uploaded a new version of this plugin:
- Added GetUserNameFromSID function
- Added GetSIDFromUserName function
- Fixed a problem in the RegLoadUserHive function when a user was deleted and then recreated
Quote:
Originally posted by TobbeSweden
Now I can run the plugin but there is one thing I find weird...
code:
Name "UsrMgrTest"
OutFile "UsrMgrTest.exe"
ShowInstDetails show
Page instfiles

Section ""
UserMgr::GetCurrentUserName
Pop $0
DetailPrint ">$0<"
UserMgr::GetUserInfo $0 "HOMEDIR"
Pop $1
DetailPrint ">$1<"
UserMgr::HasPrivilege $0 "SeInteractiveLogonRight"
Pop $2
DetailPrint ">$2<"
SectionEnd


$1 is just an empty string when I run that. And $2 is "ERROR LsaEnumerateAccountRights". $0 does contain my username.
Thanks to ginglese I found a better way to get the HOMEDIR:http://forums.winamp.com/showthread....postid=2558509
code:
UserMgr::GetCurrentUserName
Pop $0
UserMgr::GetSIDFromUserName "" $0
Pop $1
ReadRegStr $2 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
ExpandEnvStrings $3 $2
DetailPrint "Homedir: $3"

jpderuiter is offline   Reply With Quote