Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[C++] LogonUser

Featured Replies

Hi all,

Writing some code that needs to be able to logon as another user to modify some registry keys. I am using the LogonUser() function and it works fine when my code is executed on a WinXP machine, but I also need to support WinNT. When I run the code on WinNT I get an error that I don't have appropriate privileges. I've read some about the SE_TCB_NAME privilege, but how do I get this privilege at runtime? Is there a better way to logon as another user in WinNT?

Thanks

  • 3 months later...

Hi dude,

Can you give me the sourcecode and exe which works in windows XP?

Thanks and Regards,

Senthil Kumar M.

  • Author

I don't have the code anymore as I switched to using SSPI to logon as another user.

Check Microsofts site:

http://msdn.microsoft.com/library/default....y/logonuser.asp

Here is a snipet of code I used to get a handle to another users HKCU registry key:

HANDLE hToken = NULL;
LogonUser(tName, tDomain, tPassword, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, &hToken);
PROFILEINFO pi = {sizeof pi, PI_NOUI, tName};
LoadUserProfile(hToken, π);
//registry code here

UnloadUserProfile(hToken, pi.hProfile);
CloseHandle(hToken);
hToken = NULL;

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.