ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2014
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
413 discussions
Start a n
N
ew thread
[hbelusca] 64430: [NTVDM] - Code reorganization: Move CPU code to specific files for modularity (prepares ground for some future work). Part 2/2 (fixes build ; ) ) - Improve a DPRINT. - Set reported...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Sep 30 23:55:52 2014 New Revision: 64430 URL:
http://svn.reactos.org/svn/reactos?rev=64430&view=rev
Log: [NTVDM] - Code reorganization: Move CPU code to specific files for modularity (prepares ground for some future work). Part 2/2 (fixes build ;) ) - Improve a DPRINT. - Set reported DOS OEM number to 0xFF as NTDOS does. Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Tue Sep 30 23:55:52 2014 @@ -12,7 +12,8 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" +#include "cpu/cpu.h" +#include "int32.h" #include "dos.h" #include "dos/dem.h" @@ -1062,8 +1063,8 @@ /* Execute */ CurrentPsp = Segment; DiskTransferArea = MAKELONG(0x80, Segment); - EmulatorExecute(Segment + Header->e_cs + (sizeof(DOS_PSP) >> 4), - Header->e_ip); + CpuExecute(Segment + Header->e_cs + (sizeof(DOS_PSP) >> 4), + Header->e_ip); } } else @@ -1121,7 +1122,7 @@ /* Execute */ CurrentPsp = Segment; DiskTransferArea = MAKELONG(0x80, Segment); - EmulatorExecute(Segment, 0x100); + CpuExecute(Segment, 0x100); } } @@ -1165,7 +1166,7 @@ /* Start simulation */ SetEvent(VdmTaskEvent); - EmulatorSimulate(); + CpuSimulate(); /* Detach from the console */ VidBiosDetachFromConsole(); // FIXME: And in fact, detach the full NTVDM UI from the console @@ -1344,7 +1345,7 @@ if (CurrentPsp == SYSTEM_PSP) { ResetEvent(VdmTaskEvent); - EmulatorUnsimulate(); + CpuUnsimulate(); } } @@ -1374,8 +1375,8 @@ DosErrorLevel = MAKEWORD(ReturnCode, 0x00); /* Return control to the parent process */ - EmulatorExecute(HIWORD(PspBlock->TerminateAddress), - LOWORD(PspBlock->TerminateAddress)); + CpuExecute(HIWORD(PspBlock->TerminateAddress), + LOWORD(PspBlock->TerminateAddress)); } BOOLEAN DosHandleIoctl(BYTE ControlCode, WORD FileHandle) @@ -1752,7 +1753,8 @@ case 0x25: { ULONG FarPointer = MAKELONG(getDX(), getDS()); - DPRINT1("Setting interrupt 0x%x ...\n", getAL()); + DPRINT1("Setting interrupt 0x%02X to %04X:%04X ...\n", + getAL(), HIWORD(FarPointer), LOWORD(FarPointer)); /* Write the new far pointer to the IDT */ ((PULONG)BaseAddress)[getAL()] = FarPointer; @@ -1837,8 +1839,9 @@ * Return DOS OEM number: * 0x00 for IBM PC-DOS * 0x02 for packaged MS-DOS + * 0xFF for NT DOS */ - setBH(0x02); + setBH(0xFF); } if (LOBYTE(PspBlock->DosVersion) >= 5 && getAL() == 0x01) @@ -2806,7 +2809,7 @@ /* Stop the VDM task */ ResetEvent(VdmTaskEvent); - EmulatorUnsimulate(); + CpuUnsimulate(); } VOID WINAPI DosFastConOut(LPWORD Stack)
10 years, 2 months
1
0
0
0
[hbelusca] 64429: [NTVDM] Code reorganization: Move CPU code to specific files for modularity (prepares ground for some future work). We reintroduce also int32.c in which all the int32 handling cod...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Sep 30 23:47:23 2014 New Revision: 64429 URL:
http://svn.reactos.org/svn/reactos?rev=64429&view=rev
Log: [NTVDM] Code reorganization: Move CPU code to specific files for modularity (prepares ground for some future work). We reintroduce also int32.c in which all the int32 handling code is moved to. Part 1/2 Added: trunk/reactos/subsystems/ntvdm/cpu/ (with props) trunk/reactos/subsystems/ntvdm/cpu/bop.c - copied unchanged from r64385, trunk/reactos/subsystems/ntvdm/bop.c trunk/reactos/subsystems/ntvdm/cpu/bop.h - copied unchanged from r64385, trunk/reactos/subsystems/ntvdm/bop.h trunk/reactos/subsystems/ntvdm/cpu/callback.c - copied, changed from r64385, trunk/reactos/subsystems/ntvdm/callback.c trunk/reactos/subsystems/ntvdm/cpu/callback.h - copied, changed from r64385, trunk/reactos/subsystems/ntvdm/callback.h trunk/reactos/subsystems/ntvdm/cpu/cpu.c - copied, changed from r64385, trunk/reactos/subsystems/ntvdm/emulator.c trunk/reactos/subsystems/ntvdm/cpu/cpu.h - copied, changed from r64385, trunk/reactos/subsystems/ntvdm/emulator.h Removed: trunk/reactos/subsystems/ntvdm/bop.c trunk/reactos/subsystems/ntvdm/bop.h trunk/reactos/subsystems/ntvdm/callback.c trunk/reactos/subsystems/ntvdm/callback.h Modified: trunk/reactos/subsystems/ntvdm/CMakeLists.txt trunk/reactos/subsystems/ntvdm/bios/bios.c trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c trunk/reactos/subsystems/ntvdm/bios/bios32/bios32p.h trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.c trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.c trunk/reactos/subsystems/ntvdm/bios/kbdbios.c trunk/reactos/subsystems/ntvdm/bios/rom.c trunk/reactos/subsystems/ntvdm/bios/vidbios.c trunk/reactos/subsystems/ntvdm/clock.c trunk/reactos/subsystems/ntvdm/dos/dem.c trunk/reactos/subsystems/ntvdm/dos/dos32krnl/bios.c trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h trunk/reactos/subsystems/ntvdm/dos/mouse32.c trunk/reactos/subsystems/ntvdm/emulator.c trunk/reactos/subsystems/ntvdm/emulator.h trunk/reactos/subsystems/ntvdm/int32.c trunk/reactos/subsystems/ntvdm/int32.h trunk/reactos/subsystems/ntvdm/registers.c trunk/reactos/subsystems/ntvdm/vddsup.c Modified: trunk/reactos/subsystems/ntvdm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/CMakeList…
============================================================================== --- trunk/reactos/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -14,6 +14,9 @@ bios/kbdbios.c bios/rom.c bios/vidbios.c + cpu/bop.c + cpu/callback.c + cpu/cpu.c hardware/cmos.c hardware/keyboard.c hardware/mouse.c @@ -27,10 +30,9 @@ dos/dos32krnl/dosfiles.c dos/mouse32.c dos/dem.c - bop.c - callback.c clock.c emulator.c + int32.c io.c registers.c utils.c Modified: trunk/reactos/subsystems/ntvdm/bios/bios.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -11,8 +11,8 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" -#include "bop.h" +#include "cpu/callback.h" +#include "cpu/bop.h" #include "bios.h" #include "bios32/bios32.h" Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -14,8 +14,9 @@ #include <reactos/buildno.h> #include "emulator.h" -#include "callback.h" -#include "bop.h" +#include "cpu/cpu.h" // for EMULATOR_FLAG_CF +#include "int32.h" +// #include "bop.h" #include "../bios.h" #include "../rom.h" Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/bios32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/bios32p.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/bios32p.h [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -14,7 +14,7 @@ #include "ntvdm.h" #include "../bios.h" -/**/ #include "callback.h" /**/ +/**/ #include "int32.h" /**/ /* DEFINES ********************************************************************/ Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -11,7 +11,8 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" +#include "cpu/cpu.h" // for EMULATOR_FLAG_ZF +#include "int32.h" #include "kbdbios32.h" #include "../kbdbios.h" Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -11,7 +11,6 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" #include "moubios32.h" #include "bios32p.h" Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -13,7 +13,7 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" +#include "int32.h" #include "vidbios32.h" #include "../vidbios.h" Modified: trunk/reactos/subsystems/ntvdm/bios/kbdbios.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/kbdb…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/kbdbios.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/kbdbios.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -11,8 +11,7 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" -#include "bop.h" +#include "cpu/bop.h" #include "bios.h" // #include "kbdbios.h" Modified: trunk/reactos/subsystems/ntvdm/bios/rom.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/rom.…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/rom.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/rom.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -11,7 +11,7 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" +#include "cpu/callback.h" #include "utils.h" #include "rom.h" Modified: trunk/reactos/subsystems/ntvdm/bios/vidbios.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/vidb…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/vidbios.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/vidbios.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -12,8 +12,8 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" -#include "bop.h" +#include "cpu/cpu.h" +#include "cpu/bop.h" #include "bios.h" // #include "vidbios.h" Removed: trunk/reactos/subsystems/ntvdm/bop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bop.c?rev…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bop.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bop.c (removed) @@ -1,50 +0,0 @@ -/* - * COPYRIGHT: GPL - See COPYING in the top level directory - * PROJECT: ReactOS Virtual DOS Machine - * FILE: bop.c - * PURPOSE: BIOS Operation Handlers - * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> - * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) - */ - -/* INCLUDES *******************************************************************/ - -// #define NDEBUG - -#include "emulator.h" -#include "bop.h" - -/* PRIVATE VARIABLES **********************************************************/ - -/* - * This is the list of registered BOP handlers. - */ -static EMULATOR_BOP_PROC BopProc[EMULATOR_MAX_BOP_NUM] = { NULL }; - -/* PUBLIC FUNCTIONS ***********************************************************/ - -VOID RegisterBop(BYTE BopCode, EMULATOR_BOP_PROC BopHandler) -{ - BopProc[BopCode] = BopHandler; -} - -VOID WINAPI EmulatorBiosOperation(PFAST486_STATE State, UCHAR BopCode) -{ - WORD StackSegment, StackPointer; - LPWORD Stack; - - /* Get the SS:SP */ - StackSegment = State->SegmentRegs[FAST486_REG_SS].Selector; - StackPointer = State->GeneralRegs[FAST486_REG_ESP].LowWord; - - /* Get the stack */ - Stack = (LPWORD)SEG_OFF_TO_PTR(StackSegment, StackPointer); - - /* Call the BOP handler */ - if (BopProc[BopCode] != NULL) - BopProc[BopCode](Stack); - else - DPRINT("Invalid BOP code: 0x%02X\n", BopCode); -} - -/* EOF */ Removed: trunk/reactos/subsystems/ntvdm/bop.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bop.h?rev…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bop.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bop.h (removed) @@ -1,28 +0,0 @@ -/* - * COPYRIGHT: GPL - See COPYING in the top level directory - * PROJECT: ReactOS Virtual DOS Machine - * FILE: bop.h - * PURPOSE: BIOS Operation Handlers - * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> - * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) - */ - -#ifndef _BOP_H_ -#define _BOP_H_ - -/* DEFINES ********************************************************************/ - -/* BOP Identifiers */ -#define EMULATOR_BOP 0xC4C4 -#define EMULATOR_MAX_BOP_NUM 0xFF + 1 - -/* FUNCTIONS ******************************************************************/ - -typedef VOID (WINAPI *EMULATOR_BOP_PROC)(LPWORD Stack); - -VOID RegisterBop(BYTE BopCode, EMULATOR_BOP_PROC BopHandler); -VOID WINAPI EmulatorBiosOperation(PFAST486_STATE State, UCHAR BopCode); - -#endif // _BOP_H_ - -/* EOF */ Removed: trunk/reactos/subsystems/ntvdm/callback.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/callback.…
============================================================================== --- trunk/reactos/subsystems/ntvdm/callback.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/callback.c (removed) @@ -1,310 +0,0 @@ -/* - * COPYRIGHT: GPL - See COPYING in the top level directory - * PROJECT: ReactOS Virtual DOS Machine - * FILE: callback.c - * PURPOSE: 16 and 32-bit Callbacks Support - * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> - * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) - */ - -/******************************************************************************\ -| WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! -| -| Callbacks support supposes implicitely that the callbacks are used -| in the SAME thread as the CPU thread, otherwise messing in parallel -| with the CPU registers is 100% prone to bugs!! -\******************************************************************************/ - -/* INCLUDES *******************************************************************/ - -#define NDEBUG - -#include "emulator.h" -#include "callback.h" - -#include "bop.h" -#include <isvbop.h> - -/* PRIVATE VARIABLES **********************************************************/ - -/* - * This is the list of registered 32-bit Interrupt handlers. - */ -static EMULATOR_INT32_PROC Int32Proc[EMULATOR_MAX_INT32_NUM] = { NULL }; - -/* BOP Identifiers */ -#define BOP_CONTROL 0xFF // Control BOP Handler - #define BOP_CONTROL_DEFFUNC 0x00 // Default Control BOP Function - #define BOP_CONTROL_INT32 0xFF // 32-bit Interrupt dispatcher - // function code for the Control BOP Handler - -#define BOP(num) LOBYTE(EMULATOR_BOP), HIBYTE(EMULATOR_BOP), (num) -#define UnSimulate16(trap) \ -do { \ - *(PUSHORT)(trap) = EMULATOR_BOP; \ - (trap) += sizeof(USHORT); \ - *(trap) = BOP_UNSIMULATE; \ -} while(0) -// #define UnSimulate16 MAKELONG(EMULATOR_BOP, BOP_UNSIMULATE) // BOP(BOP_UNSIMULATE) - -#define CALL16_TRAMPOLINE_SIZE (1 * sizeof(ULONGLONG)) -#define INT16_TRAMPOLINE_SIZE (1 * sizeof(ULONGLONG)) - -// -// WARNING WARNING!! -// -// If you modify the code stubs here, think also -// about updating them in int32.c too!! -// - -/* 16-bit generic interrupt code for calling a 32-bit interrupt handler */ -static BYTE Int16To32[] = -{ - 0xFA, // cli - - /* Push the value of the interrupt to be called */ - 0x6A, 0xFF, // push i (patchable to 0x6A, 0xIntNum) - - /* The BOP Sequence */ -// BOP_SEQ: - 0xF8, // clc - BOP(BOP_CONTROL), // Control BOP - BOP_CONTROL_INT32, // 32-bit Interrupt dispatcher - - 0x73, 0x04, // jnc EXIT (offset +4) - - 0xFB, // sti - - // HACK: The following instruction should be HLT! - 0x90, // nop - - 0xEB, 0xF5, // jmp BOP_SEQ (offset -11) - -// EXIT: - 0x44, 0x44, // inc sp, inc sp - 0xCF, // iret -}; -const ULONG Int16To32StubSize = sizeof(Int16To32); - -/* PUBLIC FUNCTIONS ***********************************************************/ - -VOID -InitializeContext(IN PCALLBACK16 Context, - IN USHORT Segment, - IN USHORT Offset) -{ - Context->TrampolineFarPtr = MAKELONG(Offset, Segment); - Context->TrampolineSize = max(CALL16_TRAMPOLINE_SIZE, - INT16_TRAMPOLINE_SIZE); - Context->Segment = Segment; - Context->NextOffset = Offset + Context->TrampolineSize; -} - -VOID -Call16(IN USHORT Segment, - IN USHORT Offset) -{ - /* Save CS:IP */ - USHORT OrgCS = getCS(); - USHORT OrgIP = getIP(); - - /* Set the new CS:IP */ - setCS(Segment); - setIP(Offset); - - DPRINT("Call16(%04X:%04X)\n", Segment, Offset); - - /* Start CPU simulation */ - EmulatorSimulate(); - - /* Restore CS:IP */ - setCS(OrgCS); - setIP(OrgIP); -} - - - -ULONG -RegisterCallback16(IN ULONG FarPtr, - IN LPBYTE CallbackCode, - IN SIZE_T CallbackSize, - OUT PSIZE_T CodeSize OPTIONAL) -{ - LPBYTE CodeStart = (LPBYTE)FAR_POINTER(FarPtr); - LPBYTE Code = CodeStart; - - SIZE_T OurCodeSize = CallbackSize; - - if (CallbackCode == NULL) CallbackSize = 0; - - if (CallbackCode) - { - /* 16-bit interrupt code */ - RtlCopyMemory(Code, CallbackCode, CallbackSize); - Code += CallbackSize; - } - - /* Return the real size of the code if needed */ - if (CodeSize) *CodeSize = OurCodeSize; // == (ULONG_PTR)Code - (ULONG_PTR)CodeStart; - - // /* Return the entry-point address for 32-bit calls */ - // return (ULONG_PTR)(CodeStart + CallbackSize); - return OurCodeSize; -} - -VOID -RunCallback16(IN PCALLBACK16 Context, - IN ULONG FarPtr) -{ - PUCHAR TrampolineBase = (PUCHAR)FAR_POINTER(Context->TrampolineFarPtr); - PUCHAR Trampoline = TrampolineBase; - UCHAR OldTrampoline[CALL16_TRAMPOLINE_SIZE]; - - /* Save the old trampoline */ - ((PULONGLONG)&OldTrampoline)[0] = ((PULONGLONG)TrampolineBase)[0]; - - DPRINT1("RunCallback16(0x%p)\n", FarPtr); - - /* Build the generic entry-point for 16-bit far calls */ - *Trampoline++ = 0x9A; // Call far seg:off - *(PULONG)Trampoline = FarPtr; - Trampoline += sizeof(ULONG); - UnSimulate16(Trampoline); - - /* Perform the call */ - Call16(HIWORD(Context->TrampolineFarPtr), - LOWORD(Context->TrampolineFarPtr)); - - /* Restore the old trampoline */ - ((PULONGLONG)TrampolineBase)[0] = ((PULONGLONG)&OldTrampoline)[0]; -} - - - -ULONG -RegisterInt16(IN ULONG FarPtr, - IN BYTE IntNumber, - IN LPBYTE CallbackCode, - IN SIZE_T CallbackSize, - OUT PSIZE_T CodeSize OPTIONAL) -{ - /* Get a pointer to the IVT and set the corresponding entry (far pointer) */ - LPDWORD IntVecTable = (LPDWORD)SEG_OFF_TO_PTR(0x0000, 0x0000); - IntVecTable[IntNumber] = FarPtr; - - /* Register the 16-bit callback */ - return RegisterCallback16(FarPtr, - CallbackCode, - CallbackSize, - CodeSize); -} - -ULONG -RegisterInt32(IN ULONG FarPtr, - IN BYTE IntNumber, - IN EMULATOR_INT32_PROC IntHandler, - OUT PSIZE_T CodeSize OPTIONAL) -{ - /* Array for holding our copy of the 16-bit interrupt callback */ - BYTE IntCallback[sizeof(Int16To32)/sizeof(BYTE)]; - - /* Check whether the 32-bit interrupt was already registered */ -#if 0 - if (Int32Proc[IntNumber] != NULL) - { - DPRINT1("RegisterInt32: Interrupt 0x%02X already registered!\n", IntNumber); - return 0; - } -#endif - - /* Register the 32-bit interrupt handler */ - Int32Proc[IntNumber] = IntHandler; - - /* Copy the generic 16-bit interrupt callback and patch it */ - RtlCopyMemory(IntCallback, Int16To32, sizeof(Int16To32)); - IntCallback[2] = IntNumber; - - /* Register the 16-bit interrupt callback */ - return RegisterInt16(FarPtr, - IntNumber, - IntCallback, - sizeof(IntCallback), - CodeSize); -} - -VOID -Int32Call(IN PCALLBACK16 Context, - IN BYTE IntNumber) -{ - PUCHAR TrampolineBase = (PUCHAR)FAR_POINTER(Context->TrampolineFarPtr); - PUCHAR Trampoline = TrampolineBase; - UCHAR OldTrampoline[INT16_TRAMPOLINE_SIZE]; - - DPRINT("Int32Call(0x%02X)\n", IntNumber); - - /* Save the old trampoline */ - ((PULONGLONG)&OldTrampoline)[0] = ((PULONGLONG)TrampolineBase)[0]; - - /* Build the generic entry-point for 16-bit calls */ - if (IntNumber == 0x03) - { - /* We are redefining for INT 03h */ - *Trampoline++ = 0xCC; // Call INT 03h - /** *Trampoline++ = 0x90; // nop **/ - } - else - { - /* Normal interrupt */ - *Trampoline++ = 0xCD; // Call INT XXh - *Trampoline++ = IntNumber; - } - UnSimulate16(Trampoline); - - /* Perform the call */ - Call16(HIWORD(Context->TrampolineFarPtr), - LOWORD(Context->TrampolineFarPtr)); - - /* Restore the old trampoline */ - ((PULONGLONG)TrampolineBase)[0] = ((PULONGLONG)&OldTrampoline)[0]; -} - - - -VOID WINAPI Int32Dispatch(LPWORD Stack) -{ - /* Get the interrupt number */ - BYTE IntNum = LOBYTE(Stack[STACK_INT_NUM]); - - /* Call the 32-bit Interrupt handler */ - if (Int32Proc[IntNum] != NULL) - Int32Proc[IntNum](Stack); - else - DPRINT1("Unhandled 32-bit interrupt: 0x%02X, AX = 0x%04X\n", IntNum, getAX()); -} - -static VOID WINAPI ControlBop(LPWORD Stack) -{ - /* Get the Function Number and skip it */ - BYTE FuncNum = *(PBYTE)SEG_OFF_TO_PTR(getCS(), getIP()); - setIP(getIP() + 1); - - switch (FuncNum) - { - case BOP_CONTROL_INT32: - Int32Dispatch(Stack); - break; - - default: - // DPRINT1("Unassigned Control BOP Function: 0x%02X\n", FuncNum); - DisplayMessage(L"Unassigned Control BOP Function: 0x%02X", FuncNum); - break; - } -} - -VOID InitializeCallbacks(VOID) -{ - /* Register the Control BOP */ - RegisterBop(BOP_CONTROL, ControlBop); -} - -/* EOF */ Removed: trunk/reactos/subsystems/ntvdm/callback.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/callback.…
============================================================================== --- trunk/reactos/subsystems/ntvdm/callback.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/callback.h (removed) @@ -1,73 +0,0 @@ -/* - * COPYRIGHT: GPL - See COPYING in the top level directory - * PROJECT: ReactOS Virtual DOS Machine - * FILE: callback.h - * PURPOSE: 32-bit Interrupt Handlers - * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> - * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) - */ - -#ifndef _CALLBACK_H_ -#define _CALLBACK_H_ - -/* DEFINES ********************************************************************/ - -/* 32-bit Interrupt Identifiers */ -#define EMULATOR_MAX_INT32_NUM 0xFF + 1 - -typedef struct _CALLBACK16 -{ - ULONG TrampolineFarPtr; // Where the trampoline zone is placed - ULONG TrampolineSize; // Size of the trampoline zone - USHORT Segment; - USHORT NextOffset; -} CALLBACK16, *PCALLBACK16; - -extern const ULONG Int16To32StubSize; - -/* FUNCTIONS ******************************************************************/ - -typedef VOID (WINAPI *EMULATOR_INT32_PROC)(LPWORD Stack); - -VOID -InitializeContext(IN PCALLBACK16 Context, - IN USHORT Segment, - IN USHORT Offset); - -VOID -Call16(IN USHORT Segment, - IN USHORT Offset); - -ULONG -RegisterCallback16(IN ULONG FarPtr, - IN LPBYTE CallbackCode, - IN SIZE_T CallbackSize, - OUT PSIZE_T CodeSize OPTIONAL); - -VOID -RunCallback16(IN PCALLBACK16 Context, - IN ULONG FarPtr); - -ULONG -RegisterInt16(IN ULONG FarPtr, - IN BYTE IntNumber, - IN LPBYTE CallbackCode, - IN SIZE_T CallbackSize, - OUT PSIZE_T CodeSize OPTIONAL); - -ULONG -RegisterInt32(IN ULONG FarPtr, - IN BYTE IntNumber, - IN EMULATOR_INT32_PROC IntHandler, - OUT PSIZE_T CodeSize OPTIONAL); - -VOID -Int32Call(IN PCALLBACK16 Context, - IN BYTE IntNumber); - -VOID WINAPI Int32Dispatch(LPWORD Stack); -VOID InitializeCallbacks(VOID); - -#endif // _CALLBACK_H_ - -/* EOF */ Modified: trunk/reactos/subsystems/ntvdm/clock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/clock.c?r…
============================================================================== --- trunk/reactos/subsystems/ntvdm/clock.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/clock.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -12,6 +12,7 @@ #define NDEBUG #include "emulator.h" +#include "cpu/cpu.h" // #include "clock.h" @@ -62,7 +63,7 @@ VOID ClockUpdate(VOID) { - extern BOOLEAN CpuSimulate; + extern BOOLEAN CpuRunning; UINT i; #ifdef WORKING_TIMER @@ -137,9 +138,9 @@ VgaHorizontalRetrace(); /* Continue CPU emulation */ - for (i = 0; VdmRunning && CpuSimulate && (i < STEPS_PER_CYCLE); i++) + for (i = 0; VdmRunning && CpuRunning && (i < STEPS_PER_CYCLE); i++) { - EmulatorStep(); + CpuStep(); #ifdef IPS_DISPLAY Cycles++; #endif Propchange: trunk/reactos/subsystems/ntvdm/cpu/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Tue Sep 30 23:47:23 2014 @@ -0,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/subsystems/ntvdm/cpu/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/subsystems/ntvdm/cpu/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/subsystems/ntvdm/cpu/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Copied: trunk/reactos/subsystems/ntvdm/cpu/callback.c (from r64385, trunk/reactos/subsystems/ntvdm/callback.c) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/cpu/callb…
============================================================================== --- trunk/reactos/subsystems/ntvdm/callback.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/cpu/callback.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -19,85 +19,48 @@ #define NDEBUG +#include "cpu.h" +#include "callback.h" #include "emulator.h" -#include "callback.h" #include "bop.h" #include <isvbop.h> /* PRIVATE VARIABLES **********************************************************/ -/* - * This is the list of registered 32-bit Interrupt handlers. - */ -static EMULATOR_INT32_PROC Int32Proc[EMULATOR_MAX_INT32_NUM] = { NULL }; +#define TRAMPOLINE_SIZE sizeof(ULONGLONG) -/* BOP Identifiers */ -#define BOP_CONTROL 0xFF // Control BOP Handler - #define BOP_CONTROL_DEFFUNC 0x00 // Default Control BOP Function - #define BOP_CONTROL_INT32 0xFF // 32-bit Interrupt dispatcher - // function code for the Control BOP Handler - -#define BOP(num) LOBYTE(EMULATOR_BOP), HIBYTE(EMULATOR_BOP), (num) -#define UnSimulate16(trap) \ -do { \ - *(PUSHORT)(trap) = EMULATOR_BOP; \ - (trap) += sizeof(USHORT); \ - *(trap) = BOP_UNSIMULATE; \ -} while(0) -// #define UnSimulate16 MAKELONG(EMULATOR_BOP, BOP_UNSIMULATE) // BOP(BOP_UNSIMULATE) - -#define CALL16_TRAMPOLINE_SIZE (1 * sizeof(ULONGLONG)) -#define INT16_TRAMPOLINE_SIZE (1 * sizeof(ULONGLONG)) - -// -// WARNING WARNING!! -// -// If you modify the code stubs here, think also -// about updating them in int32.c too!! -// - -/* 16-bit generic interrupt code for calling a 32-bit interrupt handler */ -static BYTE Int16To32[] = +static BYTE Yield[] = { - 0xFA, // cli - - /* Push the value of the interrupt to be called */ - 0x6A, 0xFF, // push i (patchable to 0x6A, 0xIntNum) - - /* The BOP Sequence */ -// BOP_SEQ: - 0xF8, // clc - BOP(BOP_CONTROL), // Control BOP - BOP_CONTROL_INT32, // 32-bit Interrupt dispatcher - - 0x73, 0x04, // jnc EXIT (offset +4) - - 0xFB, // sti - - // HACK: The following instruction should be HLT! - 0x90, // nop - - 0xEB, 0xF5, // jmp BOP_SEQ (offset -11) - -// EXIT: - 0x44, 0x44, // inc sp, inc sp - 0xCF, // iret + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, // 13x nop + BOP(BOP_UNSIMULATE), // UnSimulate16 BOP }; -const ULONG Int16To32StubSize = sizeof(Int16To32); +C_ASSERT(sizeof(Yield) == 16 * sizeof(BYTE)); /* PUBLIC FUNCTIONS ***********************************************************/ + +VOID +InitializeContextEx(IN PCALLBACK16 Context, + IN ULONG TrampolineSize, + IN USHORT Segment, + IN USHORT Offset) +{ + Context->TrampolineFarPtr = MAKELONG(Offset, Segment); + Context->TrampolineSize = max(TRAMPOLINE_SIZE, TrampolineSize); + Context->Segment = Segment; + Context->NextOffset = Offset + Context->TrampolineSize; +} VOID InitializeContext(IN PCALLBACK16 Context, IN USHORT Segment, IN USHORT Offset) { - Context->TrampolineFarPtr = MAKELONG(Offset, Segment); - Context->TrampolineSize = max(CALL16_TRAMPOLINE_SIZE, - INT16_TRAMPOLINE_SIZE); - Context->Segment = Segment; - Context->NextOffset = Offset + Context->TrampolineSize; + InitializeContextEx(Context, + TRAMPOLINE_SIZE, + Segment, + Offset); } VOID @@ -115,14 +78,39 @@ DPRINT("Call16(%04X:%04X)\n", Segment, Offset); /* Start CPU simulation */ - EmulatorSimulate(); + CpuSimulate(); /* Restore CS:IP */ setCS(OrgCS); setIP(OrgIP); } +VOID +RunCallback16(IN PCALLBACK16 Context, + IN ULONG FarPtr) +{ + PUCHAR TrampolineBase = (PUCHAR)FAR_POINTER(Context->TrampolineFarPtr); + PUCHAR Trampoline = TrampolineBase; + UCHAR OldTrampoline[TRAMPOLINE_SIZE]; + /* Save the old trampoline */ + ((PULONGLONG)&OldTrampoline)[0] = ((PULONGLONG)TrampolineBase)[0]; + + DPRINT("RunCallback16(0x%p)\n", FarPtr); + + /* Build the generic entry-point for 16-bit far calls */ + *Trampoline++ = 0x9A; // Call far seg:off + *(PULONG)Trampoline = FarPtr; + Trampoline += sizeof(ULONG); + UnSimulate16(Trampoline); + + /* Perform the call */ + Call16(HIWORD(Context->TrampolineFarPtr), + LOWORD(Context->TrampolineFarPtr)); + + /* Restore the old trampoline */ + ((PULONGLONG)TrampolineBase)[0] = ((PULONGLONG)&OldTrampoline)[0]; +} ULONG RegisterCallback16(IN ULONG FarPtr, @@ -152,159 +140,4 @@ return OurCodeSize; } -VOID -RunCallback16(IN PCALLBACK16 Context, - IN ULONG FarPtr) -{ - PUCHAR TrampolineBase = (PUCHAR)FAR_POINTER(Context->TrampolineFarPtr); - PUCHAR Trampoline = TrampolineBase; - UCHAR OldTrampoline[CALL16_TRAMPOLINE_SIZE]; - - /* Save the old trampoline */ - ((PULONGLONG)&OldTrampoline)[0] = ((PULONGLONG)TrampolineBase)[0]; - - DPRINT1("RunCallback16(0x%p)\n", FarPtr); - - /* Build the generic entry-point for 16-bit far calls */ - *Trampoline++ = 0x9A; // Call far seg:off - *(PULONG)Trampoline = FarPtr; - Trampoline += sizeof(ULONG); - UnSimulate16(Trampoline); - - /* Perform the call */ - Call16(HIWORD(Context->TrampolineFarPtr), - LOWORD(Context->TrampolineFarPtr)); - - /* Restore the old trampoline */ - ((PULONGLONG)TrampolineBase)[0] = ((PULONGLONG)&OldTrampoline)[0]; -} - - - -ULONG -RegisterInt16(IN ULONG FarPtr, - IN BYTE IntNumber, - IN LPBYTE CallbackCode, - IN SIZE_T CallbackSize, - OUT PSIZE_T CodeSize OPTIONAL) -{ - /* Get a pointer to the IVT and set the corresponding entry (far pointer) */ - LPDWORD IntVecTable = (LPDWORD)SEG_OFF_TO_PTR(0x0000, 0x0000); - IntVecTable[IntNumber] = FarPtr; - - /* Register the 16-bit callback */ - return RegisterCallback16(FarPtr, - CallbackCode, - CallbackSize, - CodeSize); -} - -ULONG -RegisterInt32(IN ULONG FarPtr, - IN BYTE IntNumber, - IN EMULATOR_INT32_PROC IntHandler, - OUT PSIZE_T CodeSize OPTIONAL) -{ - /* Array for holding our copy of the 16-bit interrupt callback */ - BYTE IntCallback[sizeof(Int16To32)/sizeof(BYTE)]; - - /* Check whether the 32-bit interrupt was already registered */ -#if 0 - if (Int32Proc[IntNumber] != NULL) - { - DPRINT1("RegisterInt32: Interrupt 0x%02X already registered!\n", IntNumber); - return 0; - } -#endif - - /* Register the 32-bit interrupt handler */ - Int32Proc[IntNumber] = IntHandler; - - /* Copy the generic 16-bit interrupt callback and patch it */ - RtlCopyMemory(IntCallback, Int16To32, sizeof(Int16To32)); - IntCallback[2] = IntNumber; - - /* Register the 16-bit interrupt callback */ - return RegisterInt16(FarPtr, - IntNumber, - IntCallback, - sizeof(IntCallback), - CodeSize); -} - -VOID -Int32Call(IN PCALLBACK16 Context, - IN BYTE IntNumber) -{ - PUCHAR TrampolineBase = (PUCHAR)FAR_POINTER(Context->TrampolineFarPtr); - PUCHAR Trampoline = TrampolineBase; - UCHAR OldTrampoline[INT16_TRAMPOLINE_SIZE]; - - DPRINT("Int32Call(0x%02X)\n", IntNumber); - - /* Save the old trampoline */ - ((PULONGLONG)&OldTrampoline)[0] = ((PULONGLONG)TrampolineBase)[0]; - - /* Build the generic entry-point for 16-bit calls */ - if (IntNumber == 0x03) - { - /* We are redefining for INT 03h */ - *Trampoline++ = 0xCC; // Call INT 03h - /** *Trampoline++ = 0x90; // nop **/ - } - else - { - /* Normal interrupt */ - *Trampoline++ = 0xCD; // Call INT XXh - *Trampoline++ = IntNumber; - } - UnSimulate16(Trampoline); - - /* Perform the call */ - Call16(HIWORD(Context->TrampolineFarPtr), - LOWORD(Context->TrampolineFarPtr)); - - /* Restore the old trampoline */ - ((PULONGLONG)TrampolineBase)[0] = ((PULONGLONG)&OldTrampoline)[0]; -} - - - -VOID WINAPI Int32Dispatch(LPWORD Stack) -{ - /* Get the interrupt number */ - BYTE IntNum = LOBYTE(Stack[STACK_INT_NUM]); - - /* Call the 32-bit Interrupt handler */ - if (Int32Proc[IntNum] != NULL) - Int32Proc[IntNum](Stack); - else - DPRINT1("Unhandled 32-bit interrupt: 0x%02X, AX = 0x%04X\n", IntNum, getAX()); -} - -static VOID WINAPI ControlBop(LPWORD Stack) -{ - /* Get the Function Number and skip it */ - BYTE FuncNum = *(PBYTE)SEG_OFF_TO_PTR(getCS(), getIP()); - setIP(getIP() + 1); - - switch (FuncNum) - { - case BOP_CONTROL_INT32: - Int32Dispatch(Stack); - break; - - default: - // DPRINT1("Unassigned Control BOP Function: 0x%02X\n", FuncNum); - DisplayMessage(L"Unassigned Control BOP Function: 0x%02X", FuncNum); - break; - } -} - -VOID InitializeCallbacks(VOID) -{ - /* Register the Control BOP */ - RegisterBop(BOP_CONTROL, ControlBop); -} - /* EOF */ Copied: trunk/reactos/subsystems/ntvdm/cpu/callback.h (from r64385, trunk/reactos/subsystems/ntvdm/callback.h) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/cpu/callb…
============================================================================== --- trunk/reactos/subsystems/ntvdm/callback.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/cpu/callback.h [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -12,8 +12,14 @@ /* DEFINES ********************************************************************/ -/* 32-bit Interrupt Identifiers */ -#define EMULATOR_MAX_INT32_NUM 0xFF + 1 +#define BOP(num) LOBYTE(EMULATOR_BOP), HIBYTE(EMULATOR_BOP), (num) +#define UnSimulate16(trap) \ +do { \ + *(PUSHORT)(trap) = EMULATOR_BOP; \ + (trap) += sizeof(USHORT); \ + *(trap) = BOP_UNSIMULATE; \ +} while(0) +// #define UnSimulate16 MAKELONG(EMULATOR_BOP, BOP_UNSIMULATE) // BOP(BOP_UNSIMULATE) typedef struct _CALLBACK16 { @@ -23,11 +29,23 @@ USHORT NextOffset; } CALLBACK16, *PCALLBACK16; -extern const ULONG Int16To32StubSize; +// +// WARNING WARNING!! +// If you're changing the indices here, you then need to +// also fix the BOP code in callback.c !!!!!!!!!!!!!!!!! +// +#define STACK_INT_NUM 0 +#define STACK_IP 1 +#define STACK_CS 2 +#define STACK_FLAGS 3 /* FUNCTIONS ******************************************************************/ -typedef VOID (WINAPI *EMULATOR_INT32_PROC)(LPWORD Stack); +VOID +InitializeContextEx(IN PCALLBACK16 Context, + IN ULONG TrampolineSize, + IN USHORT Segment, + IN USHORT Offset); VOID InitializeContext(IN PCALLBACK16 Context, @@ -38,36 +56,16 @@ Call16(IN USHORT Segment, IN USHORT Offset); +VOID +RunCallback16(IN PCALLBACK16 Context, + IN ULONG FarPtr); + ULONG RegisterCallback16(IN ULONG FarPtr, IN LPBYTE CallbackCode, IN SIZE_T CallbackSize, OUT PSIZE_T CodeSize OPTIONAL); -VOID -RunCallback16(IN PCALLBACK16 Context, - IN ULONG FarPtr); - -ULONG -RegisterInt16(IN ULONG FarPtr, - IN BYTE IntNumber, - IN LPBYTE CallbackCode, - IN SIZE_T CallbackSize, - OUT PSIZE_T CodeSize OPTIONAL); - -ULONG -RegisterInt32(IN ULONG FarPtr, - IN BYTE IntNumber, - IN EMULATOR_INT32_PROC IntHandler, - OUT PSIZE_T CodeSize OPTIONAL); - -VOID -Int32Call(IN PCALLBACK16 Context, - IN BYTE IntNumber); - -VOID WINAPI Int32Dispatch(LPWORD Stack); -VOID InitializeCallbacks(VOID); - #endif // _CALLBACK_H_ /* EOF */ Copied: trunk/reactos/subsystems/ntvdm/cpu/cpu.c (from r64385, trunk/reactos/subsystems/ntvdm/emulator.c) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/cpu/cpu.c…
============================================================================== --- trunk/reactos/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/cpu/cpu.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -10,8 +10,12 @@ #define NDEBUG +#include "cpu.h" + #include "emulator.h" #include "callback.h" +#include "bop.h" +#include <isvbop.h> #include "clock.h" #include "bios/rom.h" @@ -24,29 +28,20 @@ #include "hardware/timer.h" #include "hardware/vga.h" -#include "bop.h" -#include "vddsup.h" #include "io.h" - -#include <isvbop.h> /* PRIVATE VARIABLES **********************************************************/ FAST486_STATE EmulatorContext; -BOOLEAN CpuSimulate = FALSE; +BOOLEAN CpuRunning = FALSE; /* No more than 'MaxCpuCallLevel' recursive CPU calls are allowed */ static const INT MaxCpuCallLevel = 32; static INT CpuCallLevel = 0; -LPVOID BaseAddress = NULL; -BOOLEAN VdmRunning = TRUE; +// BOOLEAN VdmRunning = TRUE; -static BOOLEAN A20Line = FALSE; -static BYTE Port61hState = 0x00; - -static HANDLE InputThread = NULL; - +#if 0 LPCWSTR ExceptionName[] = { L"Division By Zero", @@ -58,90 +53,14 @@ L"Invalid Opcode", L"FPU Not Available" }; +#endif -/* BOP Identifiers */ -#define BOP_DEBUGGER 0x56 // Break into the debugger from a 16-bit app +// /* BOP Identifiers */ +// #define BOP_DEBUGGER 0x56 // Break into the debugger from a 16-bit app /* PRIVATE FUNCTIONS **********************************************************/ -VOID WINAPI EmulatorReadMemory(PFAST486_STATE State, ULONG Address, PVOID Buffer, ULONG Size) -{ - UNREFERENCED_PARAMETER(State); - - // BIG HACK!!!! To make BIOS images working correctly, - // until Aleksander rewrites memory management!! - if (Address >= 0xFFFFFFF0) Address -= 0xFFF00000; - - /* If the A20 line is disabled, mask bit 20 */ - if (!A20Line) Address &= ~(1 << 20); - - /* Make sure the requested address is valid */ - if ((Address + Size) >= MAX_ADDRESS) return; - - /* - * Check if we are going to read the VGA memory and - * copy it into the virtual address space if needed. - */ - if (((Address + Size) >= VgaGetVideoBaseAddress()) - && (Address < VgaGetVideoLimitAddress())) - { - DWORD VgaAddress = max(Address, VgaGetVideoBaseAddress()); - DWORD ActualSize = min(Address + Size - 1, VgaGetVideoLimitAddress()) - - VgaAddress + 1; - LPBYTE DestBuffer = (LPBYTE)REAL_TO_PHYS(VgaAddress); - - /* Read from the VGA memory */ - VgaReadMemory(VgaAddress, DestBuffer, ActualSize); - } - - /* Read the data from the virtual address space and store it in the buffer */ - RtlCopyMemory(Buffer, REAL_TO_PHYS(Address), Size); -} - -VOID WINAPI EmulatorWriteMemory(PFAST486_STATE State, ULONG Address, PVOID Buffer, ULONG Size) -{ - UNREFERENCED_PARAMETER(State); - - // BIG HACK!!!! To make BIOS images working correctly, - // until Aleksander rewrites memory management!! - if (Address >= 0xFFFFFFF0) Address -= 0xFFF00000; - - /* If the A20 line is disabled, mask bit 20 */ - if (!A20Line) Address &= ~(1 << 20); - - /* Make sure the requested address is valid */ - if ((Address + Size) >= MAX_ADDRESS) return; - - /* Make sure we don't write to the ROM area */ - if ((Address + Size) >= ROM_AREA_START && (Address < ROM_AREA_END)) return; - - /* Read the data from the buffer and store it in the virtual address space */ - RtlCopyMemory(REAL_TO_PHYS(Address), Buffer, Size); - - /* - * Check if we modified the VGA memory. - */ - if (((Address + Size) >= VgaGetVideoBaseAddress()) - && (Address < VgaGetVideoLimitAddress())) - { - DWORD VgaAddress = max(Address, VgaGetVideoBaseAddress()); - DWORD ActualSize = min(Address + Size - 1, VgaGetVideoLimitAddress()) - - VgaAddress + 1; - LPBYTE SrcBuffer = (LPBYTE)REAL_TO_PHYS(VgaAddress); - - /* Write to the VGA memory */ - VgaWriteMemory(VgaAddress, SrcBuffer, ActualSize); - } -} - -UCHAR WINAPI EmulatorIntAcknowledge(PFAST486_STATE State) -{ - UNREFERENCED_PARAMETER(State); - - /* Get the interrupt number from the PIC */ - return PicGetInterrupt(); -} - +#if 0 VOID EmulatorException(BYTE ExceptionNumber, LPWORD Stack) { WORD CodeSegment, InstructionPointer; @@ -175,15 +94,16 @@ EmulatorTerminate(); return; } +#endif // FIXME: This function assumes 16-bit mode!!! -VOID EmulatorExecute(WORD Segment, WORD Offset) +VOID CpuExecute(WORD Segment, WORD Offset) { /* Tell Fast486 to move the instruction pointer */ Fast486ExecuteAt(&EmulatorContext, Segment, Offset); } -VOID EmulatorStep(VOID) +VOID CpuStep(VOID) { /* Dump the state for debugging purposes */ // Fast486DumpState(&EmulatorContext); @@ -192,7 +112,7 @@ Fast486StepInto(&EmulatorContext); } -VOID EmulatorSimulate(VOID) +VOID CpuSimulate(VOID) { if (CpuCallLevel > MaxCpuCallLevel) { @@ -205,366 +125,45 @@ } CpuCallLevel++; - CpuSimulate = TRUE; - while (VdmRunning && CpuSimulate) ClockUpdate(); + CpuRunning = TRUE; + while (VdmRunning && CpuRunning) ClockUpdate(); CpuCallLevel--; if (CpuCallLevel < 0) CpuCallLevel = 0; /* This takes into account for reentrance */ - CpuSimulate = TRUE; + CpuRunning = TRUE; } -VOID EmulatorUnsimulate(VOID) +VOID CpuUnsimulate(VOID) { /* Stop simulation */ - CpuSimulate = FALSE; + CpuRunning = FALSE; } +static VOID WINAPI CpuUnsimulateBop(LPWORD Stack) +{ + CpuUnsimulate(); +} + +#if 0 VOID EmulatorTerminate(VOID) { /* Stop the VDM */ VdmRunning = FALSE; } - -VOID EmulatorInterrupt(BYTE Number) -{ - /* Call the Fast486 API */ - Fast486Interrupt(&EmulatorContext, Number); -} - -VOID EmulatorInterruptSignal(VOID) -{ - /* Call the Fast486 API */ - Fast486InterruptSignal(&EmulatorContext); -} - -VOID EmulatorSetA20(BOOLEAN Enabled) -{ - A20Line = Enabled; -} - -static VOID WINAPI EmulatorDebugBreakBop(LPWORD Stack) -{ - DPRINT1("NTVDM: BOP_DEBUGGER\n"); - DebugBreak(); -} - -static VOID WINAPI EmulatorUnsimulateBop(LPWORD Stack) -{ - EmulatorUnsimulate(); -} - -static BYTE WINAPI Port61hRead(ULONG Port) -{ - return Port61hState; -} - -static VOID WINAPI Port61hWrite(ULONG Port, BYTE Data) -{ - // BOOLEAN SpeakerStateChange = FALSE; - BYTE OldPort61hState = Port61hState; - - /* Only the four lowest bytes can be written */ - Port61hState = (Port61hState & 0xF0) | (Data & 0x0F); - - if ((OldPort61hState ^ Port61hState) & 0x01) - { - DPRINT("PIT 2 Gate %s\n", Port61hState & 0x01 ? "on" : "off"); - PitSetGate(2, !!(Port61hState & 0x01)); - // SpeakerStateChange = TRUE; - } - - if ((OldPort61hState ^ Port61hState) & 0x02) - { - /* There were some change for the speaker... */ - DPRINT("Speaker %s\n", Port61hState & 0x02 ? "on" : "off"); - // SpeakerStateChange = TRUE; - } - // if (SpeakerStateChange) SpeakerChange(); - SpeakerChange(); -} - -static VOID WINAPI PitChan0Out(LPVOID Param, BOOLEAN State) -{ - if (State) - { - DPRINT("PicInterruptRequest\n"); - PicInterruptRequest(0); // Raise IRQ 0 - } - // else < Lower IRQ 0 > -} - -static VOID WINAPI PitChan1Out(LPVOID Param, BOOLEAN State) -{ -#if 0 - if (State) - { - /* Set bit 4 of Port 61h */ - Port61hState |= 1 << 4; - } - else - { - /* Clear bit 4 of Port 61h */ - Port61hState &= ~(1 << 4); - } -#else - Port61hState = (Port61hState & 0xEF) | (State << 4); #endif -} - -static VOID WINAPI PitChan2Out(LPVOID Param, BOOLEAN State) -{ - BYTE OldPort61hState = Port61hState; - -#if 0 - if (State) - { - /* Set bit 5 of Port 61h */ - Port61hState |= 1 << 5; - } - else - { - /* Clear bit 5 of Port 61h */ - Port61hState &= ~(1 << 5); - } -#else - Port61hState = (Port61hState & 0xDF) | (State << 5); -#endif - - if ((OldPort61hState ^ Port61hState) & 0x20) - { - DPRINT("PitChan2Out -- Port61hState changed\n"); - SpeakerChange(); - } -} - - -static DWORD -WINAPI -PumpConsoleInput(LPVOID Parameter) -{ - HANDLE ConsoleInput = (HANDLE)Parameter; - INPUT_RECORD InputRecord; - DWORD Count; - - while (VdmRunning) - { - /* Make sure the task event is signaled */ - WaitForSingleObject(VdmTaskEvent, INFINITE); - - /* Wait for an input record */ - if (!ReadConsoleInput(ConsoleInput, &InputRecord, 1, &Count)) - { - DWORD LastError = GetLastError(); - DPRINT1("Error reading console input (0x%p, %lu) - Error %lu\n", ConsoleInput, Count, LastError); - return LastError; - } - - ASSERT(Count != 0); - - /* Check the event type */ - switch (InputRecord.EventType) - { - /* - * Hardware events - */ - case KEY_EVENT: - KeyboardEventHandler(&InputRecord.Event.KeyEvent); - break; - - case MOUSE_EVENT: - MouseEventHandler(&InputRecord.Event.MouseEvent); - break; - - case WINDOW_BUFFER_SIZE_EVENT: - ScreenEventHandler(&InputRecord.Event.WindowBufferSizeEvent); - break; - - /* - * Interface events - */ - case MENU_EVENT: - MenuEventHandler(&InputRecord.Event.MenuEvent); - break; - - case FOCUS_EVENT: - FocusEventHandler(&InputRecord.Event.FocusEvent); - break; - - default: - break; - } - } - - return 0; -} - -static VOID EnableExtraHardware(HANDLE ConsoleInput) -{ - DWORD ConInMode; - - if (GetConsoleMode(ConsoleInput, &ConInMode)) - { -#if 0 - // GetNumberOfConsoleMouseButtons(); - // GetSystemMetrics(SM_CMOUSEBUTTONS); - // GetSystemMetrics(SM_MOUSEPRESENT); - if (MousePresent) - { -#endif - /* Support mouse input events if there is a mouse on the system */ - ConInMode |= ENABLE_MOUSE_INPUT; -#if 0 - } - else - { - /* Do not support mouse input events if there is no mouse on the system */ - ConInMode &= ~ENABLE_MOUSE_INPUT; - } -#endif - - SetConsoleMode(ConsoleInput, ConInMode); - } -} /* PUBLIC FUNCTIONS ***********************************************************/ -static VOID -DumpMemoryRaw(HANDLE hFile) +BOOLEAN CpuInitialize(VOID) { - PVOID Buffer; - SIZE_T Size; - - /* Dump the VM memory */ - SetFilePointer(hFile, 0, NULL, FILE_BEGIN); - Buffer = REAL_TO_PHYS(NULL); - Size = MAX_ADDRESS - (ULONG_PTR)(NULL); - WriteFile(hFile, Buffer, Size, &Size, NULL); -} - -static VOID -DumpMemoryTxt(HANDLE hFile) -{ -#define LINE_SIZE 75 + 2 - ULONG i; - PBYTE Ptr1, Ptr2; - CHAR LineBuffer[LINE_SIZE]; - PCHAR Line; - SIZE_T LineSize; - - /* Dump the VM memory */ - SetFilePointer(hFile, 0, NULL, FILE_BEGIN); - Ptr1 = Ptr2 = REAL_TO_PHYS(NULL); - while (MAX_ADDRESS - (ULONG_PTR)PHYS_TO_REAL(Ptr1) > 0) - { - Ptr1 = Ptr2; - Line = LineBuffer; - - /* Print the address */ - Line += snprintf(Line, LINE_SIZE + LineBuffer - Line, "%08x ", PHYS_TO_REAL(Ptr1)); - - /* Print up to 16 bytes... */ - - /* ... in hexadecimal form first... */ - i = 0; - while (i++ <= 0x0F && (MAX_ADDRESS - (ULONG_PTR)PHYS_TO_REAL(Ptr1) > 0)) - { - Line += snprintf(Line, LINE_SIZE + LineBuffer - Line, " %02x", *Ptr1); - ++Ptr1; - } - - /* ... align with spaces if needed... */ - RtlFillMemory(Line, 0x0F + 4 - i, ' '); - Line += 0x0F + 4 - i; - - /* ... then in character form. */ - i = 0; - while (i++ <= 0x0F && (MAX_ADDRESS - (ULONG_PTR)PHYS_TO_REAL(Ptr2) > 0)) - { - *Line++ = ((*Ptr2 >= 0x20 && *Ptr2 <= 0x7E) || (*Ptr2 >= 0x80 && *Ptr2 < 0xFF) ? *Ptr2 : '.'); - ++Ptr2; - } - - /* Newline */ - *Line++ = '\r'; - *Line++ = '\n'; - - /* Finally write the line to the file */ - LineSize = Line - LineBuffer; - WriteFile(hFile, LineBuffer, LineSize, &LineSize, NULL); - } -} - -VOID DumpMemory(BOOLEAN TextFormat) -{ - static ULONG DumpNumber = 0; - - HANDLE hFile; - WCHAR FileName[MAX_PATH]; - - /* Build a suitable file name */ - _snwprintf(FileName, MAX_PATH, - L"memdump%lu.%s", - DumpNumber, - TextFormat ? L"txt" : L"dat"); - ++DumpNumber; - - DPRINT1("Creating memory dump file '%S'...\n", FileName); - - /* Always create the dump file */ - hFile = CreateFileW(FileName, - GENERIC_WRITE, - 0, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - DPRINT1("Error when creating '%S' for memory dumping, GetLastError() = %u\n", - FileName, GetLastError()); - return; - } - - /* Dump the VM memory in the chosen format */ - if (TextFormat) - DumpMemoryTxt(hFile); - else - DumpMemoryRaw(hFile); - - /* Close the file */ - CloseHandle(hFile); - - DPRINT1("Memory dump done\n"); -} - -BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput) -{ - /* Allocate memory for the 16-bit address space */ - BaseAddress = HeapAlloc(GetProcessHeap(), /*HEAP_ZERO_MEMORY*/ 0, MAX_ADDRESS); - if (BaseAddress == NULL) - { - wprintf(L"FATAL: Failed to allocate VDM memory.\n"); - return FALSE; - } - /* - * For diagnostics purposes, we fill the memory with INT 0x03 codes - * so that if a program wants to execute random code in memory, we can - * retrieve the exact CS:IP where the problem happens. - */ - RtlFillMemory(BaseAddress, MAX_ADDRESS, 0xCC); - - /* Initialize I/O ports */ - /* Initialize RAM */ - - /* Initialize the internal clock */ - if (!ClockInitialize()) - { - wprintf(L"FATAL: Failed to initialize the clock\n"); - return FALSE; - } + // /* Initialize the internal clock */ + // if (!ClockInitialize()) + // { + // wprintf(L"FATAL: Failed to initialize the clock\n"); + // return FALSE; + // } /* Initialize the CPU */ Fast486Initialize(&EmulatorContext, @@ -577,163 +176,16 @@ EmulatorIntAcknowledge, NULL /* TODO: Use a TLB */); - /* Initialize DMA */ - - /* Initialize the PIC, the PIT, the CMOS and the PC Speaker */ - PicInitialize(); - PitInitialize(); - CmosInitialize(); - SpeakerInitialize(); - - /* Set output functions */ - PitSetOutFunction(0, NULL, PitChan0Out); - PitSetOutFunction(1, NULL, PitChan1Out); - PitSetOutFunction(2, NULL, PitChan2Out); - - /* Register the I/O Ports */ - RegisterIoPort(CONTROL_SYSTEM_PORT61H, Port61hRead, Port61hWrite); - - /* Set the console input mode */ - // FIXME: Activate ENABLE_WINDOW_INPUT when we will want to perform actions - // upon console window events (screen buffer resize, ...). - SetConsoleMode(ConsoleInput, ENABLE_PROCESSED_INPUT /* | ENABLE_WINDOW_INPUT */); - // SetConsoleMode(ConsoleOutput, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT); - - /**/EnableExtraHardware(ConsoleInput);/**/ - - /* Initialize the PS/2 port */ - PS2Initialize(); - - /* Initialize the keyboard and mouse and connect them to their PS/2 ports */ - KeyboardInit(0); - MouseInit(1); - - /**************** ATTACH INPUT WITH CONSOLE *****************/ - /* Start the input thread */ - InputThread = CreateThread(NULL, 0, &PumpConsoleInput, ConsoleInput, 0, NULL); - if (InputThread == NULL) - { - DisplayMessage(L"Failed to create the console input thread."); - return FALSE; - } - /************************************************************/ - - /* Initialize the VGA */ - if (!VgaInitialize(ConsoleOutput)) - { - DisplayMessage(L"Failed to initialize VGA support."); - return FALSE; - } - /* Initialize the software callback system and register the emulator BOPs */ - InitializeCallbacks(); - RegisterBop(BOP_DEBUGGER , EmulatorDebugBreakBop); - RegisterBop(BOP_UNSIMULATE, EmulatorUnsimulateBop); - - /* Initialize VDD support */ - VDDSupInitialize(); + // RegisterBop(BOP_DEBUGGER , EmulatorDebugBreakBop); + RegisterBop(BOP_UNSIMULATE, CpuUnsimulateBop); return TRUE; } -VOID EmulatorCleanup(VOID) +VOID CpuCleanup(VOID) { - VgaCleanup(); - - /* Close the input thread handle */ - if (InputThread != NULL) CloseHandle(InputThread); - InputThread = NULL; - - PS2Cleanup(); - - SpeakerCleanup(); - CmosCleanup(); - // PitCleanup(); - // PicCleanup(); - // Fast486Cleanup(); - - /* Free the memory allocated for the 16-bit address space */ - if (BaseAddress != NULL) HeapFree(GetProcessHeap(), 0, BaseAddress); -} - - - -VOID -WINAPI -VDDSimulate16(VOID) -{ - EmulatorSimulate(); -} - -VOID -WINAPI -VDDTerminateVDM(VOID) -{ - /* Stop the VDM */ - EmulatorTerminate(); -} - -PBYTE -WINAPI -Sim32pGetVDMPointer(IN ULONG Address, - IN BOOLEAN ProtectedMode) -{ - // FIXME - UNREFERENCED_PARAMETER(ProtectedMode); - - /* - * HIWORD(Address) == Segment (if ProtectedMode == FALSE) - * or Selector (if ProtectedMode == TRUE ) - * LOWORD(Address) == Offset - */ - return (PBYTE)FAR_POINTER(Address); -} - -PBYTE -WINAPI -MGetVdmPointer(IN ULONG Address, - IN ULONG Size, - IN BOOLEAN ProtectedMode) -{ - UNREFERENCED_PARAMETER(Size); - return Sim32pGetVDMPointer(Address, ProtectedMode); -} - -PVOID -WINAPI -VdmMapFlat(IN USHORT Segment, - IN ULONG Offset, - IN VDM_MODE Mode) -{ - // FIXME - UNREFERENCED_PARAMETER(Mode); - - return SEG_OFF_TO_PTR(Segment, Offset); -} - -BOOL -WINAPI -VdmFlushCache(IN USHORT Segment, - IN ULONG Offset, - IN ULONG Size, - IN VDM_MODE Mode) -{ - // FIXME - UNIMPLEMENTED; - return TRUE; -} - -BOOL -WINAPI -VdmUnmapFlat(IN USHORT Segment, - IN ULONG Offset, - IN PVOID Buffer, - IN VDM_MODE Mode) -{ - // FIXME - UNIMPLEMENTED; - return TRUE; } /* EOF */ Copied: trunk/reactos/subsystems/ntvdm/cpu/cpu.h (from r64385, trunk/reactos/subsystems/ntvdm/emulator.h) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/cpu/cpu.h…
============================================================================== --- trunk/reactos/subsystems/ntvdm/emulator.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/cpu/cpu.h [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -6,8 +6,8 @@ * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> */ -#ifndef _EMULATOR_H_ -#define _EMULATOR_H_ +#ifndef _CPU_H_ +#define _CPU_H_ /* INCLUDES *******************************************************************/ @@ -17,62 +17,24 @@ /* DEFINES ********************************************************************/ /* FLAGS */ -#define EMULATOR_FLAG_CF (1 << 0) -#define EMULATOR_FLAG_PF (1 << 2) -#define EMULATOR_FLAG_AF (1 << 4) -#define EMULATOR_FLAG_ZF (1 << 6) -#define EMULATOR_FLAG_SF (1 << 7) -#define EMULATOR_FLAG_TF (1 << 8) -#define EMULATOR_FLAG_IF (1 << 9) -#define EMULATOR_FLAG_DF (1 << 10) -#define EMULATOR_FLAG_OF (1 << 11) -#define EMULATOR_FLAG_NT (1 << 14) -#define EMULATOR_FLAG_RF (1 << 16) -#define EMULATOR_FLAG_VM (1 << 17) -#define EMULATOR_FLAG_AC (1 << 18) -#define EMULATOR_FLAG_VIF (1 << 19) -#define EMULATOR_FLAG_VIP (1 << 20) -#define EMULATOR_FLAG_ID (1 << 21) +#define EMULATOR_FLAG_CF (1 << 0) +#define EMULATOR_FLAG_PF (1 << 2) +#define EMULATOR_FLAG_AF (1 << 4) +#define EMULATOR_FLAG_ZF (1 << 6) +#define EMULATOR_FLAG_SF (1 << 7) +#define EMULATOR_FLAG_TF (1 << 8) +#define EMULATOR_FLAG_IF (1 << 9) +#define EMULATOR_FLAG_DF (1 << 10) +#define EMULATOR_FLAG_OF (1 << 11) +#define EMULATOR_FLAG_NT (1 << 14) +#define EMULATOR_FLAG_RF (1 << 16) +#define EMULATOR_FLAG_VM (1 << 17) +#define EMULATOR_FLAG_AC (1 << 18) +#define EMULATOR_FLAG_VIF (1 << 19) +#define EMULATOR_FLAG_VIP (1 << 20) +#define EMULATOR_FLAG_ID (1 << 21) -// -// WARNING WARNING!! -// If you're changing the indices here, you then need to -// also fix the BOP code in callback.c !!!!!!!!!!!!!!!!! -// -#define STACK_INT_NUM 0 -#define STACK_IP 1 -#define STACK_CS 2 -#define STACK_FLAGS 3 - - -/* Basic Memory Management */ -#define MEM_ALIGN_UP(ptr, align) MEM_ALIGN_DOWN((ULONG_PTR)(ptr) + (align) - 1l, (align)) -#define MEM_ALIGN_DOWN(ptr, align) (PVOID)((ULONG_PTR)(ptr) & ~((align) - 1l)) - -#define TO_LINEAR(seg, off) (((seg) << 4) + (off)) -#define MAX_SEGMENT 0xFFFF -#define MAX_OFFSET 0xFFFF -#define MAX_ADDRESS 0x1000000 // 16 MB of RAM - -#define FAR_POINTER(x) \ - (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR(HIWORD(x), LOWORD(x))) - -#define SEG_OFF_TO_PTR(seg, off) \ - (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR((seg), (off))) - -#define REAL_TO_PHYS(ptr) (PVOID)((ULONG_PTR)(ptr) + (ULONG_PTR)BaseAddress) -#define PHYS_TO_REAL(ptr) (PVOID)((ULONG_PTR)(ptr) - (ULONG_PTR)BaseAddress) - - -/* BCD-Binary conversion */ -#define BINARY_TO_BCD(x) ((((x) / 1000) << 12) + (((x) / 100) << 8) + (((x) / 10) << 4) + ((x) % 10)) -#define BCD_TO_BINARY(x) (((x) >> 12) * 1000 + ((x) >> 8) * 100 + ((x) >> 4) * 10 + ((x) & 0x0F)) - - -/* System I/O ports */ -#define CONTROL_SYSTEM_PORT61H 0x61 - - +#if 0 enum { EMULATOR_EXCEPTION_DIVISION_BY_ZERO, @@ -91,51 +53,27 @@ EMULATOR_EXCEPTION_GPF, EMULATOR_EXCEPTION_PAGE_FAULT }; - +#endif extern FAST486_STATE EmulatorContext; -extern LPVOID BaseAddress; -extern BOOLEAN VdmRunning; +// extern BOOLEAN VdmRunning; /* FUNCTIONS ******************************************************************/ -VOID DumpMemory(BOOLEAN TextFormat); +#if 0 +VOID EmulatorException(BYTE ExceptionNumber, LPWORD Stack); +#endif -VOID WINAPI EmulatorReadMemory -( - PFAST486_STATE State, - ULONG Address, - PVOID Buffer, - ULONG Size -); +VOID CpuExecute(WORD Segment, WORD Offset); +VOID CpuStep(VOID); +VOID CpuSimulate(VOID); +VOID CpuUnsimulate(VOID); +#if 0 +VOID EmulatorTerminate(VOID); +#endif -VOID WINAPI EmulatorWriteMemory -( - PFAST486_STATE State, - ULONG Address, - PVOID Buffer, - ULONG Size -); +BOOLEAN CpuInitialize(VOID); +VOID CpuCleanup(VOID); -UCHAR WINAPI EmulatorIntAcknowledge -( - PFAST486_STATE State -); - -VOID EmulatorException(BYTE ExceptionNumber, LPWORD Stack); - -VOID EmulatorExecute(WORD Segment, WORD Offset); -VOID EmulatorStep(VOID); -VOID EmulatorSimulate(VOID); -VOID EmulatorUnsimulate(VOID); -VOID EmulatorTerminate(VOID); - -VOID EmulatorInterrupt(BYTE Number); -VOID EmulatorInterruptSignal(VOID); -VOID EmulatorSetA20(BOOLEAN Enabled); - -BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput); -VOID EmulatorCleanup(VOID); - -#endif // _EMULATOR_H_ +#endif // _CPU_H_ /* EOF */ Modified: trunk/reactos/subsystems/ntvdm/dos/dem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dem.c…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/dem.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/dem.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -18,7 +18,7 @@ #include "utils.h" #include "dem.h" -#include "bop.h" +#include "cpu/bop.h" #include "bios/bios.h" #include "mouse32.h" Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/bios.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -11,7 +11,7 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" +#include "int32.h" #include "dos.h" Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -13,7 +13,7 @@ #include "ntvdm.h" -/**/ #include "callback.h" /**/ +/**/ #include "int32.h" /**/ /* DEFINES ********************************************************************/ Modified: trunk/reactos/subsystems/ntvdm/dos/mouse32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/mouse…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/mouse32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/mouse32.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -11,7 +11,8 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" +#include "cpu/cpu.h" +#include "int32.h" #include "mouse32.h" #include "bios/bios.h" Modified: trunk/reactos/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/emulator.…
============================================================================== --- trunk/reactos/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/emulator.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -11,7 +11,13 @@ #define NDEBUG #include "emulator.h" -#include "callback.h" + +#include "cpu/callback.h" +#include "cpu/cpu.h" +#include "cpu/bop.h" +#include <isvbop.h> + +#include "int32.h" #include "clock.h" #include "bios/rom.h" @@ -24,20 +30,10 @@ #include "hardware/timer.h" #include "hardware/vga.h" -#include "bop.h" #include "vddsup.h" #include "io.h" -#include <isvbop.h> - /* PRIVATE VARIABLES **********************************************************/ - -FAST486_STATE EmulatorContext; -BOOLEAN CpuSimulate = FALSE; - -/* No more than 'MaxCpuCallLevel' recursive CPU calls are allowed */ -static const INT MaxCpuCallLevel = 32; -static INT CpuCallLevel = 0; LPVOID BaseAddress = NULL; BOOLEAN VdmRunning = TRUE; @@ -176,51 +172,6 @@ return; } -// FIXME: This function assumes 16-bit mode!!! -VOID EmulatorExecute(WORD Segment, WORD Offset) -{ - /* Tell Fast486 to move the instruction pointer */ - Fast486ExecuteAt(&EmulatorContext, Segment, Offset); -} - -VOID EmulatorStep(VOID) -{ - /* Dump the state for debugging purposes */ - // Fast486DumpState(&EmulatorContext); - - /* Execute the next instruction */ - Fast486StepInto(&EmulatorContext); -} - -VOID EmulatorSimulate(VOID) -{ - if (CpuCallLevel > MaxCpuCallLevel) - { - DisplayMessage(L"Too many CPU levels of recursion (%d, expected maximum %d)", - CpuCallLevel, MaxCpuCallLevel); - - /* Stop the VDM */ - EmulatorTerminate(); - return; - } - CpuCallLevel++; - - CpuSimulate = TRUE; - while (VdmRunning && CpuSimulate) ClockUpdate(); - - CpuCallLevel--; - if (CpuCallLevel < 0) CpuCallLevel = 0; - - /* This takes into account for reentrance */ - CpuSimulate = TRUE; -} - -VOID EmulatorUnsimulate(VOID) -{ - /* Stop simulation */ - CpuSimulate = FALSE; -} - VOID EmulatorTerminate(VOID) { /* Stop the VDM */ @@ -248,11 +199,6 @@ { DPRINT1("NTVDM: BOP_DEBUGGER\n"); DebugBreak(); -} - -static VOID WINAPI EmulatorUnsimulateBop(LPWORD Stack) -{ - EmulatorUnsimulate(); } static BYTE WINAPI Port61hRead(ULONG Port) @@ -559,6 +505,8 @@ /* Initialize I/O ports */ /* Initialize RAM */ + /* Initialize the CPU */ + /* Initialize the internal clock */ if (!ClockInitialize()) { @@ -567,15 +515,16 @@ } /* Initialize the CPU */ - Fast486Initialize(&EmulatorContext, - EmulatorReadMemory, - EmulatorWriteMemory, - EmulatorReadIo, - EmulatorWriteIo, - NULL, - EmulatorBiosOperation, - EmulatorIntAcknowledge, - NULL /* TODO: Use a TLB */); + CpuInitialize(); + // Fast486Initialize(&EmulatorContext, + // EmulatorReadMemory, + // EmulatorWriteMemory, + // EmulatorReadIo, + // EmulatorWriteIo, + // NULL, + // EmulatorBiosOperation, + // EmulatorIntAcknowledge, + // NULL /* TODO: Use a TLB */); /* Initialize DMA */ @@ -626,9 +575,9 @@ } /* Initialize the software callback system and register the emulator BOPs */ - InitializeCallbacks(); + InitializeInt32(); RegisterBop(BOP_DEBUGGER , EmulatorDebugBreakBop); - RegisterBop(BOP_UNSIMULATE, EmulatorUnsimulateBop); + // RegisterBop(BOP_UNSIMULATE, CpuUnsimulateBop); /* Initialize VDD support */ VDDSupInitialize(); @@ -651,7 +600,7 @@ // PitCleanup(); // PicCleanup(); - // Fast486Cleanup(); + CpuCleanup(); /* Free the memory allocated for the 16-bit address space */ if (BaseAddress != NULL) HeapFree(GetProcessHeap(), 0, BaseAddress); @@ -663,7 +612,7 @@ WINAPI VDDSimulate16(VOID) { - EmulatorSimulate(); + CpuSimulate(); } VOID Modified: trunk/reactos/subsystems/ntvdm/emulator.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/emulator.…
============================================================================== --- trunk/reactos/subsystems/ntvdm/emulator.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/emulator.h [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -15,35 +15,6 @@ #include <fast486.h> /* DEFINES ********************************************************************/ - -/* FLAGS */ -#define EMULATOR_FLAG_CF (1 << 0) -#define EMULATOR_FLAG_PF (1 << 2) -#define EMULATOR_FLAG_AF (1 << 4) -#define EMULATOR_FLAG_ZF (1 << 6) -#define EMULATOR_FLAG_SF (1 << 7) -#define EMULATOR_FLAG_TF (1 << 8) -#define EMULATOR_FLAG_IF (1 << 9) -#define EMULATOR_FLAG_DF (1 << 10) -#define EMULATOR_FLAG_OF (1 << 11) -#define EMULATOR_FLAG_NT (1 << 14) -#define EMULATOR_FLAG_RF (1 << 16) -#define EMULATOR_FLAG_VM (1 << 17) -#define EMULATOR_FLAG_AC (1 << 18) -#define EMULATOR_FLAG_VIF (1 << 19) -#define EMULATOR_FLAG_VIP (1 << 20) -#define EMULATOR_FLAG_ID (1 << 21) - -// -// WARNING WARNING!! -// If you're changing the indices here, you then need to -// also fix the BOP code in callback.c !!!!!!!!!!!!!!!!! -// -#define STACK_INT_NUM 0 -#define STACK_IP 1 -#define STACK_CS 2 -#define STACK_FLAGS 3 - /* Basic Memory Management */ #define MEM_ALIGN_UP(ptr, align) MEM_ALIGN_DOWN((ULONG_PTR)(ptr) + (align) - 1l, (align)) @@ -92,7 +63,7 @@ EMULATOR_EXCEPTION_PAGE_FAULT }; -extern FAST486_STATE EmulatorContext; +// extern FAST486_STATE EmulatorContext; extern LPVOID BaseAddress; extern BOOLEAN VdmRunning; @@ -123,10 +94,6 @@ VOID EmulatorException(BYTE ExceptionNumber, LPWORD Stack); -VOID EmulatorExecute(WORD Segment, WORD Offset); -VOID EmulatorStep(VOID); -VOID EmulatorSimulate(VOID); -VOID EmulatorUnsimulate(VOID); VOID EmulatorTerminate(VOID); VOID EmulatorInterrupt(BYTE Number); Modified: trunk/reactos/subsystems/ntvdm/int32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/int32.c?r…
============================================================================== --- trunk/reactos/subsystems/ntvdm/int32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/int32.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -14,25 +14,55 @@ #include "emulator.h" #include "int32.h" -#include "bop.h" +#include "cpu/bop.h" +#include <isvbop.h> /* PRIVATE VARIABLES **********************************************************/ /* * This is the list of registered 32-bit Interrupt handlers. */ -EMULATOR_INT32_PROC Int32Proc[EMULATOR_MAX_INT32_NUM] = { NULL }; +static EMULATOR_INT32_PROC Int32Proc[EMULATOR_MAX_INT32_NUM] = { NULL }; /* BOP Identifiers */ #define BOP_CONTROL 0xFF // Control BOP Handler #define BOP_CONTROL_DEFFUNC 0x00 // Default Control BOP Function + #define BOP_CONTROL_INT32 0xFF // 32-bit Interrupt dispatcher -/* 32-bit Interrupt dispatcher function code for the Control BOP Handler */ -#define BOP_CONTROL_INT32 0xFF +#define INT16_TRAMPOLINE_SIZE sizeof(ULONGLONG) // == TRAMPOLINE_SIZE + +/* 16-bit generic interrupt code for calling a 32-bit interrupt handler */ +static BYTE Int16To32[] = +{ + 0xFA, // cli + + /* Push the value of the interrupt to be called */ + 0x6A, 0xFF, // push i (patchable to 0x6A, 0xIntNum) + + /* The BOP Sequence */ +// BOP_SEQ: + 0xF8, // clc + BOP(BOP_CONTROL), // Control BOP + BOP_CONTROL_INT32, // 32-bit Interrupt dispatcher + + 0x73, 0x04, // jnc EXIT (offset +4) + + 0xFB, // sti + + // HACK: The following instruction should be HLT! + 0x90, // nop + + 0xEB, 0xF5, // jmp BOP_SEQ (offset -11) + +// EXIT: + 0x44, 0x44, // inc sp, inc sp + 0xCF, // iret +}; +const ULONG Int16To32StubSize = sizeof(Int16To32); /* PUBLIC FUNCTIONS ***********************************************************/ -VOID WINAPI Int32Dispatch(LPWORD Stack) +static VOID WINAPI Int32Dispatch(LPWORD Stack) { /* Get the interrupt number */ BYTE IntNum = LOBYTE(Stack[STACK_INT_NUM]); @@ -41,88 +71,127 @@ if (Int32Proc[IntNum] != NULL) Int32Proc[IntNum](Stack); else - DPRINT("Unhandled 32-bit interrupt: 0x%02X, AX = 0x%04X\n", IntNum, getAX()); + DPRINT1("Unhandled 32-bit interrupt: 0x%02X, AX = 0x%04X\n", IntNum, getAX()); } -VOID WINAPI ControlBop(LPWORD Stack) +static VOID WINAPI ControlBop(LPWORD Stack) { /* Get the Function Number and skip it */ BYTE FuncNum = *(PBYTE)SEG_OFF_TO_PTR(getCS(), getIP()); setIP(getIP() + 1); - if (FuncNum == BOP_CONTROL_INT32) - Int32Dispatch(Stack); - else - DPRINT("Unassigned Control BOP Function: 0x%02X\n", FuncNum); + switch (FuncNum) + { + case BOP_CONTROL_INT32: + Int32Dispatch(Stack); + break; + + default: + // DPRINT1("Unassigned Control BOP Function: 0x%02X\n", FuncNum); + DisplayMessage(L"Unassigned Control BOP Function: 0x%02X", FuncNum); + break; + } } -VOID InitializeInt32(WORD BiosSegment) +ULONG +RegisterInt16(IN ULONG FarPtr, + IN BYTE IntNumber, + IN LPBYTE CallbackCode, + IN SIZE_T CallbackSize, + OUT PSIZE_T CodeSize OPTIONAL) { - // - // WARNING WARNING!! - // - // If you modify the code stubs here, think also - // about updating them in callback.c too!! - // + /* Get a pointer to the IVT and set the corresponding entry (far pointer) */ + LPDWORD IntVecTable = (LPDWORD)SEG_OFF_TO_PTR(0x0000, 0x0000); + IntVecTable[IntNumber] = FarPtr; - LPDWORD IntVecTable = (LPDWORD)BaseAddress; - LPBYTE BiosCode = (LPBYTE)SEG_OFF_TO_PTR(BiosSegment, 0); - USHORT i; - WORD BopSeqOffset, Offset = 0; + /* Register the 16-bit callback */ + return RegisterCallback16(FarPtr, + CallbackCode, + CallbackSize, + CodeSize); +} - /* Generate ISR stubs and fill the IVT */ - for (i = 0x00; i <= 0xFF; i++) +ULONG +RegisterInt32(IN ULONG FarPtr, + IN BYTE IntNumber, + IN EMULATOR_INT32_PROC IntHandler, + OUT PSIZE_T CodeSize OPTIONAL) +{ + /* Array for holding our copy of the 16-bit interrupt callback */ + BYTE IntCallback[sizeof(Int16To32)/sizeof(BYTE)]; + + /* Check whether the 32-bit interrupt was already registered */ +#if 0 + if (Int32Proc[IntNumber] != NULL) { - Offset = INT_HANDLER_OFFSET + (i << 4); - IntVecTable[i] = MAKELONG(Offset, BiosSegment); + DPRINT1("RegisterInt32: Interrupt 0x%02X already registered!\n", IntNumber); + return 0; + } +#endif - BiosCode[Offset++] = 0xFA; // cli + /* Register the 32-bit interrupt handler */ + Int32Proc[IntNumber] = IntHandler; - BiosCode[Offset++] = 0x6A; // push i - BiosCode[Offset++] = (UCHAR)i; + /* Copy the generic 16-bit interrupt callback and patch it */ + RtlCopyMemory(IntCallback, Int16To32, sizeof(Int16To32)); + IntCallback[2] = IntNumber; - BopSeqOffset = COMMON_STUB_OFFSET - (Offset + 3); + /* Register the 16-bit interrupt callback */ + return RegisterInt16(FarPtr, + IntNumber, + IntCallback, + sizeof(IntCallback), + CodeSize); +} - BiosCode[Offset++] = 0xE9; // jmp near BOP_SEQ - BiosCode[Offset++] = LOBYTE(BopSeqOffset); - BiosCode[Offset++] = HIBYTE(BopSeqOffset); +VOID +Int32Call(IN PCALLBACK16 Context, + IN BYTE IntNumber) +{ + /* + * TODO: This function has almost the same code as RunCallback16. + * Something that may be nice is to have a common interface to + * build the trampoline... + */ + + PUCHAR TrampolineBase = (PUCHAR)FAR_POINTER(Context->TrampolineFarPtr); + PUCHAR Trampoline = TrampolineBase; + UCHAR OldTrampoline[INT16_TRAMPOLINE_SIZE]; + + DPRINT("Int32Call(0x%02X)\n", IntNumber); + + ASSERT(Context->TrampolineSize == INT16_TRAMPOLINE_SIZE); + + /* Save the old trampoline */ + ((PULONGLONG)&OldTrampoline)[0] = ((PULONGLONG)TrampolineBase)[0]; + + /* Build the generic entry-point for 16-bit calls */ + if (IntNumber == 0x03) + { + /* We are redefining for INT 03h */ + *Trampoline++ = 0xCC; // Call INT 03h + /** *Trampoline++ = 0x90; // nop **/ } + else + { + /* Normal interrupt */ + *Trampoline++ = 0xCD; // Call INT XXh + *Trampoline++ = IntNumber; + } + UnSimulate16(Trampoline); - /* Write the common stub code */ - Offset = COMMON_STUB_OFFSET; + /* Perform the call */ + Call16(HIWORD(Context->TrampolineFarPtr), + LOWORD(Context->TrampolineFarPtr)); -// BOP_SEQ: - BiosCode[Offset++] = 0xF8; // clc + /* Restore the old trampoline */ + ((PULONGLONG)TrampolineBase)[0] = ((PULONGLONG)&OldTrampoline)[0]; +} - BiosCode[Offset++] = LOBYTE(EMULATOR_BOP); // BOP sequence - BiosCode[Offset++] = HIBYTE(EMULATOR_BOP); - BiosCode[Offset++] = BOP_CONTROL; // Control BOP - BiosCode[Offset++] = BOP_CONTROL_INT32; // 32-bit Interrupt dispatcher - - BiosCode[Offset++] = 0x73; // jnc EXIT (offset +4) - BiosCode[Offset++] = 0x04; - - BiosCode[Offset++] = 0xFB; // sti - - // HACK: The following instruction should be HLT! - BiosCode[Offset++] = 0x90; // nop - - BiosCode[Offset++] = 0xEB; // jmp BOP_SEQ (offset -11) - BiosCode[Offset++] = 0xF5; - -// EXIT: - BiosCode[Offset++] = 0x44; // inc sp - BiosCode[Offset++] = 0x44; // inc sp - - BiosCode[Offset++] = 0xCF; // iret - +VOID InitializeInt32(VOID) +{ /* Register the Control BOP */ RegisterBop(BOP_CONTROL, ControlBop); } -VOID RegisterInt32(BYTE IntNumber, EMULATOR_INT32_PROC IntHandler) -{ - Int32Proc[IntNumber] = IntHandler; -} - /* EOF */ Modified: trunk/reactos/subsystems/ntvdm/int32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/int32.h?r…
============================================================================== --- trunk/reactos/subsystems/ntvdm/int32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/int32.h [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -10,21 +10,39 @@ #ifndef _INT32_H_ #define _INT32_H_ +/* INCLUDES *******************************************************************/ + +#include "cpu/callback.h" + /* DEFINES ********************************************************************/ /* 32-bit Interrupt Identifiers */ #define EMULATOR_MAX_INT32_NUM 0xFF + 1 -#define INT_HANDLER_OFFSET 0x1000 -#define COMMON_STUB_OFFSET 0x2000 +extern const ULONG Int16To32StubSize; /* FUNCTIONS ******************************************************************/ typedef VOID (WINAPI *EMULATOR_INT32_PROC)(LPWORD Stack); -VOID WINAPI Int32Dispatch(LPWORD Stack); -VOID InitializeInt32(WORD BiosSegment); -VOID RegisterInt32(BYTE IntNumber, EMULATOR_INT32_PROC IntHandler); +ULONG +RegisterInt16(IN ULONG FarPtr, + IN BYTE IntNumber, + IN LPBYTE CallbackCode, + IN SIZE_T CallbackSize, + OUT PSIZE_T CodeSize OPTIONAL); + +ULONG +RegisterInt32(IN ULONG FarPtr, + IN BYTE IntNumber, + IN EMULATOR_INT32_PROC IntHandler, + OUT PSIZE_T CodeSize OPTIONAL); + +VOID +Int32Call(IN PCALLBACK16 Context, + IN BYTE IntNumber); + +VOID InitializeInt32(VOID); #endif // _INT32_H_ Modified: trunk/reactos/subsystems/ntvdm/registers.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/registers…
============================================================================== --- trunk/reactos/subsystems/ntvdm/registers.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/registers.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -11,23 +11,9 @@ #define NDEBUG #include "emulator.h" +#include "cpu/cpu.h" /* PUBLIC FUNCTIONS ***********************************************************/ - -static inline BOOLEAN EmulatorGetFlag(ULONG Flag) -{ - return (EmulatorContext.Flags.Long & Flag) ? TRUE : FALSE; -} - -static inline VOID EmulatorSetFlag(ULONG Flag) -{ - EmulatorContext.Flags.Long |= Flag; -} - -static inline VOID EmulatorClearFlag(ULONG Flag) -{ - EmulatorContext.Flags.Long &= ~Flag; -} VOID EmulatorSetStack(WORD Segment, DWORD Offset) { @@ -405,7 +391,7 @@ WINAPI setEIP(ULONG Value) { - EmulatorExecute(getCS(), Value); + CpuExecute(getCS(), Value); } USHORT @@ -419,7 +405,7 @@ WINAPI setIP(USHORT Value) { - EmulatorExecute(getCS(), Value); + CpuExecute(getCS(), Value); } @@ -514,136 +500,112 @@ WINAPI getCF(VOID) { - return EmulatorGetFlag(EMULATOR_FLAG_CF); + return EmulatorContext.Flags.Cf; } VOID WINAPI setCF(ULONG Flag) { - if (Flag & 1) - EmulatorSetFlag(EMULATOR_FLAG_CF); - else - EmulatorClearFlag(EMULATOR_FLAG_CF); + EmulatorContext.Flags.Cf = !!(Flag & 1); } ULONG WINAPI getPF(VOID) { - return EmulatorGetFlag(EMULATOR_FLAG_PF); + return EmulatorContext.Flags.Pf; } VOID WINAPI setPF(ULONG Flag) { - if (Flag & 1) - EmulatorSetFlag(EMULATOR_FLAG_PF); - else - EmulatorClearFlag(EMULATOR_FLAG_PF); + EmulatorContext.Flags.Pf = !!(Flag & 1); } ULONG WINAPI getAF(VOID) { - return EmulatorGetFlag(EMULATOR_FLAG_AF); + return EmulatorContext.Flags.Af; } VOID WINAPI setAF(ULONG Flag) { - if (Flag & 1) - EmulatorSetFlag(EMULATOR_FLAG_AF); - else - EmulatorClearFlag(EMULATOR_FLAG_AF); + EmulatorContext.Flags.Af = !!(Flag & 1); } ULONG WINAPI getZF(VOID) { - return EmulatorGetFlag(EMULATOR_FLAG_ZF); + return EmulatorContext.Flags.Zf; } VOID WINAPI setZF(ULONG Flag) { - if (Flag & 1) - EmulatorSetFlag(EMULATOR_FLAG_ZF); - else - EmulatorClearFlag(EMULATOR_FLAG_ZF); + EmulatorContext.Flags.Zf = !!(Flag & 1); } ULONG WINAPI getSF(VOID) { - return EmulatorGetFlag(EMULATOR_FLAG_SF); + return EmulatorContext.Flags.Sf; } VOID WINAPI setSF(ULONG Flag) { - if (Flag & 1) - EmulatorSetFlag(EMULATOR_FLAG_SF); - else - EmulatorClearFlag(EMULATOR_FLAG_SF); + EmulatorContext.Flags.Sf = !!(Flag & 1); } ULONG WINAPI getIF(VOID) { - return EmulatorGetFlag(EMULATOR_FLAG_IF); + return EmulatorContext.Flags.If; } VOID WINAPI setIF(ULONG Flag) { - if (Flag & 1) - EmulatorSetFlag(EMULATOR_FLAG_IF); - else - EmulatorClearFlag(EMULATOR_FLAG_IF); + EmulatorContext.Flags.If = !!(Flag & 1); } ULONG WINAPI getDF(VOID) { - return EmulatorGetFlag(EMULATOR_FLAG_DF); + return EmulatorContext.Flags.Df; } VOID WINAPI setDF(ULONG Flag) { - if (Flag & 1) - EmulatorSetFlag(EMULATOR_FLAG_DF); - else - EmulatorClearFlag(EMULATOR_FLAG_DF); + EmulatorContext.Flags.Df = !!(Flag & 1); } ULONG WINAPI getOF(VOID) { - return EmulatorGetFlag(EMULATOR_FLAG_OF); + return EmulatorContext.Flags.Of; } VOID WINAPI setOF(ULONG Flag) { - if (Flag & 1) - EmulatorSetFlag(EMULATOR_FLAG_OF); - else - EmulatorClearFlag(EMULATOR_FLAG_OF); + EmulatorContext.Flags.Of = !!(Flag & 1); } Modified: trunk/reactos/subsystems/ntvdm/vddsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/vddsup.c?…
============================================================================== --- trunk/reactos/subsystems/ntvdm/vddsup.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/vddsup.c [iso-8859-1] Tue Sep 30 23:47:23 2014 @@ -13,8 +13,7 @@ #include "emulator.h" #include "vddsup.h" -#include "bop.h" - +#include "cpu/bop.h" #include <isvbop.h> typedef VOID (WINAPI *VDD_PROC)(VOID);
10 years, 2 months
1
0
0
0
[aandrejevic] 64428: [FAST486] Apparently MOVS, LODS, STOS, INS and OUTS can also take REPNZ as a prefix.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Tue Sep 30 22:18:41 2014 New Revision: 64428 URL:
http://svn.reactos.org/svn/reactos?rev=64428&view=rev
Log: [FAST486] Apparently MOVS, LODS, STOS, INS and OUTS can also take REPNZ as a prefix. Modified: trunk/reactos/lib/fast486/opcodes.c Modified: trunk/reactos/lib/fast486/opcodes.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opcodes.c?rev=…
============================================================================== --- trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] Tue Sep 30 22:18:41 2014 @@ -5469,7 +5469,7 @@ Segment = State->SegmentOverride; } - if (State->PrefixFlags & FAST486_PREFIX_REP) + if (State->PrefixFlags & (FAST486_PREFIX_REP | FAST486_PREFIX_REPNZ)) { if ((AddressSize && (State->GeneralRegs[FAST486_REG_ECX].Long == 0)) || (!AddressSize && (State->GeneralRegs[FAST486_REG_ECX].LowWord == 0))) @@ -5537,7 +5537,7 @@ } // FIXME: This method is slow! - if (State->PrefixFlags & FAST486_PREFIX_REP) + if (State->PrefixFlags & (FAST486_PREFIX_REP | FAST486_PREFIX_REPNZ)) { if (AddressSize) { @@ -5727,7 +5727,7 @@ if (Opcode == 0xAA) DataSize = sizeof(UCHAR); else DataSize = OperandSize ? sizeof(ULONG) : sizeof(USHORT); - if (State->PrefixFlags & FAST486_PREFIX_REP) + if (State->PrefixFlags & (FAST486_PREFIX_REP | FAST486_PREFIX_REPNZ)) { UCHAR Block[STRING_BLOCK_SIZE]; ULONG Count = AddressSize ? State->GeneralRegs[FAST486_REG_ECX].Long @@ -5870,7 +5870,7 @@ if (Opcode == 0xAC) DataSize = sizeof(UCHAR); else DataSize = OperandSize ? sizeof(ULONG) : sizeof(USHORT); - if (State->PrefixFlags & FAST486_PREFIX_REP) + if (State->PrefixFlags & (FAST486_PREFIX_REP | FAST486_PREFIX_REPNZ)) { ULONG Count = AddressSize ? State->GeneralRegs[FAST486_REG_ECX].Long : State->GeneralRegs[FAST486_REG_ECX].LowWord; @@ -6056,7 +6056,7 @@ if (Opcode == 0x6C) DataSize = sizeof(UCHAR); else DataSize = OperandSize ? sizeof(ULONG) : sizeof(USHORT); - if (State->PrefixFlags & FAST486_PREFIX_REP) + if (State->PrefixFlags & (FAST486_PREFIX_REP | FAST486_PREFIX_REPNZ)) { UCHAR Block[STRING_BLOCK_SIZE]; ULONG Count = AddressSize ? State->GeneralRegs[FAST486_REG_ECX].Long @@ -6197,7 +6197,7 @@ if (Opcode == 0x6E) DataSize = sizeof(UCHAR); else DataSize = OperandSize ? sizeof(ULONG) : sizeof(USHORT); - if (State->PrefixFlags & FAST486_PREFIX_REP) + if (State->PrefixFlags & (FAST486_PREFIX_REP | FAST486_PREFIX_REPNZ)) { UCHAR Block[STRING_BLOCK_SIZE]; ULONG Count = AddressSize ? State->GeneralRegs[FAST486_REG_ECX].Long
10 years, 2 months
1
0
0
0
[jgardou] 64427: [ADVAPI32] - Centralize RegDeleteKey[Ex]{A, W} implementation into RegDeleteKeyExW - Update the HKCR wrapper accordingly. CORE-8582
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Sep 30 22:05:50 2014 New Revision: 64427 URL:
http://svn.reactos.org/svn/reactos?rev=64427&view=rev
Log: [ADVAPI32] - Centralize RegDeleteKey[Ex]{A,W} implementation into RegDeleteKeyExW - Update the HKCR wrapper accordingly. CORE-8582 Modified: trunk/reactos/dll/win32/advapi32/reg/hkcr.c trunk/reactos/dll/win32/advapi32/reg/reg.c trunk/reactos/dll/win32/advapi32/reg/reg.h Modified: trunk/reactos/dll/win32/advapi32/reg/hkcr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/hkc…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/hkcr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/hkcr.c [iso-8859-1] Tue Sep 30 22:05:50 2014 @@ -272,7 +272,9 @@ WINAPI DeleteHKCRKey( _In_ HKEY hKey, - _In_ LPCWSTR lpSubKey) + _In_ LPCWSTR lpSubKey, + _In_ REGSAM RegSam, + _In_ DWORD Reserved) { HKEY QueriedKey; LONG ErrorCode; @@ -287,7 +289,7 @@ if (ErrorCode == ERROR_FILE_NOT_FOUND) { /* The key doesn't exist on HKCU side, no chance for a subkey */ - return RegDeleteKeyW(hKey, lpSubKey); + return RegDeleteKeyExW(hKey, lpSubKey, RegSam, Reserved); } if (ErrorCode != ERROR_SUCCESS) @@ -296,7 +298,7 @@ return ErrorCode; } - ErrorCode = RegDeleteKeyW(QueriedKey, lpSubKey); + ErrorCode = RegDeleteKeyExW(QueriedKey, lpSubKey, RegSam, Reserved); /* Close it if we must */ if (QueriedKey != hKey) @@ -317,7 +319,7 @@ return ErrorCode; } - ErrorCode = RegDeleteKeyW(QueriedKey, lpSubKey); + ErrorCode = RegDeleteKeyExW(QueriedKey, lpSubKey, RegSam, Reserved); /* Close it if we must */ if (QueriedKey != hKey) Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] Tue Sep 30 22:05:50 2014 @@ -1181,16 +1181,50 @@ * * @implemented */ -LONG WINAPI -RegDeleteKeyA(HKEY hKey, - LPCSTR lpSubKey) +LONG +WINAPI +RegDeleteKeyA( + _In_ HKEY hKey, + _In_ LPCSTR lpSubKey) +{ + return RegDeleteKeyExA(hKey, lpSubKey, 0, 0); +} + + +/************************************************************************ + * RegDeleteKeyW + * + * @implemented + */ +LONG +WINAPI +RegDeleteKeyW( + _In_ HKEY hKey, + _In_ LPCWSTR lpSubKey) +{ + return RegDeleteKeyExW(hKey, lpSubKey, 0, 0); +} + + +/************************************************************************ + * RegDeleteKeyExA + * + * @implemented + */ +LONG +WINAPI +RegDeleteKeyExA( + _In_ HKEY hKey, + _In_ LPCSTR lpSubKey, + _In_ REGSAM samDesired, + _In_ DWORD Reserved) { LONG ErrorCode; UNICODE_STRING SubKeyName; RtlCreateUnicodeStringFromAsciiz(&SubKeyName, (LPSTR)lpSubKey); - ErrorCode = RegDeleteKeyW(hKey, SubKeyName.Buffer); + ErrorCode = RegDeleteKeyExW(hKey, SubKeyName.Buffer, samDesired, Reserved); RtlFreeUnicodeString(&SubKeyName); @@ -1199,13 +1233,17 @@ /************************************************************************ - * RegDeleteKeyW - * - * @implemented - */ -LONG WINAPI -RegDeleteKeyW(HKEY hKey, - LPCWSTR lpSubKey) + * RegDeleteKeyExW + * + * @implemented + */ +LONG +WINAPI +RegDeleteKeyExW( + _In_ HKEY hKey, + _In_ LPCWSTR lpSubKey, + _In_ REGSAM samDesired, + _In_ DWORD Reserved) { OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING SubKeyName; @@ -1228,139 +1266,7 @@ } if (IsHKCRKey(ParentKey)) - return DeleteHKCRKey(ParentKey, lpSubKey); - - RtlInitUnicodeString(&SubKeyName, - (LPWSTR)lpSubKey); - InitializeObjectAttributes(&ObjectAttributes, - &SubKeyName, - OBJ_CASE_INSENSITIVE, - ParentKey, - NULL); - Status = NtOpenKey(&TargetKey, - DELETE, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - goto Cleanup; - } - - Status = NtDeleteKey(TargetKey); - NtClose(TargetKey); - -Cleanup: - ClosePredefKey(ParentKey); - - if (!NT_SUCCESS(Status)) - { - return RtlNtStatusToDosError(Status); - } - - return ERROR_SUCCESS; -} - - -/************************************************************************ - * RegDeleteKeyExA - * - * @implemented - */ -LONG -WINAPI -RegDeleteKeyExA(HKEY hKey, - LPCSTR lpSubKey, - REGSAM samDesired, - DWORD Reserved) -{ - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING SubKeyName; - HANDLE ParentKey; - HANDLE TargetKey; - NTSTATUS Status; - - /* Make sure we got a subkey */ - if (!lpSubKey) - { - /* Fail */ - return ERROR_INVALID_PARAMETER; - } - - Status = MapDefaultKey(&ParentKey, - hKey); - if (!NT_SUCCESS(Status)) - { - return RtlNtStatusToDosError(Status); - } - - if (samDesired & KEY_WOW64_32KEY) - ERR("Wow64 not yet supported!\n"); - - if (samDesired & KEY_WOW64_64KEY) - ERR("Wow64 not yet supported!\n"); - - RtlCreateUnicodeStringFromAsciiz(&SubKeyName, - (LPSTR)lpSubKey); - InitializeObjectAttributes(&ObjectAttributes, - &SubKeyName, - OBJ_CASE_INSENSITIVE, - ParentKey, - NULL); - - Status = NtOpenKey(&TargetKey, - DELETE, - &ObjectAttributes); - RtlFreeUnicodeString(&SubKeyName); - if (!NT_SUCCESS(Status)) - { - goto Cleanup; - } - - Status = NtDeleteKey(TargetKey); - NtClose (TargetKey); - -Cleanup: - ClosePredefKey(ParentKey); - - if (!NT_SUCCESS(Status)) - { - return RtlNtStatusToDosError(Status); - } - - return ERROR_SUCCESS; -} - - -/************************************************************************ - * RegDeleteKeyExW - * - * @implemented - */ -LONG -WINAPI -RegDeleteKeyExW(HKEY hKey, - LPCWSTR lpSubKey, - REGSAM samDesired, - DWORD Reserved) -{ - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING SubKeyName; - HANDLE ParentKey; - HANDLE TargetKey; - NTSTATUS Status; - - /* Make sure we got a subkey */ - if (!lpSubKey) - { - /* Fail */ - return ERROR_INVALID_PARAMETER; - } - - Status = MapDefaultKey(&ParentKey, - hKey); - if (!NT_SUCCESS(Status)) - { - return RtlNtStatusToDosError(Status); - } + return DeleteHKCRKey(ParentKey, lpSubKey, samDesired, Reserved); if (samDesired & KEY_WOW64_32KEY) ERR("Wow64 not yet supported!\n"); Modified: trunk/reactos/dll/win32/advapi32/reg/reg.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/reg.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/reg.h [iso-8859-1] Tue Sep 30 22:05:50 2014 @@ -35,5 +35,7 @@ WINAPI DeleteHKCRKey( _In_ HKEY hKey, - _In_ LPCWSTR lpSubKey); + _In_ LPCWSTR lpSubKey, + _In_ REGSAM RegSam, + _In_ DWORD Reserved);
10 years, 2 months
1
0
0
0
[tkreuzer] 64426: [WIN32K] Implement DC_bIsBitmapCompatible() helper function and use it in NtGdiSelectBitmap. Will be reused later. [SPEC2DEF] Improve formatting
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Sep 30 21:13:57 2014 New Revision: 64426 URL:
http://svn.reactos.org/svn/reactos?rev=64426&view=rev
Log: [WIN32K] Implement DC_bIsBitmapCompatible() helper function and use it in NtGdiSelectBitmap. Will be reused later. [SPEC2DEF] Improve formatting Modified: trunk/reactos/tools/spec2def/spec2def.c trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c Modified: trunk/reactos/tools/spec2def/spec2def.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/spec2def/spec2def.c?…
============================================================================== --- trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] (original) +++ trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] Tue Sep 30 21:13:57 2014 @@ -604,7 +604,8 @@ /* C++ stubs are forwarded to C stubs */ fprintf(fileDest, "=stub_function%d", pexp->nNumber); } - else if (gbTracing && ((pexp->uFlags & FL_NORELAY) == 0) && (pexp->nCallingConvention == CC_STDCALL) && + else if (gbTracing && ((pexp->uFlags & FL_NORELAY) == 0) && + (pexp->nCallingConvention == CC_STDCALL) && (pexp->strName.buf[0] != '?')) { /* Redirect it to the relay-tracing trampoline */ Modified: trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] Tue Sep 30 21:13:57 2014 @@ -318,6 +318,28 @@ return hOrgPen; } +BOOL +NTAPI +DC_bIsBitmapCompatible(PDC pdc, PSURFACE psurf) +{ + ULONG cBitsPixel; + + /* Must be an API bitmap */ + if (!(psurf->flags & API_BITMAP)) return FALSE; + + /* DIB sections are always compatible */ + if (psurf->hSecure != NULL) return TRUE; + + /* Get the bit depth of the bitmap */ + cBitsPixel = gajBitsPerFormat[psurf->SurfObj.iBitmapFormat]; + + /* 1 BPP is compatible */ + if ((cBitsPixel == 1) || (cBitsPixel == pdc->ppdev->gdiinfo.cBitsPixel)) + return TRUE; + + return FALSE; +} + /* * @implemented */ @@ -332,7 +354,6 @@ PSURFACE psurfNew, psurfOld; PREGION VisRgn; HDC hdcOld; - ULONG cBitsPixel; ASSERT_NOGDILOCKS(); /* Verify parameters */ @@ -395,10 +416,7 @@ } /* Check if the bitmap is compatile with the dc */ - cBitsPixel = gajBitsPerFormat[psurfNew->SurfObj.iBitmapFormat]; - if ((cBitsPixel != 1) && - (cBitsPixel != pdc->ppdev->gdiinfo.cBitsPixel) && - (psurfNew->hSecure == NULL)) + if (!DC_bIsBitmapCompatible(pdc, psurfNew)) { /* Dereference the bitmap, unlock the DC and fail. */ SURFACE_ShareUnlockSurface(psurfNew);
10 years, 2 months
1
0
0
0
[tkreuzer] 64425: [CRT_APITEST] Fix some tests based on Windows 2003 SP1 behavior. Patch by Victor Martinez.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Sep 30 21:10:15 2014 New Revision: 64425 URL:
http://svn.reactos.org/svn/reactos?rev=64425&view=rev
Log: [CRT_APITEST] Fix some tests based on Windows 2003 SP1 behavior. Patch by Victor Martinez. Modified: trunk/rostests/apitests/crt/_vsnprintf.c trunk/rostests/apitests/crt/_vsnwprintf.c Modified: trunk/rostests/apitests/crt/_vsnprintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/_vsnprintf.c…
============================================================================== --- trunk/rostests/apitests/crt/_vsnprintf.c [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/_vsnprintf.c [iso-8859-1] Tue Sep 30 21:10:15 2014 @@ -31,37 +31,54 @@ call_varargs(buffer, 255, 12, "%S world!", L"hello"); call_varargs(buffer, 255, 12, "%s world!", "hello"); call_varargs(buffer, 255, 11, "%u cookies", 100); - /* This is how WINE implements _vcsprintf, and they are obviously wrong */ + StartSeh() +#if defined(TEST_CRTDLL)||defined(TEST_USER32) call_varargs(NULL, INT_MAX, -1, "%s it really work?", "does"); -#if defined(TEST_CRTDLL) || defined(TEST_USER32) +#else + call_varargs(NULL, INT_MAX, 20, "%s it really work?", "does"); +#endif + +#if defined(TEST_CRTDLL)||defined(TEST_USER32) EndSeh(STATUS_ACCESS_VIOLATION); #else EndSeh(STATUS_SUCCESS); #endif -#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + +#if defined(TEST_USER32) /* NTDLL doesn't use/set errno */ ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); +#else + ok(errno == 0, "Expected 0, got %u \n", errno); #endif + /* This one is no better */ StartSeh() +#if defined(TEST_CRTDLL)||defined(TEST_USER32) call_varargs(NULL, 0, -1, "%s it really work?", "does"); -#if defined(TEST_CRTDLL) || defined(TEST_USER32) +#else + call_varargs(NULL, 0, 20, "%s it really work?", "does"); +#endif + +#if defined(TEST_USER32) EndSeh(STATUS_ACCESS_VIOLATION); -#else +#else EndSeh(STATUS_SUCCESS); #endif -#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + +#if defined(TEST_USER32) /* NTDLL doesn't use/set errno */ ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); +#else + ok(errno == 0, "Expected 0, got %u \n", errno); #endif + /* One more NULL checks */ StartSeh() call_varargs(buffer, 255, -1, NULL); -#if defined(TEST_CRTDLL) EndSeh(STATUS_ACCESS_VIOLATION); + +#if defined(TEST_USER32) /* NTDLL doesn't use/set errno */ + ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); #else - EndSeh(STATUS_SUCCESS); -#endif -#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ - ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); + ok(errno == 0, "Expected 0, got %u \n", errno); #endif } Modified: trunk/rostests/apitests/crt/_vsnwprintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/_vsnwprintf.…
============================================================================== --- trunk/rostests/apitests/crt/_vsnwprintf.c [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/_vsnwprintf.c [iso-8859-1] Tue Sep 30 21:10:15 2014 @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS api tests * LICENSE: GPL - See COPYING in the top level directory - * PURPOSE: Test for _vsnprintf + * PURPOSE: Test for _vsnwprintf */ #include <apitest.h> @@ -28,40 +28,43 @@ wchar_t buffer[255]; /* Test basic functionality */ - call_varargs(buffer, 255, 19, L"%s world!", "hello"); + call_varargs(buffer, 255, 10, L"%s world!", "hello"); call_varargs(buffer, 255, 12, L"%s world!", L"hello"); call_varargs(buffer, 255, 11, L"%u cookies", 100); /* This is how WINE implements _vcsprintf, and they are obviously wrong */ StartSeh() +#if defined(TEST_CRTDLL) call_varargs(NULL, INT_MAX, -1, L"%s it really work?", L"does"); -#if defined(TEST_CRTDLL) +#else + call_varargs(NULL, INT_MAX, 20, L"%s it really work?", L"does"); +#endif + +#if defined(TEST_USER32) EndSeh(STATUS_ACCESS_VIOLATION); -#else +#else EndSeh(STATUS_SUCCESS); #endif -#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + +#if defined(TEST_USER32)/* NTDLL doesn't use/set errno */ ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); +#else + ok(errno == 0, "Expected 0, got %u\n", errno); #endif + /* This one is no better */ StartSeh() +#if defined(TEST_CRTDLL) call_varargs(NULL, 0, -1, L"%s it really work?", L"does"); -#if defined(TEST_CRTDLL) - EndSeh(STATUS_ACCESS_VIOLATION); -#else +#else + call_varargs(NULL, 0, 20, L"%s it really work?", L"does"); +#endif EndSeh(STATUS_SUCCESS); -#endif -#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ - ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); -#endif + ok(errno == 0, "Expected 0, got %u\n", errno); + + /* One more NULL checks */ StartSeh() call_varargs(buffer, 255, -1, NULL); -#if defined(TEST_CRTDLL) EndSeh(STATUS_ACCESS_VIOLATION); -#else - EndSeh(STATUS_SUCCESS); -#endif -#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ - ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); -#endif + ok(errno == 0, "Expected 0, got %u\n", errno); }
10 years, 2 months
1
0
0
0
[tkreuzer] 64424: [DLLEXPORT_TEST] Add a dll that imports basically everything from framedyn.dll
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Sep 30 20:52:54 2014 New Revision: 64424 URL:
http://svn.reactos.org/svn/reactos?rev=64424&view=rev
Log: [DLLEXPORT_TEST] Add a dll that imports basically everything from framedyn.dll Added: trunk/rostests/tests/dllexport/dllimport_framedyn.cpp (with props) Modified: trunk/rostests/tests/dllexport/CMakeLists.txt Modified: trunk/rostests/tests/dllexport/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/tests/dllexport/CMakeList…
============================================================================== --- trunk/rostests/tests/dllexport/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/tests/dllexport/CMakeLists.txt [iso-8859-1] Tue Sep 30 20:52:54 2014 @@ -20,3 +20,13 @@ set_module_type(dllexport_test win32cui) add_importlibs(dllexport_test dllexport_test_dll1 msvcrt kernel32 ntdll) + +if(MSVC) + add_compile_flags("/Zc:wchar_t-") +endif() + +add_executable(dllimport_test + dllimport_framedyn.cpp) +set_module_type(dllimport_test win32dll ENTRYPOINT 0) +add_importlibs(dllimport_test framedyn) +target_link_libraries(dllimport_test framedynex) Added: trunk/rostests/tests/dllexport/dllimport_framedyn.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/tests/dllexport/dllimport…
============================================================================== --- trunk/rostests/tests/dllexport/dllimport_framedyn.cpp (added) +++ trunk/rostests/tests/dllexport/dllimport_framedyn.cpp [iso-8859-1] Tue Sep 30 20:52:54 2014 @@ -0,0 +1,98 @@ + +#include <chstring.h> + +class CHString2 : CHString +{ +public: + void + UseStuff(void) + { + AllocBeforeWrite(1);// ?AllocBeforeWrite@CHString@@IAEXH@Z(long) + AllocBuffer(1);// ?AllocBuffer@CHString@@IAEXH@Z(long) + AllocCopy(*this, 1, 2, 3);// ?AllocCopy@CHString@@IBEXAAV1@HHH@Z(ptr long long long) + AllocSysString(); // ?AllocSysString@CHString@@QBEPAGXZ() + AssignCopy(1, L"test");// ?AssignCopy@CHString@@IAEXHPBG@Z(long wstr) +// ??0CHString@@QAE@ABV0@@Z(ptr) +// ??0CHString@@QAE@PBD@Z(str) +// ??0CHString@@QAE@PBE@Z(str) +// ??0CHString@@QAE@PBG@Z(wstr) +// ??0CHString@@QAE@PBGH@Z(wstr long) +// ??0CHString@@QAE@GH@Z(long long) +// ??0CHString@@QAE@XZ() + Collate(L"test");// ?Collate@CHString@@QBEHPBG@Z(wstr) + Compare(L"test");// ?Compare@CHString@@QBEHPBG@Z(wstr) + CompareNoCase(L"test");// ?CompareNoCase@CHString@@QBEHPBG@Z(wstr) + ConcatCopy(1, L"test", 2, L"data");// ?ConcatCopy@CHString@@IAEXHPBGH0@Z(long wstr long wstr) + ConcatInPlace(1, L"test");// ?ConcatInPlace@CHString@@IAEXHPBG@Z(long wstr) + CopyBeforeWrite();// ?CopyBeforeWrite@CHString@@IAEXXZ() + Empty();// ?Empty@CHString@@QAEXXZ() + Find(L"test");// ?Find@CHString@@QBEHPBG@Z(wstr) + Find(L'a');// ?Find@CHString@@QBEHG@Z(long) + FindOneOf(L"abc");// ?FindOneOf@CHString@@QBEHPBG@Z(wstr) + Format(1, 123);// ?Format@CHString@@QAAXIZZ(long long long) + Format(L"Format %x", 123);// ?Format@CHString@@QAAXPBGZZ(long wstr long) + FormatMessageW(1, 123);// ?FormatMessageW@CHString@@QAAXIZZ(long long long) + FormatMessageW(L"Format %x", 123);// ?FormatMessageW@CHString@@QAAXPBGZZ(long ptr long) + FormatV(L"Format %x", NULL);// ?FormatV@CHString@@QAEXPBGPAD@Z(wstr long) + FreeExtra();// ?FreeExtra@CHString@@QAEXXZ() + GetAllocLength();// ?GetAllocLength@CHString@@QBEHXZ() + GetAt(0);// ?GetAt@CHString@@QBEGH@Z(long) + GetBuffer(0);// ?GetBuffer@CHString@@QAEPAGH@Z(long) + GetBufferSetLength(1);// ?GetBufferSetLength@CHString@@QAEPAGH@Z(long) + (void)*(volatile int*)GetData();// ?GetData@CHString@@IBEPAUCHStringData@@XZ() + GetLength();// ?GetLength@CHString@@QBEHXZ() + Init();// ?Init@CHString@@IAEXXZ() + IsEmpty();// ?IsEmpty@CHString@@QBEHXZ() + Left(1);// ?Left@CHString@@QBE?AV1@H@Z(long) + LoadStringW(1);// ?LoadStringW@CHString@@QAEHI@Z(long) + LoadStringW(1, NULL, 256);// ?LoadStringW@CHString@@IAEHIPAGI@Z(long wstr long) + LockBuffer();// ?LockBuffer@CHString@@QAEPAGXZ() + MakeLower();// ?MakeLower@CHString@@QAEXXZ() + MakeReverse();// ?MakeReverse@CHString@@QAEXXZ() + MakeUpper();// ?MakeUpper@CHString@@QAEXXZ() + Mid(12);// ?Mid@CHString@@QBE?AV1@H@Z(long) + Mid(12, 4);// ?Mid@CHString@@QBE?AV1@HH@Z(long long) + Release(NULL);// ?Release@CHString@@KGXPAUCHStringData@@@Z(ptr) + Release();// ?Release@CHString@@IAEXXZ() + ReleaseBuffer(); // ?ReleaseBuffer@CHString@@QAEXH@Z(long) + ReverseFind(L'a');// ?ReverseFind@CHString@@QBEHG@Z(long) + Right(2);// ?Right@CHString@@QBE?AV1@H@Z(long) + SafeStrlen(L"test");// ?SafeStrlen@CHString@@KGHPBG@Z(wstr) + SetAt(0, L'a');// ?SetAt@CHString@@QAEXHG@Z(long long) + SpanExcluding(L"test");// ?SpanExcluding@CHString@@QBE?AV1@PBG@Z(long wstr) + SpanIncluding(L"test");// ?SpanIncluding@CHString@@QBE?AV1@PBG@Z(long wstr) + TrimLeft();// ?TrimLeft@CHString@@QAEXXZ() + TrimRight();// ?TrimRight@CHString@@QAEXXZ() + UnlockBuffer();// ?UnlockBuffer@CHString@@QAEXXZ() +// ??BCHString@@QBEPBGXZ(ptr) +// ??YCHString@@QAEABV0@ABV0@@Z(ptr) +// ??YCHString@@QAEABV0@D@Z(long) +// ??YCHString@@QAEABV0@PBG@Z(wstr) +// ??YCHString@@QAEABV0@G@Z(long) +// ??4CHString@@QAEABV0@PAV0@@Z(ptr) +// ??4CHString@@QAEABV0@ABV0@@Z(ptr) +// ??4CHString@@QAEABV0@PBD@Z(str) +// ??4CHString@@QAEABV0@D@Z(long) +// ??4CHString@@QAEABV0@PBE@Z(str) +// ??4CHString@@QAEABV0@PBG@Z(wstr) +// ??4CHString@@QAEABV0@G@Z(long) +// ??ACHString@@QBEGH@Z(long) +// ??1CHString@@QAE@XZ() +// ??H@YG?AVCHString@@GABV0@@Z(long ptr) +// ??H@YG?AVCHString@@ABV0@G@Z(ptr long) +// ??H@YG?AVCHString@@ABV0@PBG@Z(ptr wstr) +// ??H@YG?AVCHString@@PBGABV0@@Z(wstr ptr) +// ??H@YG?AVCHString@@ABV0@0@Z(ptr ptr) + + } +}; + +int +main() +{ + CHString2 String; + + String.UseStuff(); + + return 0; +} Propchange: trunk/rostests/tests/dllexport/dllimport_framedyn.cpp ------------------------------------------------------------------------------ svn:eol-style = native
10 years, 2 months
1
0
0
0
[tkreuzer] 64423: [CRT] - Allow to allow wchar_t even on C++, if it is not GCC - Remove a number of duplicate definitions [FRAMEDYN] - Compile with /Zc:wchar_t- on MSVC - Get rid of now obsolete MS...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Sep 30 20:48:54 2014 New Revision: 64423 URL:
http://svn.reactos.org/svn/reactos?rev=64423&view=rev
Log: [CRT] - Allow to allow wchar_t even on C++, if it is not GCC - Remove a number of duplicate definitions [FRAMEDYN] - Compile with /Zc:wchar_t- on MSVC - Get rid of now obsolete MSVC symbol aliases - Share the spec file - Add 2 GCC symbols in the export lib (C2 constructor, D2 destructor), which are in this case identical to C1 and D1 Added: trunk/reactos/dll/win32/framedyn/framedyn.spec - copied, changed from r64367, trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec Removed: trunk/reactos/dll/win32/framedyn/alias_msvc.s trunk/reactos/dll/win32/framedyn/fix_exports_msvc.s trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec trunk/reactos/dll/win32/framedyn/framedyn_msvc.spec Modified: trunk/reactos/dll/win32/framedyn/CMakeLists.txt trunk/reactos/dll/win32/framedyn/alias_gcc.s trunk/reactos/include/crt/crtdefs.h trunk/reactos/include/crt/rtcapi.h trunk/reactos/include/crt/wctype.h Modified: trunk/reactos/dll/win32/framedyn/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/framedyn/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/framedyn/CMakeLists.txt [iso-8859-1] Tue Sep 30 20:48:54 2014 @@ -1,11 +1,7 @@ set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) -if(NOT MSVC) - spec2def(framedyn.dll framedyn_gcc.spec ADD_IMPORTLIB) -else() - spec2def(framedyn.dll framedyn_msvc.spec ADD_IMPORTLIB) -endif() +spec2def(framedyn.dll framedyn.spec ADD_IMPORTLIB) list(APPEND SOURCE main.c @@ -13,18 +9,16 @@ ${CMAKE_CURRENT_BINARY_DIR}/framedyn.def) if(MSVC) - add_asm_files(framedyn_asm fix_exports_msvc.s) + add_compile_flags("/Zc:wchar_t-") endif() -add_library(framedyn SHARED ${SOURCE} ${framedyn_asm}) +add_library(framedyn SHARED ${SOURCE}) set_module_type(framedyn win32dll UNICODE) add_importlibs(framedyn oleaut32 msvcrt kernel32 ntdll) add_cd_file(TARGET framedyn DESTINATION reactos/system32/wbem FOR all) -if(MSVC) - add_asm_files(framedynex_asm alias_msvc.s) -else() +if(NOT MSVC) add_asm_files(framedynex_asm alias_gcc.s) endif() add_library(framedynex ${framedynex_asm}) Modified: trunk/reactos/dll/win32/framedyn/alias_gcc.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/alias_g…
============================================================================== --- trunk/reactos/dll/win32/framedyn/alias_gcc.s [iso-8859-1] (original) +++ trunk/reactos/dll/win32/framedyn/alias_gcc.s [iso-8859-1] Tue Sep 30 20:48:54 2014 @@ -24,6 +24,7 @@ DEFINE_ALIAS(__ZN8CHStringC1EPKwi, ??0CHString@@QAE@PBGH@Z) DEFINE_ALIAS(__ZN8CHStringC1Ewi, ??0CHString@@QAE@GH@Z) DEFINE_ALIAS(__ZN8CHStringC1Ev, ??0CHString@@QAE@XZ) +DEFINE_ALIAS(__ZN8CHStringC2Ev, ??0CHString@@QAE@XZ) // CHString::CHString(void) DEFINE_ALIAS(__ZNK8CHString7CollateEPKw, ?Collate@CHString@@QBEHPBG@Z) DEFINE_ALIAS(__ZNK8CHString7CompareEPKw, ?Compare@CHString@@QBEHPBG@Z) DEFINE_ALIAS(__ZNK8CHString13CompareNoCaseEPKw, ?CompareNoCase@CHString@@QBEHPBG@Z) @@ -62,7 +63,7 @@ DEFINE_ALIAS(__ZN8CHString13ReleaseBufferEi, ?ReleaseBuffer@CHString@@QAEXH@Z) DEFINE_ALIAS(__ZNK8CHString11ReverseFindEw, ?ReverseFind@CHString@@QBEHG@Z) DEFINE_ALIAS(__ZNK8CHString5RightEi, ?Right@CHString@@QBE?AV1@H@Z) -DEFINE_ALIAS(__ZN8CHString10SafeStrlenEPKw, ?SafeStrlen@CHString@@KGHPBG@Z) +DEFINE_ALIAS(__ZN8CHString10SafeStrlenEPKw@4, ?SafeStrlen@CHString@@KGHPBG@Z) DEFINE_ALIAS(__ZN8CHString5SetAtEiw, ?SetAt@CHString@@QAEXHG@Z) DEFINE_ALIAS(__ZNK8CHString13SpanExcludingEPKw, ?SpanExcluding@CHString@@QBE?AV1@PBG@Z) DEFINE_ALIAS(__ZNK8CHString13SpanIncludingEPKw, ?SpanIncluding@CHString@@QBE?AV1@PBG@Z) @@ -82,7 +83,8 @@ DEFINE_ALIAS(__ZN8CHStringaSEPKw, ??4CHString@@QAEABV0@PBG@Z) DEFINE_ALIAS(__ZN8CHStringaSEw, ??4CHString@@QAEABV0@G@Z) DEFINE_ALIAS(__ZNK8CHStringixEi, ??ACHString@@QBEGH@Z) -DEFINE_ALIAS(__ZN8CHStringD1Ev, ??1CHString@@QAE@XZ) +DEFINE_ALIAS(__ZN8CHStringD1Ev, ??1CHString@@QAE@XZ) // CHString::~CHString() complete object destructor +DEFINE_ALIAS(__ZN8CHStringD2Ev, ??1CHString@@QAE@XZ) // CHString::~CHString() base object destructor DEFINE_ALIAS(__ZplwRK8CHString, ??H@YG?AVCHString@@GABV0@@Z) DEFINE_ALIAS(__ZplRK8CHStringw, ??H@YG?AVCHString@@ABV0@G@Z) DEFINE_ALIAS(__ZplRK8CHStringPKw, ??H@YG?AVCHString@@ABV0@PBG@Z) Removed: trunk/reactos/dll/win32/framedyn/alias_msvc.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/alias_m…
============================================================================== --- trunk/reactos/dll/win32/framedyn/alias_msvc.s [iso-8859-1] (original) +++ trunk/reactos/dll/win32/framedyn/alias_msvc.s (removed) @@ -1,48 +0,0 @@ -#include <asm.inc> - -.code64 -.align 4 - -MACRO(DEFINE_ALIAS, alias, orig) -EXTERN &orig:ABS -ALIAS <&alias> = <&orig> -ENDM - -DEFINE_ALIAS ?AllocSysString@CHString@@QBEPA_WXZ, ?AllocSysString@CHString@@QBEPAGXZ -DEFINE_ALIAS ?AssignCopy@CHString@@IAEXHPB_W@Z, ?AssignCopy@CHString@@IAEXHPBG@Z -DEFINE_ALIAS ??0CHString@@QAE@PB_W@Z, ??0CHString@@QAE@PBG@Z -DEFINE_ALIAS ??0CHString@@QAE@PB_WH@Z, ??0CHString@@QAE@PBGH@Z -DEFINE_ALIAS ??0CHString@@QAE@_WH@Z, ??0CHString@@QAE@GH@Z -DEFINE_ALIAS ?Collate@CHString@@QBEHPB_W@Z, ?Collate@CHString@@QBEHPBG@Z -DEFINE_ALIAS ?Compare@CHString@@QBEHPB_W@Z, ?Compare@CHString@@QBEHPBG@Z -DEFINE_ALIAS ?CompareNoCase@CHString@@QBEHPB_W@Z, ?CompareNoCase@CHString@@QBEHPBG@Z -DEFINE_ALIAS ?ConcatCopy@CHString@@IAEXHPB_WH0@Z, ?ConcatCopy@CHString@@IAEXHPBGH0@Z -DEFINE_ALIAS ?ConcatInPlace@CHString@@IAEXHPB_W@Z, ?ConcatInPlace@CHString@@IAEXHPBG@Z -DEFINE_ALIAS ?Find@CHString@@QBEHPB_W@Z, ?Find@CHString@@QBEHPBG@Z -DEFINE_ALIAS ?Find@CHString@@QBEH_W@Z, ?Find@CHString@@QBEHG@Z -DEFINE_ALIAS ?FindOneOf@CHString@@QBEHPB_W@Z, ?FindOneOf@CHString@@QBEHPBG@Z -DEFINE_ALIAS ?Format@CHString@@QAAXPB_WZZ, ?Format@CHString@@QAAXPBGZZ -DEFINE_ALIAS ?FormatMessageW@CHString@@QAAXPB_WZZ, ?FormatMessageW@CHString@@QAAXPBGZZ -DEFINE_ALIAS ?FormatV@CHString@@QAEXPB_WPAD@Z, ?FormatV@CHString@@QAEXPBGPAD@Z -DEFINE_ALIAS ?GetAt@CHString@@QBE_WH@Z, ?GetAt@CHString@@QBEGH@Z -DEFINE_ALIAS ?GetBuffer@CHString@@QAEPA_WH@Z, ?GetBuffer@CHString@@QAEPAGH@Z -DEFINE_ALIAS ?GetBufferSetLength@CHString@@QAEPA_WH@Z, ?GetBufferSetLength@CHString@@QAEPAGH@Z -DEFINE_ALIAS ?LoadStringW@CHString@@IAEHIPA_WI@Z, ?LoadStringW@CHString@@IAEHIPAGI@Z -DEFINE_ALIAS ?LockBuffer@CHString@@QAEPA_WXZ, ?LockBuffer@CHString@@QAEPAGXZ -DEFINE_ALIAS ?ReverseFind@CHString@@QBEH_W@Z, ?ReverseFind@CHString@@QBEHG@Z -DEFINE_ALIAS ?SafeStrlen@CHString@@KGHPB_W@Z, ?SafeStrlen@CHString@@KGHPBG@Z -DEFINE_ALIAS ?SetAt@CHString@@QAEXH_W@Z, ?SetAt@CHString@@QAEXHG@Z -DEFINE_ALIAS ?SpanExcluding@CHString@@QBE?AV1@PB_W@Z, ?SpanExcluding@CHString@@QBE?AV1@PBG@Z -DEFINE_ALIAS ?SpanIncluding@CHString@@QBE?AV1@PB_W@Z, ?SpanIncluding@CHString@@QBE?AV1@PBG@Z -DEFINE_ALIAS ??BCHString@@QBEPB_WXZ, ??BCHString@@QBEPBGXZ -DEFINE_ALIAS ??YCHString@@QAEABV0@PB_W@Z, ??YCHString@@QAEABV0@PBG@Z -DEFINE_ALIAS ??YCHString@@QAEABV0@_W@Z, ??YCHString@@QAEABV0@G@Z -DEFINE_ALIAS ??4CHString@@QAEABV0@PB_W@Z, ??4CHString@@QAEABV0@PBG@Z -DEFINE_ALIAS ??4CHString@@QAEABV0@_W@Z, ??4CHString@@QAEABV0@G@Z -DEFINE_ALIAS ??ACHString@@QBE_WH@Z, ??ACHString@@QBEGH@Z -DEFINE_ALIAS ??H@YG?AVCHString@@_WABV0@@Z, ??H@YG?AVCHString@@GABV0@@Z -DEFINE_ALIAS ??H@YG?AVCHString@@ABV0@_W@Z, ??H@YG?AVCHString@@ABV0@G@Z -DEFINE_ALIAS ??H@YG?AVCHString@@ABV0@PB_W@Z, ??H@YG?AVCHString@@ABV0@PBG@Z -DEFINE_ALIAS ??H@YG?AVCHString@@PB_WABV0@@Z, ??H@YG?AVCHString@@PBGABV0@@Z - -END Removed: trunk/reactos/dll/win32/framedyn/fix_exports_msvc.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/fix_exp…
============================================================================== --- trunk/reactos/dll/win32/framedyn/fix_exports_msvc.s [iso-8859-1] (original) +++ trunk/reactos/dll/win32/framedyn/fix_exports_msvc.s (removed) @@ -1,48 +0,0 @@ -#include <asm.inc> - -.code64 -.align 4 - -MACRO(DEFINE_ALIAS, alias, orig) -EXTERN &orig:ABS -ALIAS <&alias> = <&orig> -ENDM - -DEFINE_ALIAS ?AllocSysString@CHString@@QBEPAGXZ, ?AllocSysString@CHString@@QBEPA_WXZ -DEFINE_ALIAS ?AssignCopy@CHString@@IAEXHPBG@Z, ?AssignCopy@CHString@@IAEXHPB_W@Z -DEFINE_ALIAS ??0CHString@@QAE@PBG@Z, ??0CHString@@QAE@PB_W@Z -DEFINE_ALIAS ??0CHString@@QAE@PBGH@Z, ??0CHString@@QAE@PB_WH@Z -DEFINE_ALIAS ??0CHString@@QAE@GH@Z, ??0CHString@@QAE@_WH@Z -DEFINE_ALIAS ?Collate@CHString@@QBEHPBG@Z, ?Collate@CHString@@QBEHPB_W@Z -DEFINE_ALIAS ?Compare@CHString@@QBEHPBG@Z, ?Compare@CHString@@QBEHPB_W@Z -DEFINE_ALIAS ?CompareNoCase@CHString@@QBEHPBG@Z, ?CompareNoCase@CHString@@QBEHPB_W@Z -DEFINE_ALIAS ?ConcatCopy@CHString@@IAEXHPBGH0@Z, ?ConcatCopy@CHString@@IAEXHPB_WH0@Z -DEFINE_ALIAS ?ConcatInPlace@CHString@@IAEXHPBG@Z, ?ConcatInPlace@CHString@@IAEXHPB_W@Z -DEFINE_ALIAS ?Find@CHString@@QBEHPBG@Z, ?Find@CHString@@QBEHPB_W@Z -DEFINE_ALIAS ?Find@CHString@@QBEHG@Z, ?Find@CHString@@QBEH_W@Z -DEFINE_ALIAS ?FindOneOf@CHString@@QBEHPBG@Z, ?FindOneOf@CHString@@QBEHPB_W@Z -DEFINE_ALIAS ?Format@CHString@@QAAXPBGZZ, ?Format@CHString@@QAAXPB_WZZ -DEFINE_ALIAS ?FormatMessageW@CHString@@QAAXPBGZZ, ?FormatMessageW@CHString@@QAAXPB_WZZ -DEFINE_ALIAS ?FormatV@CHString@@QAEXPBGPAD@Z, ?FormatV@CHString@@QAEXPB_WPAD@Z -DEFINE_ALIAS ?GetAt@CHString@@QBEGH@Z, ?GetAt@CHString@@QBE_WH@Z -DEFINE_ALIAS ?GetBuffer@CHString@@QAEPAGH@Z, ?GetBuffer@CHString@@QAEPA_WH@Z -DEFINE_ALIAS ?GetBufferSetLength@CHString@@QAEPAGH@Z, ?GetBufferSetLength@CHString@@QAEPA_WH@Z -DEFINE_ALIAS ?LoadStringW@CHString@@IAEHIPAGI@Z, ?LoadStringW@CHString@@IAEHIPA_WI@Z -DEFINE_ALIAS ?LockBuffer@CHString@@QAEPAGXZ, ?LockBuffer@CHString@@QAEPA_WXZ -DEFINE_ALIAS ?ReverseFind@CHString@@QBEHG@Z, ?ReverseFind@CHString@@QBEH_W@Z -DEFINE_ALIAS ?SafeStrlen@CHString@@KGHPBG@Z, ?SafeStrlen@CHString@@KGHPB_W@Z -DEFINE_ALIAS ?SetAt@CHString@@QAEXHG@Z, ?SetAt@CHString@@QAEXH_W@Z -DEFINE_ALIAS ?SpanExcluding@CHString@@QBE?AV1@PBG@Z, ?SpanExcluding@CHString@@QBE?AV1@PB_W@Z -DEFINE_ALIAS ?SpanIncluding@CHString@@QBE?AV1@PBG@Z, ?SpanIncluding@CHString@@QBE?AV1@PB_W@Z -DEFINE_ALIAS ??BCHString@@QBEPBGXZ, ??BCHString@@QBEPB_WXZ -DEFINE_ALIAS ??YCHString@@QAEABV0@PBG@Z, ??YCHString@@QAEABV0@PB_W@Z -DEFINE_ALIAS ??YCHString@@QAEABV0@G@Z, ??YCHString@@QAEABV0@_W@Z -DEFINE_ALIAS ??4CHString@@QAEABV0@PBG@Z, ??4CHString@@QAEABV0@PB_W@Z -DEFINE_ALIAS ??4CHString@@QAEABV0@G@Z, ??4CHString@@QAEABV0@_W@Z -DEFINE_ALIAS ??ACHString@@QBEGH@Z, ??ACHString@@QBE_WH@Z -DEFINE_ALIAS ??H@YG?AVCHString@@GABV0@@Z, ??H@YG?AVCHString@@_WABV0@@Z -DEFINE_ALIAS ??H@YG?AVCHString@@ABV0@G@Z, ??H@YG?AVCHString@@ABV0@_W@Z -DEFINE_ALIAS ??H@YG?AVCHString@@ABV0@PBG@Z, ??H@YG?AVCHString@@ABV0@PB_W@Z -DEFINE_ALIAS ??H@YG?AVCHString@@PBGABV0@@Z, ??H@YG?AVCHString@@PB_WABV0@@Z - -END Copied: trunk/reactos/dll/win32/framedyn/framedyn.spec (from r64367, trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/framedy…
============================================================================== --- trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/framedyn/framedyn.spec [iso-8859-1] Tue Sep 30 20:48:54 2014 @@ -68,7 +68,7 @@ @ thiscall ??4CHString@@QAEABV0@PBG@Z(wstr) _ZN8CHStringaSEPKw @ thiscall ??4CHString@@QAEABV0@G@Z(long) _ZN8CHStringaSEw @ thiscall ??ACHString@@QBEGH@Z(long) _ZNK8CHStringixEi -@ thiscall ??1CHString@@QAE@XZ() _ZN8CHStringD1Ev +@ thiscall ??1CHString@@QAE@XZ() _ZN8CHStringD1Ev # complete object destructor, identical to _ZN8CHStringD2Ev aka base object destructor @ stdcall ??H@YG?AVCHString@@GABV0@@Z(long ptr) _ZplwRK8CHString @ stdcall ??H@YG?AVCHString@@ABV0@G@Z(ptr long) _ZplRK8CHStringw @ stdcall ??H@YG?AVCHString@@ABV0@PBG@Z(ptr wstr) _ZplRK8CHStringPKw Removed: trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/framedy…
============================================================================== --- trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec (removed) @@ -1,76 +0,0 @@ -@ thiscall ?AllocBeforeWrite@CHString@@IAEXH@Z(long) _ZN8CHString16AllocBeforeWriteEi -@ thiscall ?AllocBuffer@CHString@@IAEXH@Z(long) _ZN8CHString11AllocBufferEi -@ thiscall ?AllocCopy@CHString@@IBEXAAV1@HHH@Z(ptr long long long) _ZNK8CHString9AllocCopyERS_iii -@ thiscall ?AllocSysString@CHString@@QBEPAGXZ() _ZNK8CHString14AllocSysStringEv -@ thiscall ?AssignCopy@CHString@@IAEXHPBG@Z(long wstr) _ZN8CHString10AssignCopyEiPKw -@ thiscall ??0CHString@@QAE@ABV0@@Z(ptr) _ZN8CHStringC1ERKS_ -@ thiscall ??0CHString@@QAE@PBD@Z(str) _ZN8CHStringC1EPKc -@ thiscall ??0CHString@@QAE@PBE@Z(str) _ZN8CHStringC1EPKh -@ thiscall ??0CHString@@QAE@PBG@Z(wstr) _ZN8CHStringC1EPKw -@ thiscall ??0CHString@@QAE@PBGH@Z(wstr long) _ZN8CHStringC1EPKwi -@ thiscall ??0CHString@@QAE@GH@Z(long long) _ZN8CHStringC1Ewi -@ thiscall ??0CHString@@QAE@XZ() _ZN8CHStringC1Ev -@ thiscall ?Collate@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString7CollateEPKw -@ thiscall ?Compare@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString7CompareEPKw -@ thiscall ?CompareNoCase@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString13CompareNoCaseEPKw -@ thiscall ?ConcatCopy@CHString@@IAEXHPBGH0@Z(long wstr long wstr) _ZN8CHString10ConcatCopyEiPKwiS1_ -@ thiscall ?ConcatInPlace@CHString@@IAEXHPBG@Z(long wstr) _ZN8CHString13ConcatInPlaceEiPKw -@ thiscall ?CopyBeforeWrite@CHString@@IAEXXZ() _ZN8CHString15CopyBeforeWriteEv -@ thiscall ?Empty@CHString@@QAEXXZ() _ZN8CHString5EmptyEv -@ thiscall ?Find@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString4FindEPKw -@ thiscall ?Find@CHString@@QBEHG@Z(long) _ZNK8CHString4FindEw -@ thiscall ?FindOneOf@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString9FindOneOfEPKw -@ thiscall ?Format@CHString@@QAAXIZZ(long long long) _ZN8CHString6FormatEjz -@ thiscall ?Format@CHString@@QAAXPBGZZ(long wstr long) _ZN8CHString6FormatEPKwz -@ thiscall ?FormatMessageW@CHString@@QAAXIZZ(long long long) _ZN8CHString14FormatMessageWEjz -@ thiscall ?FormatMessageW@CHString@@QAAXPBGZZ(long ptr long) _ZN8CHString14FormatMessageWEPKwz -@ thiscall ?FormatV@CHString@@QAEXPBGPAD@Z(wstr long) _ZN8CHString7FormatVEPKwPc -@ thiscall ?FreeExtra@CHString@@QAEXXZ() _ZN8CHString9FreeExtraEv -@ thiscall ?GetAllocLength@CHString@@QBEHXZ() _ZNK8CHString14GetAllocLengthEv -@ thiscall ?GetAt@CHString@@QBEGH@Z(long) _ZNK8CHString5GetAtEi -@ thiscall ?GetBuffer@CHString@@QAEPAGH@Z(long) _ZN8CHString9GetBufferEi -@ thiscall ?GetBufferSetLength@CHString@@QAEPAGH@Z(long) _ZN8CHString18GetBufferSetLengthEi -@ thiscall ?GetData@CHString@@IBEPAUCHStringData@@XZ() _ZNK8CHString7GetDataEv -@ thiscall ?GetLength@CHString@@QBEHXZ() _ZNK8CHString9GetLengthEv -@ thiscall ?Init@CHString@@IAEXXZ() _ZN8CHString4InitEv -@ thiscall ?IsEmpty@CHString@@QBEHXZ() _ZNK8CHString7IsEmptyEv -@ thiscall ?Left@CHString@@QBE?AV1@H@Z(long) _ZNK8CHString4LeftEi -@ thiscall ?LoadStringW@CHString@@QAEHI@Z(long) _ZN8CHString11LoadStringWEj -@ thiscall ?LoadStringW@CHString@@IAEHIPAGI@Z(long wstr long) _ZN8CHString11LoadStringWEjPwj -@ thiscall ?LockBuffer@CHString@@QAEPAGXZ() _ZN8CHString10LockBufferEv -@ thiscall ?MakeLower@CHString@@QAEXXZ() _ZN8CHString9MakeLowerEv -@ thiscall ?MakeReverse@CHString@@QAEXXZ() _ZN8CHString11MakeReverseEv -@ thiscall ?MakeUpper@CHString@@QAEXXZ() _ZN8CHString9MakeUpperEv -@ thiscall ?Mid@CHString@@QBE?AV1@H@Z(long) _ZNK8CHString3MidEi -@ thiscall ?Mid@CHString@@QBE?AV1@HH@Z(long long) _ZNK8CHString3MidEii -@ thiscall ?Release@CHString@@KGXPAUCHStringData@@@Z(ptr) _ZN8CHString7ReleaseEP12CHStringData@4 -@ thiscall ?Release@CHString@@IAEXXZ() _ZN8CHString7ReleaseEv -@ thiscall ?ReleaseBuffer@CHString@@QAEXH@Z(long) _ZN8CHString13ReleaseBufferEi -@ thiscall ?ReverseFind@CHString@@QBEHG@Z(long) _ZNK8CHString11ReverseFindEw -@ thiscall ?Right@CHString@@QBE?AV1@H@Z(long) _ZNK8CHString5RightEi -@ stdcall ?SafeStrlen@CHString@@KGHPBG@Z(wstr) _ZN8CHString10SafeStrlenEPKw -@ thiscall ?SetAt@CHString@@QAEXHG@Z(long long) _ZN8CHString5SetAtEiw -@ thiscall ?SpanExcluding@CHString@@QBE?AV1@PBG@Z(long wstr) _ZNK8CHString13SpanExcludingEPKw -@ thiscall ?SpanIncluding@CHString@@QBE?AV1@PBG@Z(long wstr) _ZNK8CHString13SpanIncludingEPKw -@ thiscall ?TrimLeft@CHString@@QAEXXZ() _ZN8CHString8TrimLeftEv -@ thiscall ?TrimRight@CHString@@QAEXXZ() _ZN8CHString9TrimRightEv -@ thiscall ?UnlockBuffer@CHString@@QAEXXZ() _ZN8CHString12UnlockBufferEv -@ thiscall ??BCHString@@QBEPBGXZ(ptr) _ZNK8CHStringcvPKwEv -@ thiscall ??YCHString@@QAEABV0@ABV0@@Z(ptr) _ZN8CHStringpLERKS_ -@ thiscall ??YCHString@@QAEABV0@D@Z(long) _ZN8CHStringpLEc -@ thiscall ??YCHString@@QAEABV0@PBG@Z(wstr) _ZN8CHStringpLEPKw -@ thiscall ??YCHString@@QAEABV0@G@Z(long) _ZN8CHStringpLEw -@ thiscall ??4CHString@@QAEABV0@PAV0@@Z(ptr) _ZN8CHStringaSEPS_ -@ thiscall ??4CHString@@QAEABV0@ABV0@@Z(ptr) _ZN8CHStringaSERKS_ -@ thiscall ??4CHString@@QAEABV0@PBD@Z(str) _ZN8CHStringaSEPKc -@ thiscall ??4CHString@@QAEABV0@D@Z(long) _ZN8CHStringaSEc -@ thiscall ??4CHString@@QAEABV0@PBE@Z(str) _ZN8CHStringaSEPKh -@ thiscall ??4CHString@@QAEABV0@PBG@Z(wstr) _ZN8CHStringaSEPKw -@ thiscall ??4CHString@@QAEABV0@G@Z(long) _ZN8CHStringaSEw -@ thiscall ??ACHString@@QBEGH@Z(long) _ZNK8CHStringixEi -@ thiscall ??1CHString@@QAE@XZ() _ZN8CHStringD1Ev -@ stdcall ??H@YG?AVCHString@@GABV0@@Z(long ptr) _ZplwRK8CHString -@ stdcall ??H@YG?AVCHString@@ABV0@G@Z(ptr long) _ZplRK8CHStringw -@ stdcall ??H@YG?AVCHString@@ABV0@PBG@Z(ptr wstr) _ZplRK8CHStringPKw -@ stdcall ??H@YG?AVCHString@@PBGABV0@@Z(wstr ptr) _ZplPKwRK8CHString -@ stdcall ??H@YG?AVCHString@@ABV0@0@Z(ptr ptr) _ZplRK8CHStringS1_ Removed: trunk/reactos/dll/win32/framedyn/framedyn_msvc.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/framedy…
============================================================================== --- trunk/reactos/dll/win32/framedyn/framedyn_msvc.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/framedyn/framedyn_msvc.spec (removed) @@ -1,76 +0,0 @@ -@ thiscall ?AllocBeforeWrite@CHString@@IAEXH@Z(long) -@ thiscall ?AllocBuffer@CHString@@IAEXH@Z(long) -@ thiscall ?AllocCopy@CHString@@IBEXAAV1@HHH@Z(ptr long long long) -@ thiscall ?AllocSysString@CHString@@QBEPAGXZ() -@ thiscall ?AssignCopy@CHString@@IAEXHPBG@Z(long wstr) -@ thiscall ??0CHString@@QAE@ABV0@@Z(ptr) -@ thiscall ??0CHString@@QAE@PBD@Z(str) -@ thiscall ??0CHString@@QAE@PBE@Z(str) -@ thiscall ??0CHString@@QAE@PBG@Z(wstr) -@ thiscall ??0CHString@@QAE@PBGH@Z(wstr long) -@ thiscall ??0CHString@@QAE@GH@Z(long long) -@ thiscall ??0CHString@@QAE@XZ() -@ thiscall ?Collate@CHString@@QBEHPBG@Z(wstr) -@ thiscall ?Compare@CHString@@QBEHPBG@Z(wstr) -@ thiscall ?CompareNoCase@CHString@@QBEHPBG@Z(wstr) -@ thiscall ?ConcatCopy@CHString@@IAEXHPBGH0@Z(long wstr long wstr) -@ thiscall ?ConcatInPlace@CHString@@IAEXHPBG@Z(long wstr) -@ thiscall ?CopyBeforeWrite@CHString@@IAEXXZ() -@ thiscall ?Empty@CHString@@QAEXXZ() -@ thiscall ?Find@CHString@@QBEHPBG@Z(wstr) -@ thiscall ?Find@CHString@@QBEHG@Z(long) -@ thiscall ?FindOneOf@CHString@@QBEHPBG@Z(wstr) -@ thiscall ?Format@CHString@@QAAXIZZ(long long long) -@ thiscall ?Format@CHString@@QAAXPBGZZ(long wstr long) -@ thiscall ?FormatMessageW@CHString@@QAAXIZZ(long long long) -@ thiscall ?FormatMessageW@CHString@@QAAXPBGZZ(long ptr long) -@ thiscall ?FormatV@CHString@@QAEXPBGPAD@Z(wstr long) -@ thiscall ?FreeExtra@CHString@@QAEXXZ() -@ thiscall ?GetAllocLength@CHString@@QBEHXZ() -@ thiscall ?GetAt@CHString@@QBEGH@Z(long) -@ thiscall ?GetBuffer@CHString@@QAEPAGH@Z(long) -@ thiscall ?GetBufferSetLength@CHString@@QAEPAGH@Z(long) -@ thiscall ?GetData@CHString@@IBEPAUCHStringData@@XZ() -@ thiscall ?GetLength@CHString@@QBEHXZ() -@ thiscall ?Init@CHString@@IAEXXZ() -@ thiscall ?IsEmpty@CHString@@QBEHXZ() -@ thiscall ?Left@CHString@@QBE?AV1@H@Z(long) -@ thiscall ?LoadStringW@CHString@@QAEHI@Z(long) -@ thiscall ?LoadStringW@CHString@@IAEHIPAGI@Z(long wstr long) -@ thiscall ?LockBuffer@CHString@@QAEPAGXZ() -@ thiscall ?MakeLower@CHString@@QAEXXZ() -@ thiscall ?MakeReverse@CHString@@QAEXXZ() -@ thiscall ?MakeUpper@CHString@@QAEXXZ() -@ thiscall ?Mid@CHString@@QBE?AV1@H@Z(long) -@ thiscall ?Mid@CHString@@QBE?AV1@HH@Z(long long) -@ thiscall ?Release@CHString@@KGXPAUCHStringData@@@Z(ptr) -@ thiscall ?Release@CHString@@IAEXXZ() -@ thiscall ?ReleaseBuffer@CHString@@QAEXH@Z(long) -@ thiscall ?ReverseFind@CHString@@QBEHG@Z(long) -@ thiscall ?Right@CHString@@QBE?AV1@H@Z(long) -@ stdcall ?SafeStrlen@CHString@@KGHPBG@Z(wstr) -@ thiscall ?SetAt@CHString@@QAEXHG@Z(long long) -@ thiscall ?SpanExcluding@CHString@@QBE?AV1@PBG@Z(long wstr) -@ thiscall ?SpanIncluding@CHString@@QBE?AV1@PBG@Z(long wstr) -@ thiscall ?TrimLeft@CHString@@QAEXXZ() -@ thiscall ?TrimRight@CHString@@QAEXXZ() -@ thiscall ?UnlockBuffer@CHString@@QAEXXZ() -@ thiscall ??BCHString@@QBEPBGXZ(ptr) -@ thiscall ??YCHString@@QAEABV0@ABV0@@Z(ptr) -@ thiscall ??YCHString@@QAEABV0@D@Z(long) -@ thiscall ??YCHString@@QAEABV0@PBG@Z(wstr) -@ thiscall ??YCHString@@QAEABV0@G@Z(long) -@ thiscall ??4CHString@@QAEABV0@PAV0@@Z(ptr) -@ thiscall ??4CHString@@QAEABV0@ABV0@@Z(ptr) -@ thiscall ??4CHString@@QAEABV0@PBD@Z(str) -@ thiscall ??4CHString@@QAEABV0@D@Z(long) -@ thiscall ??4CHString@@QAEABV0@PBE@Z(str) -@ thiscall ??4CHString@@QAEABV0@PBG@Z(wstr) -@ thiscall ??4CHString@@QAEABV0@G@Z(long) -@ thiscall ??ACHString@@QBEGH@Z(long) -@ thiscall ??1CHString@@QAE@XZ() -@ stdcall ??H@YG?AVCHString@@GABV0@@Z(long ptr) -@ stdcall ??H@YG?AVCHString@@ABV0@G@Z(ptr long) -@ stdcall ??H@YG?AVCHString@@ABV0@PBG@Z(ptr wstr) -@ stdcall ??H@YG?AVCHString@@PBGABV0@@Z(wstr ptr) -@ stdcall ??H@YG?AVCHString@@ABV0@0@Z(ptr ptr) Modified: trunk/reactos/include/crt/crtdefs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/crtdefs.h?rev=…
============================================================================== --- trunk/reactos/include/crt/crtdefs.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/crtdefs.h [iso-8859-1] Tue Sep 30 20:48:54 2014 @@ -316,7 +316,7 @@ #ifndef _WCHAR_T_DEFINED #define _WCHAR_T_DEFINED -#ifndef __cplusplus +#if defined(_MSC_VER) || !defined(__cplusplus) typedef unsigned short wchar_t; #endif #endif Modified: trunk/reactos/include/crt/rtcapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/rtcapi.h?rev=6…
============================================================================== --- trunk/reactos/include/crt/rtcapi.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/rtcapi.h [iso-8859-1] Tue Sep 30 20:48:54 2014 @@ -22,11 +22,6 @@ #define _RTC_ERRTYPE_IGNORE -1 #define _RTC_ERRTYPE_ASK -2 - -#ifndef _WCHAR_T_DEFINED -#define _WCHAR_T_DEFINED - typedef unsigned short wchar_t; -#endif typedef int (__cdecl *_RTC_error_fn)(int,const char *,int,const char *,const char *,...); typedef int (__cdecl *_RTC_error_fnW)(int,const wchar_t *,int,const wchar_t *,const wchar_t *,...); Modified: trunk/reactos/include/crt/wctype.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/wctype.h?rev=6…
============================================================================== --- trunk/reactos/include/crt/wctype.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/wctype.h [iso-8859-1] Tue Sep 30 20:48:54 2014 @@ -16,21 +16,6 @@ #ifdef __cplusplus extern "C" { -#endif - -#ifndef _CRTIMP -#define _CRTIMP __declspec(dllimport) -#endif - -#ifndef _WCHAR_T_DEFINED - typedef unsigned short wchar_t; -#define _WCHAR_T_DEFINED -#endif - -#ifndef _WCTYPE_T_DEFINED - typedef unsigned short wint_t; - typedef unsigned short wctype_t; -#define _WCTYPE_T_DEFINED #endif #ifndef WEOF
10 years, 2 months
1
0
0
0
[jgardou] 64422: [ADVAPI32] - Fix a memory leak in failure case. Spotted by Thomas. CORE-8582
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Sep 30 20:21:50 2014 New Revision: 64422 URL:
http://svn.reactos.org/svn/reactos?rev=64422&view=rev
Log: [ADVAPI32] - Fix a memory leak in failure case. Spotted by Thomas. CORE-8582 Modified: trunk/reactos/dll/win32/advapi32/reg/hkcr.c Modified: trunk/reactos/dll/win32/advapi32/reg/hkcr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/hkc…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/hkcr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/hkcr.c [iso-8859-1] Tue Sep 30 20:21:50 2014 @@ -46,6 +46,7 @@ Status = NtQueryKey(hKey, KeyNameInformation, NameInformation, InfoLength, &InfoLength); if (!NT_SUCCESS(Status)) { + RtlFreeHeap(RtlGetProcessHeap(), 0, NameInformation); ERR("NtQueryKey failed: 0x%08x\n", Status); return RtlNtStatusToDosError(Status); } @@ -58,6 +59,7 @@ Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &InfoName, KeyName); if (!NT_SUCCESS(Status)) { + RtlFreeHeap(RtlGetProcessHeap(), 0, NameInformation); ERR("RtlDuplicateUnicodeString failed: 0x%08x\n", Status); return RtlNtStatusToDosError(Status); }
10 years, 2 months
1
0
0
0
[jgardou] 64421: [ADVAPI32] - Implement DeleteKey for HKCR subkeys CORE-8582
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Sep 30 20:01:00 2014 New Revision: 64421 URL:
http://svn.reactos.org/svn/reactos?rev=64421&view=rev
Log: [ADVAPI32] - Implement DeleteKey for HKCR subkeys CORE-8582 Modified: trunk/reactos/dll/win32/advapi32/reg/hkcr.c trunk/reactos/dll/win32/advapi32/reg/reg.c trunk/reactos/dll/win32/advapi32/reg/reg.h Modified: trunk/reactos/dll/win32/advapi32/reg/hkcr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/hkc…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/hkcr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/hkcr.c [iso-8859-1] Tue Sep 30 20:01:00 2014 @@ -238,7 +238,6 @@ /* Close it if we must */ if (QueriedKey != hKey) { - /* The original key is on the machine view */ RegCloseKey(QueriedKey); } @@ -261,9 +260,68 @@ /* Close it if we must */ if (QueriedKey != hKey) { + RegCloseKey(QueriedKey); + } + + return ErrorCode; +} + +LONG +WINAPI +DeleteHKCRKey( + _In_ HKEY hKey, + _In_ LPCWSTR lpSubKey) +{ + HKEY QueriedKey; + LONG ErrorCode; + + ASSERT(IsHKCRKey(hKey)); + + /* Remove the HKCR flag while we're working */ + hKey = (HKEY)(((ULONG_PTR)hKey) & ~0x2); + + ErrorCode = GetPreferredHKCRKey(hKey, &QueriedKey); + + if (ErrorCode == ERROR_FILE_NOT_FOUND) + { + /* The key doesn't exist on HKCU side, no chance for a subkey */ + return RegDeleteKeyW(hKey, lpSubKey); + } + + if (ErrorCode != ERROR_SUCCESS) + { + /* Somehow we failed for another reason (maybe deleted key or whatever) */ + return ErrorCode; + } + + ErrorCode = RegDeleteKeyW(QueriedKey, lpSubKey); + + /* Close it if we must */ + if (QueriedKey != hKey) + { /* The original key is on the machine view */ RegCloseKey(QueriedKey); } + /* Anything else than ERROR_FILE_NOT_FOUND means that we found it, even if it is with failures. */ + if (ErrorCode != ERROR_FILE_NOT_FOUND) + return ErrorCode; + + /* If we're here, we must open from HKLM key. */ + ErrorCode = GetFallbackHKCRKey(hKey, &QueriedKey); + if (ErrorCode != ERROR_SUCCESS) + { + /* Maybe the key doesn't exist in the HKLM view */ + return ErrorCode; + } + + ErrorCode = RegDeleteKeyW(QueriedKey, lpSubKey); + + /* Close it if we must */ + if (QueriedKey != hKey) + { + RegCloseKey(QueriedKey); + } + return ErrorCode; } Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] Tue Sep 30 20:01:00 2014 @@ -1227,6 +1227,9 @@ return RtlNtStatusToDosError(Status); } + if (IsHKCRKey(ParentKey)) + return DeleteHKCRKey(ParentKey, lpSubKey); + RtlInitUnicodeString(&SubKeyName, (LPWSTR)lpSubKey); InitializeObjectAttributes(&ObjectAttributes, Modified: trunk/reactos/dll/win32/advapi32/reg/reg.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/reg.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/reg.h [iso-8859-1] Tue Sep 30 20:01:00 2014 @@ -30,3 +30,10 @@ _In_ DWORD ulOptions, _In_ REGSAM samDesired, _In_ PHKEY phkResult); + +LONG +WINAPI +DeleteHKCRKey( + _In_ HKEY hKey, + _In_ LPCWSTR lpSubKey); +
10 years, 2 months
1
0
0
0
← Newer
1
2
3
4
...
42
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Results per page:
10
25
50
100
200