Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

win32 equivalents of getuid, getgid, etc.

Posted on 1998-05-08
9
Medium Priority
?
1,024 Views
Last Modified: 2013-12-03
I'm rewriting some code for win32 that was originally done in motif for unix.  I need a reference for equivalent (or close) functions if anyone knows of one.  In the mean time, what I need is something like getuid, getgid, etc.  All I find is SID and can't figure out if it's serving the same purpose.
0
Comment
Question by:appleby
[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
9 Comments
 

Expert Comment

by:agopal
ID: 1400086

GetUserName() is the function you are looking for.
You could subsequently use it in
  Lookup ...APIs I guess

0
 
LVL 1

Expert Comment

by:Blondie050798
ID: 1400087
Well it depends on the operating system really...windows 95 is limited in terms of the security aspect...as agopal said, ::GetUserName() will obviously get you the username! ::GetComputerName() will tell you what their pc is called...

To get more detailed information, such as security info, you need to be running NT 3.1 or later (I think)...things start to get slightly more complicated here, and it is not a simply matter of matching a unix function for a win32 function...
If you lookup LookupAccountName() or LookupAccountSid(), you will find links to the various other access control function (of which there are many!)...
0
 

Author Comment

by:appleby
ID: 1400088
Sorry to leave out details.  I am running on NT 4.0.  The code I am rewriting may not be applicable for NT, it's hard to tell so far since I'm having trouble wading through the docs on security...I keep running in circles.  I guess what I really need is one example of the difference in using GetUserName() to work like getuid and geteuid.  These are the kinds of things I can't resolve after I find the main function for dealing with such topics.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:appleby
ID: 1400089
Adjusted points to 75
0
 
LVL 1

Expert Comment

by:Blondie050798
ID: 1400090
Well rather than quoting unix functions (cos my unix is rather rusty) can you tell me exactly what you want to find out about the user?
0
 

Author Comment

by:appleby
ID: 1400091
I'd like to be able to get the user, which GetUserName does.  If the user is aliasing another user, GetUserName returns the aliased user.  I'd like to be able to get the real user too.  I'd like to be able to do the same for groups.  Get the real user's group, and the aliased user's group.
0
 

Author Comment

by:appleby
ID: 1400092
Sorry, you can scratch that last comment.  After clarification
from our project lead, (which I should have gotten before making that last comment) that is not what this code is looking for, and in fact they have decided we don't need to translate this part.
(nice of them to tell me so soon).  I'm sorry for wasting your time.  It did help me understand GetUserName, which I still need in other areas.  I just don't need to translate geteuid or the group info.
0
 
LVL 1

Accepted Solution

by:
lekshmikr earned 210 total points
ID: 1400093
To get the name of the user associated the  application can call the WNetGetUser function. (LAN manager API for windows NT)

 NetGroupGetUsers function retrieves a list of the members of a particular global group

0
 

Author Comment

by:appleby
ID: 1400094
Although my last comment was that I no longer needed the question answered, this is new information that I haven't found so it is still something I'll save for later use if needed.

I'd like to know if it's possible to remove questions once you've asked them and before they are answered.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

604 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