Jose's Read Only Forum 2023

IT-Consultant: José Roca (PBWIN 10+/PBCC 6+) (Archive only) => Discussion => Topic started by: Jean-Pierre Leroy on April 17, 2013, 05:38:32 PM

Title: ConvertSidToStringSid & ConvertStringSidToSid functions
Post by: Jean-Pierre Leroy on April 17, 2013, 05:38:32 PM
Dear all,

I was not able to find these two functions in AfxSid.inc

Any idea how to use them with PB.

Thanks.
Jean-Pierre
Title: Re: ConvertSidToStringSid & ConvertStringSidToSid functions
Post by: José Roca on April 17, 2013, 08:02:30 PM

DIM bRes AS LONG, pSid AS SID PTR
bRes = ConvertStringSidToSid("<Sid string>", pSid)
...
Later release it with LocalFree(pSid)

DIM pStrSid AS ASCIIZ PTR  ' or WSTRINGZ if using unicode
bRes = ConvertSidToStringSid(pSid, pStrSid)
IF bRes THEN ? @pStrSid
...
Later release it with LocalFree(pStrSid)

Title: Re: ConvertSidToStringSid & ConvertStringSidToSid functions
Post by: Jean-Pierre Leroy on April 18, 2013, 09:55:13 AM
Hi Jose,

Thanks for the code; Jean-Pierre
Title: Re: ConvertSidToStringSid & ConvertStringSidToSid functions
Post by: Jean-Pierre Leroy on April 18, 2013, 10:23:14 AM
Hi Jose,

Sorry for all my questions; it was my fault, I just forgot to include "Sddl.inc" in my source code !

Now with the

#Include "Sddl.inc"


It works perfectly.
Thank for your support.
Jean-Pierre