Author: hbelusca Date: Thu Aug 22 12:47:14 2013 New Revision: 59791
URL: http://svn.reactos.org/svn/reactos?rev=59791&view=rev Log: [KERNEL32] *Just* clarify some parts of the code and argument names of functions, and do not hardcode constant values; use #defines instead.
Modified: trunk/reactos/dll/win32/kernel32/client/vdm.c trunk/reactos/dll/win32/kernel32/include/kernel32.h
Modified: trunk/reactos/dll/win32/kernel32/client/vdm.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/v... ============================================================================== --- trunk/reactos/dll/win32/kernel32/client/vdm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/vdm.c [iso-8859-1] Thu Aug 22 12:47:14 2013 @@ -26,11 +26,11 @@
ENV_INFO BasepEnvNameType[] = { - {3, sizeof(L"PATH"), L"PATH"}, - {2, sizeof(L"WINDIR"), L"WINDIR"}, + {3, sizeof(L"PATH") , L"PATH" }, + {2, sizeof(L"WINDIR") , L"WINDIR" }, {2, sizeof(L"SYSTEMROOT"), L"SYSTEMROOT"}, - {3, sizeof(L"TEMP"), L"TEMP"}, - {3, sizeof(L"TMP"), L"TMP"}, + {3, sizeof(L"TEMP") , L"TEMP" }, + {3, sizeof(L"TMP") , L"TMP" }, };
UNICODE_STRING BaseDotComSuffixName = RTL_CONSTANT_STRING(L".com"); @@ -99,19 +99,21 @@ { /* VDM is being undone */ case VdmEntryUndo: - + { /* Tell the server how far we had gotten along */ UpdateVdmEntry->iTask = (ULONG)*WaitHandle; UpdateVdmEntry->VDMCreationState = IndexInfo; break; + }
/* VDM is ready with a new process handle */ case VdmEntryUpdateProcess: - + { /* Send it the process handle */ UpdateVdmEntry->VDMProcessHandle = *WaitHandle; UpdateVdmEntry->iTask = IndexInfo; break; + } }
/* Also check what kind of binary this is for the console handle */ @@ -123,11 +125,11 @@ else if (UpdateVdmEntry->iTask) { /* No handle for true VDM */ - UpdateVdmEntry->ConsoleHandle = 0; + UpdateVdmEntry->ConsoleHandle = NULL; } else { - /* Otherwise, send the regular consoel handle */ + /* Otherwise, use the regular console handle */ UpdateVdmEntry->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; }
@@ -196,7 +198,7 @@
BOOL WINAPI -BaseGetVdmConfigInfo(IN LPCWSTR Reserved, +BaseGetVdmConfigInfo(IN LPCWSTR CommandLineReserved, IN ULONG DosSeqId, IN ULONG BinaryType, IN PUNICODE_STRING CmdLineString, @@ -209,7 +211,7 @@ /* Clear the buffer in case we fail */ CmdLineString->Buffer = 0;
- /* Always return the same size */ + /* Always return the same size: 16 Mb */ *VdmSize = 0x1000000;
/* Get the system directory */ @@ -224,24 +226,31 @@ /* Check if this is VDM with a DOS Sequence ID */ if (DosSeqId) { - /* Build the VDM string for it */ + /* + * Build the VDM string for it: + * -i%lx : Gives the DOS Sequence ID; + * %s%c : Nothing if DOS VDM, -w if WoW VDM, -ws if separate WoW VDM. + */ _snwprintf(CommandLine, sizeof(CommandLine), L""%s\ntvdm.exe" -i%lx %s%c", Buffer, DosSeqId, - (BinaryType == 0x10) ? L" " : L"-w", - (BinaryType == 0x40) ? 's' : ' '); + (BinaryType == BINARY_TYPE_DOS) ? L" " : L"-w", + (BinaryType == BINARY_TYPE_SEPARATE_WOW) ? L's' : L' '); } else { - /* Non-DOS, build the string for it without the task ID */ + /* + * Build the string for it without the DOS Sequence ID: + * %s%c : Nothing if DOS VDM, -w if WoW VDM, -ws if separate WoW VDM. + */ _snwprintf(CommandLine, sizeof(CommandLine), - L""%s\ntvdm.exe" %s%c", + L""%s\ntvdm.exe" %s%c", Buffer, - (BinaryType == 0x10) ? L" " : L"-w", - (BinaryType == 0x40) ? 's' : ' '); + (BinaryType == BINARY_TYPE_DOS) ? L" " : L"-w", + (BinaryType == BINARY_TYPE_SEPARATE_WOW) ? L's' : L' '); }
/* Create the actual string */
Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include/... ============================================================================== --- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Thu Aug 22 12:47:14 2013 @@ -376,7 +376,7 @@ BOOL WINAPI BaseGetVdmConfigInfo( - IN LPCWSTR Reserved, + IN LPCWSTR CommandLineReserved, IN ULONG DosSeqId, IN ULONG BinaryType, IN PUNICODE_STRING CmdLineString,