mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 05:00:27 +00:00
- Start of fixing CreateProcess's problems. Implemented the console creation as it should be done (not quite, but much closer to design then before). There are still some problems (input/output handle inconsitencies), I am currently working on these issues;
- Some debug header cleanup. - Use the proper debug macros in some of the network code, shuts up a lot of spam when debugging for those modules wasn't enabled. svn path=/trunk/; revision=16826
This commit is contained in:
parent
7851e816be
commit
f15bd378aa
13 changed files with 254 additions and 300 deletions
|
@ -13,6 +13,7 @@
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
VOID PrintEvents( ULONG Events ) {
|
VOID PrintEvents( ULONG Events ) {
|
||||||
|
#if DBG
|
||||||
char *events_list[] = { "AFD_EVENT_RECEIVE",
|
char *events_list[] = { "AFD_EVENT_RECEIVE",
|
||||||
"AFD_EVENT_OOB_RECEIVE",
|
"AFD_EVENT_OOB_RECEIVE",
|
||||||
"AFD_EVENT_SEND",
|
"AFD_EVENT_SEND",
|
||||||
|
@ -28,7 +29,8 @@ VOID PrintEvents( ULONG Events ) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for( i = 0; events_list[i]; i++ )
|
for( i = 0; events_list[i]; i++ )
|
||||||
if( Events & (1 << i) ) DbgPrint("%s ", events_list[i] );
|
if( Events & (1 << i) ) AFD_DbgPrint(MID_TRACE,("%s ", events_list[i] ));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID CopyBackStatus( PAFD_HANDLE HandleArray,
|
VOID CopyBackStatus( PAFD_HANDLE HandleArray,
|
||||||
|
@ -224,11 +226,9 @@ AfdSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||||
PollReq->Handles[i].Status = AFD_EVENT_CLOSE;
|
PollReq->Handles[i].Status = AFD_EVENT_CLOSE;
|
||||||
Signalled++;
|
Signalled++;
|
||||||
} else {
|
} else {
|
||||||
#ifdef DBG
|
AFD_DbgPrint(MID_TRACE, ("AFD: Select Events: "));
|
||||||
DbgPrint("AFD: Select Events: ");
|
|
||||||
PrintEvents( PollReq->Handles[i].Events );
|
PrintEvents( PollReq->Handles[i].Events );
|
||||||
DbgPrint("\n");
|
AFD_DbgPrint(MID_TRACE,("\n"));
|
||||||
#endif
|
|
||||||
|
|
||||||
PollReq->Handles[i].Status =
|
PollReq->Handles[i].Status =
|
||||||
PollReq->Handles[i].Events & FCB->PollState;
|
PollReq->Handles[i].Events & FCB->PollState;
|
||||||
|
|
|
@ -68,7 +68,7 @@ BOOLEAN NICCheck(
|
||||||
/* first try the supplied value */
|
/* first try the supplied value */
|
||||||
if(ProbeAddressForNIC(Adapter->IoBaseAddress))
|
if(ProbeAddressForNIC(Adapter->IoBaseAddress))
|
||||||
{
|
{
|
||||||
NDIS_DbgPrint(MIN_TRACE, ("Found adapter at 0x%x\n", Adapter->IoBaseAddress));
|
NDIS_DbgPrint(MID_TRACE, ("Found adapter at 0x%x\n", Adapter->IoBaseAddress));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ BOOLEAN NICCheck(
|
||||||
{
|
{
|
||||||
if(ProbeAddressForNIC(ProbeAddressList[i]))
|
if(ProbeAddressForNIC(ProbeAddressList[i]))
|
||||||
{
|
{
|
||||||
NDIS_DbgPrint(MIN_TRACE, ("Found adapter at address 0x%x\n", ProbeAddressList[i]));
|
NDIS_DbgPrint(MID_TRACE, ("Found adapter at address 0x%x\n", ProbeAddressList[i]));
|
||||||
Adapter->IoBaseAddress = ProbeAddressList[i];
|
Adapter->IoBaseAddress = ProbeAddressList[i];
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -905,7 +905,7 @@ VOID NICIndicatePacket(
|
||||||
IndicateLength + DRIVER_HEADER_SIZE);
|
IndicateLength + DRIVER_HEADER_SIZE);
|
||||||
|
|
||||||
NDIS_DbgPrint(MID_TRACE, ("Indicating (%d) bytes.\n", IndicateLength));
|
NDIS_DbgPrint(MID_TRACE, ("Indicating (%d) bytes.\n", IndicateLength));
|
||||||
DbgPrint("ne2000!NICIndicatePacket: Indicating (%d) bytes.\n", IndicateLength);
|
NDIS_DbgPrint(MID_TRACE, ("ne2000!NICIndicatePacket: Indicating (%d) bytes.\n", IndicateLength));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
NDIS_DbgPrint(MAX_TRACE, ("FRAME:\n"));
|
NDIS_DbgPrint(MAX_TRACE, ("FRAME:\n"));
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
/*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS WinSock Helper DLL for TCP/IP
|
|
||||||
* FILE: include/debug.h
|
|
||||||
* PURPOSE: Debugging support macros
|
|
||||||
* DEFINES: DBG - Enable debug output
|
|
||||||
* NASSERT - Disable assertions
|
|
||||||
*/
|
|
||||||
#ifndef __DEBUG_H
|
|
||||||
#define __DEBUG_H
|
|
||||||
|
|
||||||
#define NORMAL_MASK 0x000000FF
|
|
||||||
#define SPECIAL_MASK 0xFFFFFF00
|
|
||||||
#define MIN_TRACE 0x00000001
|
|
||||||
#define MID_TRACE 0x00000002
|
|
||||||
#define MAX_TRACE 0x00000003
|
|
||||||
|
|
||||||
#define DEBUG_ULTRA 0xFFFFFFFF
|
|
||||||
|
|
||||||
#ifdef DBG
|
|
||||||
|
|
||||||
extern DWORD DebugTraceLevel;
|
|
||||||
|
|
||||||
#define WSH_DbgPrint(_t_, _x_) \
|
|
||||||
if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
|
|
||||||
((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
|
|
||||||
DbgPrint("(%hS:%d)(%hS) ", __FILE__, __LINE__, __FUNCTION__); \
|
|
||||||
DbgPrint _x_; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this belongs in ndis.h */
|
|
||||||
#if 0
|
|
||||||
#ifdef ASSERT
|
|
||||||
#undef ASSERT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NASSERT
|
|
||||||
#define ASSERT(x)
|
|
||||||
#else /* NASSERT */
|
|
||||||
#define ASSERT(x) if (!(x)) { WSH_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); }
|
|
||||||
#endif /* NASSERT */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else /* DBG */
|
|
||||||
|
|
||||||
#define WSH_DbgPrint(_t_, _x_)
|
|
||||||
|
|
||||||
/*#define ASSERT(x)*/
|
|
||||||
|
|
||||||
#endif /* DBG */
|
|
||||||
|
|
||||||
|
|
||||||
#undef assert
|
|
||||||
#define assert(x) ASSERT(x)
|
|
||||||
#define assert_irql(x) ASSERT_IRQL(x)
|
|
||||||
|
|
||||||
|
|
||||||
#define UNIMPLEMENTED \
|
|
||||||
WSH_DbgPrint(MIN_TRACE, ("(%s:%d)(%s) is unimplemented, \
|
|
||||||
please try again later.\n", __FILE__, __LINE__, __FUNCTION__));
|
|
||||||
|
|
||||||
#define CHECKPOINT \
|
|
||||||
WSH_DbgPrint(MIN_TRACE, ("\n"));
|
|
||||||
|
|
||||||
#define CP CHECKPOINT
|
|
||||||
|
|
||||||
#endif /* __DEBUG_H */
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -8,17 +8,8 @@
|
||||||
* CSH 01/09-2000 Created
|
* CSH 01/09-2000 Created
|
||||||
*/
|
*/
|
||||||
#include <wshtcpip.h>
|
#include <wshtcpip.h>
|
||||||
|
#define NDEBUG
|
||||||
#ifdef DBG
|
#include <debug.h>
|
||||||
|
|
||||||
/* See debug.h for debug/trace constants */
|
|
||||||
DWORD DebugTraceLevel = MAX_TRACE;
|
|
||||||
|
|
||||||
#endif /* DBG */
|
|
||||||
|
|
||||||
/* To make the linker happy */
|
|
||||||
VOID STDCALL KeBugCheck (ULONG BugCheckCode) {}
|
|
||||||
|
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
EXPORT
|
EXPORT
|
||||||
|
@ -26,7 +17,7 @@ DllMain(HANDLE hInstDll,
|
||||||
ULONG dwReason,
|
ULONG dwReason,
|
||||||
PVOID Reserved)
|
PVOID Reserved)
|
||||||
{
|
{
|
||||||
WSH_DbgPrint(MIN_TRACE, ("DllMain of wshtcpip.dll\n"));
|
DPRINT("DllMain of wshtcpip.dll\n");
|
||||||
|
|
||||||
switch (dwReason) {
|
switch (dwReason) {
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
|
@ -291,7 +282,7 @@ WSHOpenSocket2(
|
||||||
UNICODE_STRING RawDeviceName = RTL_CONSTANT_STRING(DD_RAW_IP_DEVICE_NAME);
|
UNICODE_STRING RawDeviceName = RTL_CONSTANT_STRING(DD_RAW_IP_DEVICE_NAME);
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
WSH_DbgPrint(MAX_TRACE, ("\n"));
|
DPRINT("");
|
||||||
|
|
||||||
switch (*SocketType) {
|
switch (*SocketType) {
|
||||||
case SOCK_STREAM:
|
case SOCK_STREAM:
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include <wsahelp.h>
|
#include <wsahelp.h>
|
||||||
#include <windows.h>
|
|
||||||
#include <debug.h>
|
|
||||||
|
|
||||||
#define EXPORT STDCALL
|
#define EXPORT STDCALL
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,6 @@ typedef struct
|
||||||
{
|
{
|
||||||
HANDLE NewProcessId;
|
HANDLE NewProcessId;
|
||||||
ULONG Flags;
|
ULONG Flags;
|
||||||
PCONTROLDISPATCHER CtrlDispatcher;
|
|
||||||
HANDLE Console;
|
|
||||||
HANDLE InputHandle;
|
|
||||||
HANDLE OutputHandle;
|
|
||||||
} CSRSS_CREATE_PROCESS, *PCSRSS_CREATE_PROCESS;
|
} CSRSS_CREATE_PROCESS, *PCSRSS_CREATE_PROCESS;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -75,6 +71,7 @@ typedef struct
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
PCONTROLDISPATCHER CtrlDispatcher;
|
PCONTROLDISPATCHER CtrlDispatcher;
|
||||||
|
BOOL ConsoleNeeded;
|
||||||
HANDLE Console;
|
HANDLE Console;
|
||||||
HANDLE InputHandle;
|
HANDLE InputHandle;
|
||||||
HANDLE OutputHandle;
|
HANDLE OutputHandle;
|
||||||
|
|
|
@ -1341,6 +1341,7 @@ BOOL STDCALL AllocConsole(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
Request.Data.AllocConsoleRequest.CtrlDispatcher = ConsoleControlDispatcher;
|
Request.Data.AllocConsoleRequest.CtrlDispatcher = ConsoleControlDispatcher;
|
||||||
|
Request.Data.AllocConsoleRequest.ConsoleNeeded = TRUE;
|
||||||
|
|
||||||
CsrRequest = MAKE_CSR_API(ALLOC_CONSOLE, CSR_CONSOLE);
|
CsrRequest = MAKE_CSR_API(ALLOC_CONSOLE, CSR_CONSOLE);
|
||||||
Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
|
Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
|
||||||
|
|
|
@ -37,10 +37,18 @@ RTL_CRITICAL_SECTION DllLock;
|
||||||
RTL_CRITICAL_SECTION ConsoleLock;
|
RTL_CRITICAL_SECTION ConsoleLock;
|
||||||
|
|
||||||
extern BOOL WINAPI DefaultConsoleCtrlHandler(DWORD Event);
|
extern BOOL WINAPI DefaultConsoleCtrlHandler(DWORD Event);
|
||||||
|
extern __declspec(noreturn) VOID CALLBACK ConsoleControlDispatcher(DWORD CodeAndFlag);
|
||||||
|
|
||||||
extern BOOL FASTCALL NlsInit();
|
extern BOOL FASTCALL NlsInit();
|
||||||
extern VOID FASTCALL NlsUninit();
|
extern VOID FASTCALL NlsUninit();
|
||||||
|
|
||||||
|
HANDLE
|
||||||
|
STDCALL
|
||||||
|
DuplicateConsoleHandle(HANDLE hConsole,
|
||||||
|
DWORD dwDesiredAccess,
|
||||||
|
BOOL bInheritHandle,
|
||||||
|
DWORD dwOptions);
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
|
@ -75,6 +83,105 @@ OpenBaseDirectory(PHANDLE DirHandle)
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
STDCALL
|
||||||
|
BasepInitConsole(VOID)
|
||||||
|
{
|
||||||
|
CSR_API_MESSAGE Request;
|
||||||
|
ULONG CsrRequest;
|
||||||
|
NTSTATUS Status;
|
||||||
|
PRTL_USER_PROCESS_PARAMETERS Parameters = NtCurrentPeb()->ProcessParameters;
|
||||||
|
|
||||||
|
WCHAR lpTest[MAX_PATH];
|
||||||
|
GetModuleFileNameW(NULL, lpTest, MAX_PATH);
|
||||||
|
DPRINT1("BasepInitConsole for : %S\n", lpTest);
|
||||||
|
DPRINT1("Our current console handles are: %lx, %lx, %lx\n",
|
||||||
|
Parameters->ConsoleHandle, Parameters->StandardInput,
|
||||||
|
Parameters->StandardOutput);
|
||||||
|
|
||||||
|
/* We have nothing to do if this isn't a console app... */
|
||||||
|
if (RtlImageNtHeader(GetModuleHandle(NULL))->OptionalHeader.Subsystem !=
|
||||||
|
IMAGE_SUBSYSTEM_WINDOWS_CUI)
|
||||||
|
{
|
||||||
|
DPRINT1("Image is not a console application\n");
|
||||||
|
Parameters->ConsoleHandle = NULL;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Assume one is needed */
|
||||||
|
Request.Data.AllocConsoleRequest.ConsoleNeeded = TRUE;
|
||||||
|
|
||||||
|
/* Handle the special flags given to us by BasepInitializeEnvironment */
|
||||||
|
if (Parameters->ConsoleHandle == HANDLE_DETACHED_PROCESS)
|
||||||
|
{
|
||||||
|
/* No console to create */
|
||||||
|
DPRINT1("No console to create\n");
|
||||||
|
Parameters->ConsoleHandle = NULL;
|
||||||
|
Request.Data.AllocConsoleRequest.ConsoleNeeded = FALSE;
|
||||||
|
}
|
||||||
|
else if (Parameters->ConsoleHandle == HANDLE_CREATE_NEW_CONSOLE)
|
||||||
|
{
|
||||||
|
/* We'll get the real one soon */
|
||||||
|
DPRINT1("Creating new console\n");
|
||||||
|
Parameters->ConsoleHandle = NULL;
|
||||||
|
}
|
||||||
|
else if (Parameters->ConsoleHandle == HANDLE_CREATE_NO_WINDOW)
|
||||||
|
{
|
||||||
|
/* We'll get the real one soon */
|
||||||
|
DPRINT1("NOT SUPPORTED: HANDLE_CREATE_NO_WINDOW\n");
|
||||||
|
Parameters->ConsoleHandle = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPRINT1("Using existing console: %x\n", Parameters->ConsoleHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize Console Ctrl Handler */
|
||||||
|
RtlInitializeCriticalSection(&ConsoleLock);
|
||||||
|
SetConsoleCtrlHandler(DefaultConsoleCtrlHandler, TRUE);
|
||||||
|
|
||||||
|
/* Now use the proper console handle */
|
||||||
|
Request.Data.AllocConsoleRequest.Console = Parameters->ConsoleHandle;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Normally, we should be connecting to the Console CSR Server...
|
||||||
|
* but we don't have one yet, so we will instead simply send a create
|
||||||
|
* console message to the Base Server. When we finally have a Console
|
||||||
|
* Server, this code should be changed to send connection data instead.
|
||||||
|
*
|
||||||
|
* Also note that this connection should be made for any console app, even
|
||||||
|
* in the case above where -we- return.
|
||||||
|
*/
|
||||||
|
CsrRequest = MAKE_CSR_API(ALLOC_CONSOLE, CSR_CONSOLE);
|
||||||
|
Request.Data.AllocConsoleRequest.CtrlDispatcher = ConsoleControlDispatcher;
|
||||||
|
Status = CsrClientCallServer(&Request,
|
||||||
|
NULL,
|
||||||
|
CsrRequest,
|
||||||
|
sizeof(CSR_API_MESSAGE));
|
||||||
|
if(!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status))
|
||||||
|
{
|
||||||
|
DPRINT1("CSR Failed to give us a console\n");
|
||||||
|
/* We're lying here, so at least the process can load... */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We got the handles, let's set them */
|
||||||
|
Parameters->ConsoleHandle = Request.Data.AllocConsoleRequest.Console;
|
||||||
|
SetStdHandle(STD_INPUT_HANDLE, Request.Data.AllocConsoleRequest.InputHandle);
|
||||||
|
SetStdHandle(STD_OUTPUT_HANDLE, Request.Data.AllocConsoleRequest.OutputHandle);
|
||||||
|
SetStdHandle(STD_ERROR_HANDLE,
|
||||||
|
DuplicateConsoleHandle(Request.Data.AllocConsoleRequest.OutputHandle,
|
||||||
|
0,
|
||||||
|
TRUE,
|
||||||
|
DUPLICATE_SAME_ACCESS));
|
||||||
|
|
||||||
|
DPRINT1("Console setup: %lx, %lx, %lx\n",
|
||||||
|
Request.Data.AllocConsoleRequest.Console,
|
||||||
|
Request.Data.AllocConsoleRequest.InputHandle,
|
||||||
|
Request.Data.AllocConsoleRequest.OutputHandle);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
DllMain(HANDLE hDll,
|
DllMain(HANDLE hDll,
|
||||||
|
@ -148,10 +255,12 @@ DllMain(HANDLE hDll,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize console ctrl handler */
|
/* Initialize Console Support */
|
||||||
RtlInitializeCriticalSection(&ConsoleLock);
|
if (!BasepInitConsole())
|
||||||
SetConsoleCtrlHandler(DefaultConsoleCtrlHandler, TRUE);
|
{
|
||||||
|
DPRINT1("Failure to set up console\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Insert more dll attach stuff here! */
|
/* Insert more dll attach stuff here! */
|
||||||
|
|
||||||
|
|
|
@ -80,36 +80,18 @@ BaseProcessStartup(PPROCESS_START_ROUTINE lpStartAddress)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
BasepNotifyCsrOfCreation(ULONG dwCreationFlags,
|
BasepNotifyCsrOfCreation(ULONG dwCreationFlags,
|
||||||
IN HANDLE ProcessId,
|
IN HANDLE ProcessId)
|
||||||
IN ULONG SubsystemType,
|
|
||||||
OUT PHANDLE ConsoleHandle,
|
|
||||||
OUT PHANDLE InputHandle,
|
|
||||||
OUT PHANDLE OutputHandle)
|
|
||||||
{
|
{
|
||||||
ULONG Request = CREATE_PROCESS;
|
ULONG Request = CREATE_PROCESS;
|
||||||
CSR_API_MESSAGE CsrRequest;
|
CSR_API_MESSAGE CsrRequest;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("BasepNotifyCsrOfCreation\n");
|
DPRINT1("BasepNotifyCsrOfCreation: Process: %lx, Flags %lx\n",
|
||||||
|
ProcessId, dwCreationFlags);
|
||||||
/* Some hacks (heck, this whole API is a hack) */
|
|
||||||
if (SubsystemType == IMAGE_SUBSYSTEM_WINDOWS_GUI)
|
|
||||||
{
|
|
||||||
dwCreationFlags = (dwCreationFlags &~ CREATE_NEW_CONSOLE) |
|
|
||||||
DETACHED_PROCESS;
|
|
||||||
}
|
|
||||||
else if (SubsystemType == IMAGE_SUBSYSTEM_WINDOWS_CUI)
|
|
||||||
{
|
|
||||||
dwCreationFlags |= CREATE_NEW_CONSOLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fill out the request */
|
/* Fill out the request */
|
||||||
CsrRequest.Data.CreateProcessRequest.NewProcessId = ProcessId;
|
CsrRequest.Data.CreateProcessRequest.NewProcessId = ProcessId;
|
||||||
CsrRequest.Data.CreateProcessRequest.Flags = dwCreationFlags;
|
CsrRequest.Data.CreateProcessRequest.Flags = dwCreationFlags;
|
||||||
CsrRequest.Data.CreateProcessRequest.CtrlDispatcher = ConsoleControlDispatcher;
|
|
||||||
CsrRequest.Data.CreateProcessRequest.InputHandle = 0;
|
|
||||||
CsrRequest.Data.CreateProcessRequest.OutputHandle = 0;
|
|
||||||
CsrRequest.Data.CreateProcessRequest.Console = 0;
|
|
||||||
|
|
||||||
/* Call CSR */
|
/* Call CSR */
|
||||||
Status = CsrClientCallServer(&CsrRequest,
|
Status = CsrClientCallServer(&CsrRequest,
|
||||||
|
@ -121,11 +103,6 @@ BasepNotifyCsrOfCreation(ULONG dwCreationFlags,
|
||||||
DPRINT1("Failed to tell csrss about new process\n");
|
DPRINT1("Failed to tell csrss about new process\n");
|
||||||
return CsrRequest.Status;
|
return CsrRequest.Status;
|
||||||
}
|
}
|
||||||
/* Return Handles */
|
|
||||||
*ConsoleHandle = CsrRequest.Data.CreateProcessRequest.Console;
|
|
||||||
*InputHandle = CsrRequest.Data.CreateProcessRequest.InputHandle;
|
|
||||||
*OutputHandle = CsrRequest.Data.CreateProcessRequest.OutputHandle;
|
|
||||||
DPRINT("CSR Created: %lx %lx\n", *InputHandle, *OutputHandle);
|
|
||||||
|
|
||||||
/* REturn Success */
|
/* REturn Success */
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
@ -356,9 +333,7 @@ BasepInitializeEnvironment(HANDLE ProcessHandle,
|
||||||
LPVOID Environment,
|
LPVOID Environment,
|
||||||
LPSTARTUPINFOW StartupInfo,
|
LPSTARTUPINFOW StartupInfo,
|
||||||
DWORD CreationFlags,
|
DWORD CreationFlags,
|
||||||
BOOL InheritHandles,
|
BOOL InheritHandles)
|
||||||
HANDLE hInput,
|
|
||||||
HANDLE hOutput)
|
|
||||||
{
|
{
|
||||||
WCHAR FullPath[MAX_PATH];
|
WCHAR FullPath[MAX_PATH];
|
||||||
LPWSTR Remaining;
|
LPWSTR Remaining;
|
||||||
|
@ -571,14 +546,6 @@ BasepInitializeEnvironment(HANDLE ProcessHandle,
|
||||||
ProcessParameters->Flags |= (NtCurrentPeb()->ProcessParameters->Flags &
|
ProcessParameters->Flags |= (NtCurrentPeb()->ProcessParameters->Flags &
|
||||||
PPF_DISABLE_HEAP_CHECKS);
|
PPF_DISABLE_HEAP_CHECKS);
|
||||||
|
|
||||||
/*
|
|
||||||
* FIXME: Our console init stuff is messy. See my comment in kernel32's
|
|
||||||
* DllMain.
|
|
||||||
*/
|
|
||||||
if (!ProcessParameters->StandardInput) ProcessParameters->StandardInput = hInput;
|
|
||||||
if (!ProcessParameters->StandardOutput) ProcessParameters->StandardOutput = hOutput;
|
|
||||||
if (!ProcessParameters->StandardError) ProcessParameters->StandardError = hOutput;
|
|
||||||
|
|
||||||
/* Write the Parameter Block */
|
/* Write the Parameter Block */
|
||||||
Status = NtWriteVirtualMemory(ProcessHandle,
|
Status = NtWriteVirtualMemory(ProcessHandle,
|
||||||
RemoteParameters,
|
RemoteParameters,
|
||||||
|
@ -780,7 +747,6 @@ CreateProcessW(LPCWSTR lpApplicationName,
|
||||||
ULONG RetVal;
|
ULONG RetVal;
|
||||||
UINT Error;
|
UINT Error;
|
||||||
BOOLEAN SearchDone = FALSE;
|
BOOLEAN SearchDone = FALSE;
|
||||||
HANDLE hConsole, hInput, hOutput;
|
|
||||||
CLIENT_ID ClientId;
|
CLIENT_ID ClientId;
|
||||||
PPEB OurPeb = NtCurrentPeb();
|
PPEB OurPeb = NtCurrentPeb();
|
||||||
PPEB RemotePeb;
|
PPEB RemotePeb;
|
||||||
|
@ -1317,21 +1283,6 @@ GetAppName:
|
||||||
sizeof(ProcessBasicInfo),
|
sizeof(ProcessBasicInfo),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* Notify CSRSS */
|
|
||||||
Status = BasepNotifyCsrOfCreation(dwCreationFlags,
|
|
||||||
(HANDLE)ProcessBasicInfo.UniqueProcessId,
|
|
||||||
SectionImageInfo.SubsystemType,
|
|
||||||
&hConsole,
|
|
||||||
&hInput,
|
|
||||||
&hOutput);
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DPRINT1("CSR Notification Failed");
|
|
||||||
SetLastErrorByStatus(Status);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create Process Environment */
|
/* Create Process Environment */
|
||||||
RemotePeb = ProcessBasicInfo.PebBaseAddress;
|
RemotePeb = ProcessBasicInfo.PebBaseAddress;
|
||||||
Status = BasepInitializeEnvironment(hProcess,
|
Status = BasepInitializeEnvironment(hProcess,
|
||||||
|
@ -1343,9 +1294,7 @@ GetAppName:
|
||||||
lpEnvironment,
|
lpEnvironment,
|
||||||
lpStartupInfo,
|
lpStartupInfo,
|
||||||
dwCreationFlags,
|
dwCreationFlags,
|
||||||
bInheritHandles,
|
bInheritHandles);
|
||||||
hInput,
|
|
||||||
hOutput);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Could not initialize Process Environment\n");
|
DPRINT1("Could not initialize Process Environment\n");
|
||||||
|
@ -1401,6 +1350,18 @@ GetAppName:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Notify CSRSS */
|
||||||
|
Status = BasepNotifyCsrOfCreation(dwCreationFlags,
|
||||||
|
(HANDLE)ProcessBasicInfo.UniqueProcessId);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT1("CSR Notification Failed");
|
||||||
|
SetLastErrorByStatus(Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(dwCreationFlags & CREATE_SUSPENDED))
|
if (!(dwCreationFlags & CREATE_SUSPENDED))
|
||||||
{
|
{
|
||||||
NtResumeThread(hThread, &Dummy);
|
NtResumeThread(hThread, &Dummy);
|
||||||
|
|
|
@ -192,8 +192,6 @@ NTSTATUS STDCALL CsrFreeProcessData(HANDLE Pid)
|
||||||
CSR_API(CsrCreateProcess)
|
CSR_API(CsrCreateProcess)
|
||||||
{
|
{
|
||||||
PCSRSS_PROCESS_DATA NewProcessData;
|
PCSRSS_PROCESS_DATA NewProcessData;
|
||||||
NTSTATUS Status;
|
|
||||||
CSR_API_MESSAGE ApiRequest;
|
|
||||||
|
|
||||||
Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
|
Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
|
||||||
Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
|
Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
|
||||||
|
@ -209,57 +207,6 @@ CSR_API(CsrCreateProcess)
|
||||||
NewProcessData->ShutdownLevel = 0x280;
|
NewProcessData->ShutdownLevel = 0x280;
|
||||||
NewProcessData->ShutdownFlags = 0;
|
NewProcessData->ShutdownFlags = 0;
|
||||||
|
|
||||||
if (Request->Data.CreateProcessRequest.Flags & DETACHED_PROCESS)
|
|
||||||
{
|
|
||||||
NewProcessData->Console = NULL;
|
|
||||||
}
|
|
||||||
else if (Request->Data.CreateProcessRequest.Flags & CREATE_NEW_CONSOLE)
|
|
||||||
{
|
|
||||||
ApiRequest.Type = ALLOC_CONSOLE;
|
|
||||||
ApiRequest.Header.DataSize = sizeof(CSRSS_ALLOC_CONSOLE);
|
|
||||||
ApiRequest.Header.MessageSize = LPC_MESSAGE_BASE_SIZE + sizeof(CSRSS_ALLOC_CONSOLE);
|
|
||||||
ApiRequest.Data.AllocConsoleRequest.CtrlDispatcher = Request->Data.CreateProcessRequest.CtrlDispatcher;
|
|
||||||
|
|
||||||
CsrApiCallHandler(NewProcessData, &ApiRequest);
|
|
||||||
|
|
||||||
Request->Status = ApiRequest.Status;
|
|
||||||
if (! NT_SUCCESS(Request->Status))
|
|
||||||
{
|
|
||||||
CsrFreeProcessData(Request->Data.CreateProcessRequest.NewProcessId);
|
|
||||||
return Request->Status;
|
|
||||||
}
|
|
||||||
Request->Data.CreateProcessRequest.InputHandle = ApiRequest.Data.AllocConsoleRequest.InputHandle;
|
|
||||||
Request->Data.CreateProcessRequest.OutputHandle = ApiRequest.Data.AllocConsoleRequest.OutputHandle;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NewProcessData->Console = ProcessData->Console;
|
|
||||||
InterlockedIncrement( &(ProcessData->Console->Header.ReferenceCount) );
|
|
||||||
CsrInsertObject(NewProcessData,
|
|
||||||
&Request->Data.CreateProcessRequest.InputHandle,
|
|
||||||
(Object_t *)NewProcessData->Console);
|
|
||||||
RtlEnterCriticalSection(&ProcessDataLock );
|
|
||||||
CsrInsertObject( NewProcessData,
|
|
||||||
&Request->Data.CreateProcessRequest.OutputHandle,
|
|
||||||
&(NewProcessData->Console->ActiveBuffer->Header) );
|
|
||||||
|
|
||||||
RtlLeaveCriticalSection(&ProcessDataLock);
|
|
||||||
Status = NtDuplicateObject( NtCurrentProcess(), NewProcessData->Console->ActiveEvent, NewProcessData->Process, &NewProcessData->ConsoleEvent, SYNCHRONIZE, FALSE, 0 );
|
|
||||||
if( !NT_SUCCESS( Status ) )
|
|
||||||
{
|
|
||||||
DbgPrint( "CSR: NtDuplicateObject() failed: %x\n", Status );
|
|
||||||
CsrFreeProcessData( NewProcessData->ProcessId );
|
|
||||||
Request->Status = Status;
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
NewProcessData->CtrlDispatcher = Request->Data.CreateProcessRequest.CtrlDispatcher;
|
|
||||||
RtlEnterCriticalSection(&ProcessDataLock );
|
|
||||||
InsertHeadList(&NewProcessData->Console->ProcessList, &NewProcessData->ProcessEntry);
|
|
||||||
RtlLeaveCriticalSection(&ProcessDataLock);
|
|
||||||
}
|
|
||||||
|
|
||||||
Request->Data.CreateProcessRequest.Console = NewProcessData->Console;
|
|
||||||
|
|
||||||
Request->Status = STATUS_SUCCESS;
|
Request->Status = STATUS_SUCCESS;
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,75 +223,124 @@ CsrInitConsole(PCSRSS_CONSOLE Console)
|
||||||
|
|
||||||
CSR_API(CsrAllocConsole)
|
CSR_API(CsrAllocConsole)
|
||||||
{
|
{
|
||||||
PCSRSS_CONSOLE Console;
|
PCSRSS_CONSOLE Console;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("CsrAllocConsole\n");
|
DPRINT1("CsrAllocConsole\n");
|
||||||
|
|
||||||
Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
|
Request->Header.MessageSize = sizeof(CSR_API_MESSAGE);
|
||||||
Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
|
Request->Header.DataSize = sizeof(CSR_API_MESSAGE) - LPC_MESSAGE_BASE_SIZE;
|
||||||
|
|
||||||
if (ProcessData == NULL)
|
if (ProcessData == NULL)
|
||||||
{
|
{
|
||||||
return Request->Status = STATUS_INVALID_PARAMETER;
|
DPRINT1("No process data\n");
|
||||||
|
return Request->Status = STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ProcessData->Console)
|
if (ProcessData->Console)
|
||||||
{
|
{
|
||||||
Request->Status = STATUS_INVALID_PARAMETER;
|
DPRINT1("Process already has a console\n");
|
||||||
return STATUS_INVALID_PARAMETER;
|
Request->Status = STATUS_INVALID_PARAMETER;
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
Request->Status = STATUS_SUCCESS;
|
/* Assume success */
|
||||||
Console = HeapAlloc(Win32CsrApiHeap, 0, sizeof(CSRSS_CONSOLE));
|
Request->Status = STATUS_SUCCESS;
|
||||||
if (NULL == Console)
|
|
||||||
{
|
|
||||||
Request->Status = STATUS_NO_MEMORY;
|
|
||||||
return STATUS_NO_MEMORY;
|
|
||||||
}
|
|
||||||
Request->Status = CsrInitConsole(Console);
|
|
||||||
if (! NT_SUCCESS(Request->Status))
|
|
||||||
{
|
|
||||||
HeapFree(Win32CsrApiHeap, 0, Console);
|
|
||||||
return Request->Status;
|
|
||||||
}
|
|
||||||
ProcessData->Console = Console;
|
|
||||||
Request->Data.AllocConsoleRequest.Console = Console;
|
|
||||||
|
|
||||||
/* add a reference count because the process is tied to the console */
|
/* If we don't need a console, then get out of here */
|
||||||
Console->Header.ReferenceCount++;
|
if (!Request->Data.AllocConsoleRequest.ConsoleNotNeeded)
|
||||||
Status = Win32CsrInsertObject(ProcessData, &Request->Data.AllocConsoleRequest.InputHandle, &Console->Header);
|
|
||||||
if (! NT_SUCCESS(Status))
|
|
||||||
{
|
{
|
||||||
ConioDeleteConsole((Object_t *) Console);
|
DPRINT1("No console needed\n");
|
||||||
ProcessData->Console = 0;
|
return STATUS_SUCCESS;
|
||||||
return Request->Status = Status;
|
|
||||||
}
|
|
||||||
Status = Win32CsrInsertObject(ProcessData, &Request->Data.AllocConsoleRequest.OutputHandle, &Console->ActiveBuffer->Header);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
Console->Header.ReferenceCount--;
|
|
||||||
Win32CsrReleaseObject(ProcessData, Request->Data.AllocConsoleRequest.InputHandle);
|
|
||||||
ProcessData->Console = 0;
|
|
||||||
return Request->Status = Status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! DuplicateHandle(GetCurrentProcess(), ProcessData->Console->ActiveEvent,
|
/* If we already have one, then don't create a new one... */
|
||||||
ProcessData->Process, &ProcessData->ConsoleEvent, EVENT_ALL_ACCESS, FALSE, 0))
|
if (!Request->Data.AllocConsoleRequest.Console)
|
||||||
{
|
{
|
||||||
DPRINT1("DuplicateHandle() failed: %d\n", GetLastError);
|
/* Allocate a console structure */
|
||||||
Console->Header.ReferenceCount--;
|
Console = HeapAlloc(Win32CsrApiHeap, 0, sizeof(CSRSS_CONSOLE));
|
||||||
Win32CsrReleaseObject(ProcessData, Request->Data.AllocConsoleRequest.OutputHandle);
|
if (NULL == Console)
|
||||||
Win32CsrReleaseObject(ProcessData, Request->Data.AllocConsoleRequest.InputHandle);
|
{
|
||||||
ProcessData->Console = 0;
|
DPRINT1("Not enough memory for console\n");
|
||||||
Request->Status = Status;
|
Request->Status = STATUS_NO_MEMORY;
|
||||||
return Status;
|
return STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
ProcessData->CtrlDispatcher = Request->Data.AllocConsoleRequest.CtrlDispatcher;
|
|
||||||
DPRINT("CSRSS:CtrlDispatcher address: %x\n", ProcessData->CtrlDispatcher);
|
|
||||||
InsertHeadList(&ProcessData->Console->ProcessList, &ProcessData->ProcessEntry);
|
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
/* Initialize the Console */
|
||||||
|
Request->Status = CsrInitConsole(Console);
|
||||||
|
if (!NT_SUCCESS(Request->Status))
|
||||||
|
{
|
||||||
|
DPRINT1("Console init failed\n");
|
||||||
|
HeapFree(Win32CsrApiHeap, 0, Console);
|
||||||
|
return Request->Status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Reuse our current console */
|
||||||
|
Console = Request->Data.AllocConsoleRequest.Console;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set the Process Console */
|
||||||
|
ProcessData->Console = Console;
|
||||||
|
|
||||||
|
/* Return it to the caller */
|
||||||
|
Request->Data.AllocConsoleRequest.Console = Console;
|
||||||
|
|
||||||
|
/* Add a reference count because the process is tied to the console */
|
||||||
|
Console->Header.ReferenceCount++;
|
||||||
|
|
||||||
|
/* Insert the Objects */
|
||||||
|
Status = Win32CsrInsertObject(ProcessData,
|
||||||
|
&Request->Data.AllocConsoleRequest.InputHandle,
|
||||||
|
&Console->Header);
|
||||||
|
if (! NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to insert object\n");
|
||||||
|
ConioDeleteConsole((Object_t *) Console);
|
||||||
|
ProcessData->Console = 0;
|
||||||
|
return Request->Status = Status;
|
||||||
|
}
|
||||||
|
Status = Win32CsrInsertObject(ProcessData,
|
||||||
|
&Request->Data.AllocConsoleRequest.OutputHandle,
|
||||||
|
&Console->ActiveBuffer->Header);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to insert object\n");
|
||||||
|
Console->Header.ReferenceCount--;
|
||||||
|
Win32CsrReleaseObject(ProcessData,
|
||||||
|
Request->Data.AllocConsoleRequest.InputHandle);
|
||||||
|
ProcessData->Console = 0;
|
||||||
|
return Request->Status = Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Duplicate the Event */
|
||||||
|
if (!DuplicateHandle(GetCurrentProcess(),
|
||||||
|
ProcessData->Console->ActiveEvent,
|
||||||
|
ProcessData->Process,
|
||||||
|
&ProcessData->ConsoleEvent,
|
||||||
|
EVENT_ALL_ACCESS,
|
||||||
|
FALSE,
|
||||||
|
0))
|
||||||
|
{
|
||||||
|
DPRINT1("DuplicateHandle() failed: %d\n", GetLastError);
|
||||||
|
Console->Header.ReferenceCount--;
|
||||||
|
Win32CsrReleaseObject(ProcessData,
|
||||||
|
Request->Data.AllocConsoleRequest.OutputHandle);
|
||||||
|
Win32CsrReleaseObject(ProcessData,
|
||||||
|
Request->Data.AllocConsoleRequest.InputHandle);
|
||||||
|
ProcessData->Console = 0;
|
||||||
|
Request->Status = Status;
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set the Ctrl Dispatcher */
|
||||||
|
ProcessData->CtrlDispatcher = Request->Data.AllocConsoleRequest.CtrlDispatcher;
|
||||||
|
DPRINT1("CSRSS:CtrlDispatcher address: %x\n", ProcessData->CtrlDispatcher);
|
||||||
|
|
||||||
|
/* Insert into the list */
|
||||||
|
InsertHeadList(&ProcessData->Console->ProcessList, &ProcessData->ProcessEntry);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSR_API(CsrFreeConsole)
|
CSR_API(CsrFreeConsole)
|
||||||
|
|
|
@ -42,43 +42,12 @@ extern unsigned long debug_trace_level;
|
||||||
|
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
#define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
|
|
||||||
|
|
||||||
#else /* DBG */
|
#else /* DBG */
|
||||||
|
|
||||||
#define DH_DbgPrint(_t_, _x_)
|
#define DH_DbgPrint(_t_, _x_)
|
||||||
|
|
||||||
#endif /* DBG */
|
#endif /* DBG */
|
||||||
|
|
||||||
|
|
||||||
#define assert(x) ASSERT(x)
|
|
||||||
#define assert_irql(x) ASSERT_IRQL(x)
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
|
|
||||||
#define UNIMPLEMENTED \
|
|
||||||
TI_DbgPrint(MIN_TRACE, ("The function at %s:%d is unimplemented, \
|
|
||||||
but come back another day.\n", __FILE__, __LINE__));
|
|
||||||
|
|
||||||
#else /* _MSC_VER */
|
|
||||||
|
|
||||||
#define UNIMPLEMENTED \
|
|
||||||
TI_DbgPrint(MIN_TRACE, ("(%s:%d)(%s) is unimplemented, \
|
|
||||||
but come back another day.\n", __FILE__, __LINE__, __FUNCTION__));
|
|
||||||
|
|
||||||
#endif /* _MSC_VER */
|
|
||||||
|
|
||||||
|
|
||||||
#define CHECKPOINT \
|
|
||||||
do { TI_DbgPrint(DEBUG_CHECK, ("(%s:%d)\n", __FILE__, __LINE__)); } while(0);
|
|
||||||
|
|
||||||
#define CP CHECKPOINT
|
|
||||||
|
|
||||||
#define ASSERT_KM_POINTER(_x) \
|
|
||||||
ASSERT(((PVOID)_x) != (PVOID)0xcccccccc); \
|
|
||||||
ASSERT(((PVOID)_x) >= (PVOID)0x80000000);
|
|
||||||
|
|
||||||
#endif /* __DEBUG_H */
|
#endif /* __DEBUG_H */
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <reactos/debug.h>
|
||||||
#include "rosdhcp.h"
|
#include "rosdhcp.h"
|
||||||
|
|
||||||
char *piaddr( struct iaddr addr ) {
|
char *piaddr( struct iaddr addr ) {
|
||||||
|
@ -15,7 +16,7 @@ int note( char *format, ... ) {
|
||||||
|
|
||||||
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
|
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
|
||||||
|
|
||||||
DbgPrint("NOTE: %s\n", buf);
|
DPRINT("NOTE: %s\n", buf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +29,7 @@ int debug( char *format, ... ) {
|
||||||
|
|
||||||
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
|
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
|
||||||
|
|
||||||
DbgPrint("DEBUG: %s\n", buf);
|
DPRINT("DEBUG: %s\n", buf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +42,7 @@ int warn( char *format, ... ) {
|
||||||
|
|
||||||
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
|
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
|
||||||
|
|
||||||
DbgPrint("WARN: %s\n", buf);
|
DPRINT("WARN: %s\n", buf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +55,7 @@ int warning( char *format, ... ) {
|
||||||
|
|
||||||
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
|
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
|
||||||
|
|
||||||
DbgPrint("WARNING: %s\n", buf);
|
DPRINT("WARNING: %s\n", buf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +67,7 @@ void error( char *format, ... ) {
|
||||||
|
|
||||||
vsnprintf( buf, sizeof(buf), format, arg_begin );
|
vsnprintf( buf, sizeof(buf), format, arg_begin );
|
||||||
|
|
||||||
DbgPrint("ERROR: %s\n", buf);
|
DPRINT1("ERROR: %s\n", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t getShort( unsigned char *data ) {
|
int16_t getShort( unsigned char *data ) {
|
||||||
|
|
Loading…
Reference in a new issue