From 1db5a7aa0852598462043a494420a7971649d266 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 15 Jul 2012 21:23:22 +0000 Subject: [PATCH] [USERENV] Implement stubs for userenv.dll. Patch by Hermes Belusca. See issue #7184 for more details. svn path=/trunk/; revision=56904 --- reactos/dll/win32/userenv/profile.c | 85 ++++++++++++++++++-------- reactos/dll/win32/userenv/userenv.spec | 6 +- reactos/include/psdk/userenv.h | 10 +++ 3 files changed, 73 insertions(+), 28 deletions(-) diff --git a/reactos/dll/win32/userenv/profile.c b/reactos/dll/win32/userenv/profile.c index aa2f5dd2ad9..50be177e245 100644 --- a/reactos/dll/win32/userenv/profile.c +++ b/reactos/dll/win32/userenv/profile.c @@ -75,31 +75,6 @@ AppendSystemPostfix(LPWSTR lpName, } -BOOL -WINAPI -CreateUserProfileA(PSID Sid, - LPCSTR lpUserName) -{ - UNICODE_STRING UserName; - BOOL bResult; - NTSTATUS Status; - - Status = RtlCreateUnicodeStringFromAsciiz(&UserName, - (LPSTR)lpUserName); - if (!NT_SUCCESS(Status)) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - - bResult = CreateUserProfileW(Sid, UserName.Buffer); - - RtlFreeUnicodeString(&UserName); - - return bResult; -} - - static BOOL AcquireRemoveRestorePrivilege(IN BOOL bAcquire) @@ -147,6 +122,29 @@ AcquireRemoveRestorePrivilege(IN BOOL bAcquire) } +BOOL +WINAPI +CreateUserProfileA(PSID Sid, + LPCSTR lpUserName) +{ + UNICODE_STRING UserName; + BOOL bResult; + + if (!RtlCreateUnicodeStringFromAsciiz(&UserName, + (LPSTR)lpUserName)) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + bResult = CreateUserProfileW(Sid, UserName.Buffer); + + RtlFreeUnicodeString(&UserName); + + return bResult; +} + + BOOL WINAPI CreateUserProfileW(PSID Sid, @@ -393,6 +391,34 @@ Done: } +BOOL +WINAPI +CreateUserProfileExA(IN PSID pSid, + IN LPCSTR lpUserName, + IN LPCSTR lpUserHive OPTIONAL, + OUT LPSTR lpProfileDir OPTIONAL, + IN DWORD dwDirSize, + IN BOOL bWin9xUpg) +{ + DPRINT1("CreateUserProfileExA() not implemented!\n"); + return FALSE; +} + + +BOOL +WINAPI +CreateUserProfileExW(IN PSID pSid, + IN LPCWSTR lpUserName, + IN LPCWSTR lpUserHive OPTIONAL, + OUT LPWSTR lpProfileDir OPTIONAL, + IN DWORD dwDirSize, + IN BOOL bWin9xUpg) +{ + DPRINT1("CreateUserProfileExW() not implemented!\n"); + return FALSE; +} + + BOOL WINAPI GetAllUsersProfileDirectoryA(LPSTR lpProfileDir, @@ -1305,4 +1331,13 @@ DeleteProfileA(LPCSTR lpSidString, return bResult; } + +BOOL +WINAPI +GetProfileType(OUT PDWORD pdwFlags) +{ + DPRINT1("GetProfileType() not implemented!\n"); + return FALSE; +} + /* EOF */ diff --git a/reactos/dll/win32/userenv/userenv.spec b/reactos/dll/win32/userenv/userenv.spec index 6a1242c5c10..8f8237614db 100644 --- a/reactos/dll/win32/userenv/userenv.spec +++ b/reactos/dll/win32/userenv/userenv.spec @@ -24,7 +24,7 @@ 196 stub GetGPOListW #stdcall GetGPOListW(ptr wstr wstr wstr long ptr) 197 stub GetNextFgPolicyRefreshInfo #stdcall GetNextFgPolicyRefreshInfo(8) 198 stub GetPreviousFgPolicyRefreshInfo #stdcall GetPreviousFgPolicyRefreshInfo(8) -199 stub GetProfileType #stdcall GetProfileType(ptr) +199 stdcall GetProfileType(ptr) 202 stdcall GetProfilesDirectoryA(str ptr) 203 stdcall GetProfilesDirectoryW(wstr ptr) 204 stdcall GetUserProfileDirectoryA(ptr str ptr) @@ -96,8 +96,8 @@ 150 stub -noname SignalUserPolicyForegroundProcessingDone #stdcall -noname SignalUserPolicyForegroundProcessingDone() 151 stub -noname SignalMachinePolicyForegroundProcessingDone #stdcall -noname SignalMachinePolicyForegroundProcessingDone() 152 stub -noname IsSyncForegroundPolicyRefresh #stdcall -noname IsSyncForegroundPolicyRefresh(8) -153 stub -noname CreateUserProfileExA #stdcall -noname CreateUserProfileExA(24) -154 stub -noname CreateUserProfileExW #stdcall -noname CreateUserProfileExW(24) +153 stdcall -noname CreateUserProfileExA(ptr str str str long long) +154 stdcall -noname CreateUserProfileExW(ptr wstr wstr wstr long long) 155 stub -noname CopySystemProfile #stdcall -noname CopySystemProfile(4) 156 stub -noname GetUserProfileDirFromSidA #stdcall -noname GetUserProfileDirFromSidA(12) 157 stub -noname GetUserProfileDirFromSidW #stdcall -noname GetUserProfileDirFromSidW(12) diff --git a/reactos/include/psdk/userenv.h b/reactos/include/psdk/userenv.h index e7eaa8e0c1d..85b95d70d34 100644 --- a/reactos/include/psdk/userenv.h +++ b/reactos/include/psdk/userenv.h @@ -12,6 +12,13 @@ extern "C" { #define RP_FORCE (1) #endif +/* Values returned by GetProfileType */ +#if (WINVER >= 0x0500) +#define PT_TEMPORARY 1 +#define PT_ROAMING 2 +#define PT_MANDATORY 4 +#endif + typedef struct _PROFILEINFOA { DWORD dwSize; @@ -67,6 +74,9 @@ BOOL WINAPI GetProfilesDirectoryA(LPSTR, LPDWORD); BOOL WINAPI GetProfilesDirectoryW(LPWSTR, LPDWORD); BOOL WINAPI GetUserProfileDirectoryA(HANDLE, LPSTR, LPDWORD); BOOL WINAPI GetUserProfileDirectoryW(HANDLE, LPWSTR, LPDWORD); +#if (WINVER >= 0x0500) +BOOL WINAPI GetProfileType(PDWORD); +#endif BOOL WINAPI CreateEnvironmentBlock(LPVOID*, HANDLE, BOOL); BOOL WINAPI DestroyEnvironmentBlock(LPVOID);