?
Solved

How does NetUserGetInfo() get it's info?

Posted on 2002-04-03
3
Medium Priority
?
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 800 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

777 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