| |
|
|
|
Description:
CheckTokenMembership screen, whether the SID of/ one group in a Token present and active is. These function there only under windows2000 and XP.
Deklaration:
DEF @CheckTokenMembership(3) !advapi32,CheckTokenMembership
Parameter:
1.Parameter: lever one Access Tokens or 0, for Token the current Prozesses. 2.Parameter: Memory-Variable with of/ one SID structure of/ one group. 3.Parameter: 4 byte Memory-Variable or The address of/ one LongIntvariablen, The a Flag aufnimmt, the angibt whether The in Parameter 2 angegebene group in the Token active is. => -$1 = group is present and active. - $0 = group isn't present or inaktiv.
Return Value:
0 with Error, otherwise <>0.
Examples:
CompileMarkSeparationDEF @CheckTokenMembership(3) !"advapi32","CheckTokenMembership"
DEF @GetProcAddress(2) !"KERNEL32","GetProcAddress"
DEF @GetModuleHandle(1) !"KERNEL32","GetModuleHandleA"
Declare Member&,SID#,MHANDLE&,Module$,Funktion$
LET MODULE$=$SYSPATH+"Advapi32.DLL"
LET Funktion$="CheckTokenMembership"
LET MHANDLE&=@GetModuleHandle(@ADDR(Module$))
IF @GetProcAddress(MHANDLE&,@ADDR(FUNKTION$))<>0
DIM SID#,16
LONG SID#,0=513
LONG SID#,4=83886080
LONG SID#,8=32
LONG SID#,12=544
@CheckTokenMembership(0,SID#,@ADDR(Member&))
IF Member&=1
@Messagebox("Du bist auf deinem Rechner ein Administrator!","Admincheck",64)
else
@Messagebox("Du hast keine Administratorrechte!","Admincheck",64)
endif
DISPOSE SID#
else
@MESSAGEBOX("Falsche Windowsversion","Son Scheiß!",64)
endif
[keywords:d12e752cea] Token Gruppenzugehörigkeit group present active activate rights Privilegien Admin Administrator Administratoren system [/keywords:d12e752cea] |
|
|
| |
|
|