[ros-diffs] [ekohl] 47187: [MSGINA] Use WLX_PROFILE_V2_0 instead of WLX_PROFILE_V1_0 and create an environment string that is filled with a single environment variable. WIP for bug #4102.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Thu May 13 00:10:07 CEST 2010


Author: ekohl
Date: Thu May 13 00:10:07 2010
New Revision: 47187

URL: http://svn.reactos.org/svn/reactos?rev=47187&view=rev
Log:
[MSGINA]
Use WLX_PROFILE_V2_0 instead of WLX_PROFILE_V1_0 and create an environment string that is filled with a single environment variable. WIP for bug #4102.

Modified:
    trunk/reactos/dll/win32/msgina/msgina.c

Modified: trunk/reactos/dll/win32/msgina/msgina.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.c?rev=47187&r1=47186&r2=47187&view=diff
==============================================================================
--- trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] Thu May 13 00:10:07 2010
@@ -415,8 +415,9 @@
 	IN PWSTR Password)
 {
 	LPWSTR ProfilePath = NULL;
+	LPWSTR lpEnvironment = NULL;
 	TOKEN_STATISTICS Stats;
-	PWLX_PROFILE_V1_0 pProfile = NULL;
+	PWLX_PROFILE_V2_0 pProfile = NULL;
 	DWORD cbStats, cbSize;
 	BOOL bResult;
 
@@ -449,14 +450,24 @@
 	}
 
 	/* Allocate memory for profile */
-	pProfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WLX_PROFILE_V1_0));
+	pProfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WLX_PROFILE_V2_0));
 	if (!pProfile)
 	{
 		WARN("HeapAlloc() failed\n");
 		goto cleanup;
 	}
-	pProfile->dwType = WLX_PROFILE_TYPE_V1_0;
+	pProfile->dwType = WLX_PROFILE_TYPE_V2_0;
 	pProfile->pszProfile = ProfilePath;
+
+	lpEnvironment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 32 * sizeof(WCHAR));
+	if (!lpEnvironment)
+	{
+		WARN("HeapAlloc() failed\n");
+		goto cleanup;
+	}
+	wcscpy(lpEnvironment, L"LOGONSERVER=\\\\Test");
+
+	pProfile->pszEnvironment = lpEnvironment;
 
 	if (!GetTokenInformation(pgContext->UserToken,
 		TokenStatistics,
@@ -467,6 +478,7 @@
 		WARN("Couldn't get Authentication id from user token!\n");
 		goto cleanup;
 	}
+
 	*pgContext->pAuthenticationId = Stats.AuthenticationId; 
 	pgContext->pMprNotifyInfo->pszUserName = DuplicationString(UserName);
 	pgContext->pMprNotifyInfo->pszDomain = DuplicationString(Domain);
@@ -477,6 +489,10 @@
 	return TRUE;
 
 cleanup:
+	if (pProfile)
+	{
+		HeapFree(GetProcessHeap(), 0, pProfile->pszEnvironment);
+	}
 	HeapFree(GetProcessHeap(), 0, pProfile);
 	HeapFree(GetProcessHeap(), 0, ProfilePath);
 	return FALSE;




More information about the Ros-diffs mailing list