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
March 2005
----- 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
26 participants
609 discussions
Start a n
N
ew thread
[ea] 14245: cleaned a wrong comment (copy&paste)
by ea@svn.reactos.com
cleaned a wrong comment (copy&paste) Modified: trunk/reactos/lib/winsta/main.c _____ Modified: trunk/reactos/lib/winsta/main.c --- trunk/reactos/lib/winsta/main.c 2005-03-20 22:55:05 UTC (rev 14244) +++ trunk/reactos/lib/winsta/main.c 2005-03-20 23:01:48 UTC (rev 14245) @@ -18,7 +18,7 @@ */ /* $Id$ * - * PROJECT: ReactOS Access Control List Editor + * PROJECT: ReactOS winsta.dll * FILE: lib/winsta/main.c * PURPOSE: WinStation * PROGRAMMER: Emanuele Aliberti <ea(a)reactos.com>
19 years, 9 months
1
0
0
0
[ea] 14244: SM: init system reading the registry
by ea@svn.reactos.com
SM: init system reading the registry CSR: register with SM for IMAGE_SUBSYSTEM_WINDOWS_CUI Modified: trunk/reactos/subsys/csrss/api/wapi.c Modified: trunk/reactos/subsys/csrss/csrss.c Modified: trunk/reactos/subsys/csrss/include/api.h Modified: trunk/reactos/subsys/csrss/init.c Modified: trunk/reactos/subsys/csrss/win32csr/conio.c Modified: trunk/reactos/subsys/smss/client.c Modified: trunk/reactos/subsys/smss/init.c Modified: trunk/reactos/subsys/smss/initss.c Modified: trunk/reactos/subsys/smss/makefile Modified: trunk/reactos/subsys/smss/smapi.c Modified: trunk/reactos/subsys/smss/smapiexec.c Added: trunk/reactos/subsys/smss/smapiquery.c Modified: trunk/reactos/subsys/smss/smss.c Modified: trunk/reactos/subsys/smss/smss.h _____ Modified: trunk/reactos/subsys/csrss/api/wapi.c --- trunk/reactos/subsys/csrss/api/wapi.c 2005-03-20 22:09:14 UTC (rev 14243) +++ trunk/reactos/subsys/csrss/api/wapi.c 2005-03-20 22:55:05 UTC (rev 14244) @@ -10,16 +10,21 @@ /* INCLUDES ******************************************************************/ +#define NTOS_MODE_USER +#include <ntos.h> #include <csrss/csrss.h> #include <ddk/ntddk.h> -#include <ntdll/rtl.h> + + + +#define NDEBUG #include <debug.h> #include "api.h" /* GLOBALS *******************************************************************/ -HANDLE CsrssApiHeap; +HANDLE CsrssApiHeap = (HANDLE) 0; static unsigned ApiDefinitionsCount = 0; static PCSRSS_API_DEFINITION ApiDefinitions = NULL; @@ -33,6 +38,8 @@ PCSRSS_API_DEFINITION Scan; PCSRSS_API_DEFINITION New; + DPRINT("CSR: %s called", __FUNCTION__); + NewCount = 0; for (Scan = NewDefinitions; 0 != Scan->Handler; Scan++) { @@ -107,6 +114,8 @@ PCSRSS_PROCESS_DATA ProcessData; PCSRSS_API_REPLY Reply; + DPRINT("CSR: %s called", __FUNCTION__); + Reply = NULL; for (;;) @@ -153,34 +162,37 @@ * Handle connection requests from clients to the port * "\Windows\ApiPort". */ -void STDCALL +DWORD STDCALL ServerApiPortThread (PVOID PortHandle) { - NTSTATUS Status; + NTSTATUS Status = STATUS_SUCCESS; LPC_MAX_MESSAGE Request; - HANDLE ServerPort; - HANDLE ServerThread; - PCSRSS_PROCESS_DATA ProcessData; + HANDLE hApiListenPort = * (PHANDLE) PortHandle; + HANDLE ServerPort = (HANDLE) 0; + HANDLE ServerThread = (HANDLE) 0; + PCSRSS_PROCESS_DATA ProcessData = NULL; CsrInitProcessData(); + DPRINT("CSR: %s called", __FUNCTION__); + for (;;) { LPC_SECTION_READ LpcRead; ServerPort = NULL; - Status = NtListenPort(PortHandle, &Request.Header); + Status = NtListenPort (hApiListenPort, & Request.Header); if (!NT_SUCCESS(Status)) { DPRINT1("CSR: NtListenPort() failed\n"); break; } - Status = NtAcceptConnectPort(&ServerPort, - PortHandle, + Status = NtAcceptConnectPort(& ServerPort, + hApiListenPort, NULL, TRUE, 0, - &LpcRead); + & LpcRead); if (!NT_SUCCESS(Status)) { DPRINT1("CSR: NtAcceptConnectPort() failed\n"); @@ -215,7 +227,7 @@ NULL, (PTHREAD_START_ROUTINE)ClientConnectionThread, ServerPort, - &ServerThread, + & ServerThread, NULL); if (!NT_SUCCESS(Status)) { @@ -230,6 +242,7 @@ } NtClose(PortHandle); NtTerminateThread(NtCurrentThread(), Status); + return 0; } /********************************************************************** @@ -238,45 +251,88 @@ * * DESCRIPTION * Handle connection requests from SM to the port - * "\Windows\SbApiPort". + * "\Windows\SbApiPort". We will accept only one + * connection request (from the SM). */ -VOID STDCALL +DWORD STDCALL ServerSbApiPortThread (PVOID PortHandle) { - HANDLE hSbApiPortListen = (HANDLE) PortHandle; + HANDLE hSbApiPortListen = * (PHANDLE) PortHandle; HANDLE hConnectedPort = (HANDLE) 0; LPC_MAX_MESSAGE Request = {{0}}; + PVOID Context = NULL; NTSTATUS Status = STATUS_SUCCESS; - while (TRUE) + DPRINT("CSR: %s called\n", __FUNCTION__); + + Status = NtListenPort (hSbApiPortListen, & Request.Header); + if (!NT_SUCCESS(Status)) { - Status = NtListenPort (hSbApiPortListen, & Request.Header); - if (!NT_SUCCESS(Status)) - { - DPRINT1("CSR: %s: NtListenPort(SB) failed\n", __FUNCTION__); - break; - } + DPRINT1("CSR: %s: NtListenPort(SB) failed (Status=0x%08lx)\n", + __FUNCTION__, Status); + } else { +DPRINT("-- 1\n"); Status = NtAcceptConnectPort (& hConnectedPort, hSbApiPortListen, - NULL, - TRUE, - NULL, + NULL, + TRUE, + NULL, NULL); if(!NT_SUCCESS(Status)) { - DPRINT1("CSR: %s: NtAcceptConnectPort() failed\n", __FUNCTION__); - break; + DPRINT1("CSR: %s: NtAcceptConnectPort() failed (Status=0x%08lx)\n", + __FUNCTION__, Status); + } else { +DPRINT("-- 2\n"); + Status = NtCompleteConnectPort (hConnectedPort); + if(!NT_SUCCESS(Status)) + { + DPRINT1("CSR: %s: NtCompleteConnectPort() failed (Status=0x%08lx)\n", + __FUNCTION__, Status); + } else { +DPRINT("-- 3\n"); + PLPC_MESSAGE Reply = NULL; + /* + * Tell the init thread the SM gave the + * green light for boostrapping. + */ + Status = NtSetEvent (hBootstrapOk, NULL); + if(!NT_SUCCESS(Status)) + { + DPRINT1("CSR: %s: NtSetEvent failed (Status=0x%08lx)\n", + __FUNCTION__, Status); + } + /* Wait for messages from the SM */ +DPRINT("-- 4\n"); + while (TRUE) + { + Status = NtReplyWaitReceivePort(hConnectedPort, + Context, + Reply, + & Request.Header); + if(!NT_SUCCESS(Status)) + { + DPRINT1("CSR: %s: NtReplyWaitReceivePort failed (Status=0x%08lx)\n", + __FUNCTION__, Status); + break; + } + switch (Request.Header.MessageType)//fix .h PORT_MESSAGE_TYPE(Request)) + { + /* TODO */ + default: + DPRINT1("CSR: %s received message (type=%d)\n", + __FUNCTION__, Request.Header.MessageType); + } +DPRINT("-- 5\n"); + } + } } - Status = NtCompleteConnectPort (hConnectedPort); - if(!NT_SUCCESS(Status)) - { - DPRINT1("CSR: %s: NtCompleteConnectPort() failed\n", __FUNCTION__); - break; - } - /* TODO: create thread for the connected port */ } + DPRINT1("CSR: %s: terminating!\n", __FUNCTION__); + if(hConnectedPort) NtClose (hConnectedPort); NtClose (hSbApiPortListen); NtTerminateThread (NtCurrentThread(), Status); + return 0; } /* EOF */ _____ Modified: trunk/reactos/subsys/csrss/csrss.c --- trunk/reactos/subsys/csrss/csrss.c 2005-03-20 22:09:14 UTC (rev 14243) +++ trunk/reactos/subsys/csrss/csrss.c 2005-03-20 22:55:05 UTC (rev 14244) @@ -35,6 +35,7 @@ #include <ntdll/rtl.h> #include <csrss/csrss.h> #include <rosrtl/string.h> +#include <reactos/buildno.h> #include "api.h" @@ -145,78 +146,37 @@ } -/********************************************************************** - * NAME PRIVATE - * CsrpOpenSmInitDoneEvent/0 - */ -static NTSTATUS STDCALL -CsrpOpenSmInitDoneEvent (PHANDLE CsrssInitEvent) -{ - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING EventName; - - DPRINT("CSR: %s called\n", __FUNCTION__); - - RtlInitUnicodeString(& EventName, - L"\\CsrssInitDone"); - InitializeObjectAttributes (& ObjectAttributes, - & EventName, - EVENT_ALL_ACCESS, - 0, - NULL); - return NtOpenEvent (CsrssInitEvent, - EVENT_ALL_ACCESS, - & ObjectAttributes); -} - /* Native process' entry point */ VOID STDCALL NtProcessStartup(PPEB Peb) { PRTL_USER_PROCESS_PARAMETERS RtlProcessParameters = NULL; COMMAND_LINE_ARGUMENT CmdLineArg = {0}; - HANDLE CsrssInitEvent = (HANDLE) 0; NTSTATUS Status = STATUS_SUCCESS; - DPRINT("CSR: %s\n", __FUNCTION__); + PrintString("ReactOS Client/Server Run-Time %s (Build %s)\n", + KERNEL_RELEASE_STR, + KERNEL_VERSION_BUILD_STR); RtlProcessParameters = RtlNormalizeProcessParams (Peb->ProcessParameters); /*================================================================== - * Parse the command line. + * Parse the command line: TODO actually parse the cl, because + * it is required to load hosted server DLLs. *================================================================*/ Status = CsrpParseCommandLine (Peb->ProcessHeap, RtlProcessParameters, & CmdLineArg); if(STATUS_SUCCESS != Status) { - DbgPrint("CSR: CsrpParseCommandLine failed (Status=0x%08lx)\n", - Status); + DPRINT1("CSR: %s: CsrpParseCommandLine failed (Status=0x%08lx)\n", + __FUNCTION__, Status); } - /* - * Open the SM notification event to notify we are OK after - * subsystem server initialization. - */ - Status = CsrpOpenSmInitDoneEvent(& CsrssInitEvent); - if (!NT_SUCCESS(Status)) - { - DbgPrint("CSR: CsrpOpenSmInitDoneEvent failed (Status=0x%08lx)\n", - Status); - } /*================================================================== * Initialize the Win32 environment subsystem server. *================================================================*/ if (CsrServerInitialization (CmdLineArg.Count, CmdLineArg.Vector) == TRUE) { - /*============================================================= - * Tell SM we are up and safe. If we fail to notify SM, it will - * die and the kernel will bugcheck with - * SESSION5_INITIALIZATION_FAILED. - * TODO: this won't be necessary, because CSR will call SM - * API SM_SESSION_COMPLETE. - *===========================================================*/ - NtSetEvent (CsrssInitEvent, NULL); - CsrpFreeCommandLine (Peb->ProcessHeap, & CmdLineArg); /* * Terminate the current thread only. _____ Modified: trunk/reactos/subsys/csrss/include/api.h --- trunk/reactos/subsys/csrss/include/api.h 2005-03-20 22:09:14 UTC (rev 14243) +++ trunk/reactos/subsys/csrss/include/api.h 2005-03-20 22:55:05 UTC (rev 14244) @@ -82,6 +82,9 @@ PCSRSS_API_REQUEST Request,\ PCSRSS_API_REPLY Reply) +/* init.c */ +extern HANDLE hBootstrapOk; + /* api/process.c */ CSR_API(CsrConnectProcess); CSR_API(CsrCreateProcess); @@ -96,9 +99,9 @@ VOID FASTCALL CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData, PCSRSS_API_REQUEST Request, PCSRSS_API_REPLY Reply); -VOID STDCALL ServerApiPortThread (PVOID PortHandle); -VOID STDCALL ServerSbApiPortThread (PVOID PortHandle); -VOID Console_Api( DWORD Ignored ); +DWORD STDCALL ServerApiPortThread (PVOID PortHandle); +DWORD STDCALL ServerSbApiPortThread (PVOID PortHandle); +DWORD STDCALL Console_Api( PVOID unused ); extern HANDLE CsrssApiHeap; _____ Modified: trunk/reactos/subsys/csrss/init.c --- trunk/reactos/subsys/csrss/init.c 2005-03-20 22:09:14 UTC (rev 14243) +++ trunk/reactos/subsys/csrss/init.c 2005-03-20 22:55:05 UTC (rev 14244) @@ -27,10 +27,9 @@ /* GLOBALS ******************************************************************/ -HANDLE CsrInitEvent = INVALID_HANDLE_VALUE; -HANDLE CsrHeap = INVALID_HANDLE_VALUE; +HANDLE CsrHeap = (HANDLE) 0; -HANDLE CsrObjectDirectory = INVALID_HANDLE_VALUE; +HANDLE CsrObjectDirectory = (HANDLE) 0; UNICODE_STRING CsrDirectoryName; @@ -39,11 +38,24 @@ static unsigned InitCompleteProcCount; static CSRPLUGIN_INIT_COMPLETE_PROC *InitCompleteProcs = NULL; +HANDLE hSbApiPort = (HANDLE) 0; + +HANDLE hBootstrapOk = (HANDLE) 0; + +HANDLE hSmApiPort = (HANDLE) 0; + +HANDLE hApiPort = (HANDLE) 0; + +/********************************************************************** + * CsrpAddInitCompleteProc/1 + */ static NTSTATUS FASTCALL -AddInitCompleteProc(CSRPLUGIN_INIT_COMPLETE_PROC Proc) +CsrpAddInitCompleteProc(CSRPLUGIN_INIT_COMPLETE_PROC Proc) { CSRPLUGIN_INIT_COMPLETE_PROC *NewProcs; + DPRINT("CSR: %s called\n", __FUNCTION__); + NewProcs = RtlAllocateHeap(CsrssApiHeap, 0, (InitCompleteProcCount + 1) * sizeof(CSRPLUGIN_INIT_COMPLETE_PROC)); @@ -64,12 +76,17 @@ return STATUS_SUCCESS; } +/********************************************************************** + * CallInitComplete/0 + */ static BOOL FASTCALL CallInitComplete(void) { BOOL Ok; unsigned i; + DPRINT("CSR: %s called\n", __FUNCTION__); + Ok = TRUE; if (0 != InitCompleteProcCount) { @@ -86,8 +103,11 @@ ULONG InitializeVideoAddressSpace(VOID); +/********************************************************************** + * CsrpParseCommandLine/2 + */ static NTSTATUS -CsrParseCommandLine ( +CsrpParseCommandLine ( ULONG ArgumentCount, PWSTR *ArgumentArray ) @@ -95,7 +115,9 @@ NTSTATUS Status; OBJECT_ATTRIBUTES Attributes; + DPRINT("CSR: %s called\n", __FUNCTION__); + /* DbgPrint ("Arguments: %ld\n", ArgumentCount); for (i = 0; i < ArgumentCount; i++) { @@ -114,22 +136,29 @@ NULL); Status = NtCreateDirectoryObject(&CsrObjectDirectory, - 0xF000F, + 0xF000F, /* ea:??? */ &Attributes); return Status; } - -static VOID -CsrInitVideo(VOID) +/********************************************************************** + * CsrpInitVideo/0 + * + * TODO: we need a virtual device for sessions other than + * TODO: the console one + */ +static NTSTATUS +CsrpInitVideo (ULONG argc, PWSTR* argv) { OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING DeviceName; IO_STATUS_BLOCK Iosb; - HANDLE VideoHandle; - NTSTATUS Status; + HANDLE VideoHandle = (HANDLE) 0; + NTSTATUS Status = STATUS_SUCCESS; + DPRINT("CSR: %s called\n", __FUNCTION__); + InitializeVideoAddressSpace(); RtlRosInitUnicodeStringFromLiteral(&DeviceName, L"\\??\\DISPLAY1"); @@ -148,10 +177,23 @@ { NtClose(VideoHandle); } + return Status; } -static NTSTATUS FASTCALL -InitWin32Csr() +/********************************************************************** + * CsrpInitWin32Csr/0 + * + * TODO: this function should be turned more general to load an + * TODO: hosted server DLL as received from the command line; + * TODO: for instance: ServerDll=winsrv:ConServerDllInitialization,2 + * TODO: ^method ^dll ^api ^sid + * TODO: + * TODO: CsrpHostServerDll (LPWSTR DllName, + * TODO: LPWSTR ApiName, + * TODO: DWORD ServerId) + */ +static NTSTATUS +CsrpInitWin32Csr (ULONG argc, PWSTR* argv) { NTSTATUS Status; UNICODE_STRING DllName; @@ -163,6 +205,8 @@ PCSRSS_OBJECT_DEFINITION ObjectDefinitions; CSRPLUGIN_INIT_COMPLETE_PROC InitCompleteProc; + DPRINT("CSR: %s called\n", __FUNCTION__); + RtlInitUnicodeString(&DllName, L"win32csr.dll"); Status = LdrLoadDll(NULL, 0, &DllName, (PVOID *) &hInst); if (! NT_SUCCESS(Status)) @@ -196,7 +240,7 @@ } if (NULL != InitCompleteProc) { - Status = AddInitCompleteProc(InitCompleteProc); + Status = CsrpAddInitCompleteProc(InitCompleteProc); } return Status; @@ -219,157 +263,292 @@ { 0, 0, 0, NULL } }; +static NTSTATUS STDCALL +CsrpCreateListenPort (IN LPWSTR Name, + IN OUT PHANDLE Port, + IN PTHREAD_START_ROUTINE ListenThread) +{ + NTSTATUS Status = STATUS_SUCCESS; + OBJECT_ATTRIBUTES PortAttributes; + UNICODE_STRING PortName; + + DPRINT("CSR: %s called\n", __FUNCTION__); + + RtlInitUnicodeString (& PortName, Name); + InitializeObjectAttributes (& PortAttributes, + & PortName, + 0, + NULL, + NULL); + Status = NtCreatePort ( Port, + & PortAttributes, + 260, /* TODO: make caller set it*/ + 328, /* TODO: make caller set it*/ + 0); /* TODO: make caller set it*/ + if(!NT_SUCCESS(Status)) + { + DPRINT1("CSR: %s: NtCreatePort failed (Status=%08lx)\n", + __FUNCTION__, Status); + return Status; + } + Status = RtlCreateUserThread(NtCurrentProcess(), + NULL, + FALSE, + 0, + NULL, + NULL, + (PTHREAD_START_ROUTINE) ListenThread, + Port, + NULL, + NULL); + return Status; +} + +/* === INIT ROUTINES === */ + /********************************************************************** - * NAME - * CsrpRegisterSubsystem/0 - * - * DESCRIPTION - * Register CSRSS in the SM to manage IMAGE_SUBSYSTEM_WINDOWS_CUI - * processes (environment subsystem server). - * - * RETURN VALUE - * STATUS_SUCCESS on success. + * CsrpCreateCallbackPort/0 */ -static NTSTATUS FASTCALL -CsrpRegisterSubsystem(PHANDLE hSmApiPort) +static NTSTATUS +CsrpCreateHeap (ULONG argc, PWSTR* argv) { - NTSTATUS Status = STATUS_SUCCESS; - UNICODE_STRING SbApiPortName; + DPRINT("CSR: %s called\n", __FUNCTION__); - RtlInitUnicodeString (& SbApiPortName, L"\\Windows\\SbApiPort"); - Status = SmConnectApiPort (& SbApiPortName, - (HANDLE)-1, //unused + CsrssApiHeap = RtlCreateHeap(HEAP_GROWABLE, + NULL, + 65536, + 65536, + NULL, + NULL); + if (CsrssApiHeap == NULL) + { + return STATUS_UNSUCCESSFUL; + } + return STATUS_SUCCESS; +} + +/********************************************************************** + * CsrpCreateCallbackPort/0 + */ +static NTSTATUS +CsrpCreateCallbackPort (ULONG argc, PWSTR* argv) +{ + DPRINT("CSR: %s called\n", __FUNCTION__); + + return CsrpCreateListenPort (L"\\Windows\\SbApiPort", + & hSbApiPort, + ServerSbApiPortThread); +} + +/********************************************************************** + * CsrpRegisterSubsystem/2 + */ +static NTSTATUS +CsrpRegisterSubsystem (ULONG argc, PWSTR* argv) +{ + NTSTATUS Status = STATUS_SUCCESS; + OBJECT_ATTRIBUTES BootstrapOkAttributes; + UNICODE_STRING Name; + + DPRINT("CSR: %s called\n", __FUNCTION__); + + /* + * Create the event object the callback port + * thread will signal *if* the SM will + * authorize us to bootstrap. + */ + RtlInitUnicodeString (& Name, L"\\CsrssBooting"); + InitializeObjectAttributes(& BootstrapOkAttributes, + & Name, + 0, NULL, NULL); + Status = NtCreateEvent (& hBootstrapOk, + EVENT_ALL_ACCESS, + & BootstrapOkAttributes, + SynchronizationEvent, + FALSE); + if(!NT_SUCCESS(Status)) + { + DPRINT("CSR: %s: NtCreateEvent failed (Status=0x%08lx)\n", + __FUNCTION__, Status); + return Status; + } + /* + * Let's tell the SM a new environment + * subsystem server is in the system. + */ + RtlInitUnicodeString (& Name, L"\\Windows\\SbApiPort"); + DPRINT("CSR: %s: registering with SM for\n IMAGE_SUBSYSTEM_WINDOWS_CUI == 3\n", __FUNCTION__); + Status = SmConnectApiPort (& Name, + hSbApiPort, IMAGE_SUBSYSTEM_WINDOWS_CUI, - hSmApiPort); + & hSmApiPort); if(!NT_SUCCESS(Status)) { - DPRINT("CSR: unable to connect to the SM (Status=0x%lx)\n", Status); + DPRINT("CSR: %s unable to connect to the SM (Status=0x%08lx)\n", + __FUNCTION__, Status); + NtClose (hBootstrapOk); return Status; } - DisplayString(L"CSR: registered with SM\n"); + /* + * Wait for SM to reply OK... If the SM + * won't answer, we hang here forever! + */ + DPRINT("CSR: %s: waiting for SM to OK boot...\n", __FUNCTION__); + Status = NtWaitForSingleObject (hBootstrapOk, + FALSE, + NULL); + NtClose (hBootstrapOk); return Status; } +/********************************************************************** + * CsrpCreateApiPort/0 + */ +static NTSTATUS +CsrpCreateApiPort (ULONG argc, PWSTR* argv) +{ + DPRINT("CSR: %s called\n", __FUNCTION__); + return CsrpCreateListenPort (L"\\Windows\\ApiPort", + & hApiPort, + ServerApiPortThread); +} + /********************************************************************** + * CsrpApiRegisterDef/0 + */ +static NTSTATUS +CsrpApiRegisterDef (ULONG argc, PWSTR* argv) +{ + return CsrApiRegisterDefinitions(NativeDefinitions); +} + +/********************************************************************** + * CsrpCCTS/2 + */ +static NTSTATUS +CsrpCCTS (ULONG argc, PWSTR* argv) +{ + return CsrClientConnectToServer(); +} + +/********************************************************************** + * CsrpRunWinlogon/0 + * + * Start the logon process (winlogon.exe). + * + * TODO: this should be moved in CsrpCreateSession/x (one per session) + * TODO: in its own desktop (one logon desktop per winstation). + */ +static NTSTATUS +CsrpRunWinlogon (ULONG argc, PWSTR* argv) +{ + NTSTATUS Status = STATUS_SUCCESS; + UNICODE_STRING ImagePath; + UNICODE_STRING CommandLine; + PRTL_USER_PROCESS_PARAMETERS ProcessParameters = NULL; + RTL_PROCESS_INFO ProcessInfo; + + + DPRINT("CSR: %s called\n", __FUNCTION__); + + /* initialize the process parameters */ + RtlInitUnicodeString (& ImagePath, L"\\SystemRoot\\system32\\winlogon.exe"); + RtlInitUnicodeString (& CommandLine, L""); + RtlCreateProcessParameters(& ProcessParameters, + & ImagePath, + NULL, + NULL, + & CommandLine, + NULL, + NULL, + NULL, + NULL, + NULL); + /* Create the winlogon process */ + Status = RtlCreateUserProcess (& ImagePath, + OBJ_CASE_INSENSITIVE, + ProcessParameters, + NULL, + NULL, + NULL, + FALSE, + NULL, + NULL, + & ProcessInfo); + /* Cleanup */ + RtlDestroyProcessParameters (ProcessParameters); + if (!NT_SUCCESS(Status)) + { + DPRINT("SM: %s: loading winlogon.exe failed (Status=%08lx)\n", + __FUNCTION__, Status); + } + return Status; +} + + + +typedef NTSTATUS (* CSR_INIT_ROUTINE)(ULONG, PWSTR*); + +struct { + BOOL Required; + CSR_INIT_ROUTINE EntryPoint; + PCHAR ErrorMessage; +} InitRoutine [] = { + {TRUE, CsrpCreateCallbackPort, "create the callback port \\Windows\\SbApiPort"}, + {TRUE, CsrpRegisterSubsystem, "register with SM"}, + {TRUE, CsrpCreateHeap, "create the CSR heap"}, + {TRUE, CsrpCreateApiPort, "create the api port \\Windows\\ApiPort"}, + {TRUE, CsrpParseCommandLine, "parse the command line"}, + {TRUE, CsrpInitVideo, "initialize video"}, + {TRUE, CsrpApiRegisterDef, "initialize api definitions"}, + {TRUE, CsrpCCTS, "connect client to server"}, + {TRUE, CsrpInitWin32Csr, "load usermode dll"}, + {TRUE, CsrpRunWinlogon, "run WinLogon"}, +}; + +/********************************************************************** * NAME * CsrServerInitialization * * DESCRIPTION - * Create a directory object (\windows) and a named LPC port - * (\windows\ApiPort) + * Initialize the Win32 environment subsystem server. * * RETURN VALUE * TRUE: Initialization OK; otherwise FALSE. */ -BOOL -STDCALL +BOOL STDCALL CsrServerInitialization ( ULONG ArgumentCount, PWSTR *ArgumentArray ) { - NTSTATUS Status; - HANDLE hSmApiPort = (HANDLE) 0; - OBJECT_ATTRIBUTES ObAttributes; - UNICODE_STRING PortName; - HANDLE ApiPortHandle; -// HANDLE hSbApiPort = (HANDLE) 0; + INT i = 0; + NTSTATUS Status = STATUS_SUCCESS; -DisplayString(L"CSR: CsrServerInitialization\n"); + DPRINT("CSR: %s called\n", __FUNCTION__); - Status = CsrpRegisterSubsystem(& hSmApiPort); - if (! NT_SUCCESS(Status)) - { - DPRINT1("CSR: Unable to register subsystem (Status: %x)\n", Status); - return FALSE; - } - - Status = CsrParseCommandLine (ArgumentCount, ArgumentArray); - if (! NT_SUCCESS(Status)) - { - DPRINT1("CSR: Unable to parse the command line (Status: %x)\n", Status); - return FALSE; - } - - CsrInitVideo(); - - CsrssApiHeap = RtlCreateHeap(HEAP_GROWABLE, - NULL, - 65536, - 65536, - NULL, - NULL); - if (CsrssApiHeap == NULL) - { - DPRINT1("CSR: Failed to create private heap, aborting\n"); - return FALSE; - } - - Status = CsrApiRegisterDefinitions(NativeDefinitions); - if (! NT_SUCCESS(Status)) - { - return Status; - } - - /* NEW NAMED PORT: \Windows\ApiPort */ - RtlRosInitUnicodeStringFromLiteral(&PortName, L"\\Windows\\ApiPort"); - InitializeObjectAttributes(&ObAttributes, - &PortName, - 0, - NULL, - NULL); - Status = NtCreatePort(&ApiPortHandle, - &ObAttributes, - 260, - 328, - 0); - if (! NT_SUCCESS(Status)) - { - DPRINT1("CSR: Unable to create \\Windows\\ApiPort (Status %x)\n", Status); - return FALSE; - } - Status = RtlCreateUserThread(NtCurrentProcess(), - NULL, - FALSE, - 0, - NULL, - NULL, - (PTHREAD_START_ROUTINE)ServerApiPortThread, - ApiPortHandle, - NULL, - NULL); - if (! NT_SUCCESS(Status)) - { - DPRINT1("CSR: Unable to create server thread\n"); - NtClose(ApiPortHandle); - return FALSE; - } - - /* TODO: create \Windows\SbApiPort */ - - Status = CsrClientConnectToServer(); - if (!NT_SUCCESS(Status)) - { - DPRINT1("CsrClientConnectToServer() failed (Status %x)\n", Status); - return FALSE; - } - Status = InitWin32Csr(); - if (! NT_SUCCESS(Status)) - { - DPRINT1("CSR: Unable to load usermode dll (Status %x)\n", Status); - return FALSE; - } - - if (CallInitComplete()) - { -#if 0 - Status = SmCompleteSession (hSmApiPort,hSbApiPort,ApiPortHandle); -#endif - NtClose (hSmApiPort); - return TRUE; - } - return FALSE; + for (i=0; i < (sizeof InitRoutine / sizeof InitRoutine[0]); i++) + { + Status = InitRoutine[i].EntryPoint(ArgumentCount,ArgumentArray); + if(!NT_SUCCESS(Status)) + { + DPRINT1("CSR: %s: failed to %s (Status=%08lx)\n", + __FUNCTION__, + InitRoutine[i].ErrorMessage, + Status); + if (InitRoutine[i].Required) + { + return FALSE; + } + } + } + if (CallInitComplete()) + { + Status = SmCompleteSession (hSmApiPort,hSbApiPort,hApiPort); + return TRUE; + } + return FALSE; } /* EOF */ _____ Modified: trunk/reactos/subsys/csrss/win32csr/conio.c --- trunk/reactos/subsys/csrss/win32csr/conio.c 2005-03-20 22:09:14 UTC (rev 14243) +++ trunk/reactos/subsys/csrss/win32csr/conio.c 2005-03-20 22:55:05 UTC (rev 14244) @@ -1381,8 +1381,8 @@ } } -VOID -Console_Api(DWORD RefreshEvent) +DWORD STDCALL +Console_Api (PVOID unused) { /* keep reading events from the keyboard and stuffing them into the current console's input queue */ @@ -1409,6 +1409,7 @@ } PrivateCsrssAcquireOrReleaseInputOwnership(TRUE); + return 0; } CSR_API(CsrGetScreenBufferInfo) _____ Modified: trunk/reactos/subsys/smss/client.c --- trunk/reactos/subsys/smss/client.c 2005-03-20 22:09:14 UTC (rev 14243) +++ trunk/reactos/subsys/smss/client.c 2005-03-20 22:55:05 UTC (rev 14244) @@ -99,14 +99,18 @@ * SIDE EFFECTS * SmpClientDirectory.Lock is released only on success. */ -static PSM_CLIENT_DATA STDCALL -SmpLookupClient (USHORT SubsystemId) +static PSM_CLIENT_DATA FASTCALL +SmpLookupClientUnsafe (USHORT SubsystemId, + PSM_CLIENT_DATA * Parent) { PSM_CLIENT_DATA Client = NULL; - DPRINT("SM: %s called\n", __FUNCTION__); - - RtlEnterCriticalSection (& SmpClientDirectory.Lock); + DPRINT("SM: %s(%d) called\n", __FUNCTION__, SubsystemId); + + if(NULL != Parent) + { + *Parent = NULL; + } if (SmpClientDirectory.Count > 0) { Client = SmpClientDirectory.Client; @@ -114,12 +118,31 @@ { if (SubsystemId == Client->SubsystemId) { - RtlLeaveCriticalSection (& SmpClientDirectory.Lock); - return Client; + break; } + if(NULL != Parent) + { + *Parent = Client; + } Client = Client->Next; } } + return Client; +} + +static PSM_CLIENT_DATA STDCALL +SmpLookupClient (USHORT SubsystemId) +{ + PSM_CLIENT_DATA Client = NULL; + + DPRINT("SM: %s called\n", __FUNCTION__); [truncated at 1000 lines; 746 more skipped]
19 years, 9 months
1
0
0
0
[ion] 14243: User-Mode Networking Rewrite/Improvement Branch.
by ion@svn.reactos.com
User-Mode Networking Rewrite/Improvement Branch. Goals: - NSP, LSP Support for DNS/Winsock Queries. - Fix formatting of my MSAFD code - Fix header file issues - Fix bugs in my msafd implementation - Implement ws2help and wshtcpip for msafd to use. Added: branches/umode_net_branch/ _____ Copied: branches/umode_net_branch (from rev 14242, trunk/reactos)
19 years, 9 months
1
0
0
0
[ion] 14242: Wrong name.
by ion@svn.reactos.com
Wrong name. Deleted: branches/reactos/
19 years, 9 months
1
0
0
0
[chorns] 14241: Test module type support
by chorns@svn.reactos.com
Test module type support Modified: branches/xmlbuildsystem/reactos/Makefile Modified: branches/xmlbuildsystem/reactos/ReactOS.xml Modified: branches/xmlbuildsystem/reactos/baseaddress.xml Modified: branches/xmlbuildsystem/reactos/lib/kernel32/kernel32.xml Added: branches/xmlbuildsystem/reactos/lib/kernel32/tests/kernel32.xml Added: branches/xmlbuildsystem/reactos/lib/kernel32/tests/stubs.xml Added: branches/xmlbuildsystem/reactos/regtests/directory.xml Added: branches/xmlbuildsystem/reactos/regtests/regtests/regtests.xml Added: branches/xmlbuildsystem/reactos/regtests/shared/rtshared.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/bootstrap.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.mak Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.txt Added: branches/xmlbuildsystem/reactos/tools/rbuild/stubbedcomponent.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/test.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/alltests.cpp Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/symbol.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/functiontest.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/iftest.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/invoketest.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/moduletest.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/sourcefiletest.cpp Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/symboltest.cpp _____ Modified: branches/xmlbuildsystem/reactos/Makefile --- branches/xmlbuildsystem/reactos/Makefile 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/Makefile 2005-03-20 21:58:30 UTC (rev 14241) @@ -45,47 +45,49 @@ endif endif ifeq ($(HALFVERBOSEECHO),yes) - ECHO_MKDIR =@echo [MKDIR] $@ - ECHO_BUILDNO=@echo [BUILDNO] $@ - ECHO_INVOKE =@echo [INVOKE] $< - ECHO_PCH =@echo [PCH] $@ - ECHO_CC =@echo [CC] $< - ECHO_GAS =@echo [GAS] $< - ECHO_NASM =@echo [NASM] $< - ECHO_AR =@echo [AR] $@ - ECHO_WINEBLD=@echo [WINEBLD] $@ - ECHO_WRC =@echo [WRC] $@ - ECHO_BIN2RES=@echo [BIN2RES] $< - ECHO_DLLTOOL=@echo [DLLTOOL] $@ - ECHO_LD =@echo [LD] $@ - ECHO_RBUILD =@echo [RBUILD] $@ - ECHO_RSYM =@echo [RSYM] $@ - ECHO_WMC =@echo [WMC] $@ - ECHO_NCI =@echo [NCI] $@ - ECHO_CABMAN =@echo [CABMAN] $< - ECHO_CDMAKE =@echo [CDMAKE] $@ - ECHO_TEST =@echo [TEST] $@ + ECHO_MKDIR =@echo [MKDIR] $@ + ECHO_BUILDNO =@echo [BUILDNO] $@ + ECHO_INVOKE =@echo [INVOKE] $< + ECHO_PCH =@echo [PCH] $@ + ECHO_CC =@echo [CC] $< + ECHO_GAS =@echo [GAS] $< + ECHO_NASM =@echo [NASM] $< + ECHO_AR =@echo [AR] $@ + ECHO_WINEBLD =@echo [WINEBLD] $@ + ECHO_WRC =@echo [WRC] $@ + ECHO_BIN2RES =@echo [BIN2RES] $< + ECHO_DLLTOOL =@echo [DLLTOOL] $@ + ECHO_LD =@echo [LD] $@ + ECHO_RBUILD =@echo [RBUILD] $@ + ECHO_RSYM =@echo [RSYM] $@ + ECHO_WMC =@echo [WMC] $@ + ECHO_NCI =@echo [NCI] $@ + ECHO_CABMAN =@echo [CABMAN] $< + ECHO_CDMAKE =@echo [CDMAKE] $@ + ECHO_REGTESTS=@echo [REGTESTS] $@ + ECHO_TEST =@echo [TEST] $@ else - ECHO_MKDIR = - ECHO_BUILDNO= - ECHO_INVOKE = - ECHO_PCH = - ECHO_CC = - ECHO_GAS = - ECHO_NASM = - ECHO_AR = - ECHO_WINEBLD= - ECHO_WRC = - ECHO_BIN2RES= - ECHO_DLLTOOL= - ECHO_LD = - ECHO_RBUILD = - ECHO_RSYM = - ECHO_WMC = - ECHO_NCI = - ECHO_CABMAN = - ECHO_CDMAKE = - ECHO_TEST = + ECHO_MKDIR = + ECHO_BUILDNO = + ECHO_INVOKE = + ECHO_PCH = + ECHO_CC = + ECHO_GAS = + ECHO_NASM = + ECHO_AR = + ECHO_WINEBLD = + ECHO_WRC = + ECHO_BIN2RES = + ECHO_DLLTOOL = + ECHO_LD = + ECHO_RBUILD = + ECHO_RSYM = + ECHO_WMC = + ECHO_NCI = + ECHO_CABMAN = + ECHO_CDMAKE = + ECHO_REGTESTS= + ECHO_TEST = endif _____ Modified: branches/xmlbuildsystem/reactos/ReactOS.xml --- branches/xmlbuildsystem/reactos/ReactOS.xml 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/ReactOS.xml 2005-03-20 21:58:30 UTC (rev 14241) @@ -47,6 +47,9 @@ <directory name="ntoskrnl"> <xi:include href="ntoskrnl/ntoskrnl.xml" /> </directory> + <directory name="regtests"> + <xi:include href="regtests/directory.xml" /> + </directory> <directory name="services"> <xi:include href="services/directory.xml" /> </directory> _____ Modified: branches/xmlbuildsystem/reactos/baseaddress.xml --- branches/xmlbuildsystem/reactos/baseaddress.xml 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/baseaddress.xml 2005-03-20 21:58:30 UTC (rev 14241) @@ -1,3 +1,4 @@ +<property name="BASEADDRESS_REGTESTS" value="0x07000000" /> <property name="BASEADDRESS_NOTIFYHOOK" value="0x08000000" /> <property name="BASEADDRESS_DEVENUM" value="0x35680000" /> <property name="BASEADDRESS_DINPUT" value="0x5F580000" /> _____ Modified: branches/xmlbuildsystem/reactos/lib/kernel32/kernel32.xml --- branches/xmlbuildsystem/reactos/lib/kernel32/kernel32.xml 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/lib/kernel32/kernel32.xml 2005-03-20 21:58:30 UTC (rev 14241) @@ -1,16 +1,9 @@ -<module name="kernel32" type="win32dll" baseaddress="${BASEADDRESS_KERNEL32}"> - <importlibrary definition="kernel32.def" /> - <include base="kernel32">.</include> - <include base="kernel32">include</include> +<module name="kernel32_base" type="objectlibrary"> + <include base="kernel32_base">.</include> + <include base="kernel32_base">include</include> <define name="_DISABLE_TIDENTS" /> <define name="_SEH_NO_NATIVE_NLG" /> <define name="WINVER">0x0500</define> - <library>pseh</library> - <library>rosrtl</library> - <library>ntdll</library> - <linkerflag>-lgcc</linkerflag> - <linkerflag>-nostartfiles</linkerflag> - <linkerflag>-nostdlib</linkerflag> <pch>k32.h</pch> <directory name="debug"> <file>break.c</file> @@ -109,6 +102,25 @@ <file>thread.c</file> <file>tls.c</file> </directory> +</module> +<module name="kernel32" type="win32dll" baseaddress="${BASEADDRESS_KERNEL32}"> + <importlibrary definition="kernel32.def" /> + <include base="kernel32">.</include> + <include base="kernel32">include</include> + <define name="_DISABLE_TIDENTS" /> + <define name="_SEH_NO_NATIVE_NLG" /> + <define name="WINVER">0x0500</define> + <library>kernel32_base</library> + <library>pseh</library> + <library>rosrtl</library> + <library>ntdll</library> + <linkerflag>-lgcc</linkerflag> + <linkerflag>-nostartfiles</linkerflag> + <linkerflag>-nostdlib</linkerflag> <file>kernel32.rc</file> - </module> +<!-- +<directory name="tests"> + <xi:include href="tests/kernel32.xml" /> +</directory> +--> _____ Added: branches/xmlbuildsystem/reactos/lib/kernel32/tests/kernel32.xml --- branches/xmlbuildsystem/reactos/lib/kernel32/tests/kernel32.xml 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/lib/kernel32/tests/kernel32.xml 2005-03-20 21:58:30 UTC (rev 14241) @@ -0,0 +1,19 @@ +<module name="kernel32_test" type="test"> + <include base="rtshared">.</include> + <define name="_DISABLE_TIDENTS" /> + <define name="_SEH_NO_NATIVE_NLG" /> + <define name="WINVER">0x0500</define> + <library>kernel32_base</library> + <library>pseh</library> + <library>rosrtl</library> + <library>ntdll</library> + <library>rtshared</library> + <linkerflag>-lgcc</linkerflag> + <linkerflag>-nostartfiles</linkerflag> + <linkerflag>-nostdlib</linkerflag> + <directory name="tests"> + <file>CreateFile.c</file> + </directory> + <file>setup.c</file> + <xi:include href="stubs.xml" /> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/kernel32/tests/stubs.xml --- branches/xmlbuildsystem/reactos/lib/kernel32/tests/stubs.xml 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/lib/kernel32/tests/stubs.xml 2005-03-20 21:58:30 UTC (rev 14241) @@ -0,0 +1,136 @@ +<component name="ntdll.dll"> + <symbol>CsrCaptureParameterBuffer@16</symbol> + <symbol>CsrClientCallServer@16</symbol> + <symbol>CsrClientConnectToServer@0</symbol> + <symbol>CsrReleaseParameterBuffer@4</symbol> + <symbol>DbgUiContinue@8</symbol> + <symbol newname="RtlAllocateHeap">HeapAlloc@12</symbol> + <symbol newname="RtlFreeHeap">HeapFree@12</symbol> + <symbol>LdrAccessResource@16</symbol> + <symbol>LdrDisableThreadCalloutsForDll@4</symbol> + <symbol>LdrDisableThreadCalloutsForDll@4</symbol> + <symbol>LdrFindResource_U@16</symbol> + <symbol>LdrLoadDll@16</symbol> + <symbol>LdrShutdownProcess@0</symbol> + <symbol>LdrShutdownThread@0</symbol> + <symbol>LdrUnloadDll@4</symbol> + <symbol>NtAllocateVirtualMemory@24</symbol> + <symbol>NtClose@4</symbol> + <symbol>NtCreateDirectoryObject@12</symbol> + <symbol>NtCreateEvent@20</symbol> + <symbol>NtCreateFile@44</symbol> + <symbol>NtCreateKey@28</symbol> + <symbol>NtCreateProcess@32</symbol> + <symbol>NtCreateSection@28</symbol> + <symbol>NtDelayExecution@8</symbol> + <symbol>NtDeviceIoControlFile@40</symbol> + <symbol>_imp__NtDuplicateObject@28</symbol> + <symbol>NtFlushBuffersFile@8</symbol> + <symbol>NtFlushInstructionCache@12</symbol> + <symbol>NtFlushVirtualMemory@16</symbol> + <symbol>NtFreeVirtualMemory@16</symbol> + <symbol>NtFsControlFile@40</symbol> + <symbol>NtGetContextThread@8</symbol> + <symbol>NtLockVirtualMemory@16</symbol> + <symbol>NtOpenDirectoryObject@12</symbol> + <symbol>NtOpenEvent@12</symbol> + <symbol>NtOpenFile@24</symbol> + <symbol>NtOpenKey@12</symbol> + <symbol>NtOpenProcess@16</symbol> + <symbol>NtOpenSection@12</symbol> + <symbol>NtOpenThread@16</symbol> + <symbol>NtProtectVirtualMemory@20</symbol> + <symbol>NtPulseEvent@8</symbol> + <symbol>NtQueryDefaultLocale@8</symbol> + <symbol>NtQueryDefaultUILanguage@4</symbol> + <symbol>NtQueryDirectoryFile@44</symbol> + <symbol>NtQueryInformationFile@20</symbol> + <symbol>_imp__NtQueryInformationProcess@20</symbol> + <symbol>NtQueryInformationThread@20</symbol> + <symbol>NtQueryObject@20</symbol> + <symbol>NtQuerySystemInformation@16</symbol> + <symbol>NtQuerySystemTime@4</symbol> + <symbol>NtQueryValueKey@24</symbol> + <symbol>NtQueryVirtualMemory@24</symbol> + <symbol>NtQueryVolumeInformationFile@20</symbol> + <symbol>NtReadFile@36</symbol> + <symbol>NtReadVirtualMemory@20</symbol> + <symbol>NtResetEvent@8</symbol> + <symbol>NtResumeThread@8</symbol> + <symbol>NtSetContextThread@8</symbol> + <symbol>NtSetEvent@8</symbol> + <symbol>NtSetInformationFile@20</symbol> + <symbol>NtSetInformationObject@16</symbol> + <symbol>_imp__NtSetInformationProcess@16</symbol> + <symbol>NtSetInformationThread@16</symbol> + <symbol>NtSetSystemInformation@12</symbol> + <symbol>NtSetSystemTime@8</symbol> + <symbol>NtSignalAndWaitForSingleObject@16</symbol> + <symbol>NtSuspendThread@8</symbol> + <symbol>NtTerminateThread@8</symbol> + <symbol>NtUnlockVirtualMemory@16</symbol> + <symbol>NtUnmapViewOfSection@8</symbol> + <symbol>NtWaitForMultipleObjects@20</symbol> + <symbol>NtWaitForSingleObject@12</symbol> + <symbol>NtWriteFile@36</symbol> + <symbol>NtWriteVirtualMemory@20</symbol> + <symbol>NtYieldExecution@0</symbol> + <symbol>RtlAcquirePebLock@0</symbol> + <symbol>RtlAnsiStringToUnicodeSize@4</symbol> + <symbol>_imp__RtlBaseProcessStartRoutine</symbol> + <symbol>RtlCompactHeap@8</symbol> + <symbol>RtlCopyUnicodeString@8</symbol> + <symbol>RtlCreateHeap@24</symbol> + <symbol>RtlCreateProcessParameters@40</symbol> + <symbol>RtlCreateUnicodeString@8</symbol> + <symbol>RtlCreateUnicodeStringFromAsciiz@8</symbol> + <symbol>RtlDeleteCriticalSection@4</symbol> + <symbol>RtlDestroyHeap@4</symbol> + <symbol>RtlDestroyProcessParameters@4</symbol> + <symbol>RtlDoesFileExists_U@4</symbol> + <symbol>RtlDosPathNameToNtPathName_U@16</symbol> + <symbol>RtlDosSearchPath_U@24</symbol> + <symbol>RtlEnterCriticalSection@4</symbol> + <symbol>RtlExpandEnvironmentStrings_U@16</symbol> + <symbol>RtlFreeHeap@12</symbol> + <symbol>RtlGetCurrentDirectory_U@8</symbol> + <symbol>RtlGetFullPathName_U@16</symbol> + <symbol>RtlGetProcessHeaps@8</symbol> + <symbol>RtlImageNtHeader@4</symbol> + <symbol>RtlInitCodePageTable@8</symbol> + <symbol>RtlInitializeCriticalSection@4</symbol> + <symbol>RtlInitUnicodeString@8</symbol> + <symbol>RtlIntegerToChar@16</symbol> + <symbol>RtlIntegerToUnicodeString@12</symbol> + <symbol>RtlIsNameLegalDOS8Dot3@12</symbol> + <symbol>RtlLeaveCriticalSection@4</symbol> + <symbol>RtlLockHeap@4</symbol> + <symbol>RtlNtStatusToDosError@4</symbol> + <symbol>RtlOemStringToUnicodeSize@4</symbol> + <symbol>RtlOemStringToUnicodeString@12</symbol> + <symbol>RtlOpenCurrentUser@8</symbol> + <symbol>RtlQueryEnvironmentVariable_U@12</symbol> + <symbol>RtlRaiseException@4</symbol> + <symbol>RtlReAllocateHeap@16</symbol> + <symbol>RtlReleasePebLock@0</symbol> + <symbol>RtlRosCreateUserThreadVa</symbol> + <symbol>RtlRosExitUserThread@4</symbol> + <symbol>RtlSetCurrentDirectory_U@4</symbol> + <symbol>RtlSetEnvironmentVariable@12</symbol> + <symbol>RtlSetTimeZoneInformation@4</symbol> + <symbol>RtlTimeFieldsToTime@8</symbol> + <symbol>RtlTimeToTimeFields@8</symbol> + <symbol>RtlUnicodeStringToAnsiSize@4</symbol> + <symbol>RtlUnicodeStringToAnsiString@12</symbol> + <symbol>RtlUnicodeStringToInteger@12</symbol> + <symbol>RtlUnicodeStringToOemString@12</symbol> + <symbol>RtlUnicodeToOemN@20</symbol> + <symbol>RtlUnlockHeap@4</symbol> + <symbol>RtlValidateHeap@12</symbol> + <symbol>ZwMapViewOfSection@40</symbol> + <symbol>ZwOpenSection@12</symbol> + <symbol>ZwQuerySection@20</symbol> + <symbol>ZwQuerySystemInformation@16</symbol> + <symbol>ZwReadFile@36</symbol> + <symbol>ZwTerminateProcess@8</symbol> +</component> _____ Added: branches/xmlbuildsystem/reactos/regtests/directory.xml --- branches/xmlbuildsystem/reactos/regtests/directory.xml 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/regtests/directory.xml 2005-03-20 21:58:30 UTC (rev 14241) @@ -0,0 +1,6 @@ +<directory name="regtests"> + <xi:include href="regtests/regtests.xml" /> +</directory> +<directory name="shared"> + <xi:include href="shared/rtshared.xml" /> +</directory> _____ Added: branches/xmlbuildsystem/reactos/regtests/regtests/regtests.xml --- branches/xmlbuildsystem/reactos/regtests/regtests/regtests.xml 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/regtests/regtests/regtests.xml 2005-03-20 21:58:30 UTC (rev 14241) @@ -0,0 +1,6 @@ +<module name="regtests" type="win32dll" baseaddress="${BASEADDRESS_REGTESTS}"> + <importlibrary definition="regtests.def" /> + <include base="regtests">.</include> + <library>kernel32</library> + <file>regtests.c</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/regtests/shared/rtshared.xml --- branches/xmlbuildsystem/reactos/regtests/shared/rtshared.xml 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/regtests/shared/rtshared.xml 2005-03-20 21:58:30 UTC (rev 14241) @@ -0,0 +1,4 @@ +<module name="rtshared" type="staticlibrary"> + <include base="rtshared">.</include> + <file>regtests.c</file> +</module> _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -176,6 +176,7 @@ fprintf ( fMakefile, "bin2res = " TOOL_PREFIX "bin2res" SSEP "bin2res" EXEPOSTFIX "\n" ); fprintf ( fMakefile, "cabman = " TOOL_PREFIX "cabman" SSEP "cabman" EXEPOSTFIX "\n" ); fprintf ( fMakefile, "cdmake = " TOOL_PREFIX "cdmake" SSEP "cdmake" EXEPOSTFIX "\n" ); + fprintf ( fMakefile, "regtests = " TOOL_PREFIX "regtests" EXEPOSTFIX "\n" ); fprintf ( fMakefile, "rsym = " TOOL_PREFIX "rsym" EXEPOSTFIX "\n" ); fprintf ( fMakefile, "wrc = " TOOL_PREFIX "wrc" SSEP "wrc" EXEPOSTFIX "\n" ); fprintf ( fMakefile, "\n" ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -152,6 +152,9 @@ case Iso: handler = new MingwIsoModuleHandler ( backend ); break; + case Test: + handler = new MingwTestModuleHandler ( backend ); + break; } return handler; } @@ -1226,10 +1229,10 @@ clean_files ); CLEAN_FILE ( ar_target ); - string tgt = FixupTargetFilename(module.GetPath()); - if ( tgt != ar_target ) + string target = FixupTargetFilename ( module.GetPath () ); + if ( target != ar_target ) { - CLEAN_FILE ( tgt ); + CLEAN_FILE ( target ); } } @@ -1882,8 +1885,7 @@ { GenerateMacrosAndTargets ( module, NULL, NULL, clean_files ); - string dependencies = - objectsMacro + " " + linkDepsMacro; + string dependencies = objectsMacro + " " + linkDepsMacro; string linker; if ( module.cplusplus ) @@ -2302,3 +2304,63 @@ fprintf ( fMakefile, "\n" ); } + + +MingwTestModuleHandler::MingwTestModuleHandler ( MingwBackend* backend ) + : MingwModuleHandler ( Test, + backend ) +{ +} + +void +MingwTestModuleHandler::Process ( const Module& module, string_list& clean_files ) +{ + GeneratePreconditionDependencies ( module ); + GenerateTestModuleTarget ( module, clean_files ); + GenerateInvocations ( module ); +} + +void +MingwTestModuleHandler::GenerateTestModuleTarget ( const Module& module, string_list& clean_files ) +{ + static string ros_junk ( "$(ROS_TEMPORARY)" ); + string target ( FixupTargetFilename ( module.GetPath () ) ); + string workingDirectory = GetWorkingDirectory ( ); + string objectsMacro = GetObjectsMacro ( module ); + string linkDepsMacro = GetLinkingDependenciesMacro ( module ); + string libsMacro = GetLibsMacro ( module ); + + GenerateImportLibraryTargetIfNeeded ( module, clean_files ); + + if ( module.non_if_data.files.size () > 0 ) + { + GenerateMacrosAndTargets ( module, NULL, NULL, clean_files ); + + string dependencies = objectsMacro + " " + linkDepsMacro; + + string linker; + if ( module.cplusplus ) + linker = "${gpp}"; + else + linker = "${gcc}"; + + string linkerParameters = ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000", + module.entrypoint.c_str (), + module.baseaddress.c_str () ); + GenerateLinkerCommand ( module, + target, + dependencies, + linker, + linkerParameters, + objectsMacro, + libsMacro, + clean_files ); + } + else + { + fprintf ( fMakefile, ".PHONY: %s\n\n", + target.c_str ()); + fprintf ( fMakefile, "%s:\n\n", + target.c_str ()); + } +} _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-03-20 21:58:30 UTC (rev 14241) @@ -336,4 +336,14 @@ const Module& module ); }; +class MingwTestModuleHandler : public MingwModuleHandler +{ +public: + MingwTestModuleHandler ( MingwBackend* backend ); + virtual HostType DefaultHost() { return HostFalse; } + virtual void Process ( const Module& module, string_list& clean_files ); +private: + void GenerateTestModuleTarget ( const Module& module, string_list& clean_files ); +}; + #endif /* MINGW_MODULEHANDLER_H */ _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/bootstrap.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/bootstrap.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/bootstrap.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -39,6 +39,7 @@ case StaticLibrary: case ObjectLibrary: case Iso: + case Test: return false; } throw InvalidOperationException ( __FILE__, _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -197,6 +197,8 @@ delete compilerFlags[i]; for ( i = 0; i < linkerFlags.size(); i++ ) delete linkerFlags[i]; + for ( i = 0; i < stubbedComponents.size(); i++ ) + delete stubbedComponents[i]; if ( pch ) delete pch; } @@ -215,6 +217,8 @@ compilerFlags[i]->ProcessXML(); for ( i = 0; i < linkerFlags.size(); i++ ) linkerFlags[i]->ProcessXML(); + for ( i = 0; i < stubbedComponents.size(); i++ ) + stubbedComponents[i]->ProcessXML(); non_if_data.ProcessXML(); if ( pch ) pch->ProcessXML(); @@ -342,6 +346,11 @@ linkerFlags.push_back ( new LinkerFlag ( project, this, e ) ); subs_invalid = true; } + else if ( e.name == "component" ) + { + stubbedComponents.push_back ( new StubbedComponent ( this, e ) ); + subs_invalid = false; + } else if ( e.name == "property" ) { throw InvalidBuildFileException ( @@ -407,6 +416,8 @@ return BootSector; if ( attribute.value == "iso" ) return Iso; + if ( attribute.value == "test" ) + return Test; throw InvalidAttributeValueException ( location, attribute.name, attribute.value ); @@ -439,6 +450,8 @@ return ".o"; case Iso: return ".iso"; + case Test: + return ".exe"; } throw InvalidOperationException ( __FILE__, __LINE__ ); @@ -460,6 +473,7 @@ case Win32DLL: return "_DllMain@12"; case Win32CUI: + case Test: return "_mainCRTStartup"; case Win32GUI: return "_WinMainCRTStartup"; @@ -493,6 +507,7 @@ case Win32DLL: return "0x10000"; case Win32CUI: + case Test: return "0x00400000"; case Win32GUI: return "0x00400000"; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-03-20 21:58:30 UTC (rev 14241) @@ -57,6 +57,8 @@ class Bootstrap; class CDFile; class PchFile; +class StubbedComponent; +class StubbedSymbol; class SourceFileTest; @@ -130,7 +132,8 @@ Win32GUI, BootLoader, BootSector, - Iso + Iso, + Test }; enum HostType @@ -159,6 +162,7 @@ std::vector<Dependency*> dependencies; std::vector<CompilerFlag*> compilerFlags; std::vector<LinkerFlag*> linkerFlags; + std::vector<StubbedComponent*> stubbedComponents; PchFile* pch; bool cplusplus; std::string prefix; @@ -526,6 +530,35 @@ void ProcessXML(); }; + +class StubbedComponent +{ +public: + const Module* module; + const XMLElement& node; + std::string name; + std::vector<StubbedSymbol*> symbols; + + StubbedComponent ( const Module* module_, + const XMLElement& stubbedComponentNode ); + ~StubbedComponent (); + void ProcessXML (); + void ProcessXMLSubElement ( const XMLElement& e ); +}; + + +class StubbedSymbol +{ +public: + const XMLElement& node; + std::string symbol; + std::string newname; + + StubbedSymbol ( const XMLElement& stubbedSymbolNode ); + ~StubbedSymbol (); + void ProcessXML(); +}; + extern std::string FixSeparator ( const std::string& s ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.mak --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.mak 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.mak 2005-03-20 21:58:30 UTC (rev 14241) @@ -39,6 +39,7 @@ module.cpp \ project.cpp \ ssprintf.cpp \ + stubbedcomponent.cpp \ XML.cpp RBUILD_COMMON_SOURCES = \ @@ -62,6 +63,7 @@ $(RBUILD_SPECIAL_OBJECTS) RBUILD_TESTS = \ + tests$(SEP)cdfiletest.cpp \ tests$(SEP)definetest.cpp \ tests$(SEP)functiontest.cpp \ tests$(SEP)iftest.cpp \ @@ -71,7 +73,7 @@ tests$(SEP)moduletest.cpp \ tests$(SEP)projecttest.cpp \ tests$(SEP)sourcefiletest.cpp \ - tests$(SEP)cdfiletest.cpp + tests$(SEP)symboltest.cpp RBUILD_TEST_SPECIAL_SOURCES = \ $(addprefix $(RBUILD_BASE)$(SEP), $(RBUILD_TESTS)) \ _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.txt --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.txt 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.txt 2005-03-20 21:58:30 UTC (rev 14241) @@ -123,7 +123,7 @@ None. Elements: - bootstrap, define, dependency, directory, file, if, importlibrary, include, invoke, library, property. + bootstrap, component, define, dependency, directory, file, if, importlibrary, include, invoke, library, property. Module types @@ -137,10 +137,12 @@ kernelmodedriver - Builds a kernel-mode driver. Default extension is .sys. Default entrypoint is _DriverEntry@8. nativedll - Builds a native DLL. Default extension is .dll. Default entrypoint is _DllMainCRTStartup@12. win32dll - Builds a Win32 DLL. Default extension is .dll. Default entrypoint is _DllMain@12. + win32cui - Builds a Win32 console executable. Default extension is .exe. Default entrypoint is _mainCRTStartup. The baseaddress module attribute is not applicable for this module type. win32gui - Builds a Win32 GUI executable. Default extension is .exe. Default entrypoint is _WinMainCRTStartup. The baseaddress module attribute is not applicable for this module type. bootloader - Builds a bootloader. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. bootsector - Builds one or more bootsector binaries. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. iso - Builds a bootable CD. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. + test - Builds a testsuite. Default extension is .exe. Default entrypoint is _mainCRTStartup. The baseaddress module attribute is not applicable for this module type. Bootstrap element @@ -179,6 +181,42 @@ None. +Component element +----------------- +A component element specifies that imports from a library are to be stubbed so tests can be run without actually calling the functions in the library. This element can only be used for modules of type test. + +Syntax: + <component name="ntdll.dll"> + ... + </component> + +Attributes: + name - Name of library. + +Value: + None. + +Elements: + Symbol. + + +Symbol element +-------------- +A symbol element specifies an imported function from a library that is to be stubbed so tests can be run without actually calling the function in the library. + +Syntax: + <symbol newname="RtlAllocateHeap">HeapAlloc@12</symbol> + +Attributes: + newname - New name of symbol. This attribute is optional. + +Value: + Name of symbol. + +Elements: + None. + + Define element -------------- A define element specifies the name and (optionally) value of a define for the C/C++ compiler and resource compiler. _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/stubbedcomponent.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/stubbedcomponent.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/stubbedcomponent.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -0,0 +1,80 @@ +#include "pch.h" +#include <assert.h> + +#include "rbuild.h" + +using std::string; +using std::vector; + +StubbedComponent::StubbedComponent ( const Module* module_, + const XMLElement& stubbedComponentNode ) + : module(module_), + node(stubbedComponentNode) +{ + const XMLAttribute* att = node.GetAttribute ( "name", true ); + assert ( att ); + name = att->value; +} + +StubbedComponent::~StubbedComponent () +{ + for ( size_t i = 0; i < symbols.size(); i++ ) + delete symbols[i]; +} + +void +StubbedComponent::ProcessXML () +{ + size_t i; + for ( i = 0; i < node.subElements.size (); i++ ) + ProcessXMLSubElement ( *node.subElements[i] ); + for ( i = 0; i < symbols.size (); i++ ) + symbols[i]->ProcessXML (); +} + +void +StubbedComponent::ProcessXMLSubElement ( const XMLElement& e ) +{ + bool subs_invalid = false; + if ( e.name == "symbol" ) + { + symbols.push_back ( new StubbedSymbol ( e ) ); + subs_invalid = false; + } + if ( subs_invalid && e.subElements.size () > 0 ) + throw InvalidBuildFileException ( + e.location, + "<%s> cannot have sub-elements", + e.name.c_str() ); + for ( size_t i = 0; i < e.subElements.size (); i++ ) + ProcessXMLSubElement ( *e.subElements[i] ); +} + + + +StubbedSymbol::StubbedSymbol ( const XMLElement& stubbedSymbolNode ) + : node(stubbedSymbolNode) +{ +} + +StubbedSymbol::~StubbedSymbol () +{ +} + +void +StubbedSymbol::ProcessXML () +{ + if ( node.value.size () == 0 ) + { + throw InvalidBuildFileException ( + node.location, + "<symbol> is empty." ); + } + symbol = node.value; + + const XMLAttribute* att = node.GetAttribute ( "newname", false ); + if ( att != NULL ) + newname = att->value; + else + newname = symbol; +} _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/test.h --- branches/xmlbuildsystem/reactos/tools/rbuild/test.h 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/test.h 2005-03-20 21:58:30 UTC (rev 14241) @@ -126,4 +126,11 @@ void Run (); }; + +class SymbolTest : public BaseTest +{ +public: + void Run (); +}; + #endif /* __TEST_H */ _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/alltests.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/alltests.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/alltests.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -179,6 +179,7 @@ tests.push_back(new FunctionTest()); tests.push_back(new SourceFileTest()); tests.push_back(new CDFileTest()); + tests.push_back(new SymbolTest()); } }; _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/symbol.xml --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/symbol.xml 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/symbol.xml 2005-03-20 21:58:30 UTC (rev 14241) @@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<project name="Project" makefile="Makefile"> + <module name="module1" type="test"> + <component name="ntdll.dll"> + <symbol newname="RtlAllocateHeap">HeapAlloc@12</symbol> + <symbol>LdrAccessResource@16</symbol> + </component> + </module> +</project> _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/functiontest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/functiontest.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/functiontest.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -5,5 +5,5 @@ void FunctionTest::Run () { string fixedupFilename = FixupTargetFilename ( "." SSEP "dir1" SSEP "dir2" SSEP ".." SSEP "filename.txt" ); - ARE_EQUAL ( "$(ROS_INTERMEDIATE)." SSEP "dir1" SSEP "filename.txt", fixedupFilename ); + ARE_EQUAL ( "$(INTERMEDIATE)dir1" SSEP "filename.txt", fixedupFilename ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/iftest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/iftest.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/iftest.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -17,9 +17,9 @@ ARE_EQUAL ( 1, if1.data.files.size () ); File& file1 = *if1.data.files[0]; - ARE_EQUAL( "." SSEP "file1.c", file1.name ); + ARE_EQUAL( SSEP "file1.c", file1.name ); ARE_EQUAL ( 1, module1.non_if_data.files.size () ); File& file2 = *module1.non_if_data.files[0]; - ARE_EQUAL( "." SSEP "file2.c", file2.name ); + ARE_EQUAL( SSEP "file2.c", file2.name ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -20,5 +20,5 @@ ARE_EQUAL(1, module2.non_if_data.includes.size()); Include& include3 = *module2.non_if_data.includes[0]; - ARE_EQUAL(FixSeparator("./dir1/include3"), include3.directory); + ARE_EQUAL(FixSeparator("dir1/include3"), include3.directory); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/invoketest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/invoketest.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/invoketest.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -15,5 +15,5 @@ ARE_EQUAL(1, invoke1.output.size()); InvokeFile& file1 = *invoke1.output[0]; - ARE_EQUAL(FixSeparator("./dir1/file1.c"), file1.name); + ARE_EQUAL(FixSeparator("dir1/file1.c"), file1.name); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/moduletest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/moduletest.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/moduletest.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -11,16 +11,16 @@ Module& module1 = *project.modules[0]; IS_TRUE(module1.type == BuildTool); ARE_EQUAL(2, module1.non_if_data.files.size()); - ARE_EQUAL("." SSEP "dir1" SSEP "file1.c", module1.non_if_data.files[0]->name); - ARE_EQUAL("." SSEP "dir1" SSEP "file2.c", module1.non_if_data.files[1]->name); + ARE_EQUAL("dir1" SSEP "file1.c", module1.non_if_data.files[0]->name); + ARE_EQUAL("dir1" SSEP "file2.c", module1.non_if_data.files[1]->name); ARE_EQUAL(0, module1.non_if_data.libraries.size()); Module& module2 = *project.modules[1]; IS_TRUE(module2.type == KernelModeDLL); ARE_EQUAL(2, module2.non_if_data.files.size()); - ARE_EQUAL("." SSEP "dir2" SSEP "file3.c", module2.non_if_data.files[0]->name); - ARE_EQUAL("." SSEP "dir2" SSEP "file4.c", module2.non_if_data.files[1]->name); + ARE_EQUAL("dir2" SSEP "file3.c", module2.non_if_data.files[0]->name); + ARE_EQUAL("dir2" SSEP "file4.c", module2.non_if_data.files[1]->name); ARE_EQUAL(1, module2.non_if_data.libraries.size()); Library& library1 = *module2.non_if_data.libraries[0]; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/sourcefiletest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/sourcefiletest.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/sourcefiletest.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -38,9 +38,9 @@ AutomaticDependency automaticDependency ( project ); automaticDependency.Process (); ARE_EQUAL( 4, automaticDependency.sourcefile_map.size () ); - const SourceFile* include = automaticDependency.RetrieveFromCache ( "." SSEP RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile_include.h" ); + const SourceFile* include = automaticDependency.RetrieveFromCache ( RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile_include.h" ); IS_NOT_NULL( include ); - const SourceFile* includenext = automaticDependency.RetrieveFromCache ( "." SSEP RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile1" SSEP "sourcefile_includenext.h" ); + const SourceFile* includenext = automaticDependency.RetrieveFromCache ( RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile1" SSEP "sourcefile_includenext.h" ); IS_NOT_NULL( includenext ); } @@ -51,9 +51,9 @@ AutomaticDependency automaticDependency ( project ); automaticDependency.Process (); ARE_EQUAL( 5, automaticDependency.sourcefile_map.size () ); - const SourceFile* header1 = automaticDependency.RetrieveFromCache ( "." SSEP RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile1_header1.h" ); + const SourceFile* header1 = automaticDependency.RetrieveFromCache ( RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile1_header1.h" ); IS_NOT_NULL( header1 ); - const SourceFile* recurse = automaticDependency.RetrieveFromCache ( "." SSEP RBUILD_BASE"tests" SSEP "data" SSEP "sourcefile1_recurse.h" ); + const SourceFile* recurse = automaticDependency.RetrieveFromCache ( RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile1_recurse.h" ); IS_NOT_NULL( recurse ); IS_TRUE( IsParentOf ( header1, recurse ) ); _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/symboltest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/symboltest.cpp 2005-03-20 21:57:01 UTC (rev 14240) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/symboltest.cpp 2005-03-20 21:58:30 UTC (rev 14241) @@ -0,0 +1,25 @@ +#include "test.h" + +using std::string; + +void SymbolTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/symbol.xml" ); + Project project ( projectFilename ); + + ARE_EQUAL ( 1, project.modules.size () ); + Module& module1 = *project.modules[0]; + + ARE_EQUAL ( 1, module1.stubbedComponents.size () ); + StubbedComponent& component1 = *module1.stubbedComponents[0]; + ARE_EQUAL ( "ntdll.dll", component1.name ); + + ARE_EQUAL ( 2, component1.symbols.size () ); + StubbedSymbol& symbol1 = *component1.symbols[0]; + ARE_EQUAL ( "HeapAlloc@12", symbol1.symbol ); + ARE_EQUAL ( "RtlAllocateHeap", symbol1.newname ); + + StubbedSymbol& symbol2 = *component1.symbols[1]; + ARE_EQUAL ( "LdrAccessResource@16", symbol2.symbol ); + ARE_EQUAL ( "LdrAccessResource@16", symbol2.newname ); [truncated at 1000 lines; 1 more skipped]
19 years, 9 months
1
0
0
0
[ion] 14240: Winsock, Ws2Help, MsAfd, MsWinSck, WshTcpIp re-write branch.
by ion@svn.reactos.com
Winsock, Ws2Help, MsAfd, MsWinSck, WshTcpIp re-write branch. Added: branches/reactos/ _____ Copied: branches/reactos (from rev 14239, trunk/reactos)
19 years, 9 months
1
0
0
0
[navaraf] 14239: Minor correction to my r14237 commit. Forgot to delete "++".
by navaraf@svn.reactos.com
Minor correction to my r14237 commit. Forgot to delete "++". Modified: trunk/reactos/tools/widl/client.c _____ Modified: trunk/reactos/tools/widl/client.c --- trunk/reactos/tools/widl/client.c 2005-03-20 21:40:00 UTC (rev 14238) +++ trunk/reactos/tools/widl/client.c 2005-03-20 21:44:58 UTC (rev 14239) @@ -505,7 +505,7 @@ print_client("*(("); write_type(client, var->type, NULL, var->tname); - fprintf(client, " __RPC_FAR*)_StubMsg.Buffer)++ = "); + fprintf(client, " __RPC_FAR*)_StubMsg.Buffer) = "); if (var->ptr_level == 1) fprintf(client, "*"); write_name(client, var);
19 years, 9 months
1
0
0
0
[navaraf] 14238: Reorder the source file lists so we, lousy people, building with DEPENDENCIES=no can also enjoy the blessing of the PnP gods.
by navaraf@svn.reactos.com
Reorder the source file lists so we, lousy people, building with DEPENDENCIES=no can also enjoy the blessing of the PnP gods. Modified: trunk/reactos/lib/setupapi/Makefile.in Modified: trunk/reactos/services/umpnpmgr/makefile _____ Modified: trunk/reactos/lib/setupapi/Makefile.in --- trunk/reactos/lib/setupapi/Makefile.in 2005-03-20 21:35:12 UTC (rev 14237) +++ trunk/reactos/lib/setupapi/Makefile.in 2005-03-20 21:40:00 UTC (rev 14238) @@ -9,6 +9,7 @@ EXTRALIBS = $(LIBUNICODE) C_SRCS = \ + pnp_c.c \ cfgmgr.c \ devinst.c \ dirid.c \ @@ -19,8 +20,7 @@ queue.c \ setupcab.c \ stubs.c \ - rpc.c \ - pnp_c.c + rpc.c C_SRCS16 = \ devinst16.c \ _____ Modified: trunk/reactos/services/umpnpmgr/makefile --- trunk/reactos/services/umpnpmgr/makefile 2005-03-20 21:35:12 UTC (rev 14237) +++ trunk/reactos/services/umpnpmgr/makefile 2005-03-20 21:40:00 UTC (rev 14238) @@ -12,7 +12,7 @@ TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a rpcrt4.a -TARGET_OBJECTS = umpnpmgr.o pnp_s.o +TARGET_OBJECTS = pnp_s.o umpnpmgr.o TARGET_CFLAGS = -Wall -Werror -D__USE_W32API -DUNICODE -D_UNICODE
19 years, 9 months
1
0
0
0
[navaraf] 14237: Generate code without L-value casts.
by navaraf@svn.reactos.com
Generate code without L-value casts. Modified: trunk/reactos/tools/widl/ChangeLog Modified: trunk/reactos/tools/widl/client.c Modified: trunk/reactos/tools/widl/server.c _____ Modified: trunk/reactos/tools/widl/ChangeLog --- trunk/reactos/tools/widl/ChangeLog 2005-03-20 20:46:16 UTC (rev 14236) +++ trunk/reactos/tools/widl/ChangeLog 2005-03-20 21:35:12 UTC (rev 14237) @@ -1,5 +1,12 @@ ChangeLog +2005-03-20 navaraf + + tools/widl/client.c + tools/widl/server.c + +Generate code without L-value casts. + 2005-03-20 ekohl tools/widl/client.c _____ Modified: trunk/reactos/tools/widl/client.c --- trunk/reactos/tools/widl/client.c 2005-03-20 20:46:16 UTC (rev 14236) +++ trunk/reactos/tools/widl/client.c 2005-03-20 21:35:12 UTC (rev 14237) @@ -510,6 +510,9 @@ fprintf(client, "*"); write_name(client, var); fprintf(client, ";\n"); + print_client("_StubMsg.Buffer += sizeof("); + write_type(client, var->type, NULL, var->tname); + fprintf(client, ");\n"); fprintf(client, "\n"); last_size = size; _____ Modified: trunk/reactos/tools/widl/server.c --- trunk/reactos/tools/widl/server.c 2005-03-20 20:46:16 UTC (rev 14236) +++ trunk/reactos/tools/widl/server.c 2005-03-20 21:35:12 UTC (rev 14237) @@ -639,9 +639,13 @@ fprintf(server, "\n"); print_server("*(("); write_type(server, var->type, NULL, var->tname); - fprintf(server, " __RPC_FAR *)_StubMsg.Buffer)++ = *"); + fprintf(server, " __RPC_FAR *)_StubMsg.Buffer) = *"); write_name(server, var); fprintf(server, ";\n"); + + print_server("_StubMsg.Buffer += sizeof("); + write_type(server, var->type, NULL, var->tname); + fprintf(server, ");"); } else { @@ -692,7 +696,10 @@ print_server("_StubMsg.Buffer += %u;\n", alignment); print_server("*(("); write_type(server, def->type, def, def->tname); - fprintf(server, " __RPC_FAR *)_StubMsg.Buffer)++ = _RetVal;\n"); + fprintf(server, " __RPC_FAR *)_StubMsg.Buffer) = _RetVal;\n"); + print_server("_StubMsg.Buffer += sizeof("); + write_type(server, def->type, def, def->tname); + fprintf(server, ");\n"); } }
19 years, 9 months
1
0
0
0
[weiden] 14236: revert changes from CreateFileA
by weiden@svn.reactos.com
revert changes from CreateFileA Modified: trunk/reactos/lib/kernel32/file/create.c _____ Modified: trunk/reactos/lib/kernel32/file/create.c --- trunk/reactos/lib/kernel32/file/create.c 2005-03-20 20:43:46 UTC (rev 14235) +++ trunk/reactos/lib/kernel32/file/create.c 2005-03-20 20:46:16 UTC (rev 14236) @@ -34,26 +34,15 @@ DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { - UNICODE_STRING FileNameU; - ANSI_STRING FileName; + PWCHAR FileNameW; HANDLE FileHandle; DPRINT("CreateFileA(lpFileName %s)\n",lpFileName); - RtlInitAnsiString (&FileName, - (LPSTR)lpFileName); - - /* convert ansi (or oem) string to unicode */ - if (bIsFileApiAnsi) - RtlAnsiStringToUnicodeString (&FileNameU, - &FileName, - TRUE); - else - RtlOemStringToUnicodeString (&FileNameU, - &FileName, - TRUE); + if (!(FileNameW = FilenameA2W(lpFileName, FALSE))) + return INVALID_HANDLE_VALUE; - FileHandle = CreateFileW (FileNameU.Buffer, + FileHandle = CreateFileW (FileNameW, dwDesiredAccess, dwShareMode, lpSecurityAttributes, @@ -61,10 +50,6 @@ dwFlagsAndAttributes, hTemplateFile); - RtlFreeHeap (RtlGetProcessHeap (), - 0, - FileNameU.Buffer); - return FileHandle; }
19 years, 9 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
61
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
60
61
Results per page:
10
25
50
100
200