Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getting a window to come forward on XP Pin
Antony M Kancidrowski23-Mar-04 12:38
Antony M Kancidrowski23-Mar-04 12:38 
GeneralRe: Getting a window to come forward on XP Pin
Christian Graus23-Mar-04 16:18
protectorChristian Graus23-Mar-04 16:18 
GeneralRe: Getting a window to come forward on XP Pin
Mike Dimmick24-Mar-04 2:59
Mike Dimmick24-Mar-04 2:59 
GeneralRe: Getting a window to come forward on XP Pin
Tom Wright24-Mar-04 5:56
Tom Wright24-Mar-04 5:56 
GeneralCListCtrl - Sort Pin
jcplatt23-Mar-04 11:59
jcplatt23-Mar-04 11:59 
GeneralRe: CListCtrl - Sort Pin
David Crow24-Mar-04 2:08
David Crow24-Mar-04 2:08 
GeneralRe: CListCtrl - Sort Pin
jcplatt25-Mar-04 8:46
jcplatt25-Mar-04 8:46 
GeneralCan't write to HKEY_CURRENT_USER when impersonating (new problem) Pin
ICantChangeMyAcct23-Mar-04 10:02
ICantChangeMyAcct23-Mar-04 10:02 
Background:

My application restricts the capabilities of users without administrator privileges and provides an "administrator override" capability that allows an administrator to supply credentials so that restricted operations may be performed without terminating the app. This capability is designed to work on Windows 2000 and XP. The app requests user credentials with a logon dialog box. It then validates them and impersonates the user with administrator privileges using code modified from the samples supplied with Microsoft KB article Q180548. This mechanism works correctly on Windows 2000 SP3.

Problem:

After installing SP4 or some other recent Hotfix, the administrator override capability no longer works. After the app impersonates a user with administrator privileges, it can no longer open a registry key in HKEY_CURRENT_USER for reading and writing. The call:

RegOpenKeyEx (HKEY_CURRENT_USER, pszKeyName, 0,
KEY_READ|KEY_WRITE, &hRegKey);

fails, returning a value of 1346 (0x542), listed in Winerror.h as ERROR_BAD_IMPERSONATION_LEVEL.

What must I change in the app to fix this problem?

GeneralRe: Can't write to HKEY_CURRENT_USER when impersonating (new problem) Pin
David Crow23-Mar-04 10:29
David Crow23-Mar-04 10:29 
GeneralRe: Can't write to HKEY_CURRENT_USER when impersonating (new problem) Pin
ICantChangeMyAcct23-Mar-04 11:06
ICantChangeMyAcct23-Mar-04 11:06 
GeneralPrevent to open program multiplie times Pin
Snillet2k23-Mar-04 9:52
Snillet2k23-Mar-04 9:52 
GeneralRe: Prevent to open program multiplie times Pin
David Crow23-Mar-04 9:55
David Crow23-Mar-04 9:55 
GeneralGetLastError problem Pin
rmnowick23-Mar-04 9:20
rmnowick23-Mar-04 9:20 
GeneralRe: GetLastError problem Pin
David Crow23-Mar-04 9:53
David Crow23-Mar-04 9:53 
GeneralRe: GetLastError problem Pin
rmnowick23-Mar-04 11:35
rmnowick23-Mar-04 11:35 
GeneralRe: GetLastError problem Pin
Neville Franks23-Mar-04 9:59
Neville Franks23-Mar-04 9:59 
GeneralRe: GetLastError problem Pin
rmnowick23-Mar-04 11:47
rmnowick23-Mar-04 11:47 
GeneralRe: GetLastError problem Pin
Maksim Lepikhin23-Mar-04 12:08
Maksim Lepikhin23-Mar-04 12:08 
GeneralRe: GetLastError problem Pin
rmnowick23-Mar-04 12:28
rmnowick23-Mar-04 12:28 
GeneralSaving Encrypted Passwords Pin
ExtraLean23-Mar-04 9:18
ExtraLean23-Mar-04 9:18 
GeneralRe: Saving Encrypted Passwords Pin
Robert A. T. Káldy23-Mar-04 9:35
Robert A. T. Káldy23-Mar-04 9:35 
GeneralRe: Saving Encrypted Passwords Pin
ExtraLean23-Mar-04 10:03
ExtraLean23-Mar-04 10:03 
GeneralRe: Saving Encrypted Passwords Pin
Robert A. T. Káldy23-Mar-04 10:18
Robert A. T. Káldy23-Mar-04 10:18 
GeneralProblem CRecordSet Pin
ansontong23-Mar-04 6:59
ansontong23-Mar-04 6:59 
GeneralRe: Problem CRecordSet Pin
RadioShark23-Mar-04 7:11
RadioShark23-Mar-04 7:11 

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.