Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.31 KB

UnloadUserProfile.md

File metadata and controls

56 lines (38 loc) · 1.31 KB

Home

Function name : UnloadUserProfile

Group: Shell Functions - Library: userenv


Unloads a user"s profile that was loaded by the LoadUserProfile function.


Code examples:

How to load a user profile

Declaration:

BOOL WINAPI UnloadUserProfile(
  _In_  HANDLE hToken,
  _In_  HANDLE hProfile
);  

FoxPro declaration:

DECLARE UnloadUserProfile IN userenv;
	INTEGER hToken,;
	INTEGER hProfile  

Parameters:

hToken [in] Type: HANDLE Token for the user, returned from the LogonUser, CreateRestrictedToken, DuplicateToken, OpenProcessToken, or OpenThreadToken function.

hProfile [in] Type: HANDLE Handle to the registry key. This value is the hProfile member of the PROFILEINFO structure.


Return value:

TRUE if successful; otherwise, FALSE.


Comments:

Before calling UnloadUserProfile you should ensure that all handles to keys that you have opened in the user"s registry hive are closed. If you do not close all open registry handles, the user"s profile fails to unload.

See also: LoadUserProfile.