NetGetDCName_

Just starting out? Need help? Post your questions and find answers here.
blackborg
User
User
Posts: 38
Joined: Thu Nov 02, 2006 8:20 pm

NetGetDCName_

Post by blackborg »

I feel like this should be easy.. but...

How can I read the name of the Domain Controller that's returned...

I get a result code that says the function succeeded..

Code: Select all

    mydc.s = Space(255)
    
    rc.l = NetGetDCName_(0,0,@mydc)
       
    PrintN("Did I get my DC? " + Str(rc))

but I have had no luck reading the name of the server from @mydc.. not with peekS, uni2ansi.. etc..

The program is compiled Unicode on PB 4.50
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: NetGetDCName_

Post by srod »

Get rid of mydc.s = Space(255) because you want mydc to be an integer variable.

Use PeekS(mydc...) rather than PeekS(@mydc...)
I may look like a mule, but I'm not a complete ass.
blackborg
User
User
Posts: 38
Joined: Thu Nov 02, 2006 8:20 pm

Re: NetGetDCName_

Post by blackborg »

Thanks much.. the part I missed was the api expects a pointer to a pointer..

It works great now..
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: NetGetDCName_

Post by srod »

Don't forget to use NetApiBufferFree_() when you are done with the buffer.
I may look like a mule, but I'm not a complete ass.
Post Reply