Solved

How does NetUserGetInfo() get it's info?

Posted on 2002-04-03
3
262 Views
Last Modified: 2013-12-03
Hi I'm having some problems here with user authentification. Our app uses NetUserGetInfo()to get the info about the current user (home dir, home path and of course user name). But I checked some documentation and couldn't find from what it builds up it's information (if it's even accessible to us) because it returns me a wrong path and I don't know where to change the info so it will get it correctly.

A solution I was proposed was that the conflict was with the /etc/passwd file from cygwin where the network paths are read. But the solution only worked randomly and now fails so obviously it's not the final solution.

So if anyone has any info on how NetUserGetInfo() gets it's info it'd be appreciated.

Rich.
0
Comment
Question by:mannycalaveras
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6915669
'NetUserGetInfo()' obtains the information from the SAM database, that is where NT/W2k stores it's account information (either locally or on a DC). The info it returns mainly is the one eneterd via the user manager.
0
 
LVL 1

Author Comment

by:mannycalaveras
ID: 6916094
Thanks a lot!

But would you happen to know how information are built into the database? My sys admin wrote part of the code that gets home dire for the user and it's also a nice coincidence that he also created the accounts on the current pc (with 2k) but he says he did not set the home directory himself. The info must come from somewhere else but where? It's not that important since at least we can go change it in the user accounts but I wonder if it's not going to be changed back in some way (*).

* It's because it was working earlier today and I saw that I left a trace in the code that looks for the user's home directory and removed it and recompiled and did not want to work after that.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6916107
Well, what exactly is the difference (and your environment)? HOMEPATH e.g. is an environment variable that can be changed, whereas 'NetUserGetInfo()' queries the data that is used to set up the users profile.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now