Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine that the User has Admin privileges
Message
De
04/09/2003 07:21:34
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00824487
Message ID:
00825950
Vues:
26
On my PC (Win 2000, VFP6 SP5) SYS(2600) still returns empty string.
Instead of
lcBuffer = SYS(2600, Long2Num(lcBufPtr), 32)
if I use
lcBuffer = GetStrFromMem( lcBufPtr )
it works.
This works for a local user. I still have to make it work for Domain User in which case NetUserGetInfo returns error 2221 which means Username not found.
I guess I'll have to use IADS for it.
Thanx a lot. Your help is widely appreciated.
Hitendra

FUNCTION GetStrFromMem(nAddr)
* converting allocated in memory Unicode string to a VFP string
DECLARE RtlMoveMemory IN kernel32 As CopyMemory STRING @dst, INTEGER src, INTEGER nLen
#DEFINE BUF_SIZE 128
LOCAL cBuffer
cBuffer = Repli(Chr(0), BUF_SIZE)
= CopyMemory(@cBuffer, nAddr, BUF_SIZE)
RETURN cBuffer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform