Click here to Skip to main content
16,005,552 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CPropertyPagae [modified] Pin
bob1697229-May-06 10:13
bob1697229-May-06 10:13 
GeneralRe: CPropertyPagae [modified] Pin
ftsOne29-May-06 10:43
ftsOne29-May-06 10:43 
Questioncontrol Dlg classes in 1 application Pin
Immunity1828-May-06 8:00
Immunity1828-May-06 8:00 
AnswerRe: control Dlg classes in 1 application Pin
bob1697228-May-06 8:50
bob1697228-May-06 8:50 
GeneralRe: control Dlg classes in 1 application Pin
Immunity1828-May-06 8:54
Immunity1828-May-06 8:54 
GeneralRe: control Dlg classes in 1 application Pin
bob1697228-May-06 9:36
bob1697228-May-06 9:36 
QuestionXML/Soap/HTTP Questions (help your n00b) Pin
chasetoys28-May-06 7:19
chasetoys28-May-06 7:19 
QuestionCreateProcessWithLogonW limitations? Pin
fourierman28-May-06 6:24
fourierman28-May-06 6:24 
Overview:

I'm trying to write a util that will allow users in the local 'Power Users' security group the ability to add/remove their access to regedit, .cpl entries, mmc, etc. Unfortunately, Power Users don't (by default) have access to make changes to hkcu\software\microsoft\windows\currentversion\policies (where these registry keys need to be created/modified)

By calling CreateProcessWithLogonW (passed local Administrator credentials) with a NULL parameter for the dwLogonFlags parameter, I thought it wouldn't perform a LOGON_WITH_PROFILE -- but it does anyway. This causes the Power Users HKCU hive to be overwritten with that of the local Administrator.

So, currently my plan is to have two processes:
a.exe: Runs CreateProcessWithLogonW to call process b.exe (which will run as local administrator):

b.exe runs NetLocalGroupAddMembers to add NT AUTHORITY\Authenticated Users to the local Administrators group , thereby giving them access to make changes to the registry key above. control returned to caller (a)

a.exe: Make registry key changes to HKCU hive of the Power User. Changes are complete. Remove user from Local Security Group (don't need admin rights for this)

Summary:
As you can see, to perform this task I need two executables. Seems a bit silly (and there's probably an easier way to do all this). Any way to combine everything into one file? Don't suppose there's some way to use run my code snippet/function for NetLocalGroupAddMembers using elevated privileges without creating an entirely new execuable for that?

Thanks for any help

AnswerRe: CreateProcessWithLogonW limitations? Pin
fourierman28-May-06 10:08
fourierman28-May-06 10:08 
AnswerRe: CreateProcessWithLogonW limitations? Pin
bob1697228-May-06 11:20
bob1697228-May-06 11:20 
GeneralRe: CreateProcessWithLogonW limitations? Pin
fourierman28-May-06 11:49
fourierman28-May-06 11:49 
QuestionHow i write text in a file Pin
Immunity1828-May-06 5:59
Immunity1828-May-06 5:59 
AnswerRe: How i write text in a file [modified] Pin
bob1697228-May-06 6:30
bob1697228-May-06 6:30 
GeneralRe: How i write text in a file [modified] Pin
Immunity1828-May-06 6:49
Immunity1828-May-06 6:49 
GeneralRe: How i write text in a file [modified] Pin
bob1697228-May-06 7:07
bob1697228-May-06 7:07 
GeneralRe: How i write text in a file [modified] Pin
bob1697228-May-06 7:16
bob1697228-May-06 7:16 
GeneralRe: How i write text in a file [modified] Pin
Immunity1828-May-06 7:18
Immunity1828-May-06 7:18 
QuestionSpeed up listview when adding thousands of items Pin
Master Gollom28-May-06 5:56
Master Gollom28-May-06 5:56 
AnswerRe: Speed up listview when adding thousands of items Pin
bob1697228-May-06 6:36
bob1697228-May-06 6:36 
GeneralRe: Speed up listview when adding thousands of items Pin
Master Gollom28-May-06 6:41
Master Gollom28-May-06 6:41 
GeneralRe: Speed up listview when adding thousands of items Pin
Immunity1828-May-06 9:32
Immunity1828-May-06 9:32 
AnswerRe: Speed up listview when adding thousands of items [modified] Pin
anwer_skk28-May-06 16:45
anwer_skk28-May-06 16:45 
GeneralRe: Speed up listview when adding thousands of items [modified] Pin
Master Gollom28-May-06 22:32
Master Gollom28-May-06 22:32 
QuestionDragListBox with additions Pin
Luksky28-May-06 4:30
Luksky28-May-06 4:30 
AnswerRe: DragListBox with additions Pin
Luksky28-May-06 11:57
Luksky28-May-06 11:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.