Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download - Clean, repair and optimize your system



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner 2009 - Free Scan Now

IEUser restart through Restart Manager works but...

microsoft.public.windows.vista.general




Recommended Fix - Fix Vista Errors and Optimize Performance

Click On Your Flag for Translation
Simplified Chinese French Spanish Italian Portugeuse Japanese German Dutch
Driver Scanner 2009 - Free Scan Now
Reply
  #1 (permalink)  
Old 03-14-2007
jgomezb@gmail.com
 

Posts: n/a
IEUser restart through Restart Manager works but...
Hi all,
I register an elevation policy and restart IEUser for it to take
effect. If this is done from an administrator account, all works fine:
the policy is registered, the IEUser is shutdown (RmShutdown) and
restarted (RmRestart), so the policy is considered. However, if this
is done from a standard account, it only works from a medium integrity
level but not from a high integrity level.

Maybe this happens because the user of the high integrity level
process restarting the IEUser is an administrator (after the prompt
from consent.exe) which differs from the standard user running the
original IEUser. My experimentgs show that in this case RmShutdown
succeds, but not RmRestart.

The code I am using is this:

// Restart IEUser.
DWORD RestartIEUser()
{ DWORD dwVal=ERROR_SUCCESS;
DWORD dwSessionHandle=(DWORD)-1;
WCHAR wszSessionKey[CCH_RM_SESSION_KEY+1];
UINT nProcInfo=100;
UINT nProcInfoNeeded;
DWORD lpdwRebootReason=0;

LPWSTR rgsFiles[] = { L"c:\\program files\\internet explorer\
\ieuser.exe", };

// Allocate structures.
RM_PROCESS_INFO *rgProcs=new RM_PROCESS_INFO[nProcInfo];
if (rgProcs==0)
{ dwVal=ERROR_NOT_ENOUGH_MEMORY;
goto RM_END;
}

// Starting Session.
dwVal=RmStartSession(&dwSessionHandle, 0, wszSessionKey);
if (dwVal!=ERROR_SUCCESS) goto RM_END;

// Register items.
dwVal=RmRegisterResources(dwSessionHandle, 1, (LPCWSTR*) rgsFiles, 0,
NULL, 0, NULL);
if (dwVal!=ERROR_SUCCESS) goto RM_END;

// Getting affected apps.
dwVal=RmGetList(dwSessionHandle, &nProcInfoNeeded, &nProcInfo,
rgProcs, &lpdwRebootReason);
if (dwVal!=ERROR_SUCCESS) goto RM_END;

// Shutdown ieuser process.
dwVal=RmShutdown(dwSessionHandle, 0, NULL);
if (dwVal!=ERROR_SUCCESS) goto RM_END;

// Restart ieuser.
dwVal=RmRestart(dwSessionHandle, NULL, NULL);
if (dwVal!=ERROR_SUCCESS) goto RM_END;

RM_END:

// Release structures.
if (rgProcs!=NULL) delete[] rgProcs;

// Clean up session.
if (dwSessionHandle!=-1)
RmEndSession(dwSessionHandle);

return dwVal;
}

int main(int argc, char* argv[])
{ RestartIEUser();
return 0;
}

I have tried creating a thread that impersonates the user and does the
call to RestartIEUser(), but it doesn't works. Anyone has any clue? Do
I need to create a process as the user to perform only this operation?

Thanks in advance,

Kodit

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restart Vista =?Utf-8?B?dG9wY2F0?= microsoft.public.windows.vista.installation setup 5 03-14-2007 19:58
Clicking on IE 7 Address Bar selector caused IE to lock up and need a task manager restart. Keith Caravelli microsoft.public.windows.vista.general 2 03-13-2007 21:36
Restart issue =?Utf-8?B?Um9iZGF0YQ==?= microsoft.public.windows.vista hardware devices 2 03-07-2007 04:37
Restart to Print =?Utf-8?B?RGF2aWQ=?= microsoft.public.windows.vista.print fax scan 2 03-06-2007 14:49
Vista will not Restart Parisisehs@gmail.com microsoft.public.windows.vista.general 0 02-20-2007 16:14




All times are GMT +1. The time now is 00:21.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com and Win7Heads.com.


Funny Commercials to make you laugh :-)

Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119