Find Jobs
Hire Freelancers

C++ WinAPI GetUserProfile

$30-100 USD

Cancelado
Publicado hace alrededor de 17 años

$30-100 USD

Pagado a la entrega
The following code works on Windows XP but fails on Vista. I need you to change it so it works on XP and Vista. You must have tested this on Vista before I will accept the work as complete. PROFILEINFO pi; ZeroMemory(&pi,sizeof(pi)); [login to view URL] = sizeof(PROFILEINFO); HANDLE hToken = NULL; BOOL fStatus = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY | TOKEN_IMPERSONATE | TOKEN_DUPLICATE, &hToken); if(!fStatus || hToken == NULL) { MessageBox(NULL, "Failed to open security token of the current process.", "Error", MB_OK|MB_ICONSTOP); return false; } char pszUname[UNLEN + 1]; ZeroMemory(pszUname,sizeof(pszUname)); DWORD dwSize = UNLEN; fStatus = GetUserName(pszUname,&dwSize); if(!fStatus) { MessageBox(NULL, "Failed to get current user's name.", "Error", MB_OK|MB_ICONSTOP); CloseHandle(hToken); return false; } [login to view URL] = pszUname; // ***************************** // This is where it goes wrong!! // ***************************** fStatus = LoadUserProfile(hToken,&pi); // ***************************** // End // ***************************** CloseHandle(hToken); if(!fStatus) // Fails in Vista!!!!!!!! { MessageBox(NULL, "Failed to load user's profile.", "Error", MB_OK|MB_ICONSTOP); return false; } ################################# To find out more information about fStatus you could run this code: DWORD errorCode = GetLastError(); LPVOID lpMsgBuf; DWORD nbChar = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER |FORMAT_MESSAGE_FROM_SYSTEM| FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errorCode, 0, (LPTSTR) &lpMsgBuf, 0, NULL); OutputDebugString( (LPCTSTR)lpMsgBuf); LocalFree( lpMsgBuf ); ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform Windows XP & Vista
ID del proyecto: 2922594

Información sobre el proyecto

5 propuestas
Proyecto remoto
Activo hace 17 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
5 freelancers están ofertando un promedio de $78 USD por este trabajo
Avatar del usuario
See private message.
$170 USD en 1 día
4,9 (51 comentarios)
6,6
6,6
Avatar del usuario
See private message.
$59,50 USD en 1 día
4,8 (13 comentarios)
4,5
4,5
Avatar del usuario
See private message.
$63,75 USD en 1 día
4,9 (8 comentarios)
3,4
3,4
Avatar del usuario
See private message.
$34 USD en 1 día
5,0 (4 comentarios)
2,0
2,0
Avatar del usuario
See private message.
$63,75 USD en 1 día
0,0 (2 comentarios)
0,0
0,0

Sobre este cliente

Bandera de BELGIUM
Belgium
5,0
241
Miembro desde sept 25, 2004

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.