Wabiloo
10th May 2006 14:11 UTC
Help with API call using system plugin
Hi!
I'm afraid I've hit the wall (I'm not that much of a programmer).
I need to make an API call to LoadUserProfile, (in order to create the profile for a user just created and load its registry hive into HKU). [http://msdn.microsoft.com/library/de...serprofile.asp]
As I've just created the user (with "net user"), I know its name and the password.
Can anyone help me achieve this?
Many thanks in advance!
CancerFace
10th May 2006 22:52 UTC
It may be a bit more complicated than you think ...
I am under the impression that you need to:
1) call LogonUserAPI and get a token
2) [maybe you don't need this step] call DuplicateTokenExAPI in order to duplicate the token to a new one with the required access rights
3) call LoadUserProfile using the token from step 2
4) call UnloadUserProfile after you're done.
There is a microsoft article that discusses something similar to the above
Hope this helps
CF
Wabiloo
11th May 2006 13:09 UTC
I have read that article.
Unfortunately, I'm not much of a programmer. Don't get me wrong, I've gone a long way in the scripting world, and have several thousands of line of experience with NSIS.
However, talk to me about APIs, pointers, structures and that sort of thing, and I start crying...
So, I was kind of hoping someone with a lot of experience in that sort of things would have tried that before and could therefore give me a hand...
Short of that, I guess I'll have to dig into my C books again (I avoided for years!)
Afrow UK
11th May 2006 14:14 UTC
You're better off looking at the System example scripts. It is overwhelming at first but you should be able to understand it after a while.
-Stu