Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NetUserModalsGet at level 2

Status
Not open for further replies.

bobafett

Programmer
Sep 13, 2000
1
SE
Im trying to obtain the domain Sid from the PDC with use of the
NetUserModalsGet API call (at level 2).
The resulting SID should be in the USER_MODALS_INFO_2
structure, but there seems to be impossible to get any relevant data
out of it.
The return value from NetUserModalsGet indicate success.

I have tried to pass the structure to and from a byte array with no
succes.
============================================================
Private Declare Function NetUserModalsGet Lib "netapi32.dll" _
(ByVal servername As Long, _
ByVal level As Long, _
ByVal BufPtr As Long) As Long

Private Type USER_MODALS_INFO_2
usrmod2_domain_name As Long
usrmod2_domain_id As Long
End Type
'--------------
Dim udtUsrInfo as USER_MODALS_INFO_2
Dim bytUsrInfo() as byte
Dim lngUsrInfoPtr as Long

ReDim bytUsrInfo(0 To Len(udtUsrInfo))

Call CopyMemory(bytUsrInfo(0), udtUsrInfo, Len(udtUsrInfo))

lngUsrInfoPtr = VarPtr(bytUsrInfo(0))

lngResult = NetUserModalsGet(lngPDCptr, lngLevel, lngUsrInfoPtr)

Call CopyMemory(udtUsrInfo, bytUsrInfo(0), Len(udtUsrInfo))
============================================================
(the above is not the complete code)

Any help would be appreciated.

/Bob [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top