Author: cwittich
Date: Wed Apr 18 16:31:39 2007
New Revision: 26393
URL:
http://svn.reactos.org/svn/reactos?rev=26393&view=rev
Log:
fix some bugs in CreateActCtxA
Modified:
trunk/reactos/dll/win32/kernel32/misc/actctx.c
Modified: trunk/reactos/dll/win32/kernel32/misc/actctx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ac…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/actctx.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/actctx.c Wed Apr 18 16:31:39 2007
@@ -65,44 +65,48 @@
ACTCTXW pActCtxW;
HANDLE hRetVal;
- ZeroMemory(&pActCtxW, sizeof(pActCtxW));
- pActCtxW.cbSize = sizeof(pActCtxW);
+ ZeroMemory(&pActCtxW, sizeof(ACTCTXW));
+ pActCtxW.cbSize = sizeof(ACTCTXW);
pActCtxW.dwFlags = pActCtx->dwFlags;
+ pActCtxW.wLangId = pActCtx->wLangId;
+ pActCtxW.hModule = pActCtx->hModule;
pActCtxW.wProcessorArchitecture = pActCtx->wProcessorArchitecture;
- pActCtxW.dwFlags = pActCtx->wProcessorArchitecture;
pActCtxW.hModule = pActCtx->hModule;
/* Convert ActCtx Strings */
- if (pActCtx->lpAssemblyDirectory)
- {
- BasepAnsiStringToHeapUnicodeString(pActCtx->lpSource,
- (LPWSTR*) &pActCtxW.lpSource);
- }
-
- if (pActCtx->lpAssemblyDirectory)
- {
- BasepAnsiStringToHeapUnicodeString(pActCtx->lpAssemblyDirectory,
- (LPWSTR*)
&pActCtxW.lpAssemblyDirectory);
- }
- if (pActCtx->lpResourceName)
- {
- BasepAnsiStringToHeapUnicodeString(pActCtx->lpResourceName,
- (LPWSTR*) &pActCtxW.lpResourceName);
- }
- if (pActCtx->lpApplicationName)
- {
- BasepAnsiStringToHeapUnicodeString(pActCtx->lpApplicationName,
- (LPWSTR*) &pActCtxW.lpApplicationName);
- }
-
+ if (pActCtx->lpSource)
+ {
+ BasepAnsiStringToHeapUnicodeString(pActCtx->lpSource,
+ (LPWSTR*) &pActCtxW.lpSource);
+ }
+ if (pActCtx->lpAssemblyDirectory)
+ {
+ BasepAnsiStringToHeapUnicodeString(pActCtx->lpAssemblyDirectory,
+ (LPWSTR*) &pActCtxW.lpAssemblyDirectory);
+ }
+ if (HIWORD(pActCtx->lpResourceName))
+ {
+ BasepAnsiStringToHeapUnicodeString(pActCtx->lpResourceName,
+ (LPWSTR*) &pActCtxW.lpResourceName);
+ }
+ else
+ {
+ pActCtxW.lpResourceName = (LPWSTR) pActCtx->lpResourceName;
+ }
+ if (pActCtx->lpApplicationName)
+ {
+ BasepAnsiStringToHeapUnicodeString(pActCtx->lpApplicationName,
+ (LPWSTR*) &pActCtxW.lpApplicationName);
+ }
/* Call the Unicode function */
hRetVal = CreateActCtxW(&pActCtxW);
/* Clean up */
RtlFreeHeap(GetProcessHeap(), 0, (LPWSTR*) pActCtxW.lpSource);
RtlFreeHeap(GetProcessHeap(), 0, (LPWSTR*) pActCtxW.lpAssemblyDirectory);
- RtlFreeHeap(GetProcessHeap(), 0, (LPWSTR*) pActCtxW.lpResourceName);
+ if (HIWORD(pActCtx->lpResourceName))
+ RtlFreeHeap(GetProcessHeap(), 0, (LPWSTR*) pActCtxW.lpResourceName);
RtlFreeHeap(GetProcessHeap(), 0, (LPWSTR*) pActCtxW.lpApplicationName);
return hRetVal;