Author: hbelusca
Date: Thu Aug 22 16:10:34 2013
New Revision: 59792
URL:
http://svn.reactos.org/svn/reactos?rev=59792&view=rev
Log:
[KERNEL32]
- Move VDM-related definitions into a dedicated header.
- Clean some code.
Added:
trunk/reactos/dll/win32/kernel32/include/vdm.h (with props)
Modified:
trunk/reactos/dll/win32/kernel32/client/vdm.c
trunk/reactos/dll/win32/kernel32/include/kernel32.h
trunk/reactos/dll/win32/kernel32/k32.h
Modified: trunk/reactos/dll/win32/kernel32/client/vdm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- 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 16:10:34 2013
@@ -101,7 +101,7 @@
case VdmEntryUndo:
{
/* Tell the server how far we had gotten along */
- UpdateVdmEntry->iTask = (ULONG)*WaitHandle;
+ UpdateVdmEntry->iTask = HandleToUlong(*WaitHandle);
UpdateVdmEntry->VDMCreationState = IndexInfo;
break;
}
@@ -186,7 +186,7 @@
/* Call CSRSS */
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
NULL,
- CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepGetVDMExitCode /* BasepCheckVDM */),
+ CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepGetVDMExitCode),
sizeof(BASE_GET_VDM_EXIT_CODE));
if (!NT_SUCCESS(Status)) return FALSE;
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 16:10:34
2013
@@ -61,41 +61,6 @@
#define FIELD_OFFSET(type,fld) ((LONG)&(((type *)0)->fld))
#endif
-//
-// This stuff maybe should go in a vdm.h?
-//
-typedef enum _VDM_ENTRY_CODE
-{
- VdmEntryUndo,
- VdmEntryUpdateProcess,
- VdmEntryUpdateControlCHandler
-} VDM_ENTRY_CODE;
-
-//
-// Undo States
-//
-#define VDM_UNDO_PARTIAL 0x01
-#define VDM_UNDO_FULL 0x02
-#define VDM_UNDO_REUSE 0x04
-#define VDM_UNDO_COMPLETED 0x08
-
-//
-// Binary Types to share with VDM
-//
-#define BINARY_TYPE_EXE 0x01
-#define BINARY_TYPE_COM 0x02
-#define BINARY_TYPE_PIF 0x03
-#define BINARY_TYPE_DOS 0x10
-#define BINARY_TYPE_SEPARATE_WOW 0x20
-#define BINARY_TYPE_WOW 0x40
-#define BINARY_TYPE_WOW_EX 0x80
-
-//
-// VDM States
-//
-#define VDM_NOT_LOADED 0x01
-#define VDM_NOT_READY 0x02
-#define VDM_READY 0x04
/* Undocumented CreateProcess flag */
#define STARTF_SHELLPRIVATE 0x400
@@ -366,31 +331,6 @@
VOID
);
-BOOL
-NTAPI
-BaseDestroyVDMEnvironment(
- IN PANSI_STRING AnsiEnv,
- IN PUNICODE_STRING UnicodeEnv
-);
-
-BOOL
-WINAPI
-BaseGetVdmConfigInfo(
- IN LPCWSTR CommandLineReserved,
- IN ULONG DosSeqId,
- IN ULONG BinaryType,
- IN PUNICODE_STRING CmdLineString,
- OUT PULONG VdmSize
-);
-
-BOOL
-NTAPI
-BaseCreateVDMEnvironment(
- IN PWCHAR lpEnvironment,
- IN PANSI_STRING AnsiEnv,
- IN PUNICODE_STRING UnicodeEnv
-);
-
VOID
WINAPI
InitCommandLines(VOID);
@@ -468,42 +408,11 @@
extern LIST_ENTRY BasepAppCertDllsList;
extern RTL_CRITICAL_SECTION gcsAppCert;
-BOOL
-WINAPI
-BaseUpdateVDMEntry(
- IN ULONG UpdateIndex,
- IN OUT PHANDLE WaitHandle,
- IN ULONG IndexInfo,
- IN ULONG BinaryType
-);
-
VOID
WINAPI
BaseMarkFileForDelete(
IN HANDLE FileHandle,
IN ULONG FileAttributes
-);
-
-BOOL
-WINAPI
-BaseCheckForVDM(
- IN HANDLE ProcessHandle,
- OUT LPDWORD ExitCode
-);
-
-BOOL
-WINAPI
-BaseCheckVDM(
- IN ULONG BinaryType,
- IN PCWCH ApplicationName,
- IN PCWCH CommandLine,
- IN PCWCH CurrentDirectory,
- IN PANSI_STRING AnsiEnvironment,
- IN PCSR_API_MESSAGE ApiMessage,
- IN OUT PULONG iTask,
- IN DWORD CreationFlags,
- IN LPSTARTUPINFOW StartupInfo,
- IN HANDLE hUserToken OPTIONAL
);
Added: trunk/reactos/dll/win32/kernel32/include/vdm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/include/vdm.h (added)
+++ trunk/reactos/dll/win32/kernel32/include/vdm.h [iso-8859-1] Thu Aug 22 16:10:34 2013
@@ -0,0 +1,105 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS System Libraries
+ * FILE: dll/win32/kernel32/include/vdm.h
+ * PURPOSE: Virtual DOS Machines (VDM) Support Definitions
+ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
+ */
+
+#pragma once
+
+/* CONSTANTS ******************************************************************/
+
+typedef enum _VDM_ENTRY_CODE
+{
+ VdmEntryUndo,
+ VdmEntryUpdateProcess,
+ VdmEntryUpdateControlCHandler
+} VDM_ENTRY_CODE;
+
+//
+// Undo States
+//
+#define VDM_UNDO_PARTIAL 0x01
+#define VDM_UNDO_FULL 0x02
+#define VDM_UNDO_REUSE 0x04
+#define VDM_UNDO_COMPLETED 0x08
+
+//
+// Binary Types to share with VDM
+//
+#define BINARY_TYPE_EXE 0x01
+#define BINARY_TYPE_COM 0x02
+#define BINARY_TYPE_PIF 0x03
+#define BINARY_TYPE_DOS 0x10
+#define BINARY_TYPE_SEPARATE_WOW 0x20
+#define BINARY_TYPE_WOW 0x40
+#define BINARY_TYPE_WOW_EX 0x80
+
+//
+// VDM States
+//
+#define VDM_NOT_LOADED 0x01
+#define VDM_NOT_READY 0x02
+#define VDM_READY 0x04
+
+
+/* FUNCTION PROTOTYPES ********************************************************/
+
+BOOL
+NTAPI
+BaseDestroyVDMEnvironment(
+ IN PANSI_STRING AnsiEnv,
+ IN PUNICODE_STRING UnicodeEnv
+);
+
+BOOL
+WINAPI
+BaseGetVdmConfigInfo(
+ IN LPCWSTR CommandLineReserved,
+ IN ULONG DosSeqId,
+ IN ULONG BinaryType,
+ IN PUNICODE_STRING CmdLineString,
+ OUT PULONG VdmSize
+);
+
+BOOL
+NTAPI
+BaseCreateVDMEnvironment(
+ IN PWCHAR lpEnvironment,
+ IN PANSI_STRING AnsiEnv,
+ IN PUNICODE_STRING UnicodeEnv
+);
+
+BOOL
+WINAPI
+BaseUpdateVDMEntry(
+ IN ULONG UpdateIndex,
+ IN OUT PHANDLE WaitHandle,
+ IN ULONG IndexInfo,
+ IN ULONG BinaryType
+);
+
+BOOL
+WINAPI
+BaseCheckForVDM(
+ IN HANDLE ProcessHandle,
+ OUT LPDWORD ExitCode
+);
+
+BOOL
+WINAPI
+BaseCheckVDM(
+ IN ULONG BinaryType,
+ IN PCWCH ApplicationName,
+ IN PCWCH CommandLine,
+ IN PCWCH CurrentDirectory,
+ IN PANSI_STRING AnsiEnvironment,
+ IN PCSR_API_MESSAGE ApiMessage,
+ IN OUT PULONG iTask,
+ IN DWORD CreationFlags,
+ IN LPSTARTUPINFOW StartupInfo,
+ IN HANDLE hUserToken OPTIONAL
+);
+
+/* EOF */
Propchange: trunk/reactos/dll/win32/kernel32/include/vdm.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/kernel32/k32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/k32.h?r…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/k32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/k32.h [iso-8859-1] Thu Aug 22 16:10:34 2013
@@ -72,4 +72,7 @@
/* Console API Client Definitions */
#include "include/console.h"
+/* Virtual DOS Machines (VDM) Support Definitions */
+#include "include/vdm.h"
+
#endif