mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 05:01:03 +00:00
[USERENV] Move some functions around to make it look nicer. No code changes.
This commit is contained in:
parent
d383d1c6b0
commit
b9d4e2dae6
1 changed files with 105 additions and 102 deletions
|
@ -106,6 +106,45 @@ AcquireRemoveRestorePrivilege(IN BOOL bAcquire)
|
|||
}
|
||||
|
||||
|
||||
static
|
||||
BOOL
|
||||
CheckForLoadedProfile(HANDLE hToken)
|
||||
{
|
||||
UNICODE_STRING SidString;
|
||||
HKEY hKey;
|
||||
|
||||
DPRINT("CheckForLoadedProfile() called\n");
|
||||
|
||||
/* Get the user SID string */
|
||||
if (!GetUserSidStringFromToken(hToken, &SidString))
|
||||
{
|
||||
DPRINT1("GetUserSidStringFromToken() failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (RegOpenKeyExW(HKEY_USERS,
|
||||
SidString.Buffer,
|
||||
0,
|
||||
MAXIMUM_ALLOWED,
|
||||
&hKey))
|
||||
{
|
||||
DPRINT("Profile not loaded\n");
|
||||
RtlFreeUnicodeString(&SidString);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
RtlFreeUnicodeString(&SidString);
|
||||
|
||||
DPRINT("Profile already loaded\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* PUBLIC FUNCTIONS ********************************************************/
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
CopySystemProfile(
|
||||
|
@ -672,6 +711,62 @@ done:
|
|||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
DeleteProfileA(
|
||||
_In_ LPCSTR lpSidString,
|
||||
_In_opt_ LPCSTR lpProfilePath,
|
||||
_In_opt_ LPCSTR lpComputerName)
|
||||
{
|
||||
BOOL bResult;
|
||||
UNICODE_STRING SidString, ProfilePath, ComputerName;
|
||||
|
||||
DPRINT("DeleteProfileA() called\n");
|
||||
|
||||
/* Conversion to UNICODE */
|
||||
if (lpSidString)
|
||||
RtlCreateUnicodeStringFromAsciiz(&SidString,
|
||||
(LPSTR)lpSidString);
|
||||
|
||||
if (lpProfilePath)
|
||||
RtlCreateUnicodeStringFromAsciiz(&ProfilePath,
|
||||
(LPSTR)lpProfilePath);
|
||||
|
||||
if (lpComputerName)
|
||||
RtlCreateUnicodeStringFromAsciiz(&ComputerName,
|
||||
(LPSTR)lpComputerName);
|
||||
|
||||
/* Call the UNICODE function */
|
||||
bResult = DeleteProfileW(SidString.Buffer,
|
||||
ProfilePath.Buffer,
|
||||
ComputerName.Buffer);
|
||||
|
||||
/* Memory cleanup */
|
||||
if (lpSidString)
|
||||
RtlFreeUnicodeString(&SidString);
|
||||
|
||||
if (lpProfilePath)
|
||||
RtlFreeUnicodeString(&ProfilePath);
|
||||
|
||||
if (lpComputerName)
|
||||
RtlFreeUnicodeString(&ComputerName);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
DeleteProfileW(
|
||||
_In_ LPCWSTR lpSidString,
|
||||
_In_opt_ LPCWSTR lpProfilePath,
|
||||
_In_opt_ LPCWSTR lpComputerName)
|
||||
{
|
||||
DPRINT1("DeleteProfileW() not implemented!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
GetAllUsersProfileDirectoryA(
|
||||
|
@ -1051,6 +1146,16 @@ GetProfilesDirectoryW(
|
|||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
GetProfileType(
|
||||
_Out_ PDWORD pdwFlags)
|
||||
{
|
||||
DPRINT1("GetProfileType() not implemented!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
GetUserProfileDirectoryA(
|
||||
|
@ -1195,43 +1300,6 @@ GetUserProfileDirectoryW(
|
|||
}
|
||||
|
||||
|
||||
static
|
||||
BOOL
|
||||
CheckForLoadedProfile(HANDLE hToken)
|
||||
{
|
||||
UNICODE_STRING SidString;
|
||||
HKEY hKey;
|
||||
|
||||
DPRINT("CheckForLoadedProfile() called\n");
|
||||
|
||||
/* Get the user SID string */
|
||||
if (!GetUserSidStringFromToken(hToken, &SidString))
|
||||
{
|
||||
DPRINT1("GetUserSidStringFromToken() failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (RegOpenKeyExW(HKEY_USERS,
|
||||
SidString.Buffer,
|
||||
0,
|
||||
MAXIMUM_ALLOWED,
|
||||
&hKey))
|
||||
{
|
||||
DPRINT("Profile not loaded\n");
|
||||
RtlFreeUnicodeString(&SidString);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
RtlFreeUnicodeString(&SidString);
|
||||
|
||||
DPRINT("Profile already loaded\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
LoadUserProfileA(
|
||||
|
@ -1566,69 +1634,4 @@ UnloadUserProfile(
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
DeleteProfileW(
|
||||
_In_ LPCWSTR lpSidString,
|
||||
_In_opt_ LPCWSTR lpProfilePath,
|
||||
_In_opt_ LPCWSTR lpComputerName)
|
||||
{
|
||||
DPRINT1("DeleteProfileW() not implemented!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
DeleteProfileA(
|
||||
_In_ LPCSTR lpSidString,
|
||||
_In_opt_ LPCSTR lpProfilePath,
|
||||
_In_opt_ LPCSTR lpComputerName)
|
||||
{
|
||||
BOOL bResult;
|
||||
UNICODE_STRING SidString, ProfilePath, ComputerName;
|
||||
|
||||
DPRINT("DeleteProfileA() called\n");
|
||||
|
||||
/* Conversion to UNICODE */
|
||||
if (lpSidString)
|
||||
RtlCreateUnicodeStringFromAsciiz(&SidString,
|
||||
(LPSTR)lpSidString);
|
||||
|
||||
if (lpProfilePath)
|
||||
RtlCreateUnicodeStringFromAsciiz(&ProfilePath,
|
||||
(LPSTR)lpProfilePath);
|
||||
|
||||
if (lpComputerName)
|
||||
RtlCreateUnicodeStringFromAsciiz(&ComputerName,
|
||||
(LPSTR)lpComputerName);
|
||||
|
||||
/* Call the UNICODE function */
|
||||
bResult = DeleteProfileW(SidString.Buffer,
|
||||
ProfilePath.Buffer,
|
||||
ComputerName.Buffer);
|
||||
|
||||
/* Memory cleanup */
|
||||
if (lpSidString)
|
||||
RtlFreeUnicodeString(&SidString);
|
||||
|
||||
if (lpProfilePath)
|
||||
RtlFreeUnicodeString(&ProfilePath);
|
||||
|
||||
if (lpComputerName)
|
||||
RtlFreeUnicodeString(&ComputerName);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
GetProfileType(_Out_ PDWORD pdwFlags)
|
||||
{
|
||||
DPRINT1("GetProfileType() not implemented!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue