Author: hbelusca
Date: Sat Aug 17 21:15:55 2013
New Revision: 59766
URL:
http://svn.reactos.org/svn/reactos?rev=59766&view=rev
Log:
[SOFT386]
- In the interface header soft386.h, do not include other particular headers (windows.h
and debug.h). Those must be included by the different applications which also will include
soft386.h.
- LPVOID --> PVOID (do it general, not just à-la Win32).
- The .c files include the headers, and each .c files must have its "#define
NDEBUG\n#include <debug.h>" lines, to activate (or deactivate here in the
example) debugging output.
- In the .c files, include the header windef.h for having the basic types, and temporarily
comment out the needed #defines which will be needed if one needs to include other
win***.h files. Those will be deleted if they aren't needed at the end.
Modified:
branches/ntvdm/include/reactos/libs/soft386/soft386.h
branches/ntvdm/lib/soft386/common.c
branches/ntvdm/lib/soft386/common.h
branches/ntvdm/lib/soft386/soft386.c
Modified: branches/ntvdm/include/reactos/libs/soft386/soft386.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/reactos/libs/soft…
==============================================================================
--- branches/ntvdm/include/reactos/libs/soft386/soft386.h [iso-8859-1] (original)
+++ branches/ntvdm/include/reactos/libs/soft386/soft386.h [iso-8859-1] Sat Aug 17 21:15:55
2013
@@ -8,11 +8,6 @@
#ifndef _SOFT386_H_
#define _SOFT386_H_
-
-/* INCLUDES *******************************************************************/
-
-#include <windows.h>
-#include <debug.h>
/* DEFINES ********************************************************************/
@@ -34,8 +29,7 @@
#define SOFT386_CR0_PG (1 << 31)
struct _SOFT386_STATE;
-typedef struct _SOFT386_STATE SOFT386_STATE;
-typedef struct _SOFT386_STATE *PSOFT386_STATE;
+typedef struct _SOFT386_STATE SOFT386_STATE, *PSOFT386_STATE;
enum _SOFT386_GEN_REGS
{
@@ -89,7 +83,7 @@
(
PSOFT386_STATE State,
ULONG Address,
- LPVOID Buffer,
+ PVOID Buffer,
ULONG Size
);
@@ -99,7 +93,7 @@
(
PSOFT386_STATE State,
ULONG Address,
- LPVOID Buffer,
+ PVOID Buffer,
ULONG Size
);
@@ -109,7 +103,7 @@
(
PSOFT386_STATE State,
ULONG Port,
- LPVOID Buffer,
+ PVOID Buffer,
ULONG Size
);
@@ -119,7 +113,7 @@
(
PSOFT386_STATE State,
ULONG Port,
- LPVOID Buffer,
+ PVOID Buffer,
ULONG Size
);
@@ -131,7 +125,7 @@
UCHAR HighByte;
};
USHORT LowWord;
- ULONG Long;
+ ULONG Long;
} SOFT386_REG, *PSOFT386_REG;
typedef struct _SOFT386_SEG_REG
@@ -185,7 +179,7 @@
typedef struct _SOFT386_TABLE_REG
{
USHORT Size;
- ULONG Address;
+ ULONG Address;
} SOFT386_TABLE_REG, *PSOFT386_TABLE_REG;
typedef union _SOFT386_FLAGS_REG
Modified: branches/ntvdm/lib/soft386/common.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/common.c?rev=…
==============================================================================
--- branches/ntvdm/lib/soft386/common.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/soft386/common.c [iso-8859-1] Sat Aug 17 21:15:55 2013
@@ -8,7 +8,15 @@
/* INCLUDES *******************************************************************/
+// #define WIN32_NO_STATUS
+// #define _INC_WINDOWS
+#include <windef.h>
+
+#include <soft386.h>
#include "common.h"
+
+// #define NDEBUG
+#include <debug.h>
/* PRIVATE FUNCTIONS **********************************************************/
@@ -100,7 +108,7 @@
else
{
/* Read the memory directly */
- RtlMoveMemory(Buffer, (LPVOID)LinearAddress, Size);
+ RtlMoveMemory(Buffer, (PVOID)LinearAddress, Size);
}
return TRUE;
@@ -177,7 +185,7 @@
else
{
/* Write the memory directly */
- RtlMoveMemory((LPVOID)LinearAddress, Buffer, Size);
+ RtlMoveMemory((PVOID)LinearAddress, Buffer, Size);
}
return TRUE;
@@ -344,7 +352,7 @@
else
{
RtlMoveMemory(&GdtEntry,
- (LPVOID)(State->Gdtr.Address
+ (PVOID)(State->Gdtr.Address
+ GET_SEGMENT_INDEX(Selector)),
sizeof(GdtEntry));
}
Modified: branches/ntvdm/lib/soft386/common.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/common.h?rev=…
==============================================================================
--- branches/ntvdm/lib/soft386/common.h [iso-8859-1] (original)
+++ branches/ntvdm/lib/soft386/common.h [iso-8859-1] Sat Aug 17 21:15:55 2013
@@ -8,10 +8,6 @@
#ifndef _COMMON_H_
#define _COMMON_H_
-
-/* INCLUDES *******************************************************************/
-
-#include <soft386.h>
/* DEFINES ********************************************************************/
Modified: branches/ntvdm/lib/soft386/soft386.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/soft386.c?rev…
==============================================================================
--- branches/ntvdm/lib/soft386/soft386.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/soft386/soft386.c [iso-8859-1] Sat Aug 17 21:15:55 2013
@@ -8,7 +8,15 @@
/* INCLUDES *******************************************************************/
+// #define WIN32_NO_STATUS
+// #define _INC_WINDOWS
+#include <windef.h>
+
+#include <soft386.h>
#include "common.h"
+
+// #define NDEBUG
+#include <debug.h>
/* DEFINES ********************************************************************/