|
Hello Johannes,
You're most welcome, Johannes. About your question : Yes, NetUserGetInfo() will return USER_PRIV_ADMIN if the user is a member of the "Administrator" group. The user may belong to several groups but as long as he/she is part of the Administrator's group, USER_PRIV_ADMIN will be returned.
I understand your concerns over the use of NetUserGetGroups(). If detecting Administrator rights or being part of the Administrator's Group is all that is needed, I would vote for NetUserGetInfo().
Regards,
Bio.
|
|
|
|
|
Hello Johannes,
I have another suggestion for you. There are three other functions that you can use : NetLocalGroupEnum(), LookupAccountName() and NetLocalGroupGetMembers().
1. The NetLocalGroupEnum() API retrieves information about each local group account on a target machine. It returns the group information in an array of LOCALGROUP_INFO_0 structs.
2. You can then iterate through this array and call LookupAccountName() on each group name. You will be returned an SID for that group account.
3. Now, the important part of this suggestion is the fact that NT uses a constant SID value for some well-known accounts like EVERYONE or WORLD. I'm very sure that the "Administrators" group account is also one of these well-known Group Accounts.
4. The SID string for the "Administrators" group should be "S-1-5-32-544" on all NT systems. Please verify this, Johannes, before using my suggestion.
5. Now, once you have found the "Administrators" Group Account, call NetLocalGroupGetMembers() to get an array of LOCALGROUP_MEMBERS_INFO_1 structs. Each element of the array will contain information on the User Accounts that are part of the given Group Account name.
6. You can use this method to obtain the list of User Accounts which are part of the "Administrators" Group Account on a machine. The wonderful thing about these APIs is that you can make these queries on any machine not just the local machine.
7. I have previously written an article in CodeProject with sample code and demo program that closely matches the details above. My sample program collects NT Remote and Local Group and User Account SIDs and store them in an INI and an XML file. You can run my app and collect these SID info at a later time by accessing the information in the output INI file or the XML file.
8. The following is the link to my article :
http://www.codeproject.com/useritems/collectsid.asp
You can also search for it under "Free Programming Tools" section of CodeProject.
9. I'd also like to refer you to a great article by Mark Russinovich (of SysInternals) where he gave a very good introduction to WinNT Security :
http://www.winntmag.com/Articles/Index.cfm?ArticleID=3143&pg=1
In this article he also mentions some good points about SIDs and the existence of "well-known" or "built-in" SIDs.
10. I hope the above info will help you further, Johannes. Best of luck.
Regards,
Bio.
|
|
|
|
|
In a streaming application which would seem the better, TCP or Unicast UDP? Which has less overhead, reliablity, etc. Any help would be greatly appreciated.
Stephen Caldwell
Blackfission, CEO
http://bf.steffc.yi.org:81
Sonork ID: 100.10100
|
|
|
|
|
Anyone have a CStatic control that has scrollbars? I could use CEdit with read-only, but it does not look very good on PocketPC.
|
|
|
|
|
I wanted to monitor the number of upload and download bits, in realtime, under Windows 98 and 2000. Does anyone have any idea of doing it? I would be doing it under VC++.
Many ThanXs...
|
|
|
|
|
Can anyone roughly tell me how i can send AT commands through a palm with CodeWarrior program.I have succesfully open the serial port for transmitting data but there's error when sending out AT commands.I use the hyper terminal to check my output data but it does not coincide with the input data.
|
|
|
|
|
Hello,
in my MFC app I'm using a modeless child dialog to display some extra information. When the input focus is on the modeless dlg, the accelerators of the main app are not working.
What to I do to make things better?
Thomas
|
|
|
|
|
I'm looking for a easy way to skin an MFC app(captions, buttons, progress bars, windows and dialogs borders, etc), does anybody know where can i get an example of this, or if you're gonna put an article about this?
|
|
|
|
|
Anyone seen some code that does VC.NET auto hide windows in MFC (I found one in WTL (http://home.worldonline.dk/~viksoe/autohide.htm) but that doesn't fit my current project))
Thanks
|
|
|
|
|
Wait for BCG pro
Le Ridder Noir
Considderd to be the worlds fastest knoppenbonker.
one year of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru and Crystal Ace.
|
|
|
|
|
I think you're missing the point. The whole point of this site is to share source code with each other. Recommending a commercial library doesn't answer the original poster's question. Get a clue Troll.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
I looking for a sample source code for simple transmit/recieve audio/video in c++.
I currently using the JMF but i want to have "Control".
Does somehting like this exist?Where can i find Source and documantion and samples.
Hope to have an answer.
Yoav:
yoav adler
|
|
|
|
|
Try
http://www.banasoft.com/AVPhone.htm
|
|
|
|
|
I looking for a sample source code for simple transmit/recieve audio/video in c++.
I currently using the JMF but i want to have "Control".
Does somehting like this exist?Where can i find Source and documantion and samples.
Hope to have an answer.
Yoav
|
|
|
|
|
Hi, all!
Does anyone of you know how to apply C++ to program an algorithm named "Subspace iteration", which is mainly for the calculation of eigenvalues and eigenvectors.
Thank you very much for your guidance!
Jeffrey
|
|
|
|
|
How can I find out what OS my program is running under. I need to be able to distinguish between NT 4.0 and Win 2K.
Regards,
SAK
|
|
|
|
|
you can use GetVersionEx
OSVERSIONINFO.dwMajorVersion will be 4 for NT 4.0 and 5 for Win 2K
Nish
|
|
|
|
|
Try this link.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|
|
enum OS_TYPE{
OS_WIN_32s,
OS_WIN_NT3,
OS_WIN_95,
OS_WIN_98,
OS_WIN_ME,
OS_WIN_NT4,
OS_WIN_2000,
OS_WIN_XP
};
unsigned int GetOSType()
{
OS_TYPE ShellType;
DWORD winVer;
OSVERSIONINFO *osvi;
winVer=GetVersion();
if(winVer<0x80000000){/*NT */
ShellType=OS_WIN_NT3;
osvi= (OSVERSIONINFO *)malloc(sizeof(OSVERSIONINFO));
if (osvi!=NULL){
memset(osvi,0,sizeof(OSVERSIONINFO));
osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
GetVersionEx(osvi);
if(osvi->dwMajorVersion==4L)ShellType=OS_WIN_NT4;
else if(osvi->dwMajorVersion==5L&&osvi->dwMinorVersion==0L)ShellType=OS_WIN_2000;
else if(osvi->dwMajorVersion==5L&&osvi->dwMinorVersion==1L)ShellType=OS_WIN_XP;
free(osvi);
}
}
else if (LOBYTE(LOWORD(winVer))<4)
ShellType=OS_WIN_32s;
else{
ShellType=OS_WIN_95;
osvi= (OSVERSIONINFO *)malloc(sizeof(OSVERSIONINFO));
if (osvi!=NULL){
memset(osvi,0,sizeof(OSVERSIONINFO));
osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
GetVersionEx(osvi);
if(osvi->dwMajorVersion==4L&&osvi->dwMinorVersion==10L)ShellType=OS_WIN_98;
else if(osvi->dwMajorVersion==4L&&osvi->dwMinorVersion==90L)ShellType=OS_WIN_ME;
free(osvi);
}
}
return ShellType;
}
//rate me or hate me
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
Hi there
I am learning Visual C++ and tring to build some kind of Visual CAD Builder
on MFC{ like Visio}
But of course I experience lack of knowledge
So, can anybody help me with that and send me link or some project where I can learn how to do that.
Thank you
Al
|
|
|
|
|
You'll have to be more specific about the areas you are struggling with. I suggest reading up on GDI and GDI plus. Also the Scribble tutorial that comes with Visual C++ will help you build the basic framework.
Michael
|
|
|
|
|
Do you know any good reading on GDI
GDI plus.... I have never heard about that
Al
|
|
|
|
|
|
Clim, I think your trying to jump too far ahead if you haven't yet heard of GDI (CDC). Doing so will be damaging for you for two reasons, you'll miss the basics of graphics work and risk being disillusioned with your programming experience if you fail on your early projects.
As suggested, the scribble sample program is a good place to start, because it teaches the 'object' method of drawing.
After going through the scribble tutorial to get the basics, I would suggest setting up an almost bare-bones project with just a standard View. Then work through the GDI functions, to see what they do and how there work. Then try some drawing objects of your own.
For example you might have a box class
class CBox : public CObject
{//data only class
CRect m_Box;
CPoint m_Possition;
COLORREF m_BorderColor;
COLORREF m_FillColor;
};
You might decide then to add intelligent shapes,
class CCircle : public CObject
{//Intelligent class
CRect m_BoundingRect;
double GetRadius();
double GetCircumference();
};
You could even, once you have done the ground work, create a CDC class of yuor own that understands your own objects.
But first you need to study CDC. Your C++ has already got a wealth of information of how to get started, don't waste your money on a £50 book until you have fully explored what you have and then know exactly which area of graphics you need help with, if any.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
Sorry, I meant to also say that text is an important area of graphics, thats still a CDC thing, and a plain View is the best place to work with that too.
You will need to understand the CFont/LOGFONT and how to calculate the dimensions etc.
You have a lot of work to do, but its best to just nuckle down and get on with it, you'll need to write interfaces in a your programming so the sooner you get these lessons out of the way the better.
We do it for the joy of seeing the users struggle.
|
|
|
|