ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2007
----- 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
19 participants
589 discussions
Start a n
N
ew thread
[hpoussin] 28778: Make some i386 code conditional Add missing svn:eol-style=native property
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun Sep 2 22:05:16 2007 New Revision: 28778 URL:
http://svn.reactos.org/svn/reactos?rev=28778&view=rev
Log: Make some i386 code conditional Add missing svn:eol-style=native property Modified: trunk/reactos/dll/win32/kernel32/except/except.c trunk/reactos/dll/win32/kernel32/kernel32.rbuild trunk/reactos/dll/win32/kernel32/misc/dllmain.c trunk/reactos/dll/win32/kernel32/misc/utils.c trunk/reactos/dll/win32/kernel32/thread/fiber.c trunk/reactos/lib/pseh/framebased.c trunk/reactos/lib/rtl/exception.c trunk/reactos/lib/sdk/libcntpr/string/atoi64.c trunk/reactos/lib/sdk/libcntpr/string/wtoi64.c trunk/reactos/subsystems/win32/win32k/eng/float.c trunk/reactos/tools/nci/ncitool.c trunk/reactos/tools/ofw_interface/calls.ofw (props changed) trunk/reactos/tools/ofw_interface/ofw_interface.cpp (props changed) trunk/reactos/tools/ofw_interface/ofw_interface.mak (props changed) trunk/reactos/tools/ppc.lost+found/bootcd (props changed) trunk/reactos/tools/ppc.lost+found/hfsmap.lst (props changed) trunk/reactos/tools/ppc.lost+found/link-freeldr (props changed) trunk/reactos/tools/ppc.lost+found/ofboot.b (props changed) trunk/reactos/tools/ppc.lost+found/pmake (props changed) Modified: trunk/reactos/dll/win32/kernel32/except/except.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/except/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/except/except.c (original) +++ trunk/reactos/dll/win32/kernel32/except/except.c Sun Sep 2 22:05:16 2007 @@ -124,6 +124,7 @@ return psz; } +#ifdef _M_IX86 static VOID _dump_context(PCONTEXT pc) { @@ -138,6 +139,13 @@ pc->Ebp, pc->Esi, pc->Esp); DbgPrint("EDI: %.8x EFLAGS: %.8x\n", pc->Edi, pc->EFlags); } +#else +#warning Unknown architecture +static VOID +_dump_context(PCONTEXT pc) +{ +} +#endif static LONG BasepCheckForReadOnlyResource(IN PVOID Ptr) @@ -237,9 +245,9 @@ { #ifdef _X86_ PULONG Frame; +#endif PVOID StartAddr; CHAR szMod[128] = ""; -#endif /* Print a stack trace. */ DbgPrint("Unhandled exception\n"); Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.rbuild (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.rbuild Sun Sep 2 22:05:16 2007 @@ -108,10 +108,12 @@ <file>utils.c</file> </directory> <directory name="thread"> - <directory name="i386"> - <file>fiber.S</file> - <file>thread.S</file> - </directory> + <if property="ARCH" value="i386"> + <directory name="i386"> + <file>fiber.S</file> + <file>thread.S</file> + </directory> + </if> </directory> </module> <module name="kernel32" type="win32dll" baseaddress="${BASEADDRESS_KERNEL32}" installbase="system32" installname="kernel32.dll"> Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/dl…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/dllmain.c (original) +++ trunk/reactos/dll/win32/kernel32/misc/dllmain.c Sun Sep 2 22:05:16 2007 @@ -257,6 +257,7 @@ { case DLL_PROCESS_ATTACH: +#ifdef _M_IX86 /* OK, yes, this is really retarded but it works for now */ InWindows = NtCurrentPeb()->BeingDebugged; @@ -290,6 +291,7 @@ *Eip = (ULONG)BaseProcessStartThunk; } } +#endif /* Don't bother us for each thread */ LdrDisableThreadCalloutsForDll((PVOID)hDll); Modified: trunk/reactos/dll/win32/kernel32/misc/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ut…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/utils.c (original) +++ trunk/reactos/dll/win32/kernel32/misc/utils.c Sun Sep 2 22:05:16 2007 @@ -9,7 +9,9 @@ /* INCLUDES ****************************************************************/ #include <k32.h> +#ifdef _M_IX86 #include "i386/ketypes.h" +#endif #define NDEBUG #include "../include/debug.h" @@ -334,6 +336,7 @@ IN PVOID StackAddress, IN ULONG ContextType) { +#ifdef _M_IX86 DPRINT("BasepInitializeContext: %p\n", Context); /* Setup the Initial Win32 Thread Context */ @@ -371,6 +374,11 @@ /* Give it some room for the Parameter */ Context->Esp -= sizeof(PVOID); +#else +#warning Unknown architecture + UNIMPLEMENTED; + DbgBreakPoint(); +#endif } /* Modified: trunk/reactos/dll/win32/kernel32/thread/fiber.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/thread/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/thread/fiber.c (original) +++ trunk/reactos/dll/win32/kernel32/thread/fiber.c Sun Sep 2 22:05:16 2007 @@ -251,12 +251,18 @@ WINAPI BaseFiberStartup(VOID) { +#ifdef _M_IX86 PFIBER Fiber = GetFiberData(); - + /* Call the Thread Startup Routine */ DPRINT1("Starting Fiber\n"); BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Eax, (LPVOID)Fiber->Context.Ebx); +#else +#warning Unknown architecture + UNIMPLEMENTED; + DbgBreakPoint(); +#endif } /* EOF */ Modified: trunk/reactos/lib/pseh/framebased.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/pseh/framebased.c?rev=…
============================================================================== --- trunk/reactos/lib/pseh/framebased.c (original) +++ trunk/reactos/lib/pseh/framebased.c Sun Sep 2 22:05:16 2007 @@ -150,7 +150,7 @@ } \ } #else -#error Unsupported platform. +#define _SEH_TRACE_CONTEXT(FRAME_, CONTEXT_) #endif #define _SEH_TRACE_UNWIND(FRAME_, ARGS_) \ Modified: trunk/reactos/lib/rtl/exception.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/exception.c?rev=28…
============================================================================== --- trunk/reactos/lib/rtl/exception.c (original) +++ trunk/reactos/lib/rtl/exception.c Sun Sep 2 22:05:16 2007 @@ -27,9 +27,13 @@ CONTEXT Context; NTSTATUS Status; - /* Capture the context and fixup ESP */ + /* Capture the context */ RtlCaptureContext(&Context); + +#ifdef _M_IX86 + /* Fixup ESP */ Context.Esp += sizeof(ULONG); +#endif /* Save the exception address */ ExceptionRecord->ExceptionAddress = RtlpGetExceptionAddress(); @@ -75,8 +79,10 @@ /* Capture the context */ RtlCaptureContext(&Context); +#ifdef _M_IX86 /* Add one argument to ESP */ Context.Esp += sizeof(PVOID); +#endif /* Create an exception record */ ExceptionRecord.ExceptionAddress = RtlpGetExceptionAddress(); @@ -123,10 +129,16 @@ ULONG i = 0; /* Get current EBP */ +#if defined(_M_IX86) #if defined __GNUC__ __asm__("mov %%ebp, %0" : "=r" (Stack) : ); #elif defined(_MSC_VER) __asm mov Stack, ebp +#endif +#elif defined(_M_MIPS) + __asm__("move $sp, %0" : "=r" (Stack) : ); +#else +#error Unknown architecture #endif /* Set it as the stack begin limit as well */ Modified: trunk/reactos/lib/sdk/libcntpr/string/atoi64.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/libcntpr/string/at…
============================================================================== --- trunk/reactos/lib/sdk/libcntpr/string/atoi64.c (original) +++ trunk/reactos/lib/sdk/libcntpr/string/atoi64.c Sun Sep 2 22:05:16 2007 @@ -1,5 +1,6 @@ #include <string.h> #include <ctype.h> +#include <basetsd.h> /* * @implemented Modified: trunk/reactos/lib/sdk/libcntpr/string/wtoi64.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/libcntpr/string/wt…
============================================================================== --- trunk/reactos/lib/sdk/libcntpr/string/wtoi64.c (original) +++ trunk/reactos/lib/sdk/libcntpr/string/wtoi64.c Sun Sep 2 22:05:16 2007 @@ -1,6 +1,6 @@ #include <string.h> #include <ctype.h> - +#include <basetsd.h> /* * @implemented Modified: trunk/reactos/subsystems/win32/win32k/eng/float.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/float.c (original) +++ trunk/reactos/subsystems/win32/win32k/eng/float.c Sun Sep 2 22:05:16 2007 @@ -35,6 +35,7 @@ /* DEFINES *****************************************************************/ +#ifdef _M_IX86 #ifdef __GNUC__ #define FLOAT_TO_INT(in,out) \ __asm__ __volatile__ ("fistpl %0" : "=m" (out) : "t" (in) : "st"); @@ -42,6 +43,10 @@ #define FLOAT_TO_INT(in,out) \ __asm fld in \ __asm fistp out +#endif +#else +#define FLOAT_TO_INT(in,out) \ + out = (long)in; #endif /* the following deal with IEEE single-precision numbers */ Modified: trunk/reactos/tools/nci/ncitool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/nci/ncitool.c?rev=28…
============================================================================== --- trunk/reactos/tools/nci/ncitool.c (original) +++ trunk/reactos/tools/nci/ncitool.c Sun Sep 2 22:05:16 2007 @@ -20,606 +20,618 @@ /* DEFINES ****************************************************************/ -#define INPUT_BUFFER_SIZE 255 +#define INPUT_BUFFER_SIZE 255 #define Arguments 7 - -/******* Table Indexes ************/ -#define MAIN_INDEX 0x0 -#define WIN32K_INDEX 0x1000 - -/******* Argument List ************/ -/* First, define the Databases */ -#define NativeSystemDb 0 -#define NativeGuiDb 1 - -/* Now the Service Tables */ -#define NtosServiceTable 2 -#define Win32kServiceTable 3 - -/* And finally, the stub files. */ -#define NtosUserStubs 4 -#define NtosKernelStubs 5 + +/******* Table Indexes ************/ +#define MAIN_INDEX 0x0 +#define WIN32K_INDEX 0x1000 + +/******* Argument List ************/ +/* First, define the Databases */ +#define NativeSystemDb 0 +#define NativeGuiDb 1 + +/* Now the Service Tables */ +#define NtosServiceTable 2 +#define Win32kServiceTable 3 + +/* And finally, the stub files. */ +#define NtosUserStubs 4 +#define NtosKernelStubs 5 #define Win32kStubs 6 - -/********** Stub Code ************/ - -/* - * This stubs calls into KUSER_SHARED_DATA where either a - * sysenter or interrupt is performed, depending on CPU support. - */ -#if defined(__GNUC__) -#define UserModeStub_x86 " movl $0x%x, %%eax\n" \ - " movl $KUSER_SHARED_SYSCALL, %%ecx\n" \ - " call *(%%ecx)\n" \ - " ret $0x%x\n\n" - -#define UserModeStub_ppc " mflr 0\n" \ - " addi 1,1,-16\n" \ - " li 0,%x\n" \ - " stw 0,1(0)\n" \ - " sc\n" \ - " lwz 0,1(0)\n" \ - " mtlr 0\n" \ - " addi 1,1,16\n" \ - " blr\n" -#elif defined(_MSC_VER) -#define UserModeStub_x86 " asm { \n" \ - " mov eax, %xh\n" \ - " mov ecx, KUSER_SHARED_SYSCALL\n" \ - " call [ecx]\n" \ - " ret %xh\n" \ - " }\n" -#else -#error Unknown compiler for inline assembler -#endif - -/* - * This stub calls KiSystemService directly with a fake INT2E stack. - * Because EIP is pushed during the call, the handler will return here. - */ -#if defined(__GNUC__) -#define KernelModeStub_x86 " movl $0x%x, %%eax\n" \ - " leal 4(%%esp), %%edx\n" \ - " pushfl\n" \ - " pushl $KGDT_R0_CODE\n" \ - " call _KiSystemService\n" \ - " ret $0x%x\n\n" - -#define KernelModeStub_ppc " bl KiSystemService\n" \ - " rfi\n" -#elif defined(_MSC_VER) -#define KernelModeStub_x86 " asm { \n" \ - " mov eax, %xh\n" \ - " lea edx, [esp+4]\n" \ - " pushf\n" \ - " push KGDT_R0_CODE\n" \ - " call _KiSystemService\n" \ - " ret %xh\n" \ - " }\n" -#else -#error Unknown compiler for inline assembler -#endif - -/***** Arch Dependent Stuff ******/ -struct ncitool_data_t { - const char *arch; - int args_to_bytes; - const char *km_stub; - const char *um_stub; - const char *global_header; - const char *declaration; -}; - -struct ncitool_data_t ncitool_data[] = { - { "i386", 4, KernelModeStub_x86, UserModeStub_x86, - ".global _%s@%d\n", "_%s@%d:\n" }, - { "powerpc", 4, KernelModeStub_ppc, UserModeStub_ppc, - "\t.globl %s\n", "%s:\n" }, - { 0, } -}; -int arch_sel = 0; -#define ARGS_TO_BYTES(x) (x)*(ncitool_data[arch_sel].args_to_bytes) -#define UserModeStub ncitool_data[arch_sel].um_stub -#define KernelModeStub ncitool_data[arch_sel].km_stub -#define GlobalHeader ncitool_data[arch_sel].global_header -#define Declaration ncitool_data[arch_sel].declaration - -/* FUNCTIONS ****************************************************************/ - -/*++ - * WriteFileHeader - * - * Prints out the File Header for a Stub File. - * - * Params: - * StubFile - Stub File to which to write the header. - * - * FileDescription - Description of the Stub file to which to write the header. - * - * FileLocation - Name of the Stub file to which to write the header. - * - * Returns: - * None. - * - * Remarks: - * FileLocation is only used for printing the header. - * - *--*/ -void -WriteFileHeader(FILE * StubFile, - char* FileDescription, - char* FileLocation) -{ - /* This prints out the file header */ - fprintf(StubFile, - "/* FILE: %s\n" - " * COPYRIGHT: See COPYING in the top level directory\n" - " * PURPOSE: %s\n" - " * PROGRAMMER: Computer Generated File. See tools/nci/ncitool.c\n" - " * REMARK: DO NOT EDIT OR COMMIT MODIFICATIONS TO THIS FILE\n" - " */\n\n\n" - "#include <ndk/asm.h>\n\n", - FileDescription, - FileLocation); -} - -/*++ - * WriteFileHeader - * - * Prints out the File Header for a Stub File. - * - * Params: - * StubFile - Stub File to which to write the header. - * - * FileDescription - Description of the Stub file to which to write the header. - * - * FileLocation - Name of the Stub file to which to write the header. - * - * Returns: - * None. - * - * Remarks: - * FileLocation is only used for printing the header. - * - *--*/ -void -WriteStubHeader(FILE* StubFile, - char* SyscallName, - unsigned StackBytes) -{ - /* Export the function */ - fprintf(StubFile, GlobalHeader, SyscallName, StackBytes); - - /* Define it */ - fprintf(StubFile, Declaration, SyscallName, StackBytes); -} - - -/*++ - * WriteKernelModeStub - * - * Prints out the Kernel Mode Stub for a System Call. - * - * Params: - * StubFile - Stub File to which to write the header. - * - * SyscallName - Name of System Call for which to add the stub. - * - * StackBytes - Number of bytes on the stack to return after doing the system call. - * - * SyscallId - Service Descriptor Table ID for this System Call. - * - * Returns: - * None. - * - * Remarks: - * On i386, StackBytes is the number of arguments x 4. - * - *--*/ -void -WriteKernelModeStub(FILE* StubFile, - char* SyscallName, - unsigned StackBytes, - unsigned int SyscallId) -{ - /* Write the Stub Header and export the Function */ - WriteStubHeader(StubFile, SyscallName, StackBytes); - - /* Write the Stub Code */ - fprintf(StubFile, KernelModeStub, SyscallId, StackBytes); -} - -/*++ - * WriteUserModeStub - * - * Prints out the User Mode Stub for a System Call. - * - * Params: - * StubFile - Stub File to which to write the header. - * - * SyscallName - Name of System Call for which to add the stub. - * - * StackBytes - Number of bytes on the stack to return after doing the system call. - * - * SyscallId - Service Descriptor Table ID for this System Call. - * - * Returns: - * None. - * - * Remarks: - * On i386, StackBytes is the number of arguments x 4. - * - *--*/ -void -WriteUserModeStub(FILE* StubFile, - char* SyscallName, - unsigned StackBytes, - unsigned int SyscallId) -{ - /* Write the Stub Header and export the Function */ - WriteStubHeader(StubFile, SyscallName, StackBytes); - - /* Write the Stub Code */ - fprintf(StubFile, UserModeStub, SyscallId, StackBytes); -} - -/*++ - * GetNameAndArgumentsFromDb - * - * Parses an entry from a System Call Database, extracting - * the function's name and arguments that it takes. - * - * Params: - * Line - Entry from the Database to parse. - * - * NtSyscallName - Output string to which to save the Function Name - * - * SyscallArguments - Output string to which to save the number of - * arguments that the function takes. - * - * Returns: - * None. - * - * Remarks: - * On i386, StackBytes is the number of arguments x 4. - * - *--*/ -void -GetNameAndArgumentsFromDb(char Line[], - char ** NtSyscallName, - char ** SyscallArguments) -{ - char *s; - char *stmp; - - /* Remove new line */ - if ((s = (char *) strchr(Line,'\r')) != NULL) { - *s = '\0'; - } - - /* Skip comments (#) and empty lines */ - s = &Line[0]; - if ((*s) != '#' && (*s) != '\0') { - - /* Extract the NtXXX name */ - *NtSyscallName = (char *)strtok(s," \t"); - - /* Extract the argument count */ - *SyscallArguments = (char *)strtok(NULL," \t"); - - /* Remove, if present, the trailing LF */ - if ((stmp = strchr(*SyscallArguments, '\n')) != NULL) { - *stmp = '\0'; - } - - } else { - - /* Skip this entry */ - *NtSyscallName = NULL; - *SyscallArguments = NULL; - } -} - -/*++ - * CreateStubs - * - * Parses a System Call Database and creates stubs for all the entries. - * - * Params: - * SyscallDb - System Call Database to parse. - * - * UserModeFiles - Array of Usermode Stub Files to which to write the stubs. - * - * KernelModeFile - Kernelmode Stub Files to which to write the stubs. - * + +/********** Stub Code ************/ + +/* + * This stubs calls into KUSER_SHARED_DATA where either a + * sysenter or interrupt is performed, depending on CPU support. + */ +#if defined(__GNUC__) +#define UserModeStub_x86 " movl $0x%x, %%eax\n" \ + " movl $KUSER_SHARED_SYSCALL, %%ecx\n" \ + " call *(%%ecx)\n" \ + " ret $0x%x\n\n" + +#define UserModeStub_ppc " mflr 0\n" \ + " addi 1,1,-16\n" \ + " li 0,%x\n" \ + " stw 0,1(0)\n" \ + " sc\n" \ + " lwz 0,1(0)\n" \ + " mtlr 0\n" \ + " addi 1,1,16\n" \ + " blr\n" + +#define UserModeStub_mips " li $8, KUSER_SHARED_SYSCALL\n" \ + " lw $8,0($8)\n" \ + " j $8\n" \ + " nop\n" + +#elif defined(_MSC_VER) +#define UserModeStub_x86 " asm { \n" \ + " mov eax, %xh\n" \ + " mov ecx, KUSER_SHARED_SYSCALL\n" \ + " call [ecx]\n" \ + " ret %xh\n" \ + " }\n" +#else +#error Unknown compiler for inline assembler +#endif + +/* + * This stub calls KiSystemService directly with a fake INT2E stack. + * Because EIP is pushed during the call, the handler will return here. + */ +#if defined(__GNUC__) +#define KernelModeStub_x86 " movl $0x%x, %%eax\n" \ + " leal 4(%%esp), %%edx\n" \ + " pushfl\n" \ + " pushl $KGDT_R0_CODE\n" \ + " call _KiSystemService\n" \ + " ret $0x%x\n\n" + +#define KernelModeStub_ppc " bl KiSystemService\n" \ + " rfi\n" + +#define KernelModeStub_mips " j KiSystemService\n" \ + " nop\n" + +#elif defined(_MSC_VER) +#define KernelModeStub_x86 " asm { \n" \ + " mov eax, %xh\n" \ + " lea edx, [esp+4]\n" \ + " pushf\n" \ + " push KGDT_R0_CODE\n" \ + " call _KiSystemService\n" \ + " ret %xh\n" \ + " }\n" +#else +#error Unknown compiler for inline assembler +#endif + +/***** Arch Dependent Stuff ******/ +struct ncitool_data_t { + const char *arch; + int args_to_bytes; + const char *km_stub; + const char *um_stub; + const char *global_header; + const char *declaration; +}; + +struct ncitool_data_t ncitool_data[] = { + { "i386", 4, KernelModeStub_x86, UserModeStub_x86, + ".global _%s@%d\n", "_%s@%d:\n" }, + { "powerpc", 4, KernelModeStub_ppc, UserModeStub_ppc, + "\t.globl %s\n", "%s:\n" }, + { "mips", 4, KernelModeStub_mips, UserModeStub_mips, + "\t.globl %s\n", "%s:\n" }, + { 0, } +}; +int arch_sel = 0; +#define ARGS_TO_BYTES(x) (x)*(ncitool_data[arch_sel].args_to_bytes) +#define UserModeStub ncitool_data[arch_sel].um_stub +#define KernelModeStub ncitool_data[arch_sel].km_stub +#define GlobalHeader ncitool_data[arch_sel].global_header +#define Declaration ncitool_data[arch_sel].declaration + +/* FUNCTIONS ****************************************************************/ + +/*++ + * WriteFileHeader + * + * Prints out the File Header for a Stub File. + * + * Params: + * StubFile - Stub File to which to write the header. + * + * FileDescription - Description of the Stub file to which to write the header. + * + * FileLocation - Name of the Stub file to which to write the header. + * + * Returns: + * None. + * + * Remarks: + * FileLocation is only used for printing the header. + * + *--*/ +void +WriteFileHeader(FILE * StubFile, + char* FileDescription, + char* FileLocation) +{ + /* This prints out the file header */ + fprintf(StubFile, + "/* FILE: %s\n" + " * COPYRIGHT: See COPYING in the top level directory\n" + " * PURPOSE: %s\n" + " * PROGRAMMER: Computer Generated File. See tools/nci/ncitool.c\n" + " * REMARK: DO NOT EDIT OR COMMIT MODIFICATIONS TO THIS FILE\n" + " */\n\n\n" + "#include <ndk/asm.h>\n\n", + FileDescription, + FileLocation); +} + +/*++ + * WriteFileHeader + * + * Prints out the File Header for a Stub File. + * + * Params: + * StubFile - Stub File to which to write the header. + * + * FileDescription - Description of the Stub file to which to write the header. + * + * FileLocation - Name of the Stub file to which to write the header. + * + * Returns: + * None. + * + * Remarks: + * FileLocation is only used for printing the header. + * + *--*/ +void +WriteStubHeader(FILE* StubFile, + char* SyscallName, + unsigned StackBytes) +{ + /* Export the function */ + fprintf(StubFile, GlobalHeader, SyscallName, StackBytes); + + /* Define it */ + fprintf(StubFile, Declaration, SyscallName, StackBytes); +} + + +/*++ + * WriteKernelModeStub + * + * Prints out the Kernel Mode Stub for a System Call. + * + * Params: + * StubFile - Stub File to which to write the header. + * + * SyscallName - Name of System Call for which to add the stub. + * + * StackBytes - Number of bytes on the stack to return after doing the system call. + * + * SyscallId - Service Descriptor Table ID for this System Call. + * + * Returns: + * None. + * + * Remarks: + * On i386, StackBytes is the number of arguments x 4. + * + *--*/ +void +WriteKernelModeStub(FILE* StubFile, + char* SyscallName, + unsigned StackBytes, + unsigned int SyscallId) +{ + /* Write the Stub Header and export the Function */ + WriteStubHeader(StubFile, SyscallName, StackBytes); + + /* Write the Stub Code */ + fprintf(StubFile, KernelModeStub, SyscallId, StackBytes); +} + +/*++ + * WriteUserModeStub + * + * Prints out the User Mode Stub for a System Call. + * + * Params: + * StubFile - Stub File to which to write the header. + * + * SyscallName - Name of System Call for which to add the stub. + * + * StackBytes - Number of bytes on the stack to return after doing the system call. + * + * SyscallId - Service Descriptor Table ID for this System Call. + * + * Returns: + * None. + * + * Remarks: + * On i386, StackBytes is the number of arguments x 4. + * + *--*/ +void +WriteUserModeStub(FILE* StubFile, + char* SyscallName, + unsigned StackBytes, + unsigned int SyscallId) +{ + /* Write the Stub Header and export the Function */ + WriteStubHeader(StubFile, SyscallName, StackBytes); + + /* Write the Stub Code */ + fprintf(StubFile, UserModeStub, SyscallId, StackBytes); +} + +/*++ + * GetNameAndArgumentsFromDb + * + * Parses an entry from a System Call Database, extracting + * the function's name and arguments that it takes. + * + * Params: + * Line - Entry from the Database to parse. + * + * NtSyscallName - Output string to which to save the Function Name + * + * SyscallArguments - Output string to which to save the number of + * arguments that the function takes. + * + * Returns: + * None. + * + * Remarks: + * On i386, StackBytes is the number of arguments x 4. + * + *--*/ +void +GetNameAndArgumentsFromDb(char Line[], + char ** NtSyscallName, + char ** SyscallArguments) +{ + char *s; + char *stmp; + + /* Remove new line */ + if ((s = (char *) strchr(Line,'\r')) != NULL) { + *s = '\0'; + } + + /* Skip comments (#) and empty lines */ + s = &Line[0]; + if ((*s) != '#' && (*s) != '\0') { + + /* Extract the NtXXX name */ + *NtSyscallName = (char *)strtok(s," \t"); + + /* Extract the argument count */ + *SyscallArguments = (char *)strtok(NULL," \t"); + + /* Remove, if present, the trailing LF */ + if ((stmp = strchr(*SyscallArguments, '\n')) != NULL) { + *stmp = '\0'; + } + + } else { + + /* Skip this entry */ + *NtSyscallName = NULL; + *SyscallArguments = NULL; + } +} + +/*++ + * CreateStubs + * + * Parses a System Call Database and creates stubs for all the entries. + * + * Params: + * SyscallDb - System Call Database to parse. + * + * UserModeFiles - Array of Usermode Stub Files to which to write the stubs. + * + * KernelModeFile - Kernelmode Stub Files to which to write the stubs. + * * Index - Number of first syscall - * + * * UserFiles - Number of Usermode Stub Files to create - * + * * NeedsZw - Write Zw prefix? - * - * Returns: - * None. - * - * Remarks: - * None. - * - *--*/ -void -CreateStubs(FILE * SyscallDb, - FILE * UserModeFiles[], - FILE * KernelModeFile, - unsigned Index, - unsigned UserFiles, - unsigned NeedsZw) -{ - char Line[INPUT_BUFFER_SIZE]; - char *NtSyscallName; - char *SyscallArguments; - int SyscallId; - unsigned StackBytes; - - /* We loop, incrementing the System Call Index, until the end of the file */ - for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) { - - /* Extract the Name and Arguments */ - GetNameAndArgumentsFromDb(Line, &NtSyscallName, &SyscallArguments); - if (SyscallArguments != NULL) - StackBytes = ARGS_TO_BYTES(strtoul(SyscallArguments, NULL, 0)); - else - StackBytes = 0; - - /* Make sure we really extracted something */ - if (NtSyscallName) { - - /* Create Usermode Stubs for Nt/Zw syscalls in each Usermode file */ - int i; - for (i= 0; i < UserFiles; i++) { - - /* Write the Nt Version */ - WriteUserModeStub(UserModeFiles[i], - NtSyscallName, - StackBytes, - SyscallId | Index); - - /* If a Zw Version is needed (was specified), write it too */ - if (NeedsZw) { - - NtSyscallName[0] = 'Z'; - NtSyscallName[1] = 'w'; - WriteUserModeStub(UserModeFiles[i], - NtSyscallName, - StackBytes, - SyscallId | Index); - } - - } - - /* Create the Kernel coutnerparts (only Zw*, Nt* are the real functions!) */ - if (KernelModeFile) { - - NtSyscallName[0] = 'Z'; - NtSyscallName[1] = 'w'; - WriteKernelModeStub(KernelModeFile, - NtSyscallName, - StackBytes, - SyscallId | Index); - } - - /* Only increase if we actually added something */ - SyscallId++; - } - } -} - -/*++ - * CreateSystemServiceTable - * - * Parses a System Call Database and creates a System Call Service Table for it. - * - * Params: - * SyscallDb - System Call Database to parse. - * - * SyscallTable - File in where to create System Call Service Table. - * - * Name - Name of the Service Table. - * - * FileLocation - Filename containing the Table. - * - * Returns: - * None. - * - * Remarks: - * FileLocation is only used for the header generation. - * - *--*/ -void -CreateSystemServiceTable(FILE *SyscallDb, - FILE *SyscallTable, - char * Name, - char * FileLocation) -{ - char Line[INPUT_BUFFER_SIZE]; - char *NtSyscallName; - char *SyscallArguments; - int SyscallId; - - /* Print the Header */ - WriteFileHeader(SyscallTable, "System Call Table for Native API", FileLocation); - - /* First we build the SSDT */ - fprintf(SyscallTable,"\n\n\n"); - fprintf(SyscallTable,"ULONG_PTR %sSSDT[] = {\n", Name); - - /* We loop, incrementing the System Call Index, until the end of the file */ - for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) { - - /* Extract the Name and Arguments */ - GetNameAndArgumentsFromDb(Line, &NtSyscallName, &SyscallArguments); - - /* Make sure we really extracted something */ - if (NtSyscallName) { - - /* Add a new line */ - if (SyscallId > 0) fprintf(SyscallTable,",\n"); - - /* Write the syscall name in the service table. */ - fprintf(SyscallTable,"\t\t(ULONG_PTR)%s", NtSyscallName); - - /* Only increase if we actually added something */ - SyscallId++; - } - } - - /* Close the service table (C syntax) */ - fprintf(SyscallTable,"\n};\n"); - - /* Now we build the SSPT */ - rewind(SyscallDb); - fprintf(SyscallTable,"\n\n\n"); - fprintf(SyscallTable,"UCHAR %sSSPT[] = {\n", Name); - - for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) { - - /* Extract the Name and Arguments */ - GetNameAndArgumentsFromDb(Line, &NtSyscallName, &SyscallArguments); - - /* Make sure we really extracted something */ - if (NtSyscallName) { - - /* Add a new line */ - if (SyscallId > 0) fprintf(SyscallTable,",\n"); - - /* Write the syscall arguments in the argument table. */ - if (SyscallArguments != NULL) - fprintf(SyscallTable,"\t\t%lu * sizeof(void *)",strtoul(SyscallArguments, NULL, 0)); - else - fprintf(SyscallTable,"\t\t0"); - - /* Only increase if we actually added something */ - SyscallId++; - } - } - - /* Close the service table (C syntax) */ - fprintf(SyscallTable,"\n};\n"); - - /* - * We write some useful defines - */ - fprintf(SyscallTable, "\n\n#define MIN_SYSCALL_NUMBER 0\n"); - fprintf(SyscallTable, "#define MAX_SYSCALL_NUMBER %d\n", SyscallId - 1); - fprintf(SyscallTable, "#define NUMBER_OF_SYSCALLS %d\n", SyscallId); - fprintf(SyscallTable, "ULONG %sNumberOfSysCalls = %d;\n", Name, SyscallId); -} - -void usage(char * argv0) -{ - printf("Usage: %s [-arch <arch>] sysfuncs.lst w32ksvc.db napi.h ssdt.h napi.S zw.S win32k.S win32k.S\n" - " sysfuncs.lst native system functions database\n" - " w32ksvc.db native graphic functions database\n" - " napi.h NTOSKRNL service table\n" - " ssdt.h WIN32K service table\n" - " napi.S NTDLL stubs\n" - " zw.S NTOSKRNL Zw stubs\n" - " win32k.S GDI32 stubs\n" - " win32k.S USER32 stubs\n" - " -arch is optional, default is %s\n", - argv0, - ncitool_data[0].arch - ); -} - -int main(int argc, char* argv[]) -{ - FILE * Files[Arguments] = { }; - int FileNumber, ArgOffset = 1; - char * OpenType = "r"; - - /* Catch architecture argument */ - if (argc > 3 && !strcmp(argv[1],"-arch")) { - for( arch_sel = 0; ncitool_data[arch_sel].arch; arch_sel++ ) - if (strcmp(argv[2],ncitool_data[arch_sel].arch) == 0) - break; - if (!ncitool_data[arch_sel].arch) { - printf("Invalid arch '%s'\n", argv[2]); - usage(argv[0]); - return 1; - } - ArgOffset = 3; - } - /* Make sure all arguments all there */ - if (argc != Arguments + ArgOffset) { - usage(argv[0]); - return(1); - } - - /* Open all Output and bail out if any fail */ - for (FileNumber = 0; FileNumber < Arguments; FileNumber++) { - - /* Open the File */ - if (FileNumber == 2) OpenType = "wb"; - Files[FileNumber] = fopen(argv[FileNumber + ArgOffset], OpenType); - - /* Check for failure and error out if so */ - if (!Files[FileNumber]) { - perror(argv[FileNumber + ArgOffset]); - return (1); - } - } - - /* Write the File Headers */ - WriteFileHeader(Files[NtosUserStubs], - "System Call Stubs for Native API", - argv[NtosUserStubs + ArgOffset]); - - WriteFileHeader(Files[NtosKernelStubs], - "System Call Stubs for Native API", - argv[NtosKernelStubs + ArgOffset]); - fputs("#include <ndk/asm.h>\n\n", Files[NtosKernelStubs]); - + * + * Returns: + * None. + * + * Remarks: + * None. + * + *--*/ +void +CreateStubs(FILE * SyscallDb, + FILE * UserModeFiles[], + FILE * KernelModeFile, + unsigned Index, + unsigned UserFiles, + unsigned NeedsZw) +{ + char Line[INPUT_BUFFER_SIZE]; + char *NtSyscallName; + char *SyscallArguments; + int SyscallId; + unsigned StackBytes; + + /* We loop, incrementing the System Call Index, until the end of the file */ + for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) { + + /* Extract the Name and Arguments */ + GetNameAndArgumentsFromDb(Line, &NtSyscallName, &SyscallArguments); + if (SyscallArguments != NULL) + StackBytes = ARGS_TO_BYTES(strtoul(SyscallArguments, NULL, 0)); + else + StackBytes = 0; + + /* Make sure we really extracted something */ + if (NtSyscallName) { + + /* Create Usermode Stubs for Nt/Zw syscalls in each Usermode file */ + int i; + for (i= 0; i < UserFiles; i++) { + + /* Write the Nt Version */ + WriteUserModeStub(UserModeFiles[i], + NtSyscallName, + StackBytes, + SyscallId | Index); + + /* If a Zw Version is needed (was specified), write it too */ + if (NeedsZw) { + + NtSyscallName[0] = 'Z'; + NtSyscallName[1] = 'w'; + WriteUserModeStub(UserModeFiles[i], + NtSyscallName, + StackBytes, + SyscallId | Index); + } + + } + + /* Create the Kernel coutnerparts (only Zw*, Nt* are the real functions!) */ + if (KernelModeFile) { + + NtSyscallName[0] = 'Z'; + NtSyscallName[1] = 'w'; + WriteKernelModeStub(KernelModeFile, + NtSyscallName, + StackBytes, + SyscallId | Index); + } + + /* Only increase if we actually added something */ + SyscallId++; + } + } +} + +/*++ + * CreateSystemServiceTable + * + * Parses a System Call Database and creates a System Call Service Table for it. + * + * Params: + * SyscallDb - System Call Database to parse. + * + * SyscallTable - File in where to create System Call Service Table. + * + * Name - Name of the Service Table. + * + * FileLocation - Filename containing the Table. + * + * Returns: + * None. + * + * Remarks: + * FileLocation is only used for the header generation. + * + *--*/ +void +CreateSystemServiceTable(FILE *SyscallDb, + FILE *SyscallTable, + char * Name, + char * FileLocation) +{ + char Line[INPUT_BUFFER_SIZE]; + char *NtSyscallName; + char *SyscallArguments; + int SyscallId; + + /* Print the Header */ + WriteFileHeader(SyscallTable, "System Call Table for Native API", FileLocation); + + /* First we build the SSDT */ + fprintf(SyscallTable,"\n\n\n"); + fprintf(SyscallTable,"ULONG_PTR %sSSDT[] = {\n", Name); + + /* We loop, incrementing the System Call Index, until the end of the file */ + for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) { + + /* Extract the Name and Arguments */ + GetNameAndArgumentsFromDb(Line, &NtSyscallName, &SyscallArguments); + + /* Make sure we really extracted something */ + if (NtSyscallName) { + + /* Add a new line */ + if (SyscallId > 0) fprintf(SyscallTable,",\n"); + + /* Write the syscall name in the service table. */ + fprintf(SyscallTable,"\t\t(ULONG_PTR)%s", NtSyscallName); + + /* Only increase if we actually added something */ + SyscallId++; + } + } + + /* Close the service table (C syntax) */ + fprintf(SyscallTable,"\n};\n"); + + /* Now we build the SSPT */ + rewind(SyscallDb); + fprintf(SyscallTable,"\n\n\n"); + fprintf(SyscallTable,"UCHAR %sSSPT[] = {\n", Name); + + for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) { + + /* Extract the Name and Arguments */ + GetNameAndArgumentsFromDb(Line, &NtSyscallName, &SyscallArguments); + + /* Make sure we really extracted something */ + if (NtSyscallName) { + + /* Add a new line */ + if (SyscallId > 0) fprintf(SyscallTable,",\n"); + + /* Write the syscall arguments in the argument table. */ + if (SyscallArguments != NULL) + fprintf(SyscallTable,"\t\t%lu * sizeof(void *)",strtoul(SyscallArguments, NULL, 0)); + else + fprintf(SyscallTable,"\t\t0"); + + /* Only increase if we actually added something */ + SyscallId++; + } + } + + /* Close the service table (C syntax) */ + fprintf(SyscallTable,"\n};\n"); + + /* + * We write some useful defines + */ + fprintf(SyscallTable, "\n\n#define MIN_SYSCALL_NUMBER 0\n"); + fprintf(SyscallTable, "#define MAX_SYSCALL_NUMBER %d\n", SyscallId - 1); + fprintf(SyscallTable, "#define NUMBER_OF_SYSCALLS %d\n", SyscallId); + fprintf(SyscallTable, "ULONG %sNumberOfSysCalls = %d;\n", Name, SyscallId); +} + +void usage(char * argv0) +{ + printf("Usage: %s [-arch <arch>] sysfuncs.lst w32ksvc.db napi.h ssdt.h napi.S zw.S win32k.S win32k.S\n" + " sysfuncs.lst native system functions database\n" + " w32ksvc.db native graphic functions database\n" + " napi.h NTOSKRNL service table\n" + " ssdt.h WIN32K service table\n" + " napi.S NTDLL stubs\n" + " zw.S NTOSKRNL Zw stubs\n" + " win32k.S GDI32 stubs\n" + " win32k.S USER32 stubs\n" + " -arch is optional, default is %s\n", + argv0, + ncitool_data[0].arch + ); +} + +int main(int argc, char* argv[]) +{ + FILE * Files[Arguments] = { }; + int FileNumber, ArgOffset = 1; + char * OpenType = "r"; + + /* Catch architecture argument */ + if (argc > 3 && !strcmp(argv[1],"-arch")) { + for( arch_sel = 0; ncitool_data[arch_sel].arch; arch_sel++ ) + if (strcmp(argv[2],ncitool_data[arch_sel].arch) == 0) + break; + if (!ncitool_data[arch_sel].arch) { + printf("Invalid arch '%s'\n", argv[2]); + usage(argv[0]); + return 1; + } + ArgOffset = 3; + } + /* Make sure all arguments all there */ + if (argc != Arguments + ArgOffset) { + usage(argv[0]); + return(1); + } + + /* Open all Output and bail out if any fail */ + for (FileNumber = 0; FileNumber < Arguments; FileNumber++) { + + /* Open the File */ + if (FileNumber == 2) OpenType = "wb"; + Files[FileNumber] = fopen(argv[FileNumber + ArgOffset], OpenType); + + /* Check for failure and error out if so */ + if (!Files[FileNumber]) { + perror(argv[FileNumber + ArgOffset]); + return (1); + } + } + + /* Write the File Headers */ + WriteFileHeader(Files[NtosUserStubs], + "System Call Stubs for Native API", + argv[NtosUserStubs + ArgOffset]); + + WriteFileHeader(Files[NtosKernelStubs], + "System Call Stubs for Native API", + argv[NtosKernelStubs + ArgOffset]); + fputs("#include <ndk/asm.h>\n\n", Files[NtosKernelStubs]); + WriteFileHeader(Files[Win32kStubs], - "System Call Stubs for Native API", + "System Call Stubs for Native API", argv[Win32kStubs + ArgOffset]); - - /* Create the System Stubs */ - CreateStubs(Files[NativeSystemDb], - &Files[NtosUserStubs], - Files[NtosKernelStubs], - MAIN_INDEX, + + /* Create the System Stubs */ + CreateStubs(Files[NativeSystemDb], + &Files[NtosUserStubs], + Files[NtosKernelStubs], + MAIN_INDEX, + 1, + 1); + + /* Create the Graphics Stubs */ + CreateStubs(Files[NativeGuiDb], + &Files[Win32kStubs], + NULL, + WIN32K_INDEX, 1, - 1); - - /* Create the Graphics Stubs */ - CreateStubs(Files[NativeGuiDb], - &Files[Win32kStubs], - NULL, - WIN32K_INDEX, - 1, - 0); - - /* Rewind the databases */ - rewind(Files[NativeSystemDb]); - rewind(Files[NativeGuiDb]); - - /* Create the Service Tables */ - CreateSystemServiceTable(Files[NativeSystemDb], - Files[NtosServiceTable], - "Main", - argv[NtosServiceTable + ArgOffset]); - - CreateSystemServiceTable(Files[NativeGuiDb], - Files[Win32kServiceTable], - "Win32k", - argv[Win32kServiceTable + ArgOffset]); - - /* Close all files */ - for (FileNumber = 0; FileNumber < Arguments-ArgOffset; FileNumber++) { - - /* Close the File */ - fclose(Files[FileNumber]); - - } - - return(0); -} + 0); + + /* Rewind the databases */ + rewind(Files[NativeSystemDb]); + rewind(Files[NativeGuiDb]); + + /* Create the Service Tables */ + CreateSystemServiceTable(Files[NativeSystemDb], + Files[NtosServiceTable], + "Main", + argv[NtosServiceTable + ArgOffset]); + + CreateSystemServiceTable(Files[NativeGuiDb], + Files[Win32kServiceTable], + "Win32k", + argv[Win32kServiceTable + ArgOffset]); + + /* Close all files */ + for (FileNumber = 0; FileNumber < Arguments-ArgOffset; FileNumber++) { + + /* Close the File */ + fclose(Files[FileNumber]); + + } + + return(0); +} Propchange: trunk/reactos/tools/ofw_interface/calls.ofw ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/ofw_interface/ofw_interface.cpp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/ofw_interface/ofw_interface.mak ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/ppc.lost+found/bootcd ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/ppc.lost+found/hfsmap.lst ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/ppc.lost+found/link-freeldr ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/ppc.lost+found/ofboot.b ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/ppc.lost+found/pmake ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 3 months
1
0
0
0
[hpoussin] 28777: Fix warnings, and compilation of dib24bppc.c/dib32bppc.c
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun Sep 2 20:33:00 2007 New Revision: 28777 URL:
http://svn.reactos.org/svn/reactos?rev=28777&view=rev
Log: Fix warnings, and compilation of dib24bppc.c/dib32bppc.c Modified: trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c trunk/reactos/subsystems/win32/win32k/dib/dib24bppc.c trunk/reactos/subsystems/win32/win32k/dib/dib32bppc.c Modified: trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c Sun Sep 2 20:33:00 2007 @@ -130,7 +130,7 @@ "r"(SurfObj->lDelta), "r"(y2 - y1), "a"(c) : "cc", "memory", "%ecx"); #else - PBYTE byteaddr = (ULONG_PTR)SurfObj->pvScan0 + y1 * SurfObj->lDelta; + PBYTE byteaddr = (PBYTE)(ULONG_PTR)SurfObj->pvScan0 + y1 * SurfObj->lDelta; PWORD addr = (PWORD)byteaddr + x; LONG lDelta = SurfObj->lDelta; Modified: trunk/reactos/subsystems/win32/win32k/dib/dib24bppc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib24bppc.c (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib24bppc.c Sun Sep 2 20:33:00 2007 @@ -43,6 +43,9 @@ } else { + ULONG Fill[3]; + ULONG MultiCount; + /* Align to 4-byte address */ while (0 != ((ULONG_PTR) addr & 0x3)) { @@ -86,4 +89,4 @@ addr += 1; } } -} +} Modified: trunk/reactos/subsystems/win32/win32k/dib/dib32bppc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib32bppc.c (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib32bppc.c Sun Sep 2 20:33:00 2007 @@ -26,26 +26,27 @@ VOID DIB_32BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c) { - PBYTE byteaddr = (ULONG_PTR)SurfObj->pvScan0 + y * SurfObj->lDelta; - PDWORD addr = (PDWORD)byteaddr + x1; - LONG cx = x1; - while(cx < x2) - { - *addr = (DWORD)c; - ++addr; - ++cx; - } + PBYTE byteaddr = (PBYTE)((ULONG_PTR)SurfObj->pvScan0 + y * SurfObj->lDelta); + PDWORD addr = (PDWORD)byteaddr + x1; + LONG cx = x1; + + while(cx < x2) + { + *addr = (DWORD)c; + ++addr; + ++cx; + } } BOOLEAN DIB_32BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) -{ - ULONG DestY; +{ + ULONG DestY; - for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++) - { - DIB_32BPP_HLine (DestSurface, DestRect->left, DestRect->right, DestY, color); - } + for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++) + { + DIB_32BPP_HLine (DestSurface, DestRect->left, DestRect->right, DestY, color); + } - return TRUE; -} + return TRUE; +}
17 years, 3 months
1
0
0
0
[greatlrd] 28776: implement SetDeviceGammaRamp in gdi32 (leftdo check win32k if it implement or not)
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Sep 2 18:36:48 2007 New Revision: 28776 URL:
http://svn.reactos.org/svn/reactos?rev=28776&view=rev
Log: implement SetDeviceGammaRamp in gdi32 (leftdo check win32k if it implement or not) Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sun Sep 2 18:36:48 2007 @@ -790,20 +790,26 @@ - -/* - * @unimplemented - */ -BOOL -STDCALL -SetDeviceGammaRamp( - HDC a0, - LPVOID a1 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; +/* + * @implemented + */ +BOOL +STDCALL +SetDeviceGammaRamp(HDC hdc, + LPVOID lpGammaRamp) +{ + BOOL retValue = FALSE; + + if (lpGammaRamp) + { + retValue = NtGdiSetDeviceGammaRamp(hdc, lpGammaRamp); + } + else + { + SetLastError(ERROR_INVALID_PARAMETER); + } + + return retValue; }
17 years, 3 months
1
0
0
0
[greatlrd] 28775: add smaller check to SetDIBColorTable
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Sep 2 18:11:28 2007 New Revision: 28775 URL:
http://svn.reactos.org/svn/reactos?rev=28775&view=rev
Log: add smaller check to SetDIBColorTable Modified: trunk/reactos/dll/win32/gdi32/objects/palette.c Modified: trunk/reactos/dll/win32/gdi32/objects/palette.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/pa…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/palette.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/palette.c Sun Sep 2 18:11:28 2007 @@ -63,6 +63,9 @@ return NtGdiDoPalette(hDC, iStartIndex, cEntries, pColors, GdiPalGetColorTable, FALSE); } +/* + * @implemented + */ UINT WINAPI SetDIBColorTable(HDC hDC, @@ -70,7 +73,14 @@ UINT cEntries, const RGBQUAD *pColors) { - return NtGdiDoPalette(hDC, iStartIndex, cEntries, (RGBQUAD*)pColors, GdiPalSetColorTable, TRUE); + UINT retValue=0; + + if (cEntries) + { + retValue = NtGdiDoPalette(hDC, iStartIndex, cEntries, (RGBQUAD*)pColors, GdiPalSetColorTable, TRUE); + } + + return retValue; } /* EOF */
17 years, 3 months
1
0
0
0
[greatlrd] 28774: sorry fix the the build
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Sep 2 17:54:26 2007 New Revision: 28774 URL:
http://svn.reactos.org/svn/reactos?rev=28774&view=rev
Log: sorry fix the the build Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sun Sep 2 17:54:26 2007 @@ -212,7 +212,7 @@ UINT flags) { /* FIXME add check for vaildate the flags */ - return NtGdiSetBoundsRect(hdc, *prc, flags + return NtGdiSetBoundsRect(hdc, (LPRECT)prc, flags); }
17 years, 3 months
1
0
0
0
[greatlrd] 28773: partly implement SetBoundsRect
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Sep 2 17:31:41 2007 New Revision: 28773 URL:
http://svn.reactos.org/svn/reactos?rev=28773&view=rev
Log: partly implement SetBoundsRect Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sun Sep 2 17:31:41 2007 @@ -203,19 +203,16 @@ } /* - * @unimplemented + * @implemented */ UINT STDCALL -SetBoundsRect( - HDC a0, - CONST RECT *a1, - UINT a2 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; +SetBoundsRect(HDC hdc, + CONST RECT *prc, + UINT flags) +{ + /* FIXME add check for vaildate the flags */ + return NtGdiSetBoundsRect(hdc, *prc, flags }
17 years, 3 months
1
0
0
0
[greatlrd] 28772: implement SelectFontLocal
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Sep 2 17:19:07 2007 New Revision: 28772 URL:
http://svn.reactos.org/svn/reactos?rev=28772&view=rev
Log: implement SelectFontLocal Modified: trunk/reactos/dll/win32/gdi32/misc/historic.c trunk/reactos/dll/win32/gdi32/misc/stubs.c Modified: trunk/reactos/dll/win32/gdi32/misc/historic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/histo…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/historic.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/historic.c Sun Sep 2 17:19:07 2007 @@ -243,3 +243,14 @@ { return Newhbm; } + +/* + * @implemented + */ +HFONT +STDCALL +SelectFontLocal(HFONT Currenthfnt, + HFONT newhfnt) +{ + return newhfnt; +} Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sun Sep 2 17:19:07 2007 @@ -1120,20 +1120,7 @@ } -/* - * @unimplemented - */ -DWORD -STDCALL -SelectFontLocal( - DWORD a0, - DWORD a1 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} + /*
17 years, 3 months
1
0
0
0
[greatlrd] 28771: implement SelectBrushLocal
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Sep 2 17:09:50 2007 New Revision: 28771 URL:
http://svn.reactos.org/svn/reactos?rev=28771&view=rev
Log: implement SelectBrushLocal Modified: trunk/reactos/dll/win32/gdi32/misc/historic.c trunk/reactos/dll/win32/gdi32/misc/stubs.c Modified: trunk/reactos/dll/win32/gdi32/misc/historic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/histo…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/historic.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/historic.c Sun Sep 2 17:09:50 2007 @@ -233,4 +233,13 @@ return TRUE; } - +/* + * @implemented + */ +HBRUSH +STDCALL +SelectBrushLocal(HBRUSH Currenthbm, + HBRUSH Newhbm) +{ + return Newhbm; +} Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sun Sep 2 17:09:50 2007 @@ -1112,24 +1112,6 @@ DWORD a4, DWORD a5, DWORD a6 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - - - -/* - * @unimplemented - */ -DWORD -STDCALL -SelectBrushLocal( - DWORD a0, - DWORD a1 ) { UNIMPLEMENTED;
17 years, 3 months
1
0
0
0
[hpoussin] 28770: Search a property by its name
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun Sep 2 17:08:00 2007 New Revision: 28770 URL:
http://svn.reactos.org/svn/reactos?rev=28770&view=rev
Log: Search a property by its name Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Sun Sep 2 17:08:00 2007 @@ -1204,6 +1204,18 @@ } string +MingwModuleHandler::GetPropertyValue ( const Module& module, const std::string& name ) +{ + for ( size_t i = 0; i < module.project.non_if_data.properties.size (); i++ ) + { + const Property& property = *module.project.non_if_data.properties[i]; + if ( property.name == name ) + return property.value; + } + return string ( "" ); +} + +string MingwModuleHandler::GetRpcServerHeaderFilename ( string basename ) const { return PassThruCacheDirectory ( basename + "_s.h", Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h Sun Sep 2 17:08:00 2007 @@ -211,6 +211,7 @@ void GenerateBuildNonSymbolStrippedCode (); void CleanupCompilationUnitVector ( std::vector<CompilationUnit*>& compilationUnits ); void GetRpcHeaderDependencies ( std::vector<std::string>& dependencies ) const; + static std::string GetPropertyValue ( const Module& module, const std::string& name ); std::string GetRpcServerHeaderFilename ( std::string basename ) const; std::string GetRpcClientHeaderFilename ( std::string basename ) const; std::string GetIdlHeaderFilename ( std::string basename ) const;
17 years, 3 months
1
0
0
0
[greatlrd] 28769: fix smaller bug in SelectClipRgn
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Sep 2 16:58:35 2007 New Revision: 28769 URL:
http://svn.reactos.org/svn/reactos?rev=28769&view=rev
Log: fix smaller bug in SelectClipRgn Modified: trunk/reactos/dll/win32/gdi32/objects/region.c Modified: trunk/reactos/dll/win32/gdi32/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/re…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/region.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/region.c Sun Sep 2 16:58:35 2007 @@ -10,7 +10,7 @@ HRGN hrgn ) { - return NtGdiExtSelectClipRgn(hdc, hrgn, RGN_COPY); + return ExtSelectClipRgn(hdc, hrgn, RGN_COPY); }
17 years, 3 months
1
0
0
0
← Newer
1
...
52
53
54
55
56
57
58
59
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200