Sign in to follow this  
Followers 0
engine

$tagTOKEN_PRIVILEGES question

8 posts in this topic




I am trying to do something like this:

TP.PrivilegeCount = 2
TP.Privileges(0).pLuid = RestoreLuid
TP.Privileges(0).Attributes = SE_PRIVILEGE_ENABLED
TP.Privileges(1).pLuid = BackupLuid
TP.Privileges(1).Attributes = SE_PRIVILEGE_ENABLED

but in AutoIt.


My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url]

Share this post


Link to post
Share on other sites

I am trying to do something like this:

TP.PrivilegeCount = 2
TP.Privileges(0).pLuid = RestoreLuid
TP.Privileges(0).Attributes = SE_PRIVILEGE_ENABLED
TP.Privileges(1).pLuid = BackupLuid
TP.Privileges(1).Attributes = SE_PRIVILEGE_ENABLED

but in AutoIt.

You can only set this on your executable, not on some other executable. What exactly are you trying to accomplish by doing this that autoit doesn't already do?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I am using this:

$TOKEN_PRIVILEGES = DLLStructCreate($tagTOKEN_PRIVILEGES)
DllStructSetData($TOKEN_PRIVILEGES, "Count", 2)

Thanks in advance.

Man, that is confusing!

The MSDN on the struct TOKEN_PRIVILEGES says it only has two fields, the count and an array of LUID_AND_ATTRIBUTES structures. That struct, in turn, has two fields, LUID and attributes.

The AutoIt $tagTOKEN_PRIVILEGES seems to be a mashup of the two, perhaps because you can't give a stuct definition as a type in AutoIt for DllStructCreate()?

That leaves you wondering what the count is for, since the AutoIt version has no array to give the count on... :)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Thanks guys.

I was able to solve this problem.

What was the solution? Part of the purpose of this forum is to document solutions. How did you solve it?

muttley


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hi PsaltyDS

It's something like the information in the MSDN pages you provided. It's not that obvious though.

See the SetPrivilege function inside the Reg.au3 UDF from this post #545798

Regards.

So you dropped the $tagTOKEN_PRIVILEGES and declared your own with the array in it:
Local $TOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & 3 * $iTokens & "]")

I see, said the blind man...

muttley

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0