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
August 2013
----- 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
10 participants
327 discussions
Start a n
N
ew thread
[akhaldi] 59692: [CRT/INTRIN_X86] * Fix __ll_rshift() and __ull_rshift(). Thanks to Filip Navara for his help with the issue. * Properly mark int64part as unsigned __int6 in _byteswap_uint64(). * A...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Aug 10 21:17:38 2013 New Revision: 59692 URL:
http://svn.reactos.org/svn/reactos?rev=59692&view=rev
Log: [CRT/INTRIN_X86] * Fix __ll_rshift() and __ull_rshift(). Thanks to Filip Navara for his help with the issue. * Properly mark int64part as unsigned __int6 in _byteswap_uint64(). * Add missing prototypes. Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
============================================================================== --- trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] Sat Aug 10 21:17:38 2013 @@ -88,6 +88,14 @@ /*** Memory barriers ***/ +__INTRIN_INLINE void _ReadWriteBarrier(void); +__INTRIN_INLINE void _mm_mfence(void); +__INTRIN_INLINE void _mm_lfence(void); +__INTRIN_INLINE void _mm_sfence(void); +#ifdef __x86_64__ +__INTRIN_INLINE void __faststorefence(void); +#endif + __INTRIN_INLINE void _ReadWriteBarrier(void) { __asm__ __volatile__("" : : : "memory"); @@ -127,7 +135,46 @@ /*** Atomic operations ***/ +__INTRIN_INLINE long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value); +__INTRIN_INLINE unsigned char _interlockedbittestandreset(volatile long * a, const long b); +__INTRIN_INLINE unsigned char _interlockedbittestandset(volatile long * a, const long b); +#if defined(_M_AMD64) +__INTRIN_INLINE unsigned char _interlockedbittestandreset64(volatile long long * a, const long long b); +__INTRIN_INLINE unsigned char _interlockedbittestandset64(volatile long long * a, const long long b); +#endif + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 + +__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand); +__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand); +__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand); +__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand); +__INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value); +__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value); +__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value); +__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const Addend, const long Value); +__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask); +__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask); +__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask); +__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask); +__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask); +__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask); +__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask); +__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask); +__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask); +__INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend); +__INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend); +__INTRIN_INLINE short _InterlockedDecrement16(volatile short * const lpAddend); +__INTRIN_INLINE short _InterlockedIncrement16(volatile short * const lpAddend); +#if defined(_M_AMD64) +__INTRIN_INLINE long long _InterlockedExchange64(volatile long long * const Target, const long long Value); +__INTRIN_INLINE long long _InterlockedExchangeAdd64(volatile long long * const Addend, const long long Value); +__INTRIN_INLINE long long _InterlockedAnd64(volatile long long * const value, const long long mask); +__INTRIN_INLINE long long _InterlockedOr64(volatile long long * const value, const long long mask); +__INTRIN_INLINE long long _InterlockedXor64(volatile long long * const value, const long long mask); +__INTRIN_INLINE long long _InterlockedDecrement64(volatile long long * const lpAddend); +__INTRIN_INLINE long long _InterlockedIncrement64(volatile long long * const lpAddend); +#endif __INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) { @@ -287,7 +334,33 @@ } #endif -#else +#else /* (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 */ + +__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand); +__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand); +__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand); +__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand); +__INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value); +__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value); +__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value); +__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const Addend, const long Value); +__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask); +__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask); +__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask); +__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask); +__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask); +__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask); +__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask); +__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask); +__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask); +__INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend); +__INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend); +__INTRIN_INLINE short _InterlockedDecrement16(volatile short * const lpAddend); +__INTRIN_INLINE short _InterlockedIncrement16(volatile short * const lpAddend); +#if defined(_M_AMD64) +__INTRIN_INLINE long long _InterlockedDecrement64(volatile long long * const lpAddend); +__INTRIN_INLINE long long _InterlockedIncrement64(volatile long long * const lpAddend); +#endif __INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) { @@ -530,10 +603,11 @@ } #endif -#endif +#endif /* (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 */ #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 && defined(__x86_64__) +__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand); __INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) { return __sync_val_compare_and_swap(Destination, Comperand, Exchange); @@ -541,6 +615,7 @@ #else +__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand); __INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) { long long retval = Comperand; @@ -609,6 +684,19 @@ #endif /*** String operations ***/ + +__INTRIN_INLINE void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count); +__INTRIN_INLINE void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count); +__INTRIN_INLINE void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count); +__INTRIN_INLINE void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count); +__INTRIN_INLINE void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count); +__INTRIN_INLINE void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count); +#ifdef _M_AMD64 +__INTRIN_INLINE void __stosq(unsigned __int64 * Dest, const unsigned __int64 Data, size_t Count); +__INTRIN_INLINE void __movsq(unsigned long * Destination, const unsigned long * Source, size_t Count); +#endif + + /* NOTE: we don't set a memory clobber in the __stosX functions because Visual C++ doesn't */ __INTRIN_INLINE void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count) { @@ -695,7 +783,25 @@ #endif #if defined(_M_AMD64) + /*** GS segment addressing ***/ + +__INTRIN_INLINE void __writegsbyte(const unsigned long Offset, const unsigned char Data); +__INTRIN_INLINE void __writegsword(const unsigned long Offset, const unsigned short Data); +__INTRIN_INLINE void __writegsdword(const unsigned long Offset, const unsigned long Data); +__INTRIN_INLINE void __writegsqword(const unsigned long Offset, const unsigned __int64 Data); +__INTRIN_INLINE unsigned char __readgsbyte(const unsigned long Offset); +__INTRIN_INLINE unsigned short __readgsword(const unsigned long Offset); +__INTRIN_INLINE unsigned long __readgsdword(const unsigned long Offset); +__INTRIN_INLINE unsigned __int64 __readgsqword(const unsigned long Offset); +__INTRIN_INLINE void __incgsbyte(const unsigned long Offset); +__INTRIN_INLINE void __incgsword(const unsigned long Offset); +__INTRIN_INLINE void __incgsdword(const unsigned long Offset); +__INTRIN_INLINE void __addgsbyte(const unsigned long Offset, const unsigned char Data); +__INTRIN_INLINE void __addgsword(const unsigned long Offset, const unsigned short Data); +__INTRIN_INLINE void __addgsdword(const unsigned long Offset, const unsigned int Data); +__INTRIN_INLINE void __addgsqword(const unsigned long Offset, const unsigned __int64 Data); + __INTRIN_INLINE void __writegsbyte(const unsigned long Offset, const unsigned char Data) { @@ -780,8 +886,24 @@ __asm__ __volatile__("addq %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "ir" (Data) : "memory"); } -#else +#else /* defined(_M_AMD64) */ + /*** FS segment addressing ***/ + +__INTRIN_INLINE void __writefsbyte(const unsigned long Offset, const unsigned char Data); +__INTRIN_INLINE void __writefsword(const unsigned long Offset, const unsigned short Data); +__INTRIN_INLINE void __writefsdword(const unsigned long Offset, const unsigned long Data); +__INTRIN_INLINE unsigned char __readfsbyte(const unsigned long Offset); +__INTRIN_INLINE unsigned short __readfsword(const unsigned long Offset); +__INTRIN_INLINE unsigned long __readfsdword(const unsigned long Offset); +__INTRIN_INLINE void __incfsbyte(const unsigned long Offset); +__INTRIN_INLINE void __incfsword(const unsigned long Offset); +__INTRIN_INLINE void __incfsdword(const unsigned long Offset); +__INTRIN_INLINE void __addfsbyte(const unsigned long Offset, const unsigned char Data); +__INTRIN_INLINE void __addfsword(const unsigned long Offset, const unsigned short Data); +__INTRIN_INLINE void __addfsdword(const unsigned long Offset, const unsigned int Data); + + __INTRIN_INLINE void __writefsbyte(const unsigned long Offset, const unsigned char Data) { __asm__ __volatile__("movb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); @@ -857,10 +979,39 @@ else __asm__ __volatile__("addl %k[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } -#endif + +#endif /* defined(_M_AMD64) */ /*** Bit manipulation ***/ + +__INTRIN_INLINE unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask); +__INTRIN_INLINE unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask); +__INTRIN_INLINE unsigned char _bittest(const long * const a, const long b); +#ifdef _M_AMD64 +__INTRIN_INLINE unsigned char _bittest64(const __int64 * const a, const __int64 b); +#endif +__INTRIN_INLINE unsigned char _bittestandcomplement(long * const a, const long b); +__INTRIN_INLINE unsigned char _bittestandreset(long * const a, const long b); +__INTRIN_INLINE unsigned char _bittestandset(long * const a, const long b); +__INTRIN_INLINE unsigned char _rotl8(unsigned char value, unsigned char shift); +__INTRIN_INLINE unsigned short _rotl16(unsigned short value, unsigned char shift); +__INTRIN_INLINE unsigned int _rotl(unsigned int value, int shift); +__INTRIN_INLINE unsigned int _rotr(unsigned int value, int shift); +__INTRIN_INLINE unsigned char _rotr8(unsigned char value, unsigned char shift); +__INTRIN_INLINE unsigned short _rotr16(unsigned short value, unsigned char shift); +__INTRIN_INLINE unsigned long long __ll_lshift(const unsigned long long Mask, const int Bit); +__INTRIN_INLINE long long __ll_rshift(const long long Mask, const int Bit); +__INTRIN_INLINE unsigned long long __ull_rshift(const unsigned long long Mask, int Bit); +__INTRIN_INLINE unsigned short _byteswap_ushort(unsigned short value); +__INTRIN_INLINE unsigned long _byteswap_ulong(unsigned long value); +#ifdef _M_AMD64 +__INTRIN_INLINE unsigned __int64 _byteswap_uint64(unsigned __int64 value); +#else +__INTRIN_INLINE unsigned __int64 _byteswap_uint64(unsigned __int64 value); +#endif + + __INTRIN_INLINE unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask) { __asm__("bsfl %[Mask], %[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask)); @@ -1001,11 +1152,11 @@ __INTRIN_INLINE long long __ll_rshift(const long long Mask, const int Bit) { - unsigned long long retval = Mask; + long long retval = Mask; __asm__ ( - "shldl %b[Bit], %%eax, %%edx; sarl %b[Bit], %%eax" : + "shrdl %b[Bit], %%edx, %%eax; sarl %b[Bit], %%edx" : "+A" (retval) : [Bit] "Nc" ((unsigned char)((unsigned long)Bit) & 0xFF) ); @@ -1019,7 +1170,7 @@ __asm__ ( - "shrdl %b[Bit], %%eax, %%edx; shrl %b[Bit], %%eax" : + "shrdl %b[Bit], %%edx, %%eax; shrl %b[Bit], %%edx" : "+A" (retval) : [Bit] "Nc" ((unsigned char)((unsigned long)Bit) & 0xFF) ); @@ -1052,7 +1203,7 @@ __INTRIN_INLINE unsigned __int64 _byteswap_uint64(unsigned __int64 value) { union { - __int64 int64part; + unsigned __int64 int64part; struct { unsigned long lowpart; unsigned long hipart; @@ -1067,6 +1218,15 @@ #endif /*** 64-bit math ***/ + +__INTRIN_INLINE long long __emul(const int a, const int b); +__INTRIN_INLINE unsigned long long __emulu(const unsigned int a, const unsigned int b); +#ifdef _M_AMD64 +__INTRIN_INLINE __int64 __mulh(__int64 a, __int64 b); +__INTRIN_INLINE unsigned __int64 __umulh(unsigned __int64 a, unsigned __int64 b); +#endif + + __INTRIN_INLINE long long __emul(const int a, const int b) { long long retval; @@ -1100,6 +1260,27 @@ #endif /*** Port I/O ***/ + +__INTRIN_INLINE unsigned char __inbyte(const unsigned short Port); +__INTRIN_INLINE unsigned short __inword(const unsigned short Port); +__INTRIN_INLINE unsigned long __indword(const unsigned short Port); +__INTRIN_INLINE void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count); +__INTRIN_INLINE void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count); +__INTRIN_INLINE void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count); +__INTRIN_INLINE void __outbyte(unsigned short const Port, const unsigned char Data); +__INTRIN_INLINE void __outword(unsigned short const Port, const unsigned short Data); +__INTRIN_INLINE void __outdword(unsigned short const Port, const unsigned long Data); +__INTRIN_INLINE void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count); +__INTRIN_INLINE void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count); +__INTRIN_INLINE void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count); +__INTRIN_INLINE int _inp(unsigned short Port); +__INTRIN_INLINE unsigned short _inpw(unsigned short Port); +__INTRIN_INLINE unsigned long _inpd(unsigned short Port); +__INTRIN_INLINE int _outp(unsigned short Port, int databyte); +__INTRIN_INLINE unsigned short _outpw(unsigned short Port, unsigned short dataword); +__INTRIN_INLINE unsigned long _outpd(unsigned short Port, unsigned long dataword); + + __INTRIN_INLINE unsigned char __inbyte(const unsigned short Port) { unsigned char byte; @@ -1201,7 +1382,7 @@ __INTRIN_INLINE int _outp(unsigned short Port, int databyte) { - __outbyte(Port, databyte); + __outbyte(Port, (unsigned char)databyte); return databyte; } @@ -1219,6 +1400,13 @@ /*** System information ***/ + +__INTRIN_INLINE void __cpuid(int CPUInfo [], const int InfoType); +__INTRIN_INLINE unsigned long long __rdtsc(void); +__INTRIN_INLINE void __writeeflags(uintptr_t Value); +__INTRIN_INLINE uintptr_t __readeflags(void); + + __INTRIN_INLINE void __cpuid(int CPUInfo[], const int InfoType) { __asm__ __volatile__("cpuid" : "=a" (CPUInfo[0]), "=b" (CPUInfo[1]), "=c" (CPUInfo[2]), "=d" (CPUInfo[3]) : "a" (InfoType)); @@ -1250,9 +1438,16 @@ } /*** Interrupts ***/ + +__INTRIN_INLINE void __int2c(void); +__INTRIN_INLINE void _disable(void); +__INTRIN_INLINE void _enable(void); +__INTRIN_INLINE void __halt(void); + #ifdef __clang__ #define __debugbreak() __asm__("int $3") #else +__INTRIN_INLINE void __debugbreak(void); __INTRIN_INLINE void __debugbreak(void) { __asm__("int $3"); @@ -1281,7 +1476,34 @@ /*** Protected memory management ***/ +__INTRIN_INLINE void __invlpg(void * const Address); #ifdef _M_AMD64 +__INTRIN_INLINE void __writecr0(const unsigned __int64 Data); +__INTRIN_INLINE void __writecr3(const unsigned __int64 Data); +__INTRIN_INLINE void __writecr4(const unsigned __int64 Data); +__INTRIN_INLINE void __writecr8(const unsigned __int64 Data); +__INTRIN_INLINE unsigned __int64 __readcr0(void); +__INTRIN_INLINE unsigned __int64 __readcr2(void); +__INTRIN_INLINE unsigned __int64 __readcr3(void); +__INTRIN_INLINE unsigned __int64 __readcr4(void); +__INTRIN_INLINE unsigned __int64 __readcr8(void); +__INTRIN_INLINE unsigned __int64 __readdr(unsigned int reg); +__INTRIN_INLINE void __writedr(unsigned reg, unsigned __int64 value); +#else /* _M_AMD64 */ +__INTRIN_INLINE void __writecr0(const unsigned int Data); +__INTRIN_INLINE void __writecr3(const unsigned int Data); +__INTRIN_INLINE void __writecr4(const unsigned int Data); +__INTRIN_INLINE unsigned long __readcr0(void); +__INTRIN_INLINE unsigned long __readcr2(void); +__INTRIN_INLINE unsigned long __readcr3(void); +__INTRIN_INLINE unsigned long __readcr4(void); +__INTRIN_INLINE unsigned int __readdr(unsigned int reg); +__INTRIN_INLINE void __writedr(unsigned reg, unsigned int value); +#endif /* _M_AMD64 */ + + +#ifdef _M_AMD64 + __INTRIN_INLINE void __writecr0(const unsigned __int64 Data) { __asm__("mov %[Data], %%cr0" : : [Data] "r" (Data) : "memory"); @@ -1336,7 +1558,9 @@ __asm__ __volatile__("movq %%cr8, %q[value]" : [value] "=r" (value)); return value; } -#else + +#else /* _M_AMD64 */ + __INTRIN_INLINE void __writecr0(const unsigned int Data) { __asm__("mov %[Data], %%cr0" : : [Data] "r" (Data) : "memory"); @@ -1379,9 +1603,11 @@ __asm__ __volatile__("mov %%cr4, %[value]" : [value] "=r" (value)); return value; } -#endif + +#endif /* _M_AMD64 */ #ifdef _M_AMD64 + __INTRIN_INLINE unsigned __int64 __readdr(unsigned int reg) { unsigned __int64 value; @@ -1445,7 +1671,9 @@ break; } } -#else + +#else /* _M_AMD64 */ + __INTRIN_INLINE unsigned int __readdr(unsigned int reg) { unsigned int value; @@ -1509,7 +1737,8 @@ break; } } -#endif + +#endif /* _M_AMD64 */ __INTRIN_INLINE void __invlpg(void * const Address) { @@ -1518,6 +1747,16 @@ /*** System operations ***/ + +__INTRIN_INLINE unsigned long long __readmsr(const int reg); +__INTRIN_INLINE void __writemsr(const unsigned long Register, const unsigned long long Value); +__INTRIN_INLINE unsigned long long __readpmc(const int counter); +__INTRIN_INLINE unsigned long __segmentlimit(const unsigned long a); +__INTRIN_INLINE void __wbinvd(void); +__INTRIN_INLINE void __lidt(void *Source); +__INTRIN_INLINE void __sidt(void *Destination); + + __INTRIN_INLINE unsigned long long __readmsr(const int reg) { #ifdef _M_AMD64 @@ -1572,6 +1811,9 @@ /*** Misc operations ***/ +__INTRIN_INLINE void _mm_pause(void); +__INTRIN_INLINE void __nop(void); + __INTRIN_INLINE void _mm_pause(void) { __asm__ __volatile__("pause" : : : "memory");
11 years, 4 months
1
0
0
0
[hbelusca] 59691: [NTVDM] - Use up to 256 parameters for programs (as suggested by the parsing while loop), but don't hardcode this values in many other places. - The passed command line to ntvdm s...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Aug 10 20:50:37 2013 New Revision: 59691 URL:
http://svn.reactos.org/svn/reactos?rev=59691&view=rev
Log: [NTVDM] - Use up to 256 parameters for programs (as suggested by the parsing while loop), but don't hardcode this values in many other places. - The passed command line to ntvdm should be as long as MAX_PATH. Modified: branches/ntvdm/subsystems/ntvdm/dos.c branches/ntvdm/subsystems/ntvdm/ntvdm.c Modified: branches/ntvdm/subsystems/ntvdm/dos.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Sat Aug 10 20:50:37 2013 @@ -874,8 +874,8 @@ BOOLEAN Success = FALSE, AllocatedEnvBlock = FALSE; HANDLE FileHandle = INVALID_HANDLE_VALUE, FileMapping = NULL; LPBYTE Address = NULL; - LPSTR ProgramFilePath, Parameters[128]; - CHAR CommandLineCopy[128]; + LPSTR ProgramFilePath, Parameters[256]; + CHAR CommandLineCopy[MAX_PATH]; INT ParamCount = 0; WORD Segment = 0; WORD MaxAllocSize; @@ -891,11 +891,13 @@ /* Save a copy of the command line */ strcpy(CommandLineCopy, CommandLine); + // FIXME: Improve parsing (especially: "some_path\with spaces\program.exe" options) + /* Get the file name of the executable */ ProgramFilePath = strtok(CommandLineCopy, " \t"); /* Load the parameters in the local array */ - while ((ParamCount < 256) + while ((ParamCount < sizeof(Parameters)/sizeof(Parameters[0])) && ((Parameters[ParamCount] = strtok(NULL, " \t")) != NULL)) { ParamCount++; Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.c?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] Sat Aug 10 20:50:37 2013 @@ -77,7 +77,7 @@ INT wmain(INT argc, WCHAR *argv[]) { INT i; - CHAR CommandLine[128]; + CHAR CommandLine[MAX_PATH]; DWORD CurrentTickCount; DWORD LastTickCount = GetTickCount(); DWORD Cycles = 0; @@ -94,11 +94,11 @@ UNREFERENCED_PARAMETER(argv); /* The DOS command line must be ASCII */ - WideCharToMultiByte(CP_ACP, 0, GetCommandLine(), -1, CommandLine, 128, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, GetCommandLine(), -1, CommandLine, sizeof(CommandLine), NULL, NULL); #else if (argc == 2 && argv[1] != NULL) { - WideCharToMultiByte(CP_ACP, 0, argv[1], -1, CommandLine, 128, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, argv[1], -1, CommandLine, sizeof(CommandLine), NULL, NULL); } else {
11 years, 4 months
1
0
0
0
[aandrejevic] 59690: [NTVDM] Optimize screen clearing by implementing it as a helper function in vga.c.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sat Aug 10 19:30:14 2013 New Revision: 59690 URL:
http://svn.reactos.org/svn/reactos?rev=59690&view=rev
Log: [NTVDM] Optimize screen clearing by implementing it as a helper function in vga.c. Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/vga.c branches/ntvdm/subsystems/ntvdm/vga.h Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Sat Aug 10 19:30:14 2013 @@ -255,31 +255,6 @@ } } -static VOID BiosClearScreen(VOID) -{ - INT i; - BYTE PlaneMask; - - /* Save the plane write register */ - VgaWritePort(VGA_SEQ_INDEX, VGA_SEQ_MASK_REG); - PlaneMask = VgaReadPort(VGA_SEQ_DATA); - - /* Write to all planes */ - VgaWritePort(VGA_SEQ_DATA, 0x0F); - - /* Clear the screen */ - for (i = VgaGetVideoBaseAddress(); - i < VgaGetVideoLimitAddress(); - i += sizeof(DWORD)) - { - DWORD Zero = 0; - VgaWriteMemory(i, (LPVOID)&Zero, sizeof(DWORD)); - } - - /* Restore the plane write register */ - VgaWritePort(VGA_SEQ_DATA, PlaneMask); -} - /* PUBLIC FUNCTIONS ***********************************************************/ BYTE BiosGetVideoMode(VOID) @@ -654,7 +629,7 @@ case 0x00: { BiosSetVideoMode(LOBYTE(Eax)); - BiosClearScreen(); + VgaClearMemory(); break; } Modified: branches/ntvdm/subsystems/ntvdm/vga.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Sat Aug 10 19:30:14 2013 @@ -1021,6 +1021,11 @@ } } +VOID VgaClearMemory(VOID) +{ + ZeroMemory(VgaMemory, sizeof(VgaMemory)); +} + VOID VgaInitialize(HANDLE TextHandle) { INT i, j; Modified: branches/ntvdm/subsystems/ntvdm/vga.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.h?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.h [iso-8859-1] Sat Aug 10 19:30:14 2013 @@ -193,6 +193,7 @@ VOID VgaWriteMemory(DWORD Address, LPBYTE Buffer, DWORD Size); BYTE VgaReadPort(WORD Port); VOID VgaWritePort(WORD Port, BYTE Data); +VOID VgaClearMemory(VOID); VOID VgaInitialize(HANDLE TextHandle); #endif // _VGA_H_
11 years, 4 months
1
0
0
0
[ekohl] 59689: [NETAPI32] Reimplement NetUserModalsGet and add NetUserModalsSet stub.
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Aug 10 19:24:03 2013 New Revision: 59689 URL:
http://svn.reactos.org/svn/reactos?rev=59689&view=rev
Log: [NETAPI32] Reimplement NetUserModalsGet and add NetUserModalsSet stub. Modified: trunk/reactos/dll/win32/netapi32/access.c trunk/reactos/dll/win32/netapi32/netapi32.spec trunk/reactos/dll/win32/netapi32/user.c Modified: trunk/reactos/dll/win32/netapi32/access.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/access.…
============================================================================== --- trunk/reactos/dll/win32/netapi32/access.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/access.c [iso-8859-1] Sat Aug 10 19:24:03 2013 @@ -262,130 +262,6 @@ return NERR_DCNotFound; /* say we can't find a domain controller */ } -/****************************************************************************** - * NetUserModalsGet (NETAPI32.@) - * - * Retrieves global information for all users and global groups in the security - * database. - * - * PARAMS - * szServer [I] Specifies the DNS or the NetBIOS name of the remote server - * on which the function is to execute. - * level [I] Information level of the data. - * 0 Return global passwords parameters. bufptr points to a - * USER_MODALS_INFO_0 struct. - * 1 Return logon server and domain controller information. bufptr - * points to a USER_MODALS_INFO_1 struct. - * 2 Return domain name and identifier. bufptr points to a - * USER_MODALS_INFO_2 struct. - * 3 Return lockout information. bufptr points to a USER_MODALS_INFO_3 - * struct. - * pbuffer [I] Buffer that receives the data. - * - * RETURNS - * Success: NERR_Success. - * Failure: - * ERROR_ACCESS_DENIED - the user does not have access to the info. - * NERR_InvalidComputer - computer name is invalid. - */ -NET_API_STATUS WINAPI NetUserModalsGet( - LPCWSTR szServer, DWORD level, LPBYTE *pbuffer) -{ - TRACE("(%s %d %p)\n", debugstr_w(szServer), level, pbuffer); - - switch (level) - { - case 0: - /* return global passwords parameters */ - FIXME("level 0 not implemented!\n"); - *pbuffer = NULL; - return NERR_InternalError; - case 1: - /* return logon server and domain controller info */ - FIXME("level 1 not implemented!\n"); - *pbuffer = NULL; - return NERR_InternalError; - case 2: - { - /* return domain name and identifier */ - PUSER_MODALS_INFO_2 umi; - LSA_HANDLE policyHandle; - LSA_OBJECT_ATTRIBUTES objectAttributes; - PPOLICY_ACCOUNT_DOMAIN_INFO domainInfo; - NTSTATUS ntStatus; - PSID domainIdentifier = NULL; - int domainNameLen, domainIdLen; - - ZeroMemory(&objectAttributes, sizeof(objectAttributes)); - objectAttributes.Length = sizeof(objectAttributes); - - ntStatus = LsaOpenPolicy(NULL, &objectAttributes, - POLICY_VIEW_LOCAL_INFORMATION, - &policyHandle); - if (ntStatus != STATUS_SUCCESS) - { - WARN("LsaOpenPolicy failed with NT status %x\n", - LsaNtStatusToWinError(ntStatus)); - return ntStatus; - } - - ntStatus = LsaQueryInformationPolicy(policyHandle, - PolicyAccountDomainInformation, - (PVOID *)&domainInfo); - if (ntStatus != STATUS_SUCCESS) - { - WARN("LsaQueryInformationPolicy failed with NT status %x\n", - LsaNtStatusToWinError(ntStatus)); - LsaClose(policyHandle); - return ntStatus; - } - - domainIdentifier = domainInfo->DomainSid; - domainIdLen = (domainIdentifier) ? GetLengthSid(domainIdentifier) : 0; - domainNameLen = lstrlenW(domainInfo->DomainName.Buffer) + 1; - LsaClose(policyHandle); - - ntStatus = NetApiBufferAllocate(sizeof(USER_MODALS_INFO_2) + - domainIdLen + - domainNameLen * sizeof(WCHAR), - (LPVOID *)pbuffer); - - if (ntStatus != NERR_Success) - { - WARN("NetApiBufferAllocate() failed\n"); - LsaFreeMemory(domainInfo); - return ntStatus; - } - - umi = (USER_MODALS_INFO_2 *) *pbuffer; - umi->usrmod2_domain_id = (domainIdLen > 0) ? (*pbuffer + sizeof(USER_MODALS_INFO_2)) : NULL; - umi->usrmod2_domain_name = (LPWSTR)(*pbuffer + - sizeof(USER_MODALS_INFO_2) + domainIdLen); - - lstrcpynW(umi->usrmod2_domain_name, - domainInfo->DomainName.Buffer, - domainNameLen); - if (domainIdLen > 0) - CopySid(GetLengthSid(domainIdentifier), umi->usrmod2_domain_id, - domainIdentifier); - - LsaFreeMemory(domainInfo); - - break; - } - case 3: - /* return lockout information */ - FIXME("level 3 not implemented!\n"); - *pbuffer = NULL; - return NERR_InternalError; - default: - TRACE("Invalid level %d is specified\n", level); - *pbuffer = NULL; - return ERROR_INVALID_LEVEL; - } - - return NERR_Success; -} NET_API_STATUS WINAPI NetUseAdd(LMSTR servername, DWORD level, LPBYTE bufptr, LPDWORD parm_err) { Modified: trunk/reactos/dll/win32/netapi32/netapi32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
============================================================================== --- trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] Sat Aug 10 19:24:03 2013 @@ -209,7 +209,7 @@ @ stdcall NetUserGetInfo(wstr wstr long ptr) @ stdcall NetUserGetLocalGroups(wstr wstr long long ptr long ptr ptr) @ stdcall NetUserModalsGet(wstr long ptr) -@ stub NetUserModalsSet +@ stdcall NetUserModalsSet(wstr long ptr ptr) @ stdcall NetUserSetGroups(wstr wstr long ptr long) @ stdcall NetUserSetInfo(wstr wstr long ptr ptr) @ stdcall NetWkstaGetInfo(wstr long ptr) Modified: trunk/reactos/dll/win32/netapi32/user.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/user.c?…
============================================================================== --- trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] Sat Aug 10 19:24:03 2013 @@ -45,6 +45,24 @@ BOOLEAN BuiltinDone; } ENUM_CONTEXT, *PENUM_CONTEXT; + + +static +ULONG +DeltaTimeToSeconds(LARGE_INTEGER DeltaTime) +{ + LARGE_INTEGER Seconds; + + if (DeltaTime.QuadPart == 0) + return 0; + + Seconds.QuadPart = -DeltaTime.QuadPart / 10000000; + + if (Seconds.HighPart != 0) + return TIMEQ_FOREVER; + + return Seconds.LowPart; +} static @@ -3059,6 +3077,332 @@ /****************************************************************************** + * NetUserModalsGet (NETAPI32.@) + * + * Retrieves global information for all users and global groups in the security + * database. + * + * PARAMS + * servername [I] Specifies the DNS or the NetBIOS name of the remote server + * on which the function is to execute. + * level [I] Information level of the data. + * 0 Return global passwords parameters. bufptr points to a + * USER_MODALS_INFO_0 struct. + * 1 Return logon server and domain controller information. bufptr + * points to a USER_MODALS_INFO_1 struct. + * 2 Return domain name and identifier. bufptr points to a + * USER_MODALS_INFO_2 struct. + * 3 Return lockout information. bufptr points to a USER_MODALS_INFO_3 + * struct. + * bufptr [O] Buffer that receives the data. + * + * RETURNS + * Success: NERR_Success. + * Failure: + * ERROR_ACCESS_DENIED - the user does not have access to the info. + * NERR_InvalidComputer - computer name is invalid. + */ +NET_API_STATUS +WINAPI +NetUserModalsGet(LPCWSTR servername, + DWORD level, + LPBYTE *bufptr) +{ + UNICODE_STRING ServerName; + SAM_HANDLE ServerHandle = NULL; + SAM_HANDLE DomainHandle = NULL; + PSID DomainSid = NULL; + PDOMAIN_PASSWORD_INFORMATION PasswordInfo = NULL; + PDOMAIN_LOGOFF_INFORMATION LogoffInfo = NULL; + PDOMAIN_SERVER_ROLE_INFORMATION ServerRoleInfo = NULL; + PDOMAIN_REPLICATION_INFORMATION ReplicationInfo = NULL; + PDOMAIN_NAME_INFORMATION NameInfo = NULL; + PDOMAIN_LOCKOUT_INFORMATION LockoutInfo = NULL; + ULONG DesiredAccess; + ULONG BufferSize; + PUSER_MODALS_INFO_0 umi0; + PUSER_MODALS_INFO_1 umi1; + PUSER_MODALS_INFO_2 umi2; + PUSER_MODALS_INFO_3 umi3; + NET_API_STATUS ApiStatus = NERR_Success; + NTSTATUS Status = STATUS_SUCCESS; + + TRACE("(%s %d %p)\n", debugstr_w(servername), level, bufptr); + + *bufptr = NULL; + + if (servername != NULL) + RtlInitUnicodeString(&ServerName, servername); + + /* Connect to the SAM Server */ + Status = SamConnect((servername != NULL) ? &ServerName : NULL, + &ServerHandle, + SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN, + NULL); + if (!NT_SUCCESS(Status)) + { + ERR("SamConnect failed (Status %08lx)\n", Status); + ApiStatus = NetpNtStatusToApiStatus(Status); + goto done; + } + + /* Get the Account Domain SID */ + Status = GetAccountDomainSid((servername != NULL) ? &ServerName : NULL, + &DomainSid); + if (!NT_SUCCESS(Status)) + { + ERR("GetAccountDomainSid failed (Status %08lx)\n", Status); + ApiStatus = NetpNtStatusToApiStatus(Status); + goto done; + } + + switch (level) + { + case 0: + DesiredAccess = DOMAIN_READ_OTHER_PARAMETERS | DOMAIN_READ_PASSWORD_PARAMETERS; + break; + + case 1: + DesiredAccess = DOMAIN_READ_OTHER_PARAMETERS; + break; + + case 2: + DesiredAccess = DOMAIN_READ_OTHER_PARAMETERS; + break; + + case 3: + DesiredAccess = DOMAIN_READ_PASSWORD_PARAMETERS; + break; + + default: + ApiStatus = ERROR_INVALID_LEVEL; + goto done; + } + + /* Open the Account Domain */ + Status = SamOpenDomain(ServerHandle, + DesiredAccess, + DomainSid, + &DomainHandle); + if (!NT_SUCCESS(Status)) + { + ERR("OpenAccountDomain failed (Status %08lx)\n", Status); + ApiStatus = NetpNtStatusToApiStatus(Status); + goto done; + } + + switch (level) + { + case 0: + /* return global passwords parameters */ + Status = SamQueryInformationDomain(DomainHandle, + DomainPasswordInformation, + (PVOID*)&PasswordInfo); + if (!NT_SUCCESS(Status)) + { + ApiStatus = NetpNtStatusToApiStatus(Status); + goto done; + } + + Status = SamQueryInformationDomain(DomainHandle, + DomainLogoffInformation, + (PVOID*)&LogoffInfo); + if (!NT_SUCCESS(Status)) + { + ApiStatus = NetpNtStatusToApiStatus(Status); + goto done; + } + + BufferSize = sizeof(USER_MODALS_INFO_0); + break; + + case 1: + /* return logon server and domain controller info */ + Status = SamQueryInformationDomain(DomainHandle, + DomainServerRoleInformation, + (PVOID*)&ServerRoleInfo); + if (!NT_SUCCESS(Status)) + { + ApiStatus = NetpNtStatusToApiStatus(Status); + goto done; + } + + Status = SamQueryInformationDomain(DomainHandle, + DomainReplicationInformation, + (PVOID*)&ReplicationInfo); + if (!NT_SUCCESS(Status)) + { + ApiStatus = NetpNtStatusToApiStatus(Status); + goto done; + } + + BufferSize = sizeof(USER_MODALS_INFO_1) + + ReplicationInfo->ReplicaSourceNodeName.Length + sizeof(WCHAR); + break; + + case 2: + /* return domain name and identifier */ + Status = SamQueryInformationDomain(DomainHandle, + DomainNameInformation, + (PVOID*)&NameInfo); + if (!NT_SUCCESS(Status)) + { + ApiStatus = NetpNtStatusToApiStatus(Status); + goto done; + } + + BufferSize = sizeof( USER_MODALS_INFO_2 ) + + NameInfo->DomainName.Length + sizeof(WCHAR) + + RtlLengthSid(DomainSid); + break; + + case 3: + /* return lockout information */ + Status = SamQueryInformationDomain(DomainHandle, + DomainLockoutInformation, + (PVOID*)&LockoutInfo); + if (!NT_SUCCESS(Status)) + { + ApiStatus = NetpNtStatusToApiStatus(Status); + goto done; + } + + BufferSize = sizeof(USER_MODALS_INFO_3); + break; + + default: + TRACE("Invalid level %d is specified\n", level); + ApiStatus = ERROR_INVALID_LEVEL; + goto done; + } + + + ApiStatus = NetApiBufferAllocate(BufferSize, + (LPVOID *)bufptr); + if (ApiStatus != NERR_Success) + { + WARN("NetApiBufferAllocate() failed\n"); + goto done; + } + + switch (level) + { + case 0: + umi0 = (PUSER_MODALS_INFO_0)*bufptr; + + umi0->usrmod0_min_passwd_len = PasswordInfo->MinPasswordLength; + umi0->usrmod0_max_passwd_age = (ULONG)(PasswordInfo->MaxPasswordAge.QuadPart / 10000000); + umi0->usrmod0_min_passwd_age = + DeltaTimeToSeconds(PasswordInfo->MinPasswordAge); + umi0->usrmod0_force_logoff = + DeltaTimeToSeconds(LogoffInfo->ForceLogoff); + umi0->usrmod0_password_hist_len = PasswordInfo->PasswordHistoryLength; + break; + + case 1: + umi1 = (PUSER_MODALS_INFO_1)*bufptr; + + switch (ServerRoleInfo->DomainServerRole) + { + + umi1->usrmod1_role = UAS_ROLE_STANDALONE; + umi1->usrmod1_role = UAS_ROLE_MEMBER; + + case DomainServerRolePrimary: + umi1->usrmod1_role = UAS_ROLE_PRIMARY; + break; + + case DomainServerRoleBackup: + umi1->usrmod1_role = UAS_ROLE_BACKUP; + break; + + default: + ApiStatus = NERR_InternalError; + goto done; + } + + umi1->usrmod1_primary = (LPWSTR)(*bufptr + sizeof(USER_MODALS_INFO_1)); + RtlCopyMemory(umi1->usrmod1_primary, + ReplicationInfo->ReplicaSourceNodeName.Buffer, + ReplicationInfo->ReplicaSourceNodeName.Length); + umi1->usrmod1_primary[ReplicationInfo->ReplicaSourceNodeName.Length / sizeof(WCHAR)] = UNICODE_NULL; + break; + + case 2: + umi2 = (PUSER_MODALS_INFO_2)*bufptr; + + umi2->usrmod2_domain_name = (LPWSTR)(*bufptr + sizeof(USER_MODALS_INFO_2)); + RtlCopyMemory(umi2->usrmod2_domain_name, + NameInfo->DomainName.Buffer, + NameInfo->DomainName.Length); + umi2->usrmod2_domain_name[NameInfo->DomainName.Length / sizeof(WCHAR)] = UNICODE_NULL; + + umi2->usrmod2_domain_id = *bufptr + + sizeof(USER_MODALS_INFO_2) + + NameInfo->DomainName.Length + sizeof(WCHAR); + RtlCopyMemory(umi2->usrmod2_domain_id, + DomainSid, + RtlLengthSid(DomainSid)); + break; + + case 3: + umi3 = (PUSER_MODALS_INFO_3)*bufptr; + umi3->usrmod3_lockout_duration = + DeltaTimeToSeconds(LockoutInfo->LockoutDuration); + umi3->usrmod3_lockout_observation_window = + DeltaTimeToSeconds(LockoutInfo->LockoutObservationWindow ); + umi3->usrmod3_lockout_threshold = LockoutInfo->LockoutThreshold; + break; + } + +done: + if (LockoutInfo != NULL) + SamFreeMemory(LockoutInfo); + + if (NameInfo != NULL) + SamFreeMemory(NameInfo); + + if (ReplicationInfo != NULL) + SamFreeMemory(ReplicationInfo); + + if (ServerRoleInfo != NULL) + SamFreeMemory(ServerRoleInfo); + + if (LogoffInfo != NULL) + SamFreeMemory(LogoffInfo); + + if (PasswordInfo != NULL) + SamFreeMemory(PasswordInfo); + + if (DomainSid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, DomainSid); + + if (DomainHandle != NULL) + SamCloseHandle(DomainHandle); + + if (ServerHandle != NULL) + SamCloseHandle(ServerHandle); + + return ApiStatus; +} + + +/****************************************************************************** + * NetUserModalsSet (NETAPI32.@) + */ +NET_API_STATUS +WINAPI +NetUserModalsSet(IN LPCWSTR servername, + IN DWORD level, + IN LPBYTE buf, + OUT LPDWORD parm_err) +{ + FIXME("(%s %d %p %p)\n", debugstr_w(servername), level, buf, parm_err); + return ERROR_ACCESS_DENIED; +} + + +/****************************************************************************** * NetUserSetGroups (NETAPI32.@) */ NET_API_STATUS
11 years, 4 months
1
0
0
0
[aandrejevic] 59688: [NTVDM] Clear the screen when switching video modes.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sat Aug 10 19:24:00 2013 New Revision: 59688 URL:
http://svn.reactos.org/svn/reactos?rev=59688&view=rev
Log: [NTVDM] Clear the screen when switching video modes. Modified: branches/ntvdm/subsystems/ntvdm/bios.c Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Sat Aug 10 19:24:00 2013 @@ -255,6 +255,31 @@ } } +static VOID BiosClearScreen(VOID) +{ + INT i; + BYTE PlaneMask; + + /* Save the plane write register */ + VgaWritePort(VGA_SEQ_INDEX, VGA_SEQ_MASK_REG); + PlaneMask = VgaReadPort(VGA_SEQ_DATA); + + /* Write to all planes */ + VgaWritePort(VGA_SEQ_DATA, 0x0F); + + /* Clear the screen */ + for (i = VgaGetVideoBaseAddress(); + i < VgaGetVideoLimitAddress(); + i += sizeof(DWORD)) + { + DWORD Zero = 0; + VgaWriteMemory(i, (LPVOID)&Zero, sizeof(DWORD)); + } + + /* Restore the plane write register */ + VgaWritePort(VGA_SEQ_DATA, PlaneMask); +} + /* PUBLIC FUNCTIONS ***********************************************************/ BYTE BiosGetVideoMode(VOID) @@ -304,7 +329,7 @@ /* Update the values in the BDA */ Bda->VideoMode = ModeNumber; Bda->VideoPage = 0; - Bda->VideoPageSize = BIOS_PAGE_SIZE; + Bda->VideoPageSize = BIOS_PAGE_SIZE; Bda->VideoPageOffset = 0; /* Get the character height */ @@ -629,6 +654,8 @@ case 0x00: { BiosSetVideoMode(LOBYTE(Eax)); + BiosClearScreen(); + break; }
11 years, 4 months
1
0
0
0
[aandrejevic] 59687: Synchronize with trunk to fix spec2def issue. [NTVDM] Implement write modes and latch register for VGA.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sat Aug 10 17:06:04 2013 New Revision: 59687 URL:
http://svn.reactos.org/svn/reactos?rev=59687&view=rev
Log: Synchronize with trunk to fix spec2def issue. [NTVDM] Implement write modes and latch register for VGA. Modified: branches/ntvdm/ (props changed) branches/ntvdm/dll/win32/samsrv/samsrv.h branches/ntvdm/dll/win32/samsrv/setup.c branches/ntvdm/drivers/hid/hidparse/ (props changed) branches/ntvdm/drivers/hid/hidusb/ (props changed) branches/ntvdm/drivers/usb/usbehci/ (props changed) branches/ntvdm/drivers/usb/usbhub/ (props changed) branches/ntvdm/drivers/usb/usbohci/ (props changed) branches/ntvdm/lib/drivers/libusb/common_interfaces.h (props changed) branches/ntvdm/lib/drivers/libusb/hcd_controller.cpp (props changed) branches/ntvdm/lib/drivers/libusb/hub_controller.cpp (props changed) branches/ntvdm/lib/drivers/libusb/libusb.cpp (props changed) branches/ntvdm/lib/drivers/libusb/libusb.h (props changed) branches/ntvdm/lib/drivers/libusb/memory_manager.cpp (props changed) branches/ntvdm/lib/drivers/libusb/misc.cpp (props changed) branches/ntvdm/lib/drivers/libusb/purecall.cpp (props changed) branches/ntvdm/lib/drivers/libusb/usb_device.cpp (props changed) branches/ntvdm/subsystems/ntvdm/CMakeLists.txt branches/ntvdm/subsystems/ntvdm/vga.c branches/ntvdm/tools/spec2def/spec2def.c Propchange: branches/ntvdm/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -15,4 +15,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:59241-59683 +/trunk/reactos:59241-59686 Modified: branches/ntvdm/dll/win32/samsrv/samsrv.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/samsrv/samsrv.h…
============================================================================== --- branches/ntvdm/dll/win32/samsrv/samsrv.h [iso-8859-1] (original) +++ branches/ntvdm/dll/win32/samsrv/samsrv.h [iso-8859-1] Sat Aug 10 17:06:04 2013 @@ -9,6 +9,7 @@ #include <stdio.h> #include <stdlib.h> +#include <limits.h> #define WIN32_NO_STATUS #define _INC_WINDOWS #define COM_NO_WINDOWS_H Modified: branches/ntvdm/dll/win32/samsrv/setup.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/samsrv/setup.c?…
============================================================================== --- branches/ntvdm/dll/win32/samsrv/setup.c [iso-8859-1] (original) +++ branches/ntvdm/dll/win32/samsrv/setup.c [iso-8859-1] Sat Aug 10 17:06:04 2013 @@ -577,7 +577,7 @@ FixedData.DomainModifiedCount.QuadPart = 0; FixedData.MaxPasswordAge.QuadPart = -(6LL * 7LL * 24LL * 60LL * 60LL * TICKS_PER_SECOND); /* 6 weeks */ FixedData.MinPasswordAge.QuadPart = 0; /* right now */ -// FixedData.ForceLogoff.QuadPart = // very far in the future aka never + FixedData.ForceLogoff.QuadPart = LLONG_MAX; /* very far in the future aka never */ FixedData.LockoutDuration.QuadPart = -(30LL * 60LL * TICKS_PER_SECOND); /* 30 minutes */ FixedData.LockoutObservationWindow.QuadPart = -(30LL * 60LL * TICKS_PER_SECOND); /* 30 minutes */ FixedData.ModifiedCountAtLastPromotion.QuadPart = 0; Propchange: branches/ntvdm/drivers/hid/hidparse/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -18,5 +18,5 @@ /branches/usb-bringup/drivers/hid/hidparse:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk/drivers/hid/hidparse:55020-55543,55548-55554 /branches/wlan-bringup/drivers/hid/hidparse:54809-54998 -/trunk/reactos/drivers/hid/hidparse:59241-59683 +/trunk/reactos/drivers/hid/hidparse:59241-59686 /trunk/reactos/drivers/usb/hidparse:48236-51323 Propchange: branches/ntvdm/drivers/hid/hidusb/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -18,5 +18,5 @@ /branches/usb-bringup/drivers/hid/hidusb:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk/drivers/hid/hidusb:55020-55543,55548-55554 /branches/wlan-bringup/drivers/hid/hidusb:54809-54998 -/trunk/reactos/drivers/hid/hidusb:59241-59683 +/trunk/reactos/drivers/hid/hidusb:59241-59686 /trunk/reactos/drivers/usb/hidusb:48236-51323 Propchange: branches/ntvdm/drivers/usb/usbehci/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new:54809-54998 -/trunk/reactos/drivers/usb/usbehci:59241-59683 +/trunk/reactos/drivers/usb/usbehci:59241-59686 Propchange: branches/ntvdm/drivers/usb/usbhub/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbhub:55524-55543,55548-55554 /branches/wlan-bringup/drivers/usb/usbhub:54809-54998 /branches/wlan-bringup/drivers/usb/usbhub_new:54809-54998 -/trunk/reactos/drivers/usb/usbhub:59241-59683 +/trunk/reactos/drivers/usb/usbhub:59241-59686 Propchange: branches/ntvdm/drivers/usb/usbohci/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -19,4 +19,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbohci:55019-55543,55548-55554 /branches/wlan-bringup/drivers/usb/usbohci:54809-54998 /trunk/reactos/drivers/usb/usbehci_new:48236-51323 -/trunk/reactos/drivers/usb/usbohci:59241-59683 +/trunk/reactos/drivers/usb/usbohci:59241-59686 Propchange: branches/ntvdm/lib/drivers/libusb/common_interfaces.h ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/interfaces.h:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/interfaces.h:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/interfaces.h:54809-54998 -/trunk/reactos/lib/drivers/libusb/common_interfaces.h:59241-59683 +/trunk/reactos/lib/drivers/libusb/common_interfaces.h:59241-59686 Propchange: branches/ntvdm/lib/drivers/libusb/hcd_controller.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/hcd_controller.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/hcd_controller.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/hcd_controller.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/hcd_controller.cpp:59241-59683 +/trunk/reactos/lib/drivers/libusb/hcd_controller.cpp:59241-59686 Propchange: branches/ntvdm/lib/drivers/libusb/hub_controller.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/hub_controller.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/hub_controller.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/hub_controller.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/hub_controller.cpp:59241-59683 +/trunk/reactos/lib/drivers/libusb/hub_controller.cpp:59241-59686 Propchange: branches/ntvdm/lib/drivers/libusb/libusb.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/usbehci.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/usbehci.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/libusb.cpp:59241-59683 +/trunk/reactos/lib/drivers/libusb/libusb.cpp:59241-59686 Propchange: branches/ntvdm/lib/drivers/libusb/libusb.h ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.h:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/usbehci.h:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/usbehci.h:54809-54998 -/trunk/reactos/lib/drivers/libusb/libusb.h:59241-59683 +/trunk/reactos/lib/drivers/libusb/libusb.h:59241-59686 Propchange: branches/ntvdm/lib/drivers/libusb/memory_manager.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/memory_manager.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/memory_manager.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/memory_manager.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/memory_manager.cpp:59241-59683 +/trunk/reactos/lib/drivers/libusb/memory_manager.cpp:59241-59686 Propchange: branches/ntvdm/lib/drivers/libusb/misc.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/misc.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/misc.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/misc.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/misc.cpp:59241-59683 +/trunk/reactos/lib/drivers/libusb/misc.cpp:59241-59686 Propchange: branches/ntvdm/lib/drivers/libusb/purecall.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/purecall.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/purecall.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/purecall.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/purecall.cpp:59241-59683 +/trunk/reactos/lib/drivers/libusb/purecall.cpp:59241-59686 Propchange: branches/ntvdm/lib/drivers/libusb/usb_device.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Aug 10 17:06:04 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/usb_device.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/usb_device.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/usb_device.cpp:59241-59683 +/trunk/reactos/lib/drivers/libusb/usb_device.cpp:59241-59686 Modified: branches/ntvdm/subsystems/ntvdm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/CMakeLis…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] Sat Aug 10 17:06:04 2013 @@ -13,8 +13,8 @@ ps2.c vga.c ntvdm.c - ntvdm.rc) -# ${CMAKE_CURRENT_BINARY_DIR}/ntvdm.def + ntvdm.rc + ${CMAKE_CURRENT_BINARY_DIR}/ntvdm.def) add_executable(ntvdm ${SOURCE}) set_module_type(ntvdm win32cui UNICODE) Modified: branches/ntvdm/subsystems/ntvdm/vga.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Sat Aug 10 17:06:04 2013 @@ -19,6 +19,7 @@ static CONST DWORD MemoryLimit[] = { 0xAFFFF, 0xAFFFF, 0xB7FFF, 0xBFFFF }; static BYTE VgaMemory[VGA_NUM_BANKS * VGA_BANK_SIZE]; +static BYTE VgaLatchRegisters[VGA_NUM_BANKS] = {0, 0, 0, 0}; static BYTE VgaMiscRegister; static BYTE VgaSeqIndex = VGA_SEQ_RESET_REG; static BYTE VgaSeqRegisters[VGA_SEQ_MAX_REG]; @@ -117,6 +118,66 @@ return Offset; } +static inline BYTE VgaTranslateByteForWriting(BYTE Data, BYTE Plane) +{ + BYTE WriteMode = VgaGcRegisters[VGA_GC_MODE_REG] & 3; + BYTE LogicalOperation = (VgaGcRegisters[VGA_GC_ROTATE_REG] >> 3) & 3; + BYTE RotateCount = VgaGcRegisters[VGA_GC_ROTATE_REG] & 7; + BYTE BitMask = VgaGcRegisters[VGA_GC_BITMASK_REG]; + + if (WriteMode == 1) + { + /* In write mode 1 just return the latch register */ + return VgaLatchRegisters[Plane]; + } + + if (WriteMode != 2) + { + /* Write modes 0 and 3 rotate the data to the right first */ + Data = LOBYTE(((DWORD)Data >> RotateCount) | ((DWORD)Data << (8 - RotateCount))); + } + else + { + /* Write mode 2 expands the appropriate bit to all 8 bits */ + Data = (Data & (1 << Plane)) ? 0xFF : 0x00; + } + + if (WriteMode == 0) + { + /* + * In write mode 0, the enable set/reset register decides if the + * set/reset bit should be expanded to all 8 bits. + */ + if (VgaGcRegisters[VGA_GC_ENABLE_RESET_REG] & (1 << Plane)) + { + /* Copy the bit from the set/reset register to all 8 bits */ + Data = (VgaGcRegisters[VGA_GC_RESET_REG] & (1 << Plane)) ? 0xFF : 0x00; + } + } + + if (WriteMode != 3) + { + /* Write modes 0 and 2 then perform a logical operation on the data and latch */ + if (LogicalOperation == 1) Data &= VgaLatchRegisters[Plane]; + else if (LogicalOperation == 2) Data |= VgaLatchRegisters[Plane]; + else if (LogicalOperation == 3) Data ^= VgaLatchRegisters[Plane]; + } + else + { + /* For write mode 3, we AND the bitmask with the data, which is used as the new bitmask */ + BitMask &= Data; + + /* Then we expand the bit in the set/reset field */ + Data = (VgaGcRegisters[VGA_GC_RESET_REG] & (1 << Plane)) ? 0xFF : 0x00; + } + + /* Bits cleared in the bitmask are replaced with latch register bits */ + Data = (Data & BitMask) | (VgaLatchRegisters[Plane] & (~BitMask)); + + /* Return the byte */ + return Data; +} + static inline VOID VgaMarkForUpdate(SHORT Row, SHORT Column) { DPRINT("VgaMarkForUpdate: Row %d, Column %d\n", Row, Column); @@ -694,6 +755,12 @@ { VideoAddress = VgaTranslateReadAddress(Address + i); + /* Load the latch registers */ + VgaLatchRegisters[0] = VgaMemory[LOWORD(VideoAddress)]; + VgaLatchRegisters[1] = VgaMemory[VGA_BANK_SIZE + LOWORD(VideoAddress)]; + VgaLatchRegisters[2] = VgaMemory[(2 * VGA_BANK_SIZE) + LOWORD(VideoAddress)]; + VgaLatchRegisters[3] = VgaMemory[(3 * VGA_BANK_SIZE) + LOWORD(VideoAddress)]; + /* Copy the value to the buffer */ Buffer[i] = VgaMemory[VideoAddress]; } @@ -745,7 +812,7 @@ } /* Copy the value to the VGA memory */ - VgaMemory[VideoAddress + j * VGA_BANK_SIZE] = Buffer[i]; + VgaMemory[VideoAddress + j * VGA_BANK_SIZE] = VgaTranslateByteForWriting(Buffer[i], j); } } } Modified: branches/ntvdm/tools/spec2def/spec2def.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/tools/spec2def/spec2def.c…
============================================================================== --- branches/ntvdm/tools/spec2def/spec2def.c [iso-8859-1] (original) +++ branches/ntvdm/tools/spec2def/spec2def.c [iso-8859-1] Sat Aug 10 17:06:04 2013 @@ -306,7 +306,7 @@ { fprintf(file, "; File generated automatically, do not edit!\n\n" - "LIBRARY %s\n\n" + "NAME %s\n\n" "EXPORTS\n", libname); }
11 years, 4 months
1
0
0
0
[hbelusca] 59686: [SPEC2DEF] In GCC builds, LD sucks, and therefore, use NAME instead of LIBRARY to prevent that GNU crap from marking executables as dlls just because they export stuff, which is n...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Aug 10 15:00:50 2013 New Revision: 59686 URL:
http://svn.reactos.org/svn/reactos?rev=59686&view=rev
Log: [SPEC2DEF] In GCC builds, LD sucks, and therefore, use NAME instead of LIBRARY to prevent that GNU crap from marking executables as dlls just because they export stuff, which is needed by both ntoskrnl and ntvdm. Tested and approved by Aleksandar Aandrejevic a.k.a. [TheFlash], gigaherz and Amine Khaldi. See:
http://msdn.microsoft.com/en-us/library/28d6s79h.aspx
- "Module-Definition (.Def) Files"
http://msdn.microsoft.com/en-us/library/30fw19zw.aspx
- For a description of the LIBRARY keyword
http://msdn.microsoft.com/en-us/library/03b3wfkt.aspx
- For a description of the NAME keyword
http://sourceware.org/binutils/docs-2.16/binutils/def-file-format.html
- "The format of the dlltool .def file" (GCC) for more information. Modified: trunk/reactos/tools/spec2def/spec2def.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] Sat Aug 10 15:00:50 2013 @@ -306,7 +306,7 @@ { fprintf(file, "; File generated automatically, do not edit!\n\n" - "LIBRARY %s\n\n" + "NAME %s\n\n" "EXPORTS\n", libname); }
11 years, 4 months
1
0
0
0
[ekohl] 59685: [SAMSRV] Initialize default domain ForceLogoff time.
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Aug 10 12:53:29 2013 New Revision: 59685 URL:
http://svn.reactos.org/svn/reactos?rev=59685&view=rev
Log: [SAMSRV] Initialize default domain ForceLogoff time. Modified: trunk/reactos/dll/win32/samsrv/samsrv.h trunk/reactos/dll/win32/samsrv/setup.c Modified: trunk/reactos/dll/win32/samsrv/samsrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.h?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] Sat Aug 10 12:53:29 2013 @@ -9,6 +9,7 @@ #include <stdio.h> #include <stdlib.h> +#include <limits.h> #define WIN32_NO_STATUS #define _INC_WINDOWS #define COM_NO_WINDOWS_H Modified: trunk/reactos/dll/win32/samsrv/setup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/setup.c?r…
============================================================================== --- trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] Sat Aug 10 12:53:29 2013 @@ -577,7 +577,7 @@ FixedData.DomainModifiedCount.QuadPart = 0; FixedData.MaxPasswordAge.QuadPart = -(6LL * 7LL * 24LL * 60LL * 60LL * TICKS_PER_SECOND); /* 6 weeks */ FixedData.MinPasswordAge.QuadPart = 0; /* right now */ -// FixedData.ForceLogoff.QuadPart = // very far in the future aka never + FixedData.ForceLogoff.QuadPart = LLONG_MAX; /* very far in the future aka never */ FixedData.LockoutDuration.QuadPart = -(30LL * 60LL * TICKS_PER_SECOND); /* 30 minutes */ FixedData.LockoutObservationWindow.QuadPart = -(30LL * 60LL * TICKS_PER_SECOND); /* 30 minutes */ FixedData.ModifiedCountAtLastPromotion.QuadPart = 0;
11 years, 4 months
1
0
0
0
[aandrejevic] 59684: [NTVDM] Synchronize with trunk again to fix important bugs in the build system. Implement register control functions which should be exported (Adapted from a patch by Hermes Be...
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Fri Aug 9 23:52:08 2013 New Revision: 59684 URL:
http://svn.reactos.org/svn/reactos?rev=59684&view=rev
Log: [NTVDM] Synchronize with trunk again to fix important bugs in the build system. Implement register control functions which should be exported (Adapted from a patch by Hermes Belusca-Maito). The actual export is temporarily disabled because a bug in the build system compiles ntvdm as a DLL instead of an EXE. Added: branches/ntvdm/subsystems/ntvdm/ntvdm.spec (with props) branches/ntvdm/subsystems/ntvdm/registers.c (with props) branches/ntvdm/subsystems/ntvdm/registers.h (with props) Modified: branches/ntvdm/ (props changed) branches/ntvdm/cmake/CMakeMacros.cmake branches/ntvdm/drivers/hid/hidparse/ (props changed) branches/ntvdm/drivers/hid/hidusb/ (props changed) branches/ntvdm/drivers/usb/usbehci/ (props changed) branches/ntvdm/drivers/usb/usbhub/ (props changed) branches/ntvdm/drivers/usb/usbohci/ (props changed) branches/ntvdm/lib/drivers/libusb/common_interfaces.h (props changed) branches/ntvdm/lib/drivers/libusb/hcd_controller.cpp (props changed) branches/ntvdm/lib/drivers/libusb/hub_controller.cpp (props changed) branches/ntvdm/lib/drivers/libusb/libusb.cpp (props changed) branches/ntvdm/lib/drivers/libusb/libusb.h (props changed) branches/ntvdm/lib/drivers/libusb/memory_manager.cpp (props changed) branches/ntvdm/lib/drivers/libusb/misc.cpp (props changed) branches/ntvdm/lib/drivers/libusb/purecall.cpp (props changed) branches/ntvdm/lib/drivers/libusb/usb_device.cpp (props changed) branches/ntvdm/subsystems/ntvdm/CMakeLists.txt branches/ntvdm/subsystems/ntvdm/emulator.c branches/ntvdm/subsystems/ntvdm/emulator.h Propchange: branches/ntvdm/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -15,4 +15,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:59241-59678 +/trunk/reactos:59241-59683 Modified: branches/ntvdm/cmake/CMakeMacros.cmake URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/cmake/CMakeMacros.cmake?r…
============================================================================== --- branches/ntvdm/cmake/CMakeMacros.cmake [iso-8859-1] (original) +++ branches/ntvdm/cmake/CMakeMacros.cmake [iso-8859-1] Fri Aug 9 23:52:08 2013 @@ -430,7 +430,13 @@ elseif(${TYPE} STREQUAL nativecui) set(__entrypoint NtProcessStartup) set(__entrystack 4) - elseif((${TYPE} STREQUAL win32gui) OR (${TYPE} STREQUAL win32cui)) + elseif(${TYPE} STREQUAL win32cui) + if(__module_UNICODE) + set(__entrypoint wmainCRTStartup) + else() + set(__entrypoint mainCRTStartup) + endif() + elseif(${TYPE} STREQUAL win32gui) if(__module_UNICODE) set(__entrypoint wWinMainCRTStartup) else() Propchange: branches/ntvdm/drivers/hid/hidparse/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -18,5 +18,5 @@ /branches/usb-bringup/drivers/hid/hidparse:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk/drivers/hid/hidparse:55020-55543,55548-55554 /branches/wlan-bringup/drivers/hid/hidparse:54809-54998 -/trunk/reactos/drivers/hid/hidparse:59241-59678 +/trunk/reactos/drivers/hid/hidparse:59241-59683 /trunk/reactos/drivers/usb/hidparse:48236-51323 Propchange: branches/ntvdm/drivers/hid/hidusb/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -18,5 +18,5 @@ /branches/usb-bringup/drivers/hid/hidusb:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk/drivers/hid/hidusb:55020-55543,55548-55554 /branches/wlan-bringup/drivers/hid/hidusb:54809-54998 -/trunk/reactos/drivers/hid/hidusb:59241-59678 +/trunk/reactos/drivers/hid/hidusb:59241-59683 /trunk/reactos/drivers/usb/hidusb:48236-51323 Propchange: branches/ntvdm/drivers/usb/usbehci/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new:54809-54998 -/trunk/reactos/drivers/usb/usbehci:59241-59678 +/trunk/reactos/drivers/usb/usbehci:59241-59683 Propchange: branches/ntvdm/drivers/usb/usbhub/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbhub:55524-55543,55548-55554 /branches/wlan-bringup/drivers/usb/usbhub:54809-54998 /branches/wlan-bringup/drivers/usb/usbhub_new:54809-54998 -/trunk/reactos/drivers/usb/usbhub:59241-59678 +/trunk/reactos/drivers/usb/usbhub:59241-59683 Propchange: branches/ntvdm/drivers/usb/usbohci/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -19,4 +19,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbohci:55019-55543,55548-55554 /branches/wlan-bringup/drivers/usb/usbohci:54809-54998 /trunk/reactos/drivers/usb/usbehci_new:48236-51323 -/trunk/reactos/drivers/usb/usbohci:59241-59678 +/trunk/reactos/drivers/usb/usbohci:59241-59683 Propchange: branches/ntvdm/lib/drivers/libusb/common_interfaces.h ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/interfaces.h:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/interfaces.h:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/interfaces.h:54809-54998 -/trunk/reactos/lib/drivers/libusb/common_interfaces.h:59241-59678 +/trunk/reactos/lib/drivers/libusb/common_interfaces.h:59241-59683 Propchange: branches/ntvdm/lib/drivers/libusb/hcd_controller.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/hcd_controller.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/hcd_controller.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/hcd_controller.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/hcd_controller.cpp:59241-59678 +/trunk/reactos/lib/drivers/libusb/hcd_controller.cpp:59241-59683 Propchange: branches/ntvdm/lib/drivers/libusb/hub_controller.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/hub_controller.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/hub_controller.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/hub_controller.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/hub_controller.cpp:59241-59678 +/trunk/reactos/lib/drivers/libusb/hub_controller.cpp:59241-59683 Propchange: branches/ntvdm/lib/drivers/libusb/libusb.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/usbehci.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/usbehci.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/libusb.cpp:59241-59678 +/trunk/reactos/lib/drivers/libusb/libusb.cpp:59241-59683 Propchange: branches/ntvdm/lib/drivers/libusb/libusb.h ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.h:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/usbehci.h:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/usbehci.h:54809-54998 -/trunk/reactos/lib/drivers/libusb/libusb.h:59241-59678 +/trunk/reactos/lib/drivers/libusb/libusb.h:59241-59683 Propchange: branches/ntvdm/lib/drivers/libusb/memory_manager.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/memory_manager.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/memory_manager.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/memory_manager.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/memory_manager.cpp:59241-59678 +/trunk/reactos/lib/drivers/libusb/memory_manager.cpp:59241-59683 Propchange: branches/ntvdm/lib/drivers/libusb/misc.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/misc.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/misc.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/misc.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/misc.cpp:59241-59678 +/trunk/reactos/lib/drivers/libusb/misc.cpp:59241-59683 Propchange: branches/ntvdm/lib/drivers/libusb/purecall.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/purecall.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/purecall.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/purecall.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/purecall.cpp:59241-59678 +/trunk/reactos/lib/drivers/libusb/purecall.cpp:59241-59683 Propchange: branches/ntvdm/lib/drivers/libusb/usb_device.cpp ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 9 23:52:08 2013 @@ -27,4 +27,4 @@ /branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp:55524-55543,55548-55554,55556-55567 /branches/wlan-bringup/drivers/usb/usbehci/usb_device.cpp:54809-54998 /branches/wlan-bringup/drivers/usb/usbehci_new/usb_device.cpp:54809-54998 -/trunk/reactos/lib/drivers/libusb/usb_device.cpp:59241-59678 +/trunk/reactos/lib/drivers/libusb/usb_device.cpp:59241-59683 Modified: branches/ntvdm/subsystems/ntvdm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/CMakeLis…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] Fri Aug 9 23:52:08 2013 @@ -1,16 +1,20 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/softx86) + +spec2def(ntvdm.exe ntvdm.spec) list(APPEND SOURCE bios.c dos.c emulator.c pic.c + registers.c timer.c ps2.c vga.c ntvdm.c ntvdm.rc) +# ${CMAKE_CURRENT_BINARY_DIR}/ntvdm.def add_executable(ntvdm ${SOURCE}) set_module_type(ntvdm win32cui UNICODE) Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Fri Aug 9 23:52:08 2013 @@ -416,7 +416,7 @@ return TRUE; } -VOID EmulatorSetStack(WORD Segment, WORD Offset) +VOID EmulatorSetStack(WORD Segment, DWORD Offset) { #ifndef NEW_EMULATOR /* Call the softx86 API */ @@ -479,6 +479,15 @@ #endif } +ULONG EmulatorGetProgramCounter(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->reg_ip; +#else + return EmulatorContext.InstructionPointer.Long; +#endif +} + VOID EmulatorSetRegister(ULONG Register, ULONG Value) { #ifndef NEW_EMULATOR @@ -524,9 +533,9 @@ VOID EmulatorStep(VOID) { +#ifndef NEW_EMULATOR LPWORD Instruction; -#ifndef NEW_EMULATOR /* Print the current position - useful for debugging */ DPRINT("Executing at CS:IP = %04X:%04X\n", EmulatorGetRegister(EMULATOR_REG_CS), Modified: branches/ntvdm/subsystems/ntvdm/emulator.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] Fri Aug 9 23:52:08 2013 @@ -168,14 +168,22 @@ typedef VOID (*EMULATOR_OPCODE_HANDLER)(PEMULATOR_CONTEXT Context, BYTE Opcode); +#ifndef NEW_EMULATOR +extern softx86_ctx EmulatorContext; +extern softx87_ctx FpuEmulatorContext; +#else +extern EMULATOR_CONTEXT EmulatorContext; +#endif + /* FUNCTIONS ******************************************************************/ BOOLEAN EmulatorInitialize(); -VOID EmulatorSetStack(WORD Segment, WORD Offset); +VOID EmulatorSetStack(WORD Segment, DWORD Offset); VOID EmulatorExecute(WORD Segment, WORD Offset); VOID EmulatorInterrupt(BYTE Number); VOID EmulatorExternalInterrupt(BYTE Number); ULONG EmulatorGetRegister(ULONG Register); +ULONG EmulatorGetProgramCounter(VOID); VOID EmulatorSetRegister(ULONG Register, ULONG Value); BOOLEAN EmulatorGetFlag(ULONG Flag); VOID EmulatorSetFlag(ULONG Flag); Added: branches/ntvdm/subsystems/ntvdm/ntvdm.spec URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.sp…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.spec (added) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.spec [iso-8859-1] Fri Aug 9 23:52:08 2013 @@ -0,0 +1,88 @@ +@ cdecl getAF() +@ cdecl getAH() +@ cdecl getAL() +@ cdecl getAX() +@ cdecl getBH() +@ cdecl getBL() +@ cdecl getBP() +@ cdecl getBX() +@ cdecl getCF() +@ cdecl getCH() +@ cdecl getCL() +@ cdecl getCS() +@ cdecl getCX() +@ cdecl getDF() +@ cdecl getDH() +@ cdecl getDI() +@ cdecl getDL() +@ cdecl getDS() +@ cdecl getDX() +@ cdecl getEAX() +@ cdecl getEBP() +@ cdecl getEBX() +@ cdecl getECX() +@ cdecl getEDI() +@ cdecl getEDX() +; @ cdecl getEFLAGS() +@ cdecl getEIP() +@ cdecl getES() +@ cdecl getESI() +@ cdecl getESP() +@ cdecl getFS() +@ cdecl getGS() +@ cdecl getIF() +; @ cdecl getIntelRegistersPointer() +@ cdecl getIP() +@ cdecl getMSW() +@ cdecl getOF() +@ cdecl getPF() +@ cdecl getSF() +@ cdecl getSI() +@ cdecl getSP() +@ cdecl getSS() +@ cdecl getZF() + + + +@ cdecl setAF(long) +@ cdecl setAH(long) +@ cdecl setAL(long) +@ cdecl setAX(long) +@ cdecl setBH(long) +@ cdecl setBL(long) +@ cdecl setBP(long) +@ cdecl setBX(long) +@ cdecl setCF(long) +@ cdecl setCH(long) +@ cdecl setCL(long) +@ cdecl setCS(long) +@ cdecl setCX(long) +@ cdecl setDF(long) +@ cdecl setDH(long) +@ cdecl setDI(long) +@ cdecl setDL(long) +@ cdecl setDS(long) +@ cdecl setDX(long) +@ cdecl setEAX(long) +@ cdecl setEBP(long) +@ cdecl setEBX(long) +@ cdecl setECX(long) +@ cdecl setEDI(long) +@ cdecl setEDX(long) +; @ cdecl setEFLAGS(long) +@ cdecl setEIP(long) +@ cdecl setES(long) +@ cdecl setESI(long) +@ cdecl setESP(long) +@ cdecl setFS(long) +@ cdecl setGS(long) +@ cdecl setIF(long) +@ cdecl setIP(long) +@ cdecl setMSW(long) +@ cdecl setOF(long) +@ cdecl setPF(long) +@ cdecl setSF(long) +@ cdecl setSI(long) +@ cdecl setSP(long) +@ cdecl setSS(long) +@ cdecl setZF(long) Propchange: branches/ntvdm/subsystems/ntvdm/ntvdm.spec ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ntvdm/subsystems/ntvdm/registers.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/register…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/registers.c (added) +++ branches/ntvdm/subsystems/ntvdm/registers.c [iso-8859-1] Fri Aug 9 23:52:08 2013 @@ -0,0 +1,811 @@ +/* + * COPYRIGHT: GPL - See COPYING in the top level directory + * PROJECT: ReactOS Virtual DOS Machine + * FILE: registers.c + * PURPOSE: Exported functions for manipulating registers + * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) + */ + +/* INCLUDES *******************************************************************/ + +#define NDEBUG + +#include "emulator.h" + +/* PUBLIC FUNCTIONS ***********************************************************/ + +ULONG +CDECL +getEAX(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_AX].val; +#else + return EmulatorContext.Registers[EMULATOR_REG_AX].Long; +#endif +} + +VOID +CDECL +setEAX(ULONG Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_AX].val = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_AX].Long = Value; +#endif +} + +USHORT +CDECL +getAX(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_AX].w.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_AX].LowWord; +#endif +} + +VOID +CDECL +setAX(USHORT Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_AX].w.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_AX].LowWord = Value; +#endif +} + +UCHAR +CDECL +getAH(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_AX].b.hi; +#else + return EmulatorContext.Registers[EMULATOR_REG_AX].HighByte; +#endif +} + +VOID +CDECL +setAH(UCHAR Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_AX].b.hi = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_AX].HighByte = Value; +#endif +} + +UCHAR +CDECL +getAL(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_AX].b.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_AX].LowByte; +#endif +} + +VOID +CDECL +setAL(UCHAR Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_AX].b.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_AX].LowByte = Value; +#endif +} + +ULONG +CDECL +getEBX(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_BX].val; +#else + return EmulatorContext.Registers[EMULATOR_REG_BX].Long; +#endif +} + +VOID +CDECL +setEBX(ULONG Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_BX].val = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_BX].Long = Value; +#endif +} + +USHORT +CDECL +getBX(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_BX].w.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_BX].LowWord; +#endif +} + +VOID +CDECL +setBX(USHORT Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_BX].w.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_BX].LowWord = Value; +#endif +} + +UCHAR +CDECL +getBH(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_BX].b.hi; +#else + return EmulatorContext.Registers[EMULATOR_REG_BX].HighByte; +#endif +} + +VOID +CDECL +setBH(UCHAR Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_BX].b.hi = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_BX].HighByte = Value; +#endif +} + +UCHAR +CDECL +getBL(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_BX].b.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_BX].LowByte; +#endif +} + +VOID +CDECL +setBL(UCHAR Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_BX].b.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_BX].LowByte = Value; +#endif +} + + + +ULONG +CDECL +getECX(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_CX].val; +#else + return EmulatorContext.Registers[EMULATOR_REG_CX].Long; +#endif +} + +VOID +CDECL +setECX(ULONG Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_CX].val = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_CX].Long = Value; +#endif +} + +USHORT +CDECL +getCX(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_CX].w.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_CX].LowWord; +#endif +} + +VOID +CDECL +setCX(USHORT Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_CX].w.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_CX].LowWord = Value; +#endif +} + +UCHAR +CDECL +getCH(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_CX].b.hi; +#else + return EmulatorContext.Registers[EMULATOR_REG_CX].HighByte; +#endif +} + +VOID +CDECL +setCH(UCHAR Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_CX].b.hi = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_CX].HighByte = Value; +#endif +} + +UCHAR +CDECL +getCL(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_CX].b.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_CX].LowByte; +#endif +} + +VOID +CDECL +setCL(UCHAR Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_CX].b.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_CX].LowByte = Value; +#endif +} + + + +ULONG +CDECL +getEDX(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_DX].val; +#else + return EmulatorContext.Registers[EMULATOR_REG_DX].Long; +#endif +} + +VOID +CDECL +setEDX(ULONG Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_DX].val = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_DX].Long = Value; +#endif +} + +USHORT +CDECL +getDX(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_DX].w.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_DX].LowWord; +#endif +} + +VOID +CDECL +setDX(USHORT Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_DX].w.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_DX].LowWord = Value; +#endif +} + +UCHAR +CDECL +getDH(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_DX].b.hi; +#else + return EmulatorContext.Registers[EMULATOR_REG_DX].HighByte; +#endif +} + +VOID +CDECL +setDH(UCHAR Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_DX].b.hi = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_DX].HighByte = Value; +#endif +} + +UCHAR +CDECL +getDL(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_DX].b.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_DX].LowByte; +#endif +} + +VOID +CDECL +setDL(UCHAR Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_DX].b.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_DX].LowByte = Value; +#endif +} + + + +ULONG +CDECL +getESP(VOID) +{ + return EmulatorGetRegister(EMULATOR_REG_SP); +} + +VOID +CDECL +setESP(ULONG Value) +{ + EmulatorSetStack(EmulatorGetRegister(EMULATOR_REG_SS), Value); +} + +USHORT +CDECL +getSP(VOID) +{ + return LOWORD(EmulatorGetRegister(EMULATOR_REG_SP)); +} + +VOID +CDECL +setSP(USHORT Value) +{ + EmulatorSetStack(EmulatorGetRegister(EMULATOR_REG_SS), Value); +} + + + +ULONG +CDECL +getEBP(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_BP].val; +#else + return EmulatorContext.Registers[EMULATOR_REG_BP].Long; +#endif +} + +VOID +CDECL +setEBP(ULONG Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_BP].val = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_BP].Long = Value; +#endif +} + +USHORT +CDECL +getBP(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_BP].w.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_BP].LowWord; +#endif +} + +VOID +CDECL +setBP(USHORT Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_BP].w.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_BP].LowWord = Value; +#endif +} + + + +ULONG +CDECL +getESI(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_SI].val; +#else + return EmulatorContext.Registers[EMULATOR_REG_SI].Long; +#endif +} + +VOID +CDECL +setESI(ULONG Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_SI].val = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_SI].Long = Value; +#endif +} + +USHORT +CDECL +getSI(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_SI].w.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_SI].LowWord; +#endif +} + +VOID +CDECL +setSI(USHORT Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_SI].w.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_SI].LowWord = Value; +#endif +} + + + +ULONG +CDECL +getEDI(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_DI].val; +#else + return EmulatorContext.Registers[EMULATOR_REG_DI].Long; +#endif +} + +VOID +CDECL +setEDI(ULONG Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_DI].val = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_DI].Long = Value; +#endif +} + +USHORT +CDECL +getDI(VOID) +{ +#ifndef NEW_EMULATOR + return EmulatorContext.state->general_reg[EMULATOR_REG_DI].w.lo; +#else + return EmulatorContext.Registers[EMULATOR_REG_DI].LowWord; +#endif +} + +VOID +CDECL +setDI(USHORT Value) +{ +#ifndef NEW_EMULATOR + EmulatorContext.state->general_reg[EMULATOR_REG_DI].w.lo = Value; +#else + EmulatorContext.Registers[EMULATOR_REG_DI].LowWord = Value; +#endif +} + + + +ULONG +CDECL +getEIP(VOID) +{ + return EmulatorGetProgramCounter(); +} + +VOID +CDECL +setEIP(ULONG Value) +{ + EmulatorExecute(EmulatorGetRegister(EMULATOR_REG_CS), Value); +} + +USHORT +CDECL +getIP(VOID) +{ + return LOWORD(EmulatorGetProgramCounter()); +} + +VOID +CDECL +setIP(USHORT Value) +{ + EmulatorExecute(EmulatorGetRegister(EMULATOR_REG_CS), Value); +} + + + +USHORT +CDECL +getCS(VOID) +{ + return EmulatorGetRegister(EMULATOR_REG_CS); +} + +VOID +CDECL +setCS(USHORT Value) +{ + EmulatorSetRegister(EMULATOR_REG_CS, Value); +} + +USHORT +CDECL +getSS(VOID) +{ + return EmulatorGetRegister(EMULATOR_REG_SS); +} + +VOID +CDECL +setSS(USHORT Value) +{ + EmulatorSetRegister(EMULATOR_REG_SS, Value); +} + +USHORT +CDECL +getDS(VOID) +{ + return EmulatorGetRegister(EMULATOR_REG_DS); +} + +VOID +CDECL +setDS(USHORT Value) +{ + EmulatorSetRegister(EMULATOR_REG_DS, Value); +} + +USHORT +CDECL +getES(VOID) +{ + return EmulatorGetRegister(EMULATOR_REG_ES); +} + +VOID +CDECL +setES(USHORT Value) +{ + EmulatorSetRegister(EMULATOR_REG_ES, Value); +} + +USHORT +CDECL +getFS(VOID) +{ + return EmulatorGetRegister(EMULATOR_REG_FS); +} + +VOID +CDECL +setFS(USHORT Value) +{ + EmulatorSetRegister(EMULATOR_REG_FS, Value); +} + +USHORT +CDECL +getGS(VOID) +{ + return EmulatorGetRegister(EMULATOR_REG_GS); +} + +VOID +CDECL +setGS(USHORT Value) +{ + EmulatorSetRegister(EMULATOR_REG_GS, Value); +} + + + +ULONG +CDECL +getCF(VOID) +{ + return EmulatorGetFlag(EMULATOR_FLAG_CF); +} + +VOID +CDECL +setCF(ULONG Flag) +{ + if (Flag & 1) + EmulatorSetFlag(EMULATOR_FLAG_CF); + else + EmulatorClearFlag(EMULATOR_FLAG_CF); +} + +ULONG +CDECL +getPF(VOID) +{ + return EmulatorGetFlag(EMULATOR_FLAG_PF); +} + +VOID +CDECL +setPF(ULONG Flag) +{ + if (Flag & 1) + EmulatorSetFlag(EMULATOR_FLAG_PF); + else + EmulatorClearFlag(EMULATOR_FLAG_PF); +} + +ULONG +CDECL +getAF(VOID) +{ + return EmulatorGetFlag(EMULATOR_FLAG_AF); +} + +VOID +CDECL +setAF(ULONG Flag) +{ + if (Flag & 1) + EmulatorSetFlag(EMULATOR_FLAG_AF); + else + EmulatorClearFlag(EMULATOR_FLAG_AF); +} + +ULONG +CDECL +getZF(VOID) +{ + return EmulatorGetFlag(EMULATOR_FLAG_ZF); +} + +VOID +CDECL +setZF(ULONG Flag) +{ + if (Flag & 1) + EmulatorSetFlag(EMULATOR_FLAG_ZF); + else + EmulatorClearFlag(EMULATOR_FLAG_ZF); +} + +ULONG +CDECL +getSF(VOID) +{ + return EmulatorGetFlag(EMULATOR_FLAG_SF); +} + +VOID +CDECL +setSF(ULONG Flag) +{ + if (Flag & 1) + EmulatorSetFlag(EMULATOR_FLAG_SF); + else + EmulatorClearFlag(EMULATOR_FLAG_SF); +} + +ULONG +CDECL +getIF(VOID) +{ + return EmulatorGetFlag(EMULATOR_FLAG_IF); +} + +VOID +CDECL +setIF(ULONG Flag) +{ + if (Flag & 1) + EmulatorSetFlag(EMULATOR_FLAG_IF); + else + EmulatorClearFlag(EMULATOR_FLAG_IF); +} + +ULONG +CDECL +getDF(VOID) +{ + return EmulatorGetFlag(EMULATOR_FLAG_DF); +} + +VOID +CDECL +setDF(ULONG Flag) +{ + if (Flag & 1) + EmulatorSetFlag(EMULATOR_FLAG_DF); + else + EmulatorClearFlag(EMULATOR_FLAG_DF); +} + +ULONG +CDECL +getOF(VOID) +{ + return EmulatorGetFlag(EMULATOR_FLAG_OF); +} + +VOID +CDECL +setOF(ULONG Flag) +{ + if (Flag & 1) + EmulatorSetFlag(EMULATOR_FLAG_OF); + else + EmulatorClearFlag(EMULATOR_FLAG_OF); +} + + + +USHORT +CDECL +getMSW(VOID) +{ + return 0; // UNIMPLEMENTED +} + +VOID +CDECL +setMSW(USHORT Value) +{ + // UNIMPLEMENTED +} + +/* EOF */ Propchange: branches/ntvdm/subsystems/ntvdm/registers.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ntvdm/subsystems/ntvdm/registers.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/register…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/registers.h (added) +++ branches/ntvdm/subsystems/ntvdm/registers.h [iso-8859-1] Fri Aug 9 23:52:08 2013 @@ -0,0 +1,112 @@ +/* + * COPYRIGHT: GPL - See COPYING in the top level directory + * PROJECT: ReactOS Virtual DOS Machine + * FILE: registers.c + * PURPOSE: Exported functions for manipulating registers + * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) + */ + +#ifndef _REGISTERS_H_ +#define _REGISTERS_H_ + +/* INCLUDES *******************************************************************/ + +ULONG getEAX(VOID); +VOID setEAX(ULONG); +USHORT getAX(VOID); +VOID setAX(USHORT); +UCHAR getAH(VOID); +VOID setAH(UCHAR); +UCHAR getAL(VOID); +VOID setAL(UCHAR); + +ULONG getEBX(VOID); +VOID setEBX(ULONG); +USHORT getBX(VOID); +VOID setBX(USHORT); +UCHAR getBH(VOID); +VOID setBH(UCHAR); +UCHAR getBL(VOID); +VOID setBL(UCHAR); + +ULONG getECX(VOID); +VOID setECX(ULONG); +USHORT getCX(VOID); +VOID setCX(USHORT); +UCHAR getCH(VOID); +VOID setCH(UCHAR); +UCHAR getCL(VOID); +VOID setCL(UCHAR); + +ULONG getEDX(VOID); +VOID setEDX(ULONG); +USHORT getDX(VOID); +VOID setDX(USHORT); +UCHAR getDH(VOID); +VOID setDH(UCHAR); +UCHAR getDL(VOID); +VOID setDL(UCHAR); + + + +ULONG getESP(VOID); +VOID setESP(ULONG); +USHORT getSP(VOID); +VOID setSP(USHORT); + +ULONG getEBP(VOID); +VOID setEBP(ULONG); +USHORT getBP(VOID); +VOID setBP(USHORT); + +ULONG getESI(VOID); +VOID setESI(ULONG); +USHORT getSI(VOID); +VOID setSI(USHORT); + +ULONG getEDI(VOID); +VOID setEDI(ULONG); +USHORT getDI(VOID); +VOID setDI(USHORT); + +ULONG getEIP(VOID); +VOID setEIP(ULONG); +USHORT getIP(VOID); +VOID setIP(USHORT); + +USHORT getCS(VOID); +VOID setCS(USHORT); +USHORT getSS(VOID); +VOID setSS(USHORT); +USHORT getDS(VOID); +VOID setDS(USHORT); +USHORT getES(VOID); +VOID setES(USHORT); +USHORT getFS(VOID); +VOID setFS(USHORT); +USHORT getGS(VOID); +VOID setGS(USHORT); + +ULONG getCF(VOID); +VOID setCF(ULONG); +ULONG getPF(VOID); +VOID setPF(ULONG); +ULONG getAF(VOID); +VOID setAF(ULONG); +ULONG getZF(VOID); +VOID setZF(ULONG); +ULONG getSF(VOID); +VOID setSF(ULONG); +ULONG getIF(VOID); +VOID setIF(ULONG); +ULONG getDF(VOID); +VOID setDF(ULONG); +ULONG getOF(VOID); +VOID setOF(ULONG); + +USHORT getMSW(VOID); +VOID setMSW(USHORT); + +#endif // _REGISTERS_H_ + +/* EOF */ Propchange: branches/ntvdm/subsystems/ntvdm/registers.h ------------------------------------------------------------------------------ svn:eol-style = native
11 years, 4 months
1
0
0
0
[hbelusca] 59683: [CMAKE] Fix console apps entry-point (problem since revision r53553).
by hbelusca@svn.reactos.org
Author: hbelusca Date: Fri Aug 9 22:23:27 2013 New Revision: 59683 URL:
http://svn.reactos.org/svn/reactos?rev=59683&view=rev
Log: [CMAKE] Fix console apps entry-point (problem since revision r53553). Modified: trunk/reactos/cmake/CMakeMacros.cmake Modified: trunk/reactos/cmake/CMakeMacros.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?re…
============================================================================== --- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Fri Aug 9 22:23:27 2013 @@ -430,7 +430,13 @@ elseif(${TYPE} STREQUAL nativecui) set(__entrypoint NtProcessStartup) set(__entrystack 4) - elseif((${TYPE} STREQUAL win32gui) OR (${TYPE} STREQUAL win32cui)) + elseif(${TYPE} STREQUAL win32cui) + if(__module_UNICODE) + set(__entrypoint wmainCRTStartup) + else() + set(__entrypoint mainCRTStartup) + endif() + elseif(${TYPE} STREQUAL win32gui) if(__module_UNICODE) set(__entrypoint wWinMainCRTStartup) else()
11 years, 4 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
33
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
Results per page:
10
25
50
100
200