remove whitespace from end of lines

svn path=/trunk/; revision=15111
This commit is contained in:
Steven Edwards 2005-05-08 04:07:56 +00:00
parent 917fe293f6
commit 27479fb866
157 changed files with 1449 additions and 1449 deletions

View file

@ -150,18 +150,18 @@ NTSTATUS STDCALL CsrInsertObject( PCSRSS_PROCESS_DATA ProcessData, PHANDLE Handl
}
NewBlock = RtlAllocateHeap(CsrssApiHeap,
HEAP_ZERO_MEMORY,
(ProcessData->HandleTableSize + 64) *
(ProcessData->HandleTableSize + 64) *
sizeof(HANDLE));
if (NewBlock == NULL)
{
return(STATUS_UNSUCCESSFUL);
}
RtlCopyMemory(NewBlock,
RtlCopyMemory(NewBlock,
ProcessData->HandleTable,
ProcessData->HandleTableSize * sizeof(HANDLE));
RtlFreeHeap( CsrssApiHeap, 0, ProcessData->HandleTable );
ProcessData->HandleTable = (Object_t **)NewBlock;
ProcessData->HandleTable[i] = Object;
ProcessData->HandleTable[i] = Object;
*Handle = (HANDLE)(((i + 1) << 2) | 0x3);
InterlockedIncrement( &Object->ReferenceCount );
ProcessData->HandleTableSize = ProcessData->HandleTableSize + 64;

View file

@ -42,7 +42,7 @@ PCSRSS_PROCESS_DATA STDCALL CsrGetProcessData(HANDLE ProcessId)
PCSRSS_PROCESS_DATA pProcessData;
hash = (ULONG_PTR)ProcessId % (sizeof(ProcessData) / sizeof(*ProcessData));
LOCK;
pProcessData = ProcessData[hash];
@ -64,7 +64,7 @@ PCSRSS_PROCESS_DATA STDCALL CsrCreateProcessData(HANDLE ProcessId)
NTSTATUS Status;
hash = (ULONG_PTR)ProcessId % (sizeof(ProcessData) / sizeof(*ProcessData));
LOCK;
pProcessData = ProcessData[hash];
@ -123,9 +123,9 @@ NTSTATUS STDCALL CsrFreeProcessData(HANDLE Pid)
ULONG hash;
int c;
PCSRSS_PROCESS_DATA pProcessData, pPrevProcessData = NULL;
hash = (ULONG_PTR)Pid % (sizeof(ProcessData) / sizeof(*ProcessData));
LOCK;
pProcessData = ProcessData[hash];
@ -304,7 +304,7 @@ CSR_API(CsrGetShutdownParameters)
{
return(Reply->Status = STATUS_INVALID_PARAMETER);
}
Reply->Data.GetShutdownParametersReply.Level = ProcessData->ShutdownLevel;
Reply->Data.GetShutdownParametersReply.Flags = ProcessData->ShutdownFlags;
@ -322,7 +322,7 @@ CSR_API(CsrSetShutdownParameters)
{
return(Reply->Status = STATUS_INVALID_PARAMETER);
}
ProcessData->ShutdownLevel = Request->Data.SetShutdownParametersRequest.Level;
ProcessData->ShutdownFlags = Request->Data.SetShutdownParametersRequest.Flags;

View file

@ -1,5 +1,5 @@
/* $Id$
*
*
* reactos/subsys/csrss/api/wapi.c
*
* CSRSS port message processing
@ -113,11 +113,11 @@ ClientConnectionThread(HANDLE ServerPort)
PCSRSS_API_REQUEST Request;
PCSRSS_PROCESS_DATA ProcessData;
PCSRSS_API_REPLY Reply;
DPRINT("CSR: %s called", __FUNCTION__);
Reply = NULL;
for (;;)
{
Status = NtReplyWaitReceivePort(ServerPort,
@ -129,7 +129,7 @@ ClientConnectionThread(HANDLE ServerPort)
DPRINT1("CSR: NtReplyWaitReceivePort failed\n");
break;
}
if (LpcRequest.Header.MessageType == LPC_PORT_CLOSED)
{
CsrFreeProcessData( LpcRequest.Header.ClientId.UniqueProcess );
@ -138,14 +138,14 @@ ClientConnectionThread(HANDLE ServerPort)
Request = (PCSRSS_API_REQUEST)&LpcRequest;
Reply = (PCSRSS_API_REPLY)&LpcReply;
ProcessData = CsrGetProcessData(LpcRequest.Header.ClientId.UniqueProcess);
if (ProcessData == NULL)
{
DPRINT1("CSR: Message %d: Unable to find data for process 0x%x\n",
LpcRequest.Header.MessageType, LpcRequest.Header.ClientId.UniqueProcess);
break;
}
}
CsrApiCallHandler(ProcessData, Request, Reply);
@ -171,9 +171,9 @@ ServerApiPortThread (PVOID PortHandle)
HANDLE ServerPort = (HANDLE) 0;
HANDLE ServerThread = (HANDLE) 0;
PCSRSS_PROCESS_DATA ProcessData = NULL;
CsrInitProcessData();
DPRINT("CSR: %s called", __FUNCTION__);
for (;;)
@ -207,18 +207,18 @@ ServerApiPortThread (PVOID PortHandle)
Status = STATUS_UNSUCCESSFUL;
break;
}
ProcessData->CsrSectionViewBase = LpcRead.ViewBase;
ProcessData->CsrSectionViewSize = LpcRead.ViewSize;
Status = NtCompleteConnectPort(ServerPort);
if (!NT_SUCCESS(Status))
{
DPRINT1("CSR: NtCompleteConnectPort() failed\n");
break;
}
Status = RtlCreateUserThread(NtCurrentProcess(),
NULL,
FALSE,
@ -292,7 +292,7 @@ DPRINT("-- 2\n");
} else {
DPRINT("-- 3\n");
PLPC_MESSAGE Reply = NULL;
/*
/*
* Tell the init thread the SM gave the
* green light for boostrapping.
*/

View file

@ -1,9 +1,9 @@
/* $Id$
*
* csrss.c - Client/Server Runtime subsystem
*
*
* ReactOS Operating System
*
*
* --------------------------------------------------------------------
*
* This software is free software; you can redistribute it and/or
@ -19,10 +19,10 @@
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
* MA 02139, USA.
*
* --------------------------------------------------------------------
*
*
* 19990417 (Emanuele Aliberti)
* Do nothing native application skeleton
* 19990528 (Emanuele Aliberti)
@ -64,7 +64,7 @@ CsrpParseCommandLine (HANDLE ProcessHeap,
INT i = 0;
INT afterlastspace = 0;
DPRINT("CSR: %s called\n", __FUNCTION__);
RtlZeroMemory (Argument, sizeof (COMMAND_LINE_ARGUMENT));
@ -123,20 +123,20 @@ CsrpParseCommandLine (HANDLE ProcessHeap,
Argument->Vector [Argument->Count - 1] = & (Argument->Buffer.Buffer [afterlastspace]);
}
return STATUS_SUCCESS;
return STATUS_SUCCESS;
}
/**********************************************************************
* NAME PRIVATE
* CsrpFreeCommandLine/2
*/
static VOID STDCALL
CsrpFreeCommandLine (HANDLE ProcessHeap,
PCOMMAND_LINE_ARGUMENT Argument)
{
DPRINT("CSR: %s called\n", __FUNCTION__);
RtlFreeHeap (ProcessHeap,
0,
Argument->Vector);
@ -177,7 +177,7 @@ VOID STDCALL NtProcessStartup(PPEB Peb)
*================================================================*/
if (CsrServerInitialization (CmdLineArg.Count, CmdLineArg.Vector) == TRUE)
{
CsrpFreeCommandLine (Peb->ProcessHeap, & CmdLineArg);
CsrpFreeCommandLine (Peb->ProcessHeap, & CmdLineArg);
/*
* Terminate the current thread only.
*/
@ -187,7 +187,7 @@ VOID STDCALL NtProcessStartup(PPEB Peb)
{
DisplayString (L"CSR: CsrServerInitialization failed.\n");
CsrpFreeCommandLine (Peb->ProcessHeap, & CmdLineArg);
CsrpFreeCommandLine (Peb->ProcessHeap, & CmdLineArg);
/*
* Tell the SM we failed.
*/

View file

@ -47,7 +47,7 @@ typedef struct _CSRSS_PROCESS_DATA
LIST_ENTRY ProcessEntry;
PCONTROLDISPATCHER CtrlDispatcher;
} CSRSS_PROCESS_DATA, *PCSRSS_PROCESS_DATA;
typedef VOID (STDCALL *CSR_CLEANUP_OBJECT_PROC)(Object_t *Object);
typedef struct tagCSRSS_OBJECT_DEFINITION

View file

@ -1,5 +1,5 @@
/* $Id$
*
*
* reactos/subsys/csrss/init.c
*
* Initialize the CSRSS subsystem server process.
@ -397,7 +397,7 @@ CsrpRegisterSubsystem (ULONG argc, PWSTR* argv)
FALSE,
NULL);
NtClose (hBootstrapOk);
return Status;
return Status;
}
/**********************************************************************
@ -533,7 +533,7 @@ CsrServerInitialization (
Status = InitRoutine[i].EntryPoint(ArgumentCount,ArgumentArray);
if(!NT_SUCCESS(Status))
{
DPRINT1("CSR: %s: failed to %s (Status=%08lx)\n",
DPRINT1("CSR: %s: failed to %s (Status=%08lx)\n",
__FUNCTION__,
InitRoutine[i].ErrorMessage,
Status);

View file

@ -1,9 +1,9 @@
/* $Id$
*
* smss.c - Session Manager
*
*
* ReactOS Operating System
*
*
* --------------------------------------------------------------------
*
* This software is free software; you can redistribute it and/or
@ -19,10 +19,10 @@
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
* MA 02139, USA.
*
* --------------------------------------------------------------------
*
*
* 19990529 (Emanuele Aliberti)
* Compiled successfully with egcs 1.1.2
*/
@ -34,7 +34,7 @@
VOID STDCALL DisplayString(LPCWSTR lpwString)
{
UNICODE_STRING us;
RtlInitUnicodeString (&us, lpwString);
ZwDisplayString (&us);
}
@ -45,11 +45,11 @@ VOID STDCALL PrintString (char* fmt, ...)
va_list ap;
UNICODE_STRING UnicodeString;
ANSI_STRING AnsiString;
va_start(ap, fmt);
vsprintf(buffer, fmt, ap);
va_end(ap);
RtlInitAnsiString (&AnsiString, buffer);
RtlAnsiStringToUnicodeString (&UnicodeString,
&AnsiString,

View file

@ -31,7 +31,7 @@ InitializeVideoAddressSpace(VOID)
0,
NULL,
NULL);
Status = ZwOpenSection(&PhysMemHandle, SECTION_ALL_ACCESS,
Status = ZwOpenSection(&PhysMemHandle, SECTION_ALL_ACCESS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
@ -102,13 +102,13 @@ InitializeVideoAddressSpace(VOID)
DbgPrint("NtVdmControl failed (status %x)\n", Status);
return(0);
}
/*
* Copy the real mode IVT into the right place
*/
NullAddress = (PVOID)0x0; /* Workaround for GCC 3.4 */
memcpy(NullAddress, IVT, 1024);
/*
* Get the BDA from the kernel
*/
@ -118,7 +118,7 @@ InitializeVideoAddressSpace(VOID)
DbgPrint("NtVdmControl failed (status %x)\n", Status);
return(0);
}
/*
* Copy the BDA into the right place
*/

View file

@ -75,7 +75,7 @@ VOID FASTCALL
ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData)
{
HANDLE Thread;
DPRINT("ConioConsoleCtrlEvent Parent ProcessId = %x\n", ProcessData->ProcessId);
if (ProcessData->CtrlDispatcher)
@ -105,7 +105,7 @@ ClearLineBuffer(PCSRSS_SCREEN_BUFFER Buff)
{
DWORD Offset = 2 * (Buff->CurrentY * Buff->MaxX);
UINT Pos;
for (Pos = 0; Pos < Buff->MaxX; Pos++)
{
/* Fill the cell: Offset is incremented by the macro */
@ -154,9 +154,9 @@ CsrInitConsole(PCSRSS_CONSOLE Console)
Console->Title.MaximumLength = Console->Title.Length = 0;
Console->Title.Buffer = NULL;
RtlCreateUnicodeString(&Console->Title, L"Command Prompt");
Console->Header.ReferenceCount = 0;
Console->WaitingChars = 0;
Console->WaitingLines = 0;
@ -302,7 +302,7 @@ CSR_API(CsrAllocConsole)
return Status;
}
ProcessData->CtrlDispatcher = Request->Data.AllocConsoleRequest.CtrlDispatcher;
DPRINT("CSRSS:CtrlDispatcher address: %x\n", ProcessData->CtrlDispatcher);
DPRINT("CSRSS:CtrlDispatcher address: %x\n", ProcessData->CtrlDispatcher);
InsertHeadList(&ProcessData->Console->ProcessList, &ProcessData->ProcessEntry);
return STATUS_SUCCESS;
@ -329,7 +329,7 @@ CSR_API(CsrFreeConsole)
{
ConioDeleteConsole((Object_t *) Console);
}
return STATUS_SUCCESS;
}
@ -513,9 +513,9 @@ CSR_API(CsrReadConsole)
ULONG nNumberOfCharsToRead, CharSize;
PCSRSS_CONSOLE Console;
NTSTATUS Status;
DPRINT("CsrReadConsole\n");
CharSize = (Request->Data.ReadConsoleRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
/* truncate length to CSRSS_MAX_READ_CONSOLE_REQUEST */
@ -785,7 +785,7 @@ ConioCopyRegion(PCSRSS_SCREEN_BUFFER ScreenBuffer,
DstY = (DstRegion->top + ScreenBuffer->ShowY) % ScreenBuffer->MaxY;
SrcOffset = (SrcY * ScreenBuffer->MaxX + SrcRegion->left + ScreenBuffer->ShowX) * 2;
DstOffset = (DstY * ScreenBuffer->MaxX + DstRegion->left + ScreenBuffer->ShowX) * 2;
for (i = SrcRegion->top; i <= SrcRegion->bottom; i++)
{
RtlCopyMemory(
@ -827,7 +827,7 @@ ConioFillRegion(PCSRSS_CONSOLE Console,
DWORD Delta;
ULONG i;
CHAR Char;
if(bUnicode)
ConsoleUnicodeCharToAnsiChar(Console, &Char, &CharInfo->Char.UnicodeChar);
else
@ -875,7 +875,7 @@ CSR_API(CsrWriteConsole)
ULONG CharSize = (Request->Data.WriteConsoleRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
DPRINT("CsrWriteConsole\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
@ -997,7 +997,7 @@ ConioProcessChar(PCSRSS_CONSOLE Console,
/* process Ctrl-C and Ctrl-Break */
if (Console->Mode & ENABLE_PROCESSED_INPUT &&
KeyEventRecord->InputEvent.Event.KeyEvent.bKeyDown &&
((KeyEventRecord->InputEvent.Event.KeyEvent.wVirtualKeyCode == VK_PAUSE) ||
((KeyEventRecord->InputEvent.Event.KeyEvent.wVirtualKeyCode == VK_PAUSE) ||
(KeyEventRecord->InputEvent.Event.KeyEvent.wVirtualKeyCode == 'C')) &&
(KeyEventRecord->InputEvent.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)))
{
@ -1043,10 +1043,10 @@ ConioProcessChar(PCSRSS_CONSOLE Console,
else if (Console->ActiveBuffer->ShowY != Console->ActiveBuffer->CurrentY)
/* only scroll down if there is room to scroll down into */
{
if (Console->ActiveBuffer->ShowY % Console->ActiveBuffer->MaxY !=
if (Console->ActiveBuffer->ShowY % Console->ActiveBuffer->MaxY !=
Console->ActiveBuffer->CurrentY)
{
if (((Console->ActiveBuffer->CurrentY + 1) % Console->ActiveBuffer->MaxY) !=
if (((Console->ActiveBuffer->CurrentY + 1) % Console->ActiveBuffer->MaxY) !=
(Console->ActiveBuffer->ShowY + Console->ActiveBuffer->MaxY) %
Console->ActiveBuffer->MaxY)
{
@ -1222,7 +1222,7 @@ ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode)
RepeatCount = 1;
VirtualScanCode = (msg->lParam >> 16) & 0xff;
Down = msg->message == WM_KEYDOWN || msg->message == WM_CHAR ||
Down = msg->message == WM_KEYDOWN || msg->message == WM_CHAR ||
msg->message == WM_SYSKEYDOWN || msg->message == WM_SYSCHAR;
GetKeyboardState(KeyState);
@ -1232,9 +1232,9 @@ ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode)
{
VirtualKeyCode = LastVirtualKey;
UnicodeChar = msg->wParam;
}
}
else
{
{
WCHAR Chars[2];
INT RetChars = 0;
@ -1253,7 +1253,7 @@ ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode)
{
AsciiChar = 0;
}
er.EventType = KEY_EVENT;
er.Event.KeyEvent.bKeyDown = Down;
er.Event.KeyEvent.wRepeatCount = RepeatCount;
@ -1263,7 +1263,7 @@ ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode)
er.Event.KeyEvent.wVirtualScanCode = VirtualScanCode;
if (TextMode)
{
{
if (0 != (ShiftState & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED))
&& VK_TAB == VirtualKeyCode)
{
@ -1283,7 +1283,7 @@ ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode)
}
}
if (NULL == Console)
if (NULL == Console)
{
return;
}
@ -1294,9 +1294,9 @@ ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode)
{
return;
}
ConInRec->InputEvent = er;
ConInRec->Fake = UnicodeChar &&
ConInRec->Fake = UnicodeChar &&
(msg->message != WM_CHAR && msg->message != WM_SYSCHAR &&
msg->message != WM_KEYUP && msg->message != WM_SYSKEYUP);
ConInRec->NotChar = (msg->message != WM_CHAR && msg->message != WM_SYSCHAR);
@ -1314,7 +1314,7 @@ ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode)
VirtualKeyCode,
(AsciiChar >= ' ') ? AsciiChar : '.',
ShiftState);
if (! ConInRec->Fake || ! ConInRec->NotChar)
{
/* FIXME - convert to ascii */
@ -1339,7 +1339,7 @@ Console_Api (PVOID unused)
PrivateCsrssRegisterPrimitive();
/* This call turns on the input system in win32k */
PrivateCsrssAcquireOrReleaseInputOwnership(FALSE);
while (TRUE)
{
GetMessageW(&msg, 0, 0, 0);
@ -1362,7 +1362,7 @@ CSR_API(CsrGetScreenBufferInfo)
NTSTATUS Status;
PCSRSS_SCREEN_BUFFER Buff;
PCONSOLE_SCREEN_BUFFER_INFO pInfo;
DPRINT("CsrGetScreenBufferInfo\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
@ -1399,7 +1399,7 @@ CSR_API(CsrSetCursor)
PCSRSS_SCREEN_BUFFER Buff;
LONG OldCursorX, OldCursorY;
LONG NewCursorX, NewCursorY;
DPRINT("CsrSetCursor\n");
Status = ConioConsoleFromProcessData(ProcessData, &Console);
@ -1491,7 +1491,7 @@ CSR_API(CsrWriteConsoleOutputChar)
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
CharSize = (Request->Data.WriteConsoleOutputCharRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
if (Request->Header.DataSize
@ -1576,7 +1576,7 @@ CSR_API(CsrFillOutputChar)
RECT UpdateRect;
DPRINT("CsrFillOutputChar\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
@ -1643,13 +1643,13 @@ CSR_API(CsrReadInputEvent)
NTSTATUS Status;
BOOLEAN Done = FALSE;
ConsoleInput *Input;
DPRINT("CsrReadInputEvent\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Reply->Data.ReadInputReply.Event = ProcessData->ConsoleEvent;
Status = ConioLockConsole(ProcessData, Request->Data.ReadInputRequest.ConsoleHandle, &Console);
if (! NT_SUCCESS(Status))
{
@ -1668,7 +1668,7 @@ CSR_API(CsrReadInputEvent)
Reply->Data.ReadInputReply.MoreEvents = TRUE;
break;
}
RemoveEntryList(&Input->ListEntry);
if (!Done && !Input->Fake)
@ -1693,7 +1693,7 @@ CSR_API(CsrReadInputEvent)
}
HeapFree(Win32CsrApiHeap, 0, Input);
}
if (Done)
{
Status = STATUS_SUCCESS;
@ -1725,7 +1725,7 @@ CSR_API(CsrWriteConsoleOutputAttrib)
RECT UpdateRect;
DPRINT("CsrWriteConsoleOutputAttrib\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
@ -1812,7 +1812,7 @@ CSR_API(CsrFillOutputAttrib)
{
return Reply->Status = Status;
}
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Status = ConioLockScreenBuffer(ProcessData, Request->Data.FillOutputAttribRequest.ConsoleHandle, &Buff);
@ -1866,7 +1866,7 @@ CSR_API(CsrGetCursorInfo)
{
PCSRSS_SCREEN_BUFFER Buff;
NTSTATUS Status;
DPRINT("CsrGetCursorInfo\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
@ -1890,7 +1890,7 @@ CSR_API(CsrSetCursorInfo)
DWORD Size;
BOOL Visible;
NTSTATUS Status;
DPRINT("CsrSetCursorInfo\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
@ -1951,7 +1951,7 @@ CSR_API(CsrSetTextAttrib)
NTSTATUS Status;
PCSRSS_CONSOLE Console;
PCSRSS_SCREEN_BUFFER Buff;
LONG OldCursorX, OldCursorY;
LONG OldCursorX, OldCursorY;
DPRINT("CsrSetTextAttrib\n");
@ -2069,7 +2069,7 @@ CSR_API(CsrCreateScreenBuffer)
PCSRSS_CONSOLE Console;
PCSRSS_SCREEN_BUFFER Buff;
NTSTATUS Status;
DPRINT("CsrCreateScreenBuffer\n");
if (ProcessData == NULL)
@ -2186,7 +2186,7 @@ CSR_API(CsrSetTitle)
Status = ConioLockConsole(ProcessData, Request->Data.SetTitleRequest.Console, &Console);
if(! NT_SUCCESS(Status))
{
Reply->Status = Status;
Reply->Status = Status;
}
else
{
@ -2211,7 +2211,7 @@ CSR_API(CsrGetTitle)
{
NTSTATUS Status;
PCSRSS_CONSOLE Console;
DPRINT("CsrGetTitle\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
@ -2224,7 +2224,7 @@ CSR_API(CsrGetTitle)
DPRINT1("Can't get console\n");
return Reply->Status = Status;
}
/* Copy title of the console to the user title buffer */
RtlZeroMemory(&Reply->Data.GetTitleReply, sizeof(CSRSS_GET_TITLE_REPLY));
Reply->Data.GetTitleReply.ConsoleHandle = Request->Data.GetTitleRequest.ConsoleHandle;
@ -2281,7 +2281,7 @@ CSR_API(CsrWriteConsoleOutput)
BufferCoord = Request->Data.WriteConsoleOutputRequest.BufferCoord;
CharInfo = Request->Data.WriteConsoleOutputRequest.CharInfo;
if (((PVOID)CharInfo < ProcessData->CsrSectionViewBase) ||
(((PVOID)CharInfo + PSize) >
(((PVOID)CharInfo + PSize) >
(ProcessData->CsrSectionViewBase + ProcessData->CsrSectionViewSize)))
{
ConioUnlockScreenBuffer(Buff);
@ -2510,9 +2510,9 @@ CSR_API(CsrReadConsoleOutputChar)
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = Reply->Header.MessageSize - LPC_MESSAGE_BASE_SIZE;
ReadBuffer = Reply->Data.ReadConsoleOutputCharReply.String;
CharSize = (Request->Data.ReadConsoleOutputCharRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
@ -2531,7 +2531,7 @@ CSR_API(CsrReadConsoleOutputChar)
for (i = 0; i < Request->Data.ReadConsoleOutputCharRequest.NumCharsToRead; ++i)
{
Char = Buff->Buffer[(Xpos * 2) + (Ypos * 2 * Buff->MaxX)];
if(Request->Data.ReadConsoleOutputCharRequest.Unicode)
{
ConsoleAnsiCharToUnicodeChar(Console, (WCHAR*)ReadBuffer, &Char);
@ -2566,7 +2566,7 @@ CSR_API(CsrReadConsoleOutputChar)
{
ConioUnlockConsole(Console);
}
Reply->Data.ReadConsoleOutputCharReply.CharsRead = (DWORD)((ULONG_PTR)ReadBuffer - (ULONG_PTR)Reply->Data.ReadConsoleOutputCharReply.String) / CharSize;
return Reply->Status;
@ -2636,7 +2636,7 @@ CSR_API(CsrGetNumberOfConsoleInputEvents)
PLIST_ENTRY CurrentItem;
DWORD NumEvents;
ConsoleInput *Input;
DPRINT("CsrGetNumberOfConsoleInputEvents\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
@ -2647,10 +2647,10 @@ CSR_API(CsrGetNumberOfConsoleInputEvents)
{
return Reply->Status = Status;
}
CurrentItem = Console->InputEvents.Flink;
NumEvents = 0;
/* If there are any events ... */
while (CurrentItem != &Console->InputEvents)
{
@ -2663,10 +2663,10 @@ CSR_API(CsrGetNumberOfConsoleInputEvents)
}
ConioUnlockConsole(Console);
Reply->Status = STATUS_SUCCESS;
Reply->Data.GetNumInputEventsReply.NumInputEvents = NumEvents;
return Reply->Status;
}
@ -2681,22 +2681,22 @@ CSR_API(CsrPeekConsoleInput)
PINPUT_RECORD InputRecord;
ConsoleInput* Item;
UINT NumItems;
DPRINT("CsrPeekConsoleInput\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Status = ConioLockConsole(ProcessData, Request->Data.GetNumInputEventsRequest.ConsoleHandle, &Console);
if(! NT_SUCCESS(Status))
{
return Reply->Status = Status;
}
InputRecord = Request->Data.PeekConsoleInputRequest.InputRecord;
Length = Request->Data.PeekConsoleInputRequest.Length;
Size = Length * sizeof(INPUT_RECORD);
if (((PVOID)InputRecord < ProcessData->CsrSectionViewBase)
|| (((PVOID)InputRecord + Size) > (ProcessData->CsrSectionViewBase + ProcessData->CsrSectionViewSize)))
{
@ -2704,13 +2704,13 @@ CSR_API(CsrPeekConsoleInput)
Reply->Status = STATUS_ACCESS_VIOLATION;
return Reply->Status ;
}
NumItems = 0;
if (! IsListEmpty(&Console->InputEvents))
{
CurrentItem = Console->InputEvents.Flink;
while (CurrentItem != &Console->InputEvents && NumItems < Length)
{
Item = CONTAINING_RECORD(CurrentItem, ConsoleInput, ListEntry);
@ -2720,7 +2720,7 @@ CSR_API(CsrPeekConsoleInput)
CurrentItem = CurrentItem->Flink;
continue;
}
++NumItems;
*InputRecord = Item->InputEvent;
@ -2728,7 +2728,7 @@ CSR_API(CsrPeekConsoleInput)
{
ConioInputEventToAnsi(Console, InputRecord);
}
InputRecord++;
CurrentItem = CurrentItem->Flink;
}
@ -2758,18 +2758,18 @@ CSR_API(CsrReadConsoleOutput)
RECT ScreenRect;
DWORD i, Y, X, Offset;
UINT CodePage;
DPRINT("CsrReadConsoleOutput\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Status = ConioLockScreenBuffer(ProcessData, Request->Data.ReadConsoleOutputRequest.ConsoleHandle, &Buff);
if (! NT_SUCCESS(Status))
{
return Reply->Status = Status;
}
CharInfo = Request->Data.ReadConsoleOutputRequest.CharInfo;
ReadRegion.left = Request->Data.ReadConsoleOutputRequest.ReadRegion.Left;
ReadRegion.top = Request->Data.ReadConsoleOutputRequest.ReadRegion.Top;
@ -2782,7 +2782,7 @@ CSR_API(CsrReadConsoleOutput)
/* FIXME: Is this correct? */
CodePage = ProcessData->Console->OutputCodePage;
if (((PVOID)CharInfo < ProcessData->CsrSectionViewBase)
|| (((PVOID)CharInfo + Size) > (ProcessData->CsrSectionViewBase + ProcessData->CsrSectionViewSize)))
{
@ -2790,7 +2790,7 @@ CSR_API(CsrReadConsoleOutput)
Reply->Status = STATUS_ACCESS_VIOLATION;
return Reply->Status ;
}
SizeY = RtlRosMin(BufferSize.Y - BufferCoord.Y, ConioRectHeight(&ReadRegion));
SizeX = RtlRosMin(BufferSize.X - BufferCoord.X, ConioRectWidth(&ReadRegion));
ReadRegion.bottom = ReadRegion.top + SizeY;
@ -2807,7 +2807,7 @@ CSR_API(CsrReadConsoleOutput)
for (i = 0, Y = ReadRegion.top; Y < ReadRegion.bottom; ++i, ++Y)
{
CurCharInfo = CharInfo + (i * BufferSize.X);
Offset = (((Y + Buff->ShowY) % Buff->MaxY) * Buff->MaxX + ReadRegion.left) * 2;
for (X = ReadRegion.left; X < ReadRegion.right; ++X)
{
@ -2827,13 +2827,13 @@ CSR_API(CsrReadConsoleOutput)
}
ConioUnlockScreenBuffer(Buff);
Reply->Status = STATUS_SUCCESS;
Reply->Data.ReadConsoleOutputReply.ReadRegion.Right = ReadRegion.left + SizeX - 1;
Reply->Data.ReadConsoleOutputReply.ReadRegion.Bottom = ReadRegion.top + SizeY - 1;
Reply->Data.ReadConsoleOutputReply.ReadRegion.Left = ReadRegion.left;
Reply->Data.ReadConsoleOutputReply.ReadRegion.Top = ReadRegion.top;
return Reply->Status;
}
@ -2847,22 +2847,22 @@ CSR_API(CsrWriteConsoleInput)
DWORD Size;
DWORD i;
ConsoleInput* Record;
DPRINT("CsrWriteConsoleInput\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Status = ConioLockConsole(ProcessData, Request->Data.WriteConsoleInputRequest.ConsoleHandle, &Console);
if (! NT_SUCCESS(Status))
{
return Reply->Status = Status;
}
InputRecord = Request->Data.WriteConsoleInputRequest.InputRecord;
Length = Request->Data.WriteConsoleInputRequest.Length;
Size = Length * sizeof(INPUT_RECORD);
if (((PVOID)InputRecord < ProcessData->CsrSectionViewBase)
|| (((PVOID)InputRecord + Size) > (ProcessData->CsrSectionViewBase + ProcessData->CsrSectionViewSize)))
{
@ -2870,7 +2870,7 @@ CSR_API(CsrWriteConsoleInput)
Reply->Status = STATUS_ACCESS_VIOLATION;
return Reply->Status ;
}
for (i = 0; i < Length; i++)
{
Record = HeapAlloc(Win32CsrApiHeap, 0, sizeof(ConsoleInput));
@ -2892,7 +2892,7 @@ CSR_API(CsrWriteConsoleInput)
}
ConioUnlockConsole(Console);
Reply->Status = STATUS_SUCCESS;
Reply->Data.WriteConsoleInputReply.Length = i;
@ -2928,7 +2928,7 @@ SetConsoleHardwareState (PCSRSS_CONSOLE Console, DWORD ConsoleHwState)
Console->HardwareState = ConsoleHwState;
}
return STATUS_SUCCESS;
return STATUS_SUCCESS;
}
return STATUS_INVALID_PARAMETER_3; /* Client: (handle, set_get, [mode]) */
@ -2938,12 +2938,12 @@ CSR_API(CsrHardwareStateProperty)
{
PCSRSS_CONSOLE Console;
NTSTATUS Status;
DPRINT("CsrHardwareStateProperty\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Status = ConioLockConsole(ProcessData,
Request->Data.ConsoleHardwareStateRequest.ConsoleHandle,
&Console);
@ -2958,7 +2958,7 @@ CSR_API(CsrHardwareStateProperty)
case CONSOLE_HARDWARE_STATE_GET:
Reply->Data.ConsoleHardwareStateReply.State = Console->HardwareState;
break;
case CONSOLE_HARDWARE_STATE_SET:
DPRINT("Setting console hardware state.\n");
Reply->Status = SetConsoleHardwareState(Console, Request->Data.ConsoleHardwareStateRequest.State);
@ -2980,10 +2980,10 @@ CSR_API(CsrGetConsoleWindow)
NTSTATUS Status;
DPRINT("CsrGetConsoleWindow\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
@ -3002,10 +3002,10 @@ CSR_API(CsrSetConsoleIcon)
NTSTATUS Status;
DPRINT("CsrSetConsoleIcon\n");
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
@ -3031,7 +3031,7 @@ CSR_API(CsrGetConsoleCodePage)
{
return Reply->Status = Status;
}
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Reply->Data.GetConsoleCodePage.CodePage = Console->CodePage;
@ -3051,7 +3051,7 @@ CSR_API(CsrSetConsoleCodePage)
{
return Reply->Status = Status;
}
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
if (IsValidCodePage(Request->Data.SetConsoleCodePage.CodePage))
@ -3076,7 +3076,7 @@ CSR_API(CsrGetConsoleOutputCodePage)
{
return Reply->Status = Status;
}
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
Reply->Data.GetConsoleOutputCodePage.CodePage = Console->OutputCodePage;
@ -3096,7 +3096,7 @@ CSR_API(CsrSetConsoleOutputCodePage)
{
return Reply->Status = Status;
}
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - LPC_MESSAGE_BASE_SIZE;
if (IsValidCodePage(Request->Data.SetConsoleOutputCodePage.CodePage))
@ -3119,15 +3119,15 @@ CSR_API(CsrGetProcessList)
NTSTATUS Status;
DPRINT("CsrGetProcessList\n");
Buffer = Reply->Data.GetProcessListReply.ProcessId;
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
Reply->Header.DataSize = Reply->Header.MessageSize - LPC_MESSAGE_BASE_SIZE;
nItems = nCopied = 0;
Reply->Data.GetProcessListReply.nProcessIdsCopied = 0;
Reply->Data.GetProcessListReply.nProcessIdsTotal = 0;
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
@ -3149,10 +3149,10 @@ CSR_API(CsrGetProcessList)
}
ConioUnlockConsole(Console);
Reply->Data.GetProcessListReply.nProcessIdsCopied = nCopied;
Reply->Data.GetProcessListReply.nProcessIdsTotal = nItems;
return Reply->Status = STATUS_SUCCESS;
}

View file

@ -3,7 +3,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: subsys/csrss/win32csr/dllmain.c
* PURPOSE: Initialization
* PURPOSE: Initialization
*/
/* INCLUDES ******************************************************************/

View file

@ -126,20 +126,20 @@ GuiConsoleHandleNcCreate(HWND hWnd, CREATESTRUCTW *Create)
SelectObject(Dc, OldFont);
GuiData->MemoryDC = CreateCompatibleDC(Dc);
GuiData->MemoryBitmap = CreateCompatibleBitmap(Dc,
Console->Size.X * GuiData->CharWidth,
GuiData->MemoryBitmap = CreateCompatibleBitmap(Dc,
Console->Size.X * GuiData->CharWidth,
Console->Size.Y * GuiData->CharHeight);
/* NOTE: Don't delete the "first bitmap", it's done in DeleteDC. */
SelectObject(GuiData->MemoryDC, GuiData->MemoryBitmap);
/* NOTE: Don't delete stock font. */
SelectObject(GuiData->MemoryDC, GuiData->Font);
SelectObject(GuiData->MemoryDC, GuiData->Font);
ReleaseDC(hWnd, Dc);
GuiData->CursorBlinkOn = TRUE;
GuiData->ForceCursorOff = FALSE;
GuiData->Selection.left = -1;
Console->PrivateData = GuiData;
SetWindowLongPtrW(hWnd, GWL_USERDATA, (DWORD_PTR) Console);
@ -192,7 +192,7 @@ static VOID FASTCALL
GuiConsoleUpdateSelection(HWND hWnd, PRECT rc, PGUI_CONSOLE_DATA GuiData)
{
RECT oldRect = GuiData->Selection;
if(rc != NULL)
{
RECT changeRect = *rc;
@ -203,7 +203,7 @@ GuiConsoleUpdateSelection(HWND hWnd, PRECT rc, PGUI_CONSOLE_DATA GuiData)
changeRect.top *= GuiData->CharHeight;
changeRect.right *= GuiData->CharWidth;
changeRect.bottom *= GuiData->CharHeight;
if(rc->left != oldRect.left ||
rc->top != oldRect.top ||
rc->right != oldRect.right ||
@ -212,12 +212,12 @@ GuiConsoleUpdateSelection(HWND hWnd, PRECT rc, PGUI_CONSOLE_DATA GuiData)
if(oldRect.left != -1)
{
HRGN rgn1, rgn2;
oldRect.left *= GuiData->CharWidth;
oldRect.top *= GuiData->CharHeight;
oldRect.right *= GuiData->CharWidth;
oldRect.bottom *= GuiData->CharHeight;
/* calculate the region that needs to be updated */
if((rgn1 = CreateRectRgnIndirect(&oldRect)))
{
@ -316,7 +316,7 @@ GuiConsoleUpdateBitmap(HWND hWnd, RECT rc)
GuiConsoleSetTextColors(GuiData->MemoryDC, Attribute);
LastAttribute = Attribute;
}
}
}
MultiByteToWideChar(Console->OutputCodePage, 0, (PCHAR)From, 1, To, 1);
To++;
From += 2;
@ -372,22 +372,22 @@ GuiConsoleHandlePaint(HWND hWnd)
Ps.rcPaint.right - Ps.rcPaint.left + 1,
Ps.rcPaint.bottom - Ps.rcPaint.top + 1, GuiData->MemoryDC,
Ps.rcPaint.left, Ps.rcPaint.top, SRCCOPY);
if (GuiData->Selection.left != -1)
{
RECT rc = GuiData->Selection;
rc.left *= GuiData->CharWidth;
rc.top *= GuiData->CharHeight;
rc.right *= GuiData->CharWidth;
rc.bottom *= GuiData->CharHeight;
if (IntersectRect(&rc, &Ps.rcPaint, &rc))
{
{
PatBlt(Dc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, DSTINVERT);
}
}
}
}
EndPaint (hWnd, &Ps);
LeaveCriticalSection(&GuiData->Lock);
}
@ -410,7 +410,7 @@ GuiConsoleHandleKey(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Message.message = msg;
Message.wParam = wParam;
Message.lParam = lParam;
if(msg == WM_CHAR || msg == WM_SYSKEYDOWN)
{
/* clear the selection */
@ -610,7 +610,7 @@ GuiConsoleLeftMouseDown(HWND hWnd, LPARAM lParam)
PGUI_CONSOLE_DATA GuiData;
POINTS pt;
RECT rc;
GuiConsoleGetDataPointers(hWnd, &Console, &GuiData);
if (Console == NULL || GuiData == NULL) return;
@ -620,14 +620,14 @@ GuiConsoleLeftMouseDown(HWND hWnd, LPARAM lParam)
rc.top = pt.y / GuiData->CharHeight;
rc.right = rc.left + 1;
rc.bottom = rc.top + 1;
GuiData->SelectionStart.x = rc.left;
GuiData->SelectionStart.y = rc.top;
SetCapture(hWnd);
GuiData->MouseDown = TRUE;
GuiConsoleUpdateSelection(hWnd, &rc, GuiData);
}
@ -638,13 +638,13 @@ GuiConsoleLeftMouseUp(HWND hWnd, LPARAM lParam)
PGUI_CONSOLE_DATA GuiData;
RECT rc;
POINTS pt;
GuiConsoleGetDataPointers(hWnd, &Console, &GuiData);
if (Console == NULL || GuiData == NULL) return;
if (GuiData->Selection.left == -1 || !GuiData->MouseDown) return;
pt = MAKEPOINTS(lParam);
rc.left = GuiData->SelectionStart.x;
rc.top = GuiData->SelectionStart.y;
rc.right = (pt.x >= 0 ? (pt.x / GuiData->CharWidth) + 1 : 0);
@ -665,11 +665,11 @@ GuiConsoleLeftMouseUp(HWND hWnd, LPARAM lParam)
rc.top = max(rc.bottom - 1, 0);
rc.bottom = tmp + 1;
}
GuiData->MouseDown = FALSE;
GuiConsoleUpdateSelection(hWnd, &rc, GuiData);
ReleaseCapture();
}
@ -680,9 +680,9 @@ GuiConsoleMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
PGUI_CONSOLE_DATA GuiData;
RECT rc;
POINTS pt;
if (!(wParam & MK_LBUTTON)) return;
GuiConsoleGetDataPointers(hWnd, &Console, &GuiData);
if (Console == NULL || GuiData == NULL || !GuiData->MouseDown) return;
@ -710,14 +710,14 @@ GuiConsoleMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
}
GuiConsoleUpdateSelection(hWnd, &rc, GuiData);
}
}
static VOID FASTCALL
GuiConsoleRightMouseDown(HWND hWnd)
{
PCSRSS_CONSOLE Console;
PGUI_CONSOLE_DATA GuiData;
GuiConsoleGetDataPointers(hWnd, &Console, &GuiData);
if (Console == NULL || GuiData == NULL) return;
@ -728,11 +728,11 @@ GuiConsoleRightMouseDown(HWND hWnd)
else
{
/* FIXME - copy selection to clipboard */
GuiConsoleUpdateSelection(hWnd, NULL, GuiData);
}
}
}
static LRESULT CALLBACK
GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
@ -1043,7 +1043,7 @@ GuiConsoleCopyRegion(HWND hWnd,
ScrollRect.top = Dest->top * GuiData->CharHeight;
ScrollRect.bottom = (Dest->bottom + 1) * GuiData->CharHeight;
EnterCriticalSection(&GuiData->Lock);
BitBlt(GuiData->MemoryDC, ScrollRect.left, ScrollRect.top,
BitBlt(GuiData->MemoryDC, ScrollRect.left, ScrollRect.top,
ScrollRect.right - ScrollRect.left, ScrollRect.bottom - ScrollRect.top,
GuiData->MemoryDC, Source->left * GuiData->CharWidth, Source->top * GuiData->CharHeight, SRCCOPY);

View file

@ -29,7 +29,7 @@ TuiInit(VOID)
{
CONSOLE_SCREEN_BUFFER_INFO ScrInfo;
DWORD BytesReturned;
ConsoleDeviceHandle = CreateFileW(L"\\\\.\\BlueScreen", FILE_ALL_ACCESS, 0, NULL,
OPEN_EXISTING, 0, NULL);
if (INVALID_HANDLE_VALUE == ConsoleDeviceHandle)
@ -109,9 +109,9 @@ TuiDrawRegion(PCSRSS_CONSOLE Console, RECT *Region)
ConsoleDraw->SizeY = ConioRectHeight(Region);
ConsoleDraw->CursorX = CursorX;
ConsoleDraw->CursorY = CursorY;
TuiCopyRect((char *) (ConsoleDraw + 1), Buff, Region);
if (! DeviceIoControl(ConsoleDeviceHandle, IOCTL_CONSOLE_DRAW,
NULL, 0, ConsoleDraw, ConsoleDrawSize, &BytesReturned, NULL))
{
@ -213,7 +213,7 @@ TuiCleanupConsole(PCSRSS_CONSOLE Console)
Console->Next->Prev = Console->Prev;
}
LeaveCriticalSection(&ActiveConsoleLock);
if (NULL != ActiveConsole)
{
ConioDrawConsole(ActiveConsole);
@ -291,7 +291,7 @@ TuiSwapConsole(int Next)
{
SwapConsole = ActiveConsole;
}
SwapConsole = (0 < Next ? SwapConsole->Next : SwapConsole->Prev);
Title.MaximumLength = RtlUnicodeStringToAnsiSize(&SwapConsole->Title);
Title.Length = 0;

View file

@ -1,5 +1,5 @@
/* $Id$
*
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: subsys/ntvdm/ntvdm->c
@ -139,7 +139,7 @@ BOOL ReadConfigForVDM(PVDM_CONTROL_BLOCK vdm)
BOOL result = TRUE;
DWORD dwError;
HANDLE hFile;
hFile = CreateFileW(L"\\system32\\config.nt",
GENERIC_READ,
FILE_SHARE_READ,
@ -187,7 +187,7 @@ BOOL
LoadConfigDriversForVDM(PVDM_CONFIG vdmConfig)
{
BOOL result = TRUE;
return result;
}
@ -195,7 +195,7 @@ BOOL
SetConfigOptionsForVDM(PVDM_AUTOEXEC vdmAutoexec)
{
BOOL result = TRUE;
return result;
}
@ -225,9 +225,9 @@ CreateVDM(PVDM_CONTROL_BLOCK vdm)
//SetLastError();
return FALSE;
}
}
GetSystemInfo(&inf);
vdm->hHeap = HeapCreate(0, inf.dwAllocationGranularity, 0);
if (vdm->hHeap == NULL) {
@ -295,7 +295,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
//SetLastError();
return 2;
}
ReadConfigForVDM(&VdmCB);
if (!LoadConfigDriversForVDM(&(VdmCB.vdmConfig))) {

View file

@ -1,9 +1,9 @@
/* $Id$
*
* init.c - Session Manager initialization
*
*
* ReactOS Operating System
*
*
* --------------------------------------------------------------------
*
* This software is free software; you can redistribute it and/or
@ -19,7 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
@ -105,7 +105,7 @@ InitSessionManager(VOID)
Status = InitRoutine[i].EntryPoint();
if(!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: failed to %s (Status=%lx)\n",
DPRINT1("SM: %s: failed to %s (Status=%lx)\n",
__FUNCTION__,
InitRoutine[i].ErrorMessage,
Status);

View file

@ -38,7 +38,7 @@ SM_PORT_API SmApi [] =
SmQryInfo /* smapyqry.c */
};
/* TODO: optimize this address computation (it should be done
/* TODO: optimize this address computation (it should be done
* with a macro) */
PSM_CONNECT_DATA FASTCALL SmpGetConnectData (PSM_PORT_MESSAGE Request)
{
@ -69,7 +69,7 @@ SmpCallbackServer (PSM_PORT_MESSAGE Request,
ULONG CallbackPortNameLength = SM_SB_NAME_MAX_LENGTH; /* TODO: compute length */
SB_CONNECT_DATA SbConnectData;
ULONG SbConnectDataLength = sizeof SbConnectData;
DPRINT("SM: %s called\n", __FUNCTION__);
if(IMAGE_SUBSYSTEM_NATIVE == ConnectData->SubSystemId)
@ -183,7 +183,7 @@ SmpHandleConnectionRequest (PSM_PORT_MESSAGE Request)
HANDLE hClientDataApiPortThread = (HANDLE) 0;
PHANDLE ClientDataApiPortThread = & hClientDataApiPortThread;
PVOID Context = NULL;
DPRINT("SM: %s called:\n SubSystemID=%d\n SbName=\"%S\"\n",
__FUNCTION__, ConnectData->SubSystemId, ConnectData->SbName);
@ -228,7 +228,7 @@ SmpHandleConnectionRequest (PSM_PORT_MESSAGE Request)
ClientDataApiPortThread = & ClientData->ApiPortThread;
/*
* Call back the candidate environment subsystem
* server (use the port name sent in in the
* server (use the port name sent in in the
* connection request message).
*/
Status = SmpCallbackServer (Request, ClientData);
@ -313,7 +313,7 @@ SmpHandleConnectionRequest (PSM_PORT_MESSAGE Request)
* we need a thread to listen for connection request that
* creates a new thread for each connected port. This is not
* necessary in NT LPC, because server side connected ports are
* never used to receive requests.
* never used to receive requests.
*/
VOID STDCALL
SmpApiThread (HANDLE ListeningPort)
@ -322,7 +322,7 @@ SmpApiThread (HANDLE ListeningPort)
LPC_MAX_MESSAGE Request = {{0}};
DPRINT("SM: %s called\n", __FUNCTION__);
while (TRUE)
{
Status = NtListenPort (ListeningPort, & Request.Header);

View file

@ -1,9 +1,9 @@
/* $Id$
*
* smss.c - Session Manager
*
*
* ReactOS Operating System
*
*
* --------------------------------------------------------------------
*
* This software is free software; you can redistribute it and/or
@ -19,7 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
@ -39,7 +39,7 @@ NtProcessStartup(PPEB Peb)
{
NTSTATUS Status;
PROCESS_BASIC_INFORMATION PBI = {0};
PrintString("ReactOS Session Manager %s (Build %s)\n",
KERNEL_RELEASE_STR,
KERNEL_VERSION_BUILD_STR);

View file

@ -90,7 +90,7 @@ typedef struct _SM_CLIENT_DATA
HANDLE SbApiPort;
WCHAR SbApiPortName [SM_SB_NAME_MAX_LENGTH];
struct _SM_CLIENT_DATA * Next;
} SM_CLIENT_DATA, *PSM_CLIENT_DATA;
NTSTATUS SmInitializeClientManagement(VOID);
NTSTATUS STDCALL SmCreateClient(PSM_PORT_MESSAGE,PSM_CLIENT_DATA*);

View file

@ -73,7 +73,7 @@ NtProcessStartup(PPEB Peb)
NTSTATUS Status;
PrintString("Autochk 0.0.1\n");
Status = NtQueryInformationProcess(NtCurrentProcess(),
ProcessDeviceMap,
&DeviceMap.Query,

View file

@ -26,7 +26,7 @@
* Redirection safe!
*
* 02-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
@ -236,7 +236,7 @@ VOID DestroyAlias (VOID)
/* specified routines */
VOID ExpandAlias (LPTSTR cmd, INT maxlen)
{
{
unsigned n = 0,
m,
i,
@ -279,7 +279,7 @@ VOID ExpandAlias (LPTSTR cmd, INT maxlen)
{
m = _tcslen (ptr->lpSubst);
if ((int)(_tcslen (cmd) - len + m - n) > maxlen)
{
{
ConErrResPuts(STRING_ALIAS_ERROR);
/* the parser won't cause any problems with an empty line */
@ -303,11 +303,11 @@ VOID ExpandAlias (LPTSTR cmd, INT maxlen)
INT CommandAlias (LPTSTR cmd, LPTSTR param)
{
{
LPTSTR ptr;
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_ALIAS_HELP);
return 0;
}

View file

@ -29,7 +29,7 @@
* Added handling of multiple filenames.
*
* 02-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -188,7 +188,7 @@ ChangeAttribute (LPTSTR pszPath, LPTSTR pszFile, DWORD dwMask,
INT CommandAttrib (LPTSTR cmd, LPTSTR param)
{
{
LPTSTR *arg;
INT argc, i;
TCHAR szPath[MAX_PATH];
@ -204,7 +204,7 @@ INT CommandAttrib (LPTSTR cmd, LPTSTR param)
/* print help */
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_ATTRIB_HELP);
return 0;
}

View file

@ -50,12 +50,12 @@
* 26-Jan-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
* Replaced CRT io functions by Win32 io functions.
* Unicode safe!
*
*
* 23-Feb-2001 (Carl Nettelblad <cnettel@hem.passagen.es>)
* Fixes made to get "for" working.
*
* 02-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -216,7 +216,7 @@ VOID ExitBatch (LPTSTR msg)
*/
BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
{
{
HANDLE hFile;
hFile = CreateFile (fullname, GENERIC_READ, FILE_SHARE_READ, NULL,
@ -229,7 +229,7 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
#endif
if (hFile == INVALID_HANDLE_VALUE)
{
{
ConErrResPuts(STRING_BATCH_ERROR);
return FALSE;
}

View file

@ -21,7 +21,7 @@
* Redirection ready!
*
* 02-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -33,7 +33,7 @@
INT cmd_beep (LPTSTR cmd, LPTSTR param)
{
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
{
ConOutResPuts(STRING_BEEP_HELP);
return 0;
}

View file

@ -25,7 +25,7 @@
* Unicode and redirection safe!
*
* 02-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -42,14 +42,14 @@
*/
INT cmd_call (LPTSTR cmd, LPTSTR param)
{
{
LPBATCH_CONTEXT n = NULL;
#ifdef _DEBUG
DebugPrintf (_T("cmd_call: (\'%s\',\'%s\')\n"), cmd, param);
#endif
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_CALL_HELP);
return 0;
}

View file

@ -8,7 +8,7 @@
* Started.
*
* 02-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -28,7 +28,7 @@ INT CommandChcp (LPTSTR cmd, LPTSTR param)
/* print help */
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_CHCP_HELP);
return 0;
}
@ -67,12 +67,12 @@ INT CommandChcp (LPTSTR cmd, LPTSTR param)
}
if (!SetConsoleCP(uNewCodePage))
{
{
ConErrResPuts(STRING_CHCP_ERROR4);
}
else
{
SetConsoleOutputCP (uNewCodePage);
InitLocale ();
InputCodePage= GetConsoleCP();

View file

@ -127,7 +127,7 @@ CommandChoice (LPTSTR cmd, LPTSTR param)
lpOptions = Options;
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
{
ConOutResPuts(STRING_CHOICE_HELP);
return 0;
}
@ -167,7 +167,7 @@ CommandChoice (LPTSTR cmd, LPTSTR param)
lpOptions = &arg[i][2];
if (_tcslen (lpOptions) == 0)
{
{
ConErrResPuts(STRING_CHOICE_ERROR);
freep (arg);
return 1;
@ -197,7 +197,7 @@ CommandChoice (LPTSTR cmd, LPTSTR param)
}
if (*s != _T(','))
{
{
ConErrResPuts(STRING_CHOICE_ERROR_TXT);
freep (arg);
return 1;

View file

@ -23,7 +23,7 @@
* Redirection ready!
*
* 02-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -32,13 +32,13 @@
#ifdef INCLUDE_CMD_CLS
INT cmd_cls (LPTSTR cmd, LPTSTR param)
{
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
COORD coPos;
DWORD dwWritten;
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_CLS_HELP);
return 0;
}

View file

@ -130,7 +130,7 @@
* Added ShellExecute call when all else fails to be able to "launch" any file.
*
* 02-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -922,7 +922,7 @@ ProcessInput (BOOL bFlag)
LPTSTR ip;
LPTSTR cp;
BOOL bEchoThisLine;
do
{
@ -1035,7 +1035,7 @@ ProcessInput (BOOL bFlag)
*/
BOOL WINAPI BreakHandler (DWORD dwCtrlType)
{
if ((dwCtrlType != CTRL_C_EVENT) &&
(dwCtrlType != CTRL_BREAK_EVENT))
return FALSE;
@ -1075,27 +1075,27 @@ VOID RemoveBreakHandler (VOID)
#if 0
static VOID
ShowCommands (VOID)
{
/* print command list */
{
/* print command list */
ConOutResPuts(STRING_CMD_HELP1);
PrintCommandList();
/* print feature list */
/* print feature list */
ConOutResPuts(STRING_CMD_HELP2);
#ifdef FEATURE_ALIASES
#ifdef FEATURE_ALIASES
ConOutResPuts(STRING_CMD_HELP3);
#endif
#ifdef FEATURE_HISTORY
#ifdef FEATURE_HISTORY
ConOutResPuts(STRING_CMD_HELP4);
#endif
#ifdef FEATURE_UNIX_FILENAME_COMPLETION
#ifdef FEATURE_UNIX_FILENAME_COMPLETION
ConOutResPuts(STRING_CMD_HELP5);
#endif
#ifdef FEATURE_DIRECTORY_STACK
#ifdef FEATURE_DIRECTORY_STACK
ConOutResPuts(STRING_CMD_HELP6);
#endif
#ifdef FEATURE_REDIRECTION
#ifdef FEATURE_REDIRECTION
ConOutResPuts(STRING_CMD_HELP7);
#endif
ConOutChar(_T('\n'));
@ -1111,7 +1111,7 @@ ShowCommands (VOID)
*/
static VOID
Initialize (int argc, TCHAR* argv[])
{
{
TCHAR commandline[CMDLINE_LENGTH];
TCHAR ModuleName[_MAX_PATH + 1];
INT i;
@ -1143,7 +1143,7 @@ Initialize (int argc, TCHAR* argv[])
if (argc >= 2 && !_tcsncmp (argv[1], _T("/?"), 2))
{
{
ConOutResPuts(STRING_CMD_HELP8);
ExitProcess(0);
}
@ -1286,13 +1286,13 @@ static VOID Cleanup (int argc, TCHAR *argv[])
/* run cmdexit.bat */
if (IsExistingFile (_T("cmdexit.bat")))
{
{
ConErrResPuts(STRING_CMD_ERROR5);
ParseCommandLine (_T("cmdexit.bat"));
}
else if (IsExistingFile (_T("\\cmdexit.bat")))
{
{
ConErrResPuts (STRING_CMD_ERROR5);
ParseCommandLine (_T("\\cmdexit.bat"));
}

View file

@ -165,13 +165,13 @@ VOID ReadCommand (LPTSTR str, INT maxlen)
{
#ifdef FEATURE_HISTORY
case 'K':
/*add the current command line to the history*/
if (ir.Event.KeyEvent.dwControlKeyState &
(LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED))
{
if (str[0])
History(0,str);
@ -189,7 +189,7 @@ VOID ReadCommand (LPTSTR str, INT maxlen)
(LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED))
{
ClearCommandLine (str, maxlen, orgx, orgy);
History_del_current_entry(str);
History_del_current_entry(str);
current = charcount = _tcslen (str);
ConOutPrintf (_T("%s"), str);
GetCursorXY (&curx, &cury);
@ -201,7 +201,7 @@ VOID ReadCommand (LPTSTR str, INT maxlen)
}
}
@ -353,7 +353,7 @@ VOID ReadCommand (LPTSTR str, INT maxlen)
orgy + (orgx + current) / maxx);
GetCursorXY (&curx, &cury);
}
}
}
else

View file

@ -113,7 +113,7 @@ COMMAND cmds[] =
{_T("goto"), CMD_BATCHONLY, cmd_goto},
#ifdef FEATURE_HISTORY
#ifdef FEATURE_HISTORY
{_T("history"), 0, CommandHistory},
#endif

View file

@ -37,10 +37,10 @@ VOID SetScreenColor (WORD wColor, BOOL bFill)
DWORD dwWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
COORD coPos;
if ((wColor & 0xF) == (wColor &0xF0) >> 4)
{
{
ConErrResPuts(STRING_COLOR_ERROR1);
}
else
@ -86,7 +86,7 @@ INT CommandColor (LPTSTR first, LPTSTR rest)
}
if (StringToColor(&wColor, &rest) == FALSE)
{
{
ConErrResPuts(STRING_COLOR_ERROR2);
return 1;
}

View file

@ -8,7 +8,7 @@
* started
*
* 03-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
@ -186,7 +186,7 @@ VOID ConPuts(LPTSTR szText, DWORD nStdHandle)
VOID ConOutResPuts (UINT resID)
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR szMsg[RC_STRING_MAX_SIZE];
LoadString(CMD_ModuleHandle, resID, szMsg, RC_STRING_MAX_SIZE);
ConPuts(szMsg, STD_OUTPUT_HANDLE);
@ -237,7 +237,7 @@ VOID ConOutFormatMessage (DWORD MessageId, ...)
(LPTSTR) &text,
0,
&arg_ptr);
va_end (arg_ptr);
if(ret > 0)
{
@ -268,7 +268,7 @@ VOID ConErrChar (TCHAR c)
VOID ConErrResPuts (UINT resID)
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR szMsg[RC_STRING_MAX_SIZE];
LoadString(CMD_ModuleHandle, resID, szMsg, RC_STRING_MAX_SIZE);
ConPuts(szMsg, STD_ERROR_HANDLE);
}

View file

@ -21,7 +21,7 @@
* Disabled prompting when used in batch mode.
*
* 03-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -247,7 +247,7 @@ ParseCommand (LPFILES f, int argc, TCHAR **arg, LPDWORD lpdwFlags)
{
// Make sure we have a clean workable path
GetFullPathName( arg[i], 128, (LPTSTR) &temp, NULL);
// printf("A Input %s, Output %s\n", arg[i], temp);
@ -261,7 +261,7 @@ ParseCommand (LPFILES f, int argc, TCHAR **arg, LPDWORD lpdwFlags)
GetFullPathName( arg[i], 128, (LPTSTR) &temp, NULL);
// printf("B Input %s, Output %s\n", arg[i], temp);
if (!AddFiles(f, (TCHAR *) &temp, &source, &dest, &count, lpdwFlags))
return -1;
while (f->next != NULL)
@ -300,9 +300,9 @@ Overwrite (LPTSTR fn)
TCHAR szOptions[4];
LoadString( CMD_ModuleHandle, STRING_COPY_OPTION, szOptions, 4);
ConOutResPuts(STRING_COPY_HELP1);
ConInString(inp, 10);
ConOutPuts(_T(""));
@ -375,7 +375,7 @@ int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
{
LoadString(CMD_ModuleHandle, STRING_COPY_ERROR2, szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, source);
CloseHandle (hFileSrc);
return 0;
}
@ -448,7 +448,7 @@ int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
WriteFile (hFileDest, buffer, dwRead, &dwWritten, NULL);
if (dwWritten != dwRead)
{
{
ConErrResPuts(STRING_COPY_ERROR3);
free (buffer);
@ -564,7 +564,7 @@ SetupCopy (LPFILES sources, TCHAR **p, BOOL bMultiple,
{
// printf("Merge DIR\n");
bMultiple = FALSE;
_tcscat (from_merge, _T("\\"));
_tcscat (from_merge, find.cFileName);
@ -624,7 +624,7 @@ SetupCopy (LPFILES sources, TCHAR **p, BOOL bMultiple,
INT cmd_copy (LPTSTR first, LPTSTR rest)
{
{
TCHAR **p;
TCHAR drive_d[_MAX_DRIVE];
TCHAR dir_d[_MAX_DIR];
@ -645,7 +645,7 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
DWORD dwFlags = 0;
if (!_tcsncmp (rest, _T("/?"), 2))
{
{
ConOutResPuts(STRING_COPY_HELP2);
return 1;
}
@ -717,7 +717,7 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
copied = SetupCopy (sources, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags);
}
else if (bDestFound && bWildcards)
{
{
ConErrResPuts(STRING_COPY_ERROR4);
DeleteFileList (sources);

View file

@ -28,7 +28,7 @@
* Fixed date input bug.
*
* 03-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -183,7 +183,7 @@ ParseDate (LPTSTR s)
INT cmd_date (LPTSTR cmd, LPTSTR param)
{
{
LPTSTR *arg;
INT argc;
INT i;
@ -191,7 +191,7 @@ INT cmd_date (LPTSTR cmd, LPTSTR param)
INT nDateString = -1;
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_DATE_HELP4);
return 0;
}
@ -236,7 +236,7 @@ INT cmd_date (LPTSTR cmd, LPTSTR param)
return 0;
}
ConErrResPuts(STRING_DATE_ERROR);
}
}
else
@ -246,7 +246,7 @@ INT cmd_date (LPTSTR cmd, LPTSTR param)
freep (arg);
return 0;
}
ConErrResPuts(STRING_DATE_ERROR);
}

View file

@ -111,13 +111,13 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
LONG ch;
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_DEL_HELP1);
return 0;
}
arg = split (param, &args, FALSE);
if (args > 0)
{
/* check for options anywhere in command line */
@ -240,11 +240,11 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
#endif
/* ask for deleting */
if (dwFlags & DEL_PROMPT)
if (dwFlags & DEL_PROMPT)
{
LoadString(CMD_ModuleHandle, STRING_DEL_ERROR5, szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, szFullPath);
LoadString(CMD_ModuleHandle, STRING_DEL_ERROR6, szMsg, RC_STRING_MAX_SIZE);
res = FilePromptYN ((LPTSTR)szMsg);

View file

@ -16,12 +16,12 @@
INT CommandDelay (LPTSTR cmd, LPTSTR param)
{
{
DWORD val;
DWORD mul=1000;
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
{
ConOutResPuts(STRING_DELAY_HELP);
return 0;
}

View file

@ -109,7 +109,7 @@
*
* 01-Mar-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
* Replaced all runtime io functions by their Win32 counterparts.
*
*
* 23-Feb-2001 (Carl Nettelblad <cnettel@hem.passagen.se>)
* dir /s now works in deeper trees
*
@ -248,7 +248,7 @@ DirReadParam(LPTSTR Line, /* [IN] The line with the parameters & switches */
/* No parameters yet */
*param = NULL;
ptrLast = NULL;
/* We suppose that switch parameters
were given to avoid setting them to default
if the switch was not given */
@ -263,7 +263,7 @@ DirReadParam(LPTSTR Line, /* [IN] The line with the parameters & switches */
/* we save current character as it is and its upper case */
cCurChar = *Line;
cCurUChar = _totupper(*Line);
/* 1st section (see README_DIR.txt) */
/* When a switch is expecting */
if (cCurSwitch == _T('/'))
@ -513,7 +513,7 @@ DirReadParam(LPTSTR Line, /* [IN] The line with the parameters & switches */
if ((cCurChar != _T('-')) && bPNegative)
bPNegative = FALSE;
}
Line++;
}
/* Terminate the parameters */
@ -567,18 +567,18 @@ ExtendFilespec (LPTSTR file)
if (!file)
return;
/* if no file spec, change to "*.*" */
if (*file == _T('\0'))
{
_tcscpy (file, _T("*.*"));
{
_tcscpy (file, _T("*.*"));
return;
}
// add support for *.
if ((file[0] == _T('*')) && (file[1] == _T('.') ))
{
{
return;
}
@ -592,17 +592,17 @@ ExtendFilespec (LPTSTR file)
/* if no . add .* */
if (!_tcschr (file, _T('.')))
{
_tcscat (file, _T(".*"));
_tcscat (file, _T(".*"));
return;
}
/* if last character is '.' add '*' */
len = _tcslen (file);
if (file[len - 1] == _T('.'))
{
_tcscat (file, _T("*"));
_tcscat (file, _T("*"));
return;
}
}
@ -1110,7 +1110,7 @@ PrintSummary(LPTSTR szPath,
/*
* getExt
*
* Get the extension of a filename
* Get the extension of a filename
*/
TCHAR* getExt(const TCHAR* file)
{
@ -1142,11 +1142,11 @@ static LPTSTR getName(const TCHAR* file, TCHAR * dest)
iLen = _tcslen(file);
else
iLen = (end - file);
_tcsncpy(dest, file, iLen);
*(dest + iLen) = _T('\0');
return dest;
}
@ -1344,14 +1344,14 @@ ULARGE_INTEGER u64FileSize; /* The file size */
_tcscpy(szExt, getExt( ptrFiles[i]->cFileName));
}
/* Calculate size */
if (ptrFiles[i]->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
/* Calculate size */
if (ptrFiles[i]->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
/* Directory, no size it's a directory*/
iSizeFormat = -17;
_tcscpy(szSize, _T("<DIR>"));
}
else
else
{
/* File */
iSizeFormat = 17;
@ -1359,7 +1359,7 @@ ULARGE_INTEGER u64FileSize; /* The file size */
u64FileSize.LowPart = ptrFiles[i]->nFileSizeLow;
ConvertULargeInteger(u64FileSize, szSize, 20, lpFlags->bTSeperator);
}
/* Format date and time */
DirPrintFileDateTime(szDate,szTime,ptrFiles[i],lpFlags);
@ -1414,7 +1414,7 @@ DirPrintBareList(LPWIN32_FIND_DATA ptrFiles[], /* [IN] Files' Info */
/*
* DirPrintFiles
*
*
* The functions that prints the files list
*/
static VOID
@ -1545,9 +1545,9 @@ CompareFiles(LPWIN32_FIND_DATA lpFile1, /* [IN] A pointer to WIN32_FIND_DATA of
u64File1.HighPart = lpFile1->ftLastWriteTime.dwHighDateTime ;
u64File2.LowPart = lpFile2->ftLastWriteTime.dwLowDateTime;
u64File2.HighPart = lpFile2->ftLastWriteTime.dwHighDateTime ;
break;
break;
}
/* In case that differnce is too big for a long */
if (u64File1.QuadPart < u64File2.QuadPart)
iComp = -1;
@ -1566,7 +1566,7 @@ CompareFiles(LPWIN32_FIND_DATA lpFile1, /* [IN] A pointer to WIN32_FIND_DATA of
the files/dirs,there is no need to calculate the others*/
if (iComp != 0) break;
}
/* Translate the value of iComp to boolean */
if (iComp > 0)
return TRUE;
@ -1719,7 +1719,7 @@ TCHAR szMsg[RC_STRING_MAX_SIZE];
/* Continue at next node at linked list */
ptrNextNode = ptrNextNode->ptrNext;
dwCount ++;
/* Grab statistics */
if (wfdFileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
@ -1743,7 +1743,7 @@ TCHAR szMsg[RC_STRING_MAX_SIZE];
/* Terminate list */
ptrNextNode->ptrNext = NULL;
/* Calculate and allocate space need for making an array of pointers */
/* Calculate and allocate space need for making an array of pointers */
ptrFileArray = malloc(sizeof(LPWIN32_FIND_DATA) * dwCount);
if (ptrFileArray == NULL)
{
@ -1779,7 +1779,7 @@ TCHAR szMsg[RC_STRING_MAX_SIZE];
/* Print Data */
DirPrintFiles(ptrFileArray, dwCount, szFullPath, lpFlags);
/* Free array */
free(ptrFileArray);

View file

@ -136,13 +136,13 @@ INT GetDirectoryStackDepth (VOID)
* pushd command
*/
INT CommandPushd (LPTSTR first, LPTSTR rest)
{
{
TCHAR curPath[MAX_PATH];
TCHAR newPath[MAX_PATH];
BOOL bChangePath = FALSE;
if (!_tcsncmp (rest, _T("/?"), 2))
{
{
ConOutResPuts(STRING_DIRSTACK_HELP1);
return 0;
}
@ -172,7 +172,7 @@ INT CommandPopd (LPTSTR first, LPTSTR rest)
TCHAR szPath[MAX_PATH];
if (!_tcsncmp(rest, _T("/?"), 2))
{
{
ConOutResPuts(STRING_DIRSTACK_HELP2);
return 0;
}
@ -193,11 +193,11 @@ INT CommandPopd (LPTSTR first, LPTSTR rest)
* dirs command
*/
INT CommandDirs (LPTSTR first, LPTSTR rest)
{
{
LPDIRENTRY lpDir;
if (!_tcsncmp(rest, _T("/?"), 2))
{
{
ConOutResPuts(STRING_DIRSTACK_HELP3);
return 0;
}
@ -206,7 +206,7 @@ INT CommandDirs (LPTSTR first, LPTSTR rest)
lpDir = lpStackBottom;
if (lpDir == NULL)
{
{
ConOutResPuts(STRING_DIRSTACK_HELP4);
return 0;
}

View file

@ -23,7 +23,7 @@
* Implemented 'echo.' and 'echoerr.'.
*
* 28-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -39,7 +39,7 @@ INT CommandEcho (LPTSTR cmd, LPTSTR param)
#endif
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_ECHO_HELP4);
return 0;
}
@ -78,7 +78,7 @@ INT CommandEchos (LPTSTR cmd, LPTSTR param)
#endif
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_ECHO_HELP1);
return 0;
}
@ -98,7 +98,7 @@ INT CommandEchoerr (LPTSTR cmd, LPTSTR param)
#endif
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_ECHO_HELP2);
return 0;
}
@ -127,7 +127,7 @@ INT CommandEchoserr (LPTSTR cmd, LPTSTR param)
#endif
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_ECHO_HELP3);
return 0;
}

View file

@ -17,7 +17,7 @@
* Use FormatMessage() for error reports.
*
* 28-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -117,13 +117,13 @@ VOID error_too_many_parameters (LPTSTR s)
VOID error_path_not_found (VOID)
{
{
ConErrResPuts(STRING_ERROR_PATH_NOT_FOUND);
}
VOID error_file_not_found (VOID)
{
{
ConErrResPuts(STRING_ERROR_FILE_NOT_FOUND);
}
@ -138,7 +138,7 @@ VOID error_sfile_not_found (LPTSTR f)
VOID error_req_param_missing (VOID)
{
{
ConErrResPuts(STRING_ERROR_REQ_PARAM_MISSING);
}
@ -151,25 +151,25 @@ VOID error_invalid_drive (VOID)
VOID error_bad_command (VOID)
{
ConErrResPuts(STRING_ERROR_BADCOMMAND);
ConErrResPuts(STRING_ERROR_BADCOMMAND);
}
VOID error_no_pipe (VOID)
{
ConErrResPuts(STRING_ERROR_CANNOTPIPE);
ConErrResPuts(STRING_ERROR_CANNOTPIPE);
}
VOID error_out_of_memory (VOID)
{
ConErrResPuts(STRING_ERROR_OUT_OF_MEMORY);
ConErrResPuts(STRING_ERROR_OUT_OF_MEMORY);
}
VOID error_invalid_parameter_format (LPTSTR s)
{
ConErrResPuts(STRING_ERROR_INVALID_PARAM_FORMAT);
ConErrResPuts(STRING_ERROR_INVALID_PARAM_FORMAT);
}
@ -188,7 +188,7 @@ VOID error_syntax (LPTSTR s)
VOID msg_pause (VOID)
{
ConOutResPuts(STRING_ERROR_D_PAUSEMSG);
ConOutResPuts(STRING_ERROR_D_PAUSEMSG);
}
/* EOF */

View file

@ -21,13 +21,13 @@
*
* 01-Sep-1999 (Eric Kohl)
* Added help text.
*
*
* 23-Feb-2001 (Carl Nettelblad <cnettel@hem.passagen.se>)
* Implemented preservation of echo flag. Some other for related
* code in other files fixed, too.
*
* 28-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -60,7 +60,7 @@ INT cmd_for (LPTSTR cmd, LPTSTR param)
#endif
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_FOR_HELP1);
return 0;
}

View file

@ -8,7 +8,7 @@
* Started.
*
* 28-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -93,7 +93,7 @@ PrintDiskInfo (LPTSTR szDisk)
if (szVolume[0] == _T('\0'))
{
LoadString(CMD_ModuleHandle, STRING_FREE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
_tcscpy (szVolume, szMsg);
}
@ -120,21 +120,21 @@ PrintDiskInfo (LPTSTR szDisk)
uliSize.QuadPart = dwSecPerCl * dwBytPerSec * dwFreeCl;
ConvertULargeInteger (uliSize, szFree, 40);
LoadString(CMD_ModuleHandle, STRING_FREE_HELP1, szMsg, RC_STRING_MAX_SIZE);
ConOutPrintf(szMsg, szDrive, szVolume, szSerial, szTotal, szUsed, szFree);
}
INT CommandFree (LPTSTR cmd, LPTSTR param)
{
{
LPTSTR szParam;
TCHAR szDefPath[MAX_PATH];
INT argc, i;
LPTSTR *arg;
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_FREE_HELP2);
return 0;
}

View file

@ -23,7 +23,7 @@
* Added help text ("/?").
*
* 28-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"

View file

@ -35,7 +35,7 @@
* 06/12/99 (Paolo Pantaleo <paolopan@freemail.it>)
* started.
*
*/
*/
#include "precomp.h"
@ -208,7 +208,7 @@ VOID del(LPHIST_ENTRY item)
/*set links in prev and next item*/
item->next->prev=item->prev;
item->prev->next=item->next;
item->prev->next=item->next;
free(item);
@ -256,12 +256,12 @@ VOID add_before_last(LPTSTR string)
static
VOID add_at_bottom(LPTSTR string)
{
{
LPHIST_ENTRY tmp;
/*delete first entry if maximum number of entries is reached*/
while(size>=max_size)
del(Top->prev);
@ -271,24 +271,24 @@ VOID add_at_bottom(LPTSTR string)
if (*string==_T('\0'))
return;
/*if new entry is the same than the last do not add it*/
if(size)
if(_tcscmp(string,Bottom->next->string)==0)
return;
/*fill bottom with string, it will become Bottom->next*/
/*fill bottom with string, it will become Bottom->next*/
Bottom->string=malloc((_tcslen(string)+1)*sizeof(TCHAR));
_tcscpy(Bottom->string,string);
_tcscpy(Bottom->string,string);
/*save Bottom value*/
tmp=Bottom;
/*create new void Bottom*/
Bottom=malloc(sizeof(HIST_ENTRY));
Bottom=malloc(sizeof(HIST_ENTRY));
Bottom->next=tmp;
Bottom->prev=NULL;
Bottom->string=NULL;
@ -311,7 +311,7 @@ VOID History_move_to_bottom(VOID)
VOID History (INT dir, LPTSTR commandline)
{
if(dir==0)
{
add_at_bottom(commandline);
@ -330,23 +330,23 @@ VOID History (INT dir, LPTSTR commandline)
{
if (curr_ptr->next==Top || curr_ptr==Top)
{
#ifdef WRAP_HISTORY
curr_ptr=Bottom;
#else
#ifdef WRAP_HISTORY
curr_ptr=Bottom;
#else
curr_ptr=Top;
commandline[0]=_T('\0');
return;
#endif
}
curr_ptr = curr_ptr->next;
if(curr_ptr->string)
_tcscpy(commandline,curr_ptr->string);
}
@ -355,7 +355,7 @@ VOID History (INT dir, LPTSTR commandline)
if (curr_ptr->prev==Bottom || curr_ptr==Bottom)
{
#ifdef WRAP_HISTORY
#ifdef WRAP_HISTORY
curr_ptr=Top;
#else
curr_ptr=Bottom;
@ -363,11 +363,11 @@ VOID History (INT dir, LPTSTR commandline)
return;
#endif
}
curr_ptr=curr_ptr->prev;
curr_ptr=curr_ptr->prev;
if(curr_ptr->string)
_tcscpy(commandline,curr_ptr->string);
_tcscpy(commandline,curr_ptr->string);
}
}
@ -381,7 +381,7 @@ VOID History (INT dir, LPTSTR commandline)
LPTSTR history = NULL; /*buffer to sotre all the lines*/
LPTSTR lines[MAXLINES]; /*array of pointers to each line(entry)*/
/*located in history buffer*/
INT curline = 0; /*the last line recalled by user*/
INT numlines = 0; /*number of entries, included the last*/
/*empty one*/
@ -392,7 +392,7 @@ INT maxpos = 0; /*index of last byte of last entry*/
VOID History (INT dir, LPTSTR commandline)
{
INT count; /*used in for loops*/
INT length; /*used in the same loops of count*/
/*both to make room when is full
@ -468,7 +468,7 @@ VOID History (INT dir, LPTSTR commandline)
/*copy entry in the history bufer*/
_tcscpy (lines[numlines], commandline);
numlines++;
/*set last lines[numlines] pointer next the end of last, valid,
just setted entry (the two lines above)*/
lines[numlines] = lines[numlines - 1] + _tcslen (commandline) + 1;

View file

@ -26,7 +26,7 @@
* IF DEFINED variable command
*
* 28-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*
*/
@ -47,7 +47,7 @@ INT cmd_if (LPTSTR cmd, LPTSTR param)
#endif
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_IF_HELP1);
return 0;
}
@ -111,7 +111,7 @@ INT cmd_if (LPTSTR cmd, LPTSTR param)
*pp++ = _T('\0');
ValueSize = GetEnvironmentVariable(param, Value, sizeof Value);
x_flag ^= (0 == ValueSize)
? 0
? 0
: X_EXEC;
x_flag |= X_EMPTY;
}

View file

@ -124,7 +124,7 @@
* Improved chdir/cd command.
*
* 02-Apr-2004 (Magnus Olsen <magnus@greatlord.com>)
* Remove all hard code string so they can be
* Remove all hard code string so they can be
* translate to other langues.
*/
@ -153,7 +153,7 @@ VOID FreeLastPath (VOID)
*
*/
INT cmd_chdir (LPTSTR cmd, LPTSTR param)
{
{
LPTSTR dir; /* pointer to the directory to change to */
LPTSTR lpOldPath;
LPTSTR endofstring; /* pointer to the null character in the directory to change to */
@ -163,7 +163,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
but on the other hand paths are generally not very long*/
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_CD_HELP);
return 0;
}
@ -233,7 +233,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
{
//ErrorMessage (GetLastError(), _T("CD"));
ConOutFormatMessage(GetLastError());
/* throw away current directory */
free (lpOldPath);
lpOldPath = NULL;
@ -276,7 +276,7 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param)
INT argc;
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_MKDIR_HELP);
return 0;
}
@ -311,7 +311,7 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param)
}
if (!dir)
{
{
ConErrResPuts (STRING_ERROR_REQ_PARAM_MISSING);
return 1;
}
@ -341,7 +341,7 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param)
*
*/
INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
{
{
LPTSTR dir; /* pointer to the directory to change to */
LPTSTR place; /* used to search for the \ when no space is used */
@ -349,7 +349,7 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
INT argc;
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_RMDIR_HELP);
return 0;
}
@ -383,7 +383,7 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
}
if (!dir)
{
{
ConErrResPuts(STRING_ERROR_REQ_PARAM_MISSING);
return 1;
}
@ -414,7 +414,7 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
INT CommandExit (LPTSTR cmd, LPTSTR param)
{
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_EXIT_HELP);
return 0;
}
@ -432,7 +432,7 @@ INT CommandExit (LPTSTR cmd, LPTSTR param)
INT CommandRem (LPTSTR cmd, LPTSTR param)
{
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_REM_HELP);
}

View file

@ -14,7 +14,7 @@
* Unicode ready!
*
* 28-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -38,7 +38,7 @@ INT cmd_label (LPTSTR cmd, LPTSTR param)
/* print help */
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_LABEL_HELP1);
return 0;
}
@ -89,7 +89,7 @@ INT cmd_label (LPTSTR cmd, LPTSTR param)
GetVolumeInformation(szRootPath, szOldLabel, 80, &dwSerialNr,
NULL, NULL, NULL, 0);
/* print drive info */
/* print drive info */
if (szOldLabel[0] != _T('\0'))
{
LoadString(CMD_ModuleHandle, STRING_LABEL_HELP2, szMsg, RC_STRING_MAX_SIZE);

View file

@ -8,7 +8,7 @@
* Started.
*
* 28-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -67,7 +67,7 @@ INT CommandMemory (LPTSTR cmd, LPTSTR param)
TCHAR szAvailVirtual[20];
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_MEMMORY_HELP1);
return 0;
}

View file

@ -29,7 +29,7 @@
* Added PagePrompt() and FilePrompt().
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -436,9 +436,9 @@ HWND GetConsoleWindow (VOID)
INT PagePrompt (VOID)
{
{
INPUT_RECORD ir;
ConOutResPuts(STRING_MISC_HELP1);
RemoveBreakHandler ();

View file

@ -22,7 +22,7 @@
* Added "/N" option.
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -91,7 +91,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
" /Y\n"
" /-Y\n"
"..."));
#else
#else
ConOutResPuts(STRING_MOVE_HELP2);
#endif
return 0;

View file

@ -7,7 +7,7 @@
* started - Paolo Pantaleo <paolopan@freemail.it>
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -25,7 +25,7 @@
INT CommandMsgbox (LPTSTR cmd, LPTSTR param)
{
//used to parse command line
LPTSTR tmp;
@ -43,7 +43,7 @@ INT CommandMsgbox (LPTSTR cmd, LPTSTR param)
title = buff;
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
{
ConOutResPuts(STRING_MSGBOX_HELP);
return 0;
}

View file

@ -23,7 +23,7 @@
* Fixed Win32 environment handling.
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
#include "resource.h"
@ -35,10 +35,10 @@
INT cmd_path (LPTSTR cmd, LPTSTR param)
{
{
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_PATH_HELP1);
return 0;
}
@ -55,7 +55,7 @@ INT cmd_path (LPTSTR cmd, LPTSTR param)
if (dwBuffer == 0)
{
LoadString(CMD_ModuleHandle, STRING_VOL_HELP2, szMsg, RC_STRING_MAX_SIZE);
ConOutPrintf(szMsg, _T("PATH"));
ConOutPrintf(szMsg, _T("PATH"));
return 0;
}
else if (dwBuffer > ENV_BUFFER_SIZE)

View file

@ -32,18 +32,18 @@
* specified.
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
INT cmd_pause (LPTSTR cmd, LPTSTR param)
{
{
#ifdef _DEBUG
DebugPrintf (_T("cmd_pause: \'%s\' : \'%s\')\n"), cmd, param);
#endif
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_PAUSE_HELP1);
return 0;
}

View file

@ -44,7 +44,7 @@
* Fixed Win32 environment handling.
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
#include "resource.h"
@ -181,14 +181,14 @@ VOID PrintPrompt(VOID)
INT cmd_prompt (LPTSTR cmd, LPTSTR param)
{
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_PROMPT_HELP1);
#ifdef FEATURE_DIRECTORY_STACK
#ifdef FEATURE_DIRECTORY_STACK
ConOutResPuts(STRING_PROMPT_HELP2);
#endif
#endif
ConOutResPuts(STRING_PROMPT_HELP3);
return 0;
}

View file

@ -17,7 +17,7 @@
* Implemented basic rename code.
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -61,7 +61,7 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
WIN32_FIND_DATA f;
if (!_tcsncmp(param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_REN_HELP1);
return 0;
}

View file

@ -7,7 +7,7 @@
* started - Paolo Pantaleo <paolopan@freemail.it>
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*
*/
@ -18,12 +18,12 @@
INT CommandScreen (LPTSTR cmd, LPTSTR param)
{
{
SHORT x,y;
BOOL bSkipText = FALSE;
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
{
ConOutResPuts(STRING_SCREEN_HELP);
return 0;
}

View file

@ -31,7 +31,7 @@
* Fixed little bug.
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -45,12 +45,12 @@
INT cmd_set (LPTSTR cmd, LPTSTR param)
{
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR p;
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_SET_HELP);
return 0;
}

View file

@ -34,7 +34,7 @@
*
* FREEDOS extension : optional parameter DOWN to allow shifting
* parameters backwards.
*
*
*/
INT cmd_shift (LPTSTR cmd, LPTSTR param)
@ -45,7 +45,7 @@ INT cmd_shift (LPTSTR cmd, LPTSTR param)
#endif
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_SHIFT_HELP);
return 0;
}

View file

@ -8,7 +8,7 @@
* Started.
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -24,7 +24,7 @@ INT cmd_start (LPTSTR first, LPTSTR rest)
TCHAR *param;
if (_tcsncmp (rest, _T("/?"), 2) == 0)
{
{
ConOutResPuts(STRING_START_HELP1);
return 0;
}
@ -72,7 +72,7 @@ INT cmd_start (LPTSTR first, LPTSTR rest)
#ifdef _DEBUG
DebugPrintf (_T("[BATCH: %s %s]\n"), szFullName, rest);
#endif
ConErrResPuts(STRING_START_ERROR1);
}
else
@ -98,7 +98,7 @@ INT cmd_start (LPTSTR first, LPTSTR rest)
stui.cb = sizeof (STARTUPINFO);
stui.dwFlags = STARTF_USESHOWWINDOW;
stui.wShowWindow = SW_SHOWDEFAULT;
if (CreateProcess (szFullName, szFullCmdLine, NULL, NULL, FALSE,
CREATE_NEW_CONSOLE, NULL, NULL, &stui, &prci))
{

View file

@ -53,7 +53,7 @@ CLRTABLE clrtable[] =
{_T("whi") ,_R|_G|_B },
{_T("gra") ,_I },
{_T("0") ,0 },
{_T("2") ,_G },
{_T("3") ,_B|_G },
@ -71,7 +71,7 @@ CLRTABLE clrtable[] =
{_T("14") ,_I|_R|_G },
{_T("15") ,_I|_R|_G|_B },
/* note that 1 is at the end of list
to avoid to confuse it with 10-15*/
{_T("1") ,_B },
@ -81,7 +81,7 @@ CLRTABLE clrtable[] =
/*magenta synonimous*/
{_T("pur") ,_B|_R },
{_T("") ,0},
};
@ -94,7 +94,7 @@ on erro retunr nonzero value
static
INT chop_blank(LPTSTR *arg_str)
{
LPTSTR str;
str = _tcschr(*arg_str,_T(' '));
if(!str)
@ -105,7 +105,7 @@ INT chop_blank(LPTSTR *arg_str)
return CP_BLANK_NOT_FOUND;
}
while(_istspace(*str))
str++;
@ -118,27 +118,27 @@ INT chop_blank(LPTSTR *arg_str)
*arg_str = str;
return CP_OK;
return CP_OK;
}
/*
read a color value in hex (like win nt's cmd syntax)
if an error occurs return -1
*/
if an error occurs return -1
*/
static
WORD hex_clr(LPTSTR str)
{
WORD ret= (WORD)-1;
TCHAR ch;
ch = str[1];
if(_istdigit(ch))
ret = ch-_T('0');
else
{
{
ch=_totupper(ch);
if( ch >= _T('A') && ch <= _T('F') )
@ -147,13 +147,13 @@ WORD hex_clr(LPTSTR str)
return (WORD)-1;
}
ch = str[0];
if(_istdigit(ch))
ret |= (ch-_T('0')) << 4;
else
{
{
ch=_totupper(ch);
if( ch >= _T('A') && ch <= _T('F') )
@ -168,7 +168,7 @@ WORD hex_clr(LPTSTR str)
/*
read a color value from a string (like 4nt's syntax)
if an error occurs return -1
if an error occurs return -1
*/
static
WORD txt_clr(LPTSTR str)
@ -184,7 +184,7 @@ WORD txt_clr(LPTSTR str)
/*search for x on y*/
/*search for x on y*/
static
WORD str_to_color(LPTSTR* arg_str)
{
@ -231,13 +231,13 @@ WORD str_to_color(LPTSTR* arg_str)
if(chop_blank(&str))
return (WORD)-1;
}
if( (tmp_clr = txt_clr(str)) == (WORD)-1 )
return (WORD)-1;
chop_blank(&str);
*arg_str = str;
return SC_HEX | ret_clr | tmp_clr << 4 | bBri << 7;

View file

@ -131,7 +131,7 @@ static BOOL ParseTime (LPTSTR s)
INT cmd_time (LPTSTR cmd, LPTSTR param)
{
{
LPTSTR *arg;
INT argc;
INT i;
@ -139,7 +139,7 @@ INT cmd_time (LPTSTR cmd, LPTSTR param)
INT nTimeString = -1;
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_TIME_HELP1);
return 0;
}
@ -171,7 +171,7 @@ INT cmd_time (LPTSTR cmd, LPTSTR param)
if (nTimeString == -1)
{
TCHAR s[40];
ConOutResPuts(STRING_TIME_HELP2);
ConInString (s, 40);
@ -200,7 +200,7 @@ INT cmd_time (LPTSTR cmd, LPTSTR param)
/* force input the next time around. */
nTimeString = -1;
}
ConErrResPuts(STRING_TIME_ERROR1);
}

View file

@ -25,7 +25,7 @@
//print timer value
#define PT(format) PrintElapsedTime(GetTickCount()-cT,format)
//current timer Time (at wich started to count)
#define cT clksT[clk_n]
@ -43,7 +43,7 @@ PrintElapsedTime (DWORD time,INT format)
#ifdef _DEBUG
DebugPrintf(_T("PrintTime(%d,%d)"),time,format);
#endif
switch (format)
{
case 0:
@ -74,7 +74,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
// all timers are kept
static DWORD clksT[10];
// timers status
// set all the clocks off by default
static BOOL clksS[10]={FALSE,FALSE,FALSE,FALSE,
@ -82,7 +82,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
// TRUE if /S in command line
BOOL bS = FALSE;
// avoid to set clk_n more than once
BOOL bCanNSet = TRUE;
@ -94,8 +94,8 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
// output format
INT iFormat=1;
// command line parsing variables
INT argc;
LPTSTR *p;
@ -139,14 +139,14 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
bCanNSet = FALSE;
continue;
}
// set s(plit) option
if (_totupper(p[i][1]) == _T('S'))
{
bS = TRUE;
continue;
}
// specify format
if (_totupper(p[i][1]) == _T('F'))
{
@ -169,7 +169,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
if(bS)
{
if(cS)
{
{
PS;
PrintElapsedTime(GetTickCount()-cT, iFormat);
freep(p);

View file

@ -6,7 +6,7 @@
* 1999-02-11 Emanuele Aliberti
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -16,7 +16,7 @@
INT cmd_title (LPTSTR cmd, LPTSTR param)
{
{
/* Do nothing if no args */
if (*param == _T('\0'))
@ -24,7 +24,7 @@ INT cmd_title (LPTSTR cmd, LPTSTR param)
/* Asking help? */
if (!_tcsncmp(param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_TITLE_HELP);
return 0;
}

View file

@ -23,7 +23,7 @@
* Added multiple file support (copied from y.c)
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -59,7 +59,7 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
}
argv = split (param, &argc, TRUE);
for (i = 0; i < argc; i++)
{
if (_T('/') == argv[i][0])
@ -97,7 +97,7 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
if (dwRead>0 && bRet)
WriteFile(hConsoleOut,buff,dwRead,&dwWritten,NULL);
} while(dwRead>0 && bRet);
CloseHandle(hFile);

View file

@ -62,11 +62,11 @@ VOID ShortVersion (VOID)
*
*/
INT cmd_ver (LPTSTR cmd, LPTSTR param)
{
{
INT i;
if (_tcsstr (param, _T("/?")) != NULL)
{
{
ConOutResPuts(STRING_VERSION_HELP1);
return 0;
}
@ -78,7 +78,7 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
/* Basic copyright notice */
if (param[0] == _T('\0'))
{
ConOutPuts(_T("\n"SHELLINFO));
ConOutPuts(_T("\n"SHELLINFO));
ConOutResPuts(STRING_VERSION_HELP2);
}
else
@ -102,21 +102,21 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
if (_totupper (param[i]) == _T('W'))
{
/* Warranty notice */
/* Warranty notice */
ConOutResPuts(STRING_VERSION_HELP3);
}
else if (_totupper (param[i]) == _T('R'))
{
/* Redistribution notice */
/* Redistribution notice */
ConOutResPuts(STRING_VERSION_HELP4);
}
else if (_totupper (param[i]) == _T('C'))
{
/* Developer listing */
ConOutResPuts(STRING_VERSION_HELP6);
ConOutResPuts(STRING_FREEDOS_DEV);
/* Developer listing */
ConOutResPuts(STRING_VERSION_HELP6);
ConOutResPuts(STRING_FREEDOS_DEV);
ConOutResPuts(STRING_VERSION_HELP7);
ConOutResPuts(STRING_REACTOS_DEV);
ConOutResPuts(STRING_REACTOS_DEV);
}
else
{
@ -125,7 +125,7 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
}
}
}
ConOutResPuts(STRING_VERSION_HELP5);
return 0;
}

View file

@ -15,7 +15,7 @@
* Unicode and redirection ready!
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
#include "precomp.h"
@ -33,7 +33,7 @@ INT cmd_verify (LPTSTR cmd, LPTSTR param)
TCHAR szMsg[RC_STRING_MAX_SIZE];
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_VERIFY_HELP1);
return 0;
}
@ -48,7 +48,7 @@ INT cmd_verify (LPTSTR cmd, LPTSTR param)
else if (_tcsicmp (param, D_ON) == 0)
bVerify = TRUE;
else
{
{
ConOutResPuts(STRING_VERIFY_HELP3);
}

View file

@ -67,12 +67,12 @@ PrintVolumeHeader (LPTSTR pszRootPath)
INT cmd_vol (LPTSTR cmd, LPTSTR param)
{
{
TCHAR szRootPath[] = _T("A:\\");
TCHAR szPath[MAX_PATH];
if (!_tcsncmp (param, _T("/?"), 2))
{
{
ConOutResPuts(STRING_VOL_HELP4);
return 0;
}

View file

@ -12,7 +12,7 @@
* (nice size optimization :)
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
* Remove all hardcode string to En.rc
*/
@ -178,7 +178,7 @@ INT CommandWindow (LPTSTR cmd, LPTSTR param)
HWND hwnd;
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
{
ConOutResPuts(STRING_WINDOW_HELP1);
return 0;
}
@ -190,12 +190,12 @@ INT CommandWindow (LPTSTR cmd, LPTSTR param)
INT CommandActivate (LPTSTR cmd, LPTSTR param)
{
{
LPTSTR str;
HWND hwnd;
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
{
ConOutResPuts(STRING_WINDOW_HELP2);
return 0;
}
@ -215,7 +215,7 @@ INT CommandActivate (LPTSTR cmd, LPTSTR param)
hwnd = FindWindow(NULL, param);
if (hwnd == NULL)
{
{
ConErrResPuts(STRING_WINDOW_ERROR1);
return 1;
}

View file

@ -18,22 +18,22 @@ PCHAR *GetSubkeyNames( PCHAR MainKeyName, PCHAR Append ) {
if( Error ) return NULL;
Error = RegQueryInfoKey
( MainKey,
NULL, NULL, NULL,
&MaxSubKeys, &MaxSubKeyLen,
( MainKey,
NULL, NULL, NULL,
&MaxSubKeys, &MaxSubKeyLen,
NULL, NULL, NULL, NULL, NULL, NULL );
DH_DbgPrint(MID_TRACE,("MaxSubKeys: %d, MaxSubKeyLen %d\n",
MaxSubKeys, MaxSubKeyLen));
CharTotal = (sizeof(PCHAR) + MaxSubKeyLen + AppendLen) * (MaxSubKeys + 1);
DH_DbgPrint(MID_TRACE,("AppendLen: %d, CharTotal: %d\n",
DH_DbgPrint(MID_TRACE,("AppendLen: %d, CharTotal: %d\n",
AppendLen, CharTotal));
Out = malloc( CharTotal );
OutKeyName = ((PCHAR)&Out[MaxSubKeys+1]);
if( !Out ) { RegCloseKey( MainKey ); return NULL; }
i = 0;
@ -57,23 +57,23 @@ PCHAR RegReadString( HKEY Root, PCHAR Subkey, PCHAR Value ) {
PCHAR SubOut = NULL;
DWORD SubOutLen = 0, Error = 0;
HKEY ValueKey = NULL;
DH_DbgPrint(MID_TRACE,("Looking in %x:%s:%s\n", Root, Subkey, Value ));
if( Subkey && strlen(Subkey) ) {
if( RegOpenKey( Root, Subkey, &ValueKey ) != ERROR_SUCCESS )
if( RegOpenKey( Root, Subkey, &ValueKey ) != ERROR_SUCCESS )
goto regerror;
} else ValueKey = Root;
DH_DbgPrint(MID_TRACE,("Got Key %x\n", ValueKey));
if( (Error = RegQueryValueEx( ValueKey, Value, NULL, NULL,
if( (Error = RegQueryValueEx( ValueKey, Value, NULL, NULL,
(LPBYTE)SubOut, &SubOutLen )) != ERROR_SUCCESS )
goto regerror;
DH_DbgPrint(MID_TRACE,("Value %s has size %d\n", Value, SubOutLen));
if( !(SubOut = malloc(SubOutLen)) )
if( !(SubOut = malloc(SubOutLen)) )
goto regerror;
if( (Error = RegQueryValueEx( ValueKey, Value, NULL, NULL,
@ -99,10 +99,10 @@ cleanup:
HKEY FindAdapterKey( PDHCP_ADAPTER Adapter ) {
int i = 0;
PCHAR EnumKeyName =
PCHAR EnumKeyName =
"SYSTEM\\CurrentControlSet\\Control\\Class\\"
"{4D36E972-E325-11CE-BFC1-08002BE10318}";
PCHAR TargetKeyNameStart =
PCHAR TargetKeyNameStart =
"SYSTEM\\CurrentControlSet\\Services\\";
PCHAR TargetKeyNameEnd = "\\Parameters\\Tcpip";
PCHAR TargetKeyName = NULL;
@ -123,17 +123,17 @@ HKEY FindAdapterKey( PDHCP_ADAPTER Adapter ) {
( EnumKey, EnumKeysLinkage[i], "RootDevice" );
DriverDesc = RegReadString
( EnumKey, EnumKeysTop[i], "DriverDesc" );
if( DriverDesc &&
if( DriverDesc &&
!strcmp( DriverDesc, Adapter->DhclientInfo.name ) ) {
TargetKeyName =
malloc( strlen( TargetKeyNameStart ) +
TargetKeyName =
malloc( strlen( TargetKeyNameStart ) +
strlen( RootDevice ) +
strlen( TargetKeyNameEnd ) + 1 );
if( !TargetKeyName ) goto cleanup;
sprintf( TargetKeyName, "%s%s%s",
sprintf( TargetKeyName, "%s%s%s",
TargetKeyNameStart, RootDevice, TargetKeyNameEnd );
Error = RegOpenKey( HKEY_LOCAL_MACHINE, TargetKeyName, &OutKey );
Error = RegOpenKey( HKEY_LOCAL_MACHINE, TargetKeyName, &OutKey );
break;
} else {
free( RootDevice ); RootDevice = 0;
@ -169,7 +169,7 @@ BOOL PrepareAdapterForService( PDHCP_ADAPTER Adapter ) {
if( IPAddress && strcmp( IPAddress, "0.0.0.0" ) ) {
/* Non-automatic case */
DH_DbgPrint
(MID_TRACE,("Adapter Name: [%s] (Bind Status %x) (static %s)\n",
(MID_TRACE,("Adapter Name: [%s] (Bind Status %x) (static %s)\n",
Adapter->DhclientInfo.name,
Adapter->BindStatus,
IPAddress));
@ -178,7 +178,7 @@ BOOL PrepareAdapterForService( PDHCP_ADAPTER Adapter ) {
Netmask = RegReadString( AdapterKey, NULL, "Subnetmask" );
if( !Netmask ) Netmask = "255.255.255.0";
Status = AddIPAddress( inet_addr( IPAddress ),
inet_addr( Netmask ),
Adapter->IfMib.dwIndex,
@ -194,7 +194,7 @@ BOOL PrepareAdapterForService( PDHCP_ADAPTER Adapter ) {
DefGatewayRow.dwForwardNextHop = inet_addr(DefaultGateway);
Error = CreateIpForwardEntry( &DefGatewayRow );
if( Error )
warning("Failed to set default gateway %s: %d\n",
warning("Failed to set default gateway %s: %d\n",
DefaultGateway, Error);
}
@ -228,7 +228,7 @@ void AdapterInit() {
DH_DbgPrint(MID_TRACE,("Getting Adapter List...\n"));
while( (Error = GetIfTable(Table, &Size, 0 )) ==
while( (Error = GetIfTable(Table, &Size, 0 )) ==
ERROR_INSUFFICIENT_BUFFER ) {
DH_DbgPrint(MID_TRACE,("Error %d, New Buffer Size: %d\n", Error, Size));
free( Table );
@ -240,50 +240,50 @@ void AdapterInit() {
DH_DbgPrint(MID_TRACE,("Got Adapter List (%d entries)\n", Table->dwNumEntries));
for( i = 0; i < Table->dwNumEntries; i++ ) {
DH_DbgPrint(MID_TRACE,("Getting adapter %d attributes\n",
DH_DbgPrint(MID_TRACE,("Getting adapter %d attributes\n",
Table->table[i].dwIndex));
Adapter = calloc( sizeof( DHCP_ADAPTER ) + Table->table[i].dwMtu, 1 );
if( Adapter && Table->table[i].dwType == MIB_IF_TYPE_ETHERNET ) {
memcpy( &Adapter->IfMib, &Table->table[i],
memcpy( &Adapter->IfMib, &Table->table[i],
sizeof(Adapter->IfMib) );
Adapter->DhclientInfo.client = &Adapter->DhclientState;
Adapter->DhclientInfo.rbuf = Adapter->recv_buf;
Adapter->DhclientInfo.rbuf_max = Table->table[i].dwMtu;
Adapter->DhclientInfo.rbuf_len =
Adapter->DhclientInfo.rbuf_len =
Adapter->DhclientInfo.rbuf_offset = 0;
memcpy(Adapter->DhclientInfo.hw_address.haddr,
Adapter->IfMib.bPhysAddr,
Adapter->IfMib.dwPhysAddrLen);
Adapter->DhclientInfo.hw_address.hlen =
Adapter->DhclientInfo.hw_address.hlen =
Adapter->IfMib.dwPhysAddrLen;
if( DhcpSocket == INVALID_SOCKET ) {
DhcpSocket =
DhcpSocket =
Adapter->DhclientInfo.rfdesc =
Adapter->DhclientInfo.wfdesc =
socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
Adapter->ListenAddr.sin_family = AF_INET;
Adapter->ListenAddr.sin_port = htons(LOCAL_PORT);
Adapter->BindStatus =
Adapter->BindStatus =
(bind( Adapter->DhclientInfo.rfdesc,
(struct sockaddr *)&Adapter->ListenAddr,
sizeof(Adapter->ListenAddr) ) == 0) ?
0 : WSAGetLastError();
} else {
Adapter->DhclientInfo.rfdesc =
Adapter->DhclientInfo.rfdesc =
Adapter->DhclientInfo.wfdesc = DhcpSocket;
}
Adapter->DhclientConfig.timeout = DHCP_PANIC_TIMEOUT;
Adapter->DhclientConfig.initial_interval = DHCP_DISCOVER_INTERVAL;
Adapter->DhclientConfig.retry_interval = DHCP_DISCOVER_INTERVAL;
Adapter->DhclientConfig.select_interval = 1;
Adapter->DhclientConfig.reboot_timeout = DHCP_REBOOT_TIMEOUT;
Adapter->DhclientConfig.backoff_cutoff = DHCP_BACKOFF_MAX;
Adapter->DhclientState.interval =
Adapter->DhclientState.interval =
Adapter->DhclientConfig.retry_interval;
if( PrepareAdapterForService( Adapter ) ) {
Adapter->DhclientInfo.next = ifi;
ifi = &Adapter->DhclientInfo;
@ -362,15 +362,15 @@ PDHCP_ADAPTER AdapterGetFirst() {
}
}
PDHCP_ADAPTER AdapterGetNext( PDHCP_ADAPTER This )
{
PDHCP_ADAPTER AdapterGetNext( PDHCP_ADAPTER This )
{
if( This->ListEntry.Flink == &AdapterList ) return NULL;
return CONTAINING_RECORD
( This->ListEntry.Flink, DHCP_ADAPTER, ListEntry );
}
void if_register_send(struct interface_info *ip) {
}
void if_register_receive(struct interface_info *ip) {

View file

@ -38,8 +38,8 @@ DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req ) {
Reply.Reply = Adapter ? 1 : 0;
if( Adapter ) {
add_protocol( Adapter->DhclientInfo.name,
Adapter->DhclientInfo.rfdesc, got_one,
add_protocol( Adapter->DhclientInfo.name,
Adapter->DhclientInfo.rfdesc, got_one,
&Adapter->DhclientInfo );
Adapter->DhclientInfo.client->state = S_INIT;
state_reboot(&Adapter->DhclientInfo);

View file

@ -445,22 +445,22 @@ void set_name_servers( struct client_lease *new_lease ) {
HKEY RegKey;
struct iaddr nameserver;
char *nsbuf;
int i, addrs =
int i, addrs =
new_lease->options[DHO_DOMAIN_NAME_SERVERS].len / sizeof(ULONG);
/* XXX I'm setting addrs to 1 until we are ready up the chain */
addrs = 1;
nsbuf = malloc( addrs * sizeof(IP_ADDRESS_STRING) );
nsbuf[0] = 0;
if( nsbuf && !RegOpenKeyEx
( HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
( HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
0, KEY_WRITE, &RegKey ) ) {
for( i = 0; i < addrs; i++ ) {
nameserver.len = sizeof(ULONG);
memcpy( nameserver.iabuf,
new_lease->options[DHO_DOMAIN_NAME_SERVERS].data +
memcpy( nameserver.iabuf,
new_lease->options[DHO_DOMAIN_NAME_SERVERS].data +
(i * sizeof(ULONG)), sizeof(ULONG) );
strcat( nsbuf, piaddr(nameserver) );
if( i != addrs-1 ) strcat( nsbuf, "," );
@ -475,7 +475,7 @@ void set_name_servers( struct client_lease *new_lease ) {
*/
RegSetValueEx( RegKey, "NameServer", 0, REG_SZ,
(LPBYTE)nsbuf, strlen(nsbuf) + 1 );
free( nsbuf );
}
}
@ -486,7 +486,7 @@ void setup_adapter( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) {
if( Adapter->NteContext )
DeleteIPAddress( Adapter->NteContext );
/* Set up our default router if we got one from the DHCP server */
if( new_lease->options[DHO_SUBNET_MASK].len ) {
NTSTATUS Status;
@ -494,38 +494,38 @@ void setup_adapter( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) {
memcpy( netmask.iabuf,
new_lease->options[DHO_SUBNET_MASK].data,
new_lease->options[DHO_SUBNET_MASK].len );
Status = AddIPAddress
( *((ULONG*)new_lease->address.iabuf),
*((ULONG*)netmask.iabuf),
Adapter->IfMib.dwIndex,
&Adapter->NteContext,
&Adapter->NteInstance );
if( !NT_SUCCESS(Status) )
warning("AddIPAddress: %x\n", Status);
}
}
if( new_lease->options[DHO_ROUTERS].len ) {
MIB_IPFORWARDROW RouterMib;
NTSTATUS Status;
RouterMib.dwForwardDest = 0; /* Default route */
RouterMib.dwForwardMask = 0;
RouterMib.dwForwardMetric1 = 1;
if( old_default_route ) {
/* If we set a default route before, delete it before continuing */
RouterMib.dwForwardDest = old_default_route;
DeleteIpForwardEntry( &RouterMib );
}
RouterMib.dwForwardNextHop =
RouterMib.dwForwardNextHop =
*((ULONG*)new_lease->options[DHO_ROUTERS].data);
Status = CreateIpForwardEntry( &RouterMib );
if( !NT_SUCCESS(Status) )
if( !NT_SUCCESS(Status) )
warning("CreateIpForwardEntry: %x\n", Status);
else
old_default_route = RouterMib.dwForwardNextHop;
@ -548,7 +548,7 @@ bind_lease(struct interface_info *ip)
/* Timeout of zero means no timeout (some implementations seem to use
* one day).
*/
if( ip->client->active->renewal - cur_time )
if( ip->client->active->renewal - cur_time )
add_timeout(ip->client->active->renewal, state_bound, ip);
note("bound to %s -- renewal in %d seconds.",
@ -556,7 +556,7 @@ bind_lease(struct interface_info *ip)
ip->client->active->renewal - cur_time);
ip->client->state = S_BOUND;
Adapter = AdapterFindInfo( ip );
if( Adapter ) setup_adapter( Adapter, new_lease );
@ -1137,9 +1137,9 @@ cancel:
/* Now do a preinit on the interface so that we can
discover a new address. */
if( Adapter )
if( Adapter )
DeleteIPAddress( Adapter->NteContext );
ip->client->state = S_INIT;
state_init(ip);
return;
@ -1622,7 +1622,7 @@ priv_script_init(char *reason, char *medium)
struct interface_info *ip = ifi;
if (ip) {
// XXX Do we need to do anything?
// XXX Do we need to do anything?
}
}
@ -1996,7 +1996,7 @@ ipv4addrs(char * buf)
char *tmp;
struct in_addr jnk;
int i = 0;
note("Input: %s\n", buf);
do {

View file

@ -1,5 +1,5 @@
/* $Id:$
*
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Service
* FILE: subsys/system/dhcp
@ -47,12 +47,12 @@ LRESULT WINAPI ServiceThread( PVOID Data ) {
while( GetMessage( &msg, 0, 0, 0 ) ) {
switch( msg.message ) {
case DHCP_MANAGEADAPTER:
break;
case DHCP_UNMANAGEADAPTER:
break;
case DHCP_REQUESTPARAM:
break;

View file

@ -172,7 +172,7 @@ dispatch(void)
if (ip && (l->handler != got_one || !ip->dead)) {
DH_DbgPrint
(MID_TRACE,
("set(%d) -> %s\n",
("set(%d) -> %s\n",
l->fd, FD_ISSET(l->fd, &fds) ? "true" : "false"));
i++;
}
@ -192,7 +192,7 @@ dispatch(void)
/* Get the current time... */
time(&cur_time);
i = 0;
for (l = protocols; l; l = l->next) {
struct interface_info *ip;
@ -453,7 +453,7 @@ remove_protocol(struct protocol *proto)
}
struct protocol *
find_protocol_by_adapter(struct interface_info *info)
find_protocol_by_adapter(struct interface_info *info)
{
struct protocol *p;

View file

@ -99,7 +99,7 @@ void enter_host (hd)
if (!tree_evaluate (hd -> group -> options
[DHO_DHCP_CLIENT_IDENTIFIER]))
return;
/* If there's no uid hash, make one; otherwise, see if
there's already an entry in the hash for this host. */
if (!host_uid_hash) {
@ -165,7 +165,7 @@ struct host_decl *find_hosts_by_uid (data, len)
the addr pointer, update the host pointer to point at the host_decl
that matched, and return the subnet that matched. */
subnet *find_host_for_network (struct host_decl **host, iaddr *addr,
subnet *find_host_for_network (struct host_decl **host, iaddr *addr,
shared_network *share)
{
int i;
@ -391,7 +391,7 @@ void enter_subnet (struct _subnet *subnet)
first. */
if (subnet_inner_than (subnet, scan, 1)) {
if (prev) {
prev -> next_subnet = subnet;
prev -> next_subnet = subnet;
} else
subnets = subnet;
subnet -> next_subnet = scan;
@ -404,7 +404,7 @@ void enter_subnet (struct _subnet *subnet)
subnet -> next_subnet = subnets;
subnets = subnet;
}
/* Enter a new shared network into the shared network list. */
void enter_shared_network (shared_network *share)
@ -413,7 +413,7 @@ void enter_shared_network (shared_network *share)
share -> next = shared_networks;
shared_networks = share;
}
/* Enter a lease into the system. This is called by the parser each
time it reads in a new lease. If the subnet for that lease has
already been read in (usually the case), just update that lease;
@ -548,7 +548,7 @@ int supersede_lease (struct _lease *comp, struct _lease *lease, int commit)
hw_hash_add (comp);
}
/* Remove the lease from its current place in the
/* Remove the lease from its current place in the
timeout sequence. */
if (comp -> prev) {
comp -> prev -> next = comp -> next;
@ -678,7 +678,7 @@ lease *find_lease_by_uid (unsigned char *uid, int len)
lease *find_lease_by_hw_addr (unsigned char *hwaddr, int hwlen)
{
struct _lease *lease =
struct _lease *lease =
(struct _lease *)hash_lookup (lease_hw_addr_hash,
hwaddr, hwlen);
return lease;
@ -716,7 +716,7 @@ void uid_hash_add (lease *lease)
void uid_hash_delete (lease *lease)
{
struct _lease *head =
struct _lease *head =
find_lease_by_uid (lease -> uid, lease -> uid_len);
struct _lease *scan;
@ -856,7 +856,7 @@ struct class *find_class (type, name, len)
? user_class_hash
: vendor_class_hash, name, len);
return class;
}
}
struct group *clone_group (group, caller)
struct group *group;

View file

@ -18,7 +18,7 @@ DWORD CommThrId;
DWORD PipeSend( COMM_DHCP_REPLY *Reply ) {
DWORD Written = 0;
BOOL Success =
BOOL Success =
WriteFile( CommPipe,
Reply,
sizeof(*Reply),
@ -40,15 +40,15 @@ DWORD WINAPI PipeThreadProc( LPVOID Parameter ) {
case DhcpReqQueryHWInfo:
BytesWritten = DSQueryHWInfo( PipeSend, &Req );
break;
case DhcpReqLeaseIpAddress:
BytesWritten = DSLeaseIpAddress( PipeSend, &Req );
break;
case DhcpReqReleaseIpAddress:
BytesWritten = DSReleaseIpAddressLease( PipeSend, &Req );
break;
case DhcpReqRenewIpAddress:
BytesWritten = DSRenewIpAddressLease( PipeSend, &Req );
break;

View file

@ -6,16 +6,16 @@ void SocketInit() {
ServerSocket = socket( AF_INET, SOCK_DGRAM, 0 );
}
ssize_t send_packet( struct interface_info *ip,
ssize_t send_packet( struct interface_info *ip,
struct dhcp_packet *p,
size_t size,
struct in_addr addr,
struct sockaddr_in *broadcast,
struct hardware *hardware ) {
int result =
int result =
sendto( ip->wfdesc, (char *)p, size, 0,
(struct sockaddr *)broadcast, sizeof(*broadcast) );
if (result < 0) {
note ("send_packet: %x", result);
if (result == WSAENETUNREACH)
@ -26,13 +26,13 @@ ssize_t send_packet( struct interface_info *ip,
return result;
}
ssize_t receive_packet(struct interface_info *ip,
ssize_t receive_packet(struct interface_info *ip,
unsigned char *packet_data,
size_t packet_len,
struct sockaddr_in *dest,
struct sockaddr_in *dest,
struct hardware *hardware ) {
int recv_addr_size = sizeof(*dest);
int result =
int result =
recvfrom (ip -> rfdesc, (char *)packet_data, packet_len, 0,
(struct sockaddr *)dest, &recv_addr_size );
return result;

View file

@ -158,7 +158,7 @@ struct tree *tree_concat (left, right)
free_tree (right, "tree_concat");
return left;
}
/* Otherwise, allocate a new node to concatenate the two. */
if (!(nt = new_tree ("tree_concat")))
error ("No memory for data tree concatenation node.");
@ -346,7 +346,7 @@ static TIME do_host_lookup (bufix, bufp, bufcount, dns)
/* Count the number of addresses we got... */
for (i = 0; h -> h_addr_list [i]; i++)
;
/* Do we need to allocate more memory? */
new_len = i * h -> h_length;
if (dns -> buf_len < i) {

View file

@ -14,7 +14,7 @@ int note( char *format, ... ) {
int ret;
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
DbgPrint("NOTE: %s\n", buf);
return ret;
@ -27,11 +27,11 @@ int debug( char *format, ... ) {
int ret;
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
DbgPrint("DEBUG: %s\n", buf);
return ret;
}
}
int warn( char *format, ... ) {
va_list arg_begin;
@ -40,11 +40,11 @@ int warn( char *format, ... ) {
int ret;
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
DbgPrint("WARN: %s\n", buf);
return ret;
}
}
int warning( char *format, ... ) {
va_list arg_begin;
@ -53,7 +53,7 @@ int warning( char *format, ... ) {
int ret;
ret = vsnprintf( buf, sizeof(buf), format, arg_begin );
DbgPrint("WARNING: %s\n", buf);
return ret;
@ -65,9 +65,9 @@ void error( char *format, ... ) {
char buf[0x100];
vsnprintf( buf, sizeof(buf), format, arg_begin );
DbgPrint("ERROR: %s\n", buf);
}
}
int16_t getShort( unsigned char *data ) {
return (int16_t) ntohs(*(int16_t*) data);

View file

@ -213,7 +213,7 @@
#define IDC_STATIC -1
// Next default values for new objects
//
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 169

View file

@ -855,17 +855,17 @@ handle_exception (int exceptionVector)
*ptr++ = hexchars[sigval >> 4];
*ptr++ = hexchars[sigval & 0xf];
*ptr++ = hexchars[ESP];
*ptr++ = hexchars[ESP];
*ptr++ = ':';
ptr = mem2hex((char *)&registers[ESP], ptr, 4, 0); /* SP */
*ptr++ = ';';
*ptr++ = hexchars[EBP];
*ptr++ = hexchars[EBP];
*ptr++ = ':';
ptr = mem2hex((char *)&registers[EBP], ptr, 4, 0); /* FP */
*ptr++ = ';';
*ptr++ = hexchars[PC];
*ptr++ = hexchars[PC];
*ptr++ = ':';
ptr = mem2hex((char *)&registers[PC], ptr, 4, 0); /* PC */
*ptr++ = ';';

View file

@ -73,7 +73,7 @@ struct Pane : public SubclassedWindow
#define COLUMNS 12
int _widths[COLUMNS];
int _positions[COLUMNS+1];
WindowHandle _hwndHeader;
Entry* _root;

View file

@ -827,7 +827,7 @@ struct ANSUNC DWebBrowserEvents2Impl : public SimpleComObject,
_callback->WindowSetWidth(Variant(pDispParams->rgvarg[0]));
break;
case DISPID_WINDOWSETHEIGHT: // sent when the put_height method is called on the WebOC
case DISPID_WINDOWSETHEIGHT: // sent when the put_height method is called on the WebOC
if (pDispParams->cArgs != 1)
return E_INVALIDARG;
_callback->WindowSetHeight(Variant(pDispParams->rgvarg[0]));

View file

@ -41,7 +41,7 @@
/// quick launch bar shortcut
struct QuickLaunchEntry
{
{
QuickLaunchEntry();
HBITMAP _hbmp;

View file

@ -48,7 +48,7 @@
/// internal task bar button management entry
struct TaskBarEntry
{
{
TaskBarEntry();
int _id; // ID for WM_COMMAND

View file

@ -183,7 +183,7 @@ public:
virtual ~IDropTargetImpl();
void AddSuportedFormat(FORMATETC& ftetc) {m_formatetc.push_back(ftetc);}
//return values: true - release the medium. false - don't release the medium
virtual bool OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium, DWORD *pdwEffect) = 0;
@ -260,7 +260,7 @@ public:
}
HRESULT InitializeFromWindow(HWND hwnd, POINT& pt,IDataObject* pDataObject)
{
{
if (pDragSourceHelper == NULL)
return E_FAIL;
return pDragSourceHelper->InitializeFromWindow(hwnd, &pt, pDataObject);

View file

@ -19,7 +19,7 @@
//
// Explorer clone
//
//
// shellclasses.h
//
// C++ wrapper classes for COM interfaces and shell objects
@ -733,7 +733,7 @@ struct ShellPath : public SShellPtr<ITEMIDLIST>
_p = (ITEMIDLIST*) _malloc->Alloc(l);
if (_p) memcpy(_p, pidl, l);
} else
_p = NULL;
_p = NULL;
_malloc->Free(h);
}

View file

@ -555,7 +555,7 @@ template<typename BASE> struct ResizeController : public BASE
prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
}
}
}
protected:
@ -619,7 +619,7 @@ template<typename BASE> struct CtlColorParent : public BASE
#define PM_DISPATCH_DRAWITEM (WM_APP+0x09)
/// draw message routing for ColorButton and PictureButton
/// draw message routing for ColorButton and PictureButton
template<typename BASE> struct OwnerDrawParent : public BASE
{
typedef BASE super;

View file

@ -55,9 +55,9 @@ SIZEDEFINITION LegalSizes[] = {
void PrintWin32Error( PWCHAR Message, DWORD ErrorCode )
{
LPWSTR lpMsgBuf;
FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, ErrorCode,
NULL, ErrorCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(PWCHAR) &lpMsgBuf, 0, NULL );
printf("%S: %S\n", Message, lpMsgBuf );
@ -66,7 +66,7 @@ void PrintWin32Error( PWCHAR Message, DWORD ErrorCode )
//----------------------------------------------------------------------
//
//
// Usage
//
// Tell the user how to use the program
@ -80,7 +80,7 @@ VOID Usage( PWCHAR ProgramName )
printf(" -V:label Specifies volume label.\n");
printf(" -Q Performs a quick format.\n");
printf(" -A:size Overrides the default allocation unit size. Default settings\n");
printf(" are strongly recommended for general use\n");
printf(" are strongly recommended for general use\n");
printf(" NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.\n");
printf(" FAT supports 8192, 16K, 32K, 64K, 128K, 256K.\n");
printf(" NTFS compression is not supported for allocation unit sizes\n");
@ -125,7 +125,7 @@ int ParseCommandLine( int argc, WCHAR *argv[] )
} else if( !wcsnicmp( &argv[i][1], L"A:", 2 )) {
if( gotSize ) return -1;
j = 0;
j = 0;
while( LegalSizes[j].ClusterSize &&
wcsicmp( LegalSizes[j].SizeString, &argv[i][3] )) j++;
@ -184,7 +184,7 @@ FormatExCallback (CALLBACKCOMMAND Command,
PTEXTOUTPUT output;
PBOOLEAN status;
//
//
// We get other types of commands, but we don't have to pay attention to them
//
switch( Command ) {
@ -251,11 +251,11 @@ BOOLEAN LoadFMIFSEntryPoints()
}
//----------------------------------------------------------------------
//
//
// WMain
//
// Engine. Just get command line switches and fire off a format. This
// could also be done in a GUI like Explorer does when you select a
// Engine. Just get command line switches and fire off a format. This
// could also be done in a GUI like Explorer does when you select a
// drive and run a check on it.
//
// We do this in UNICODE because the chkdsk command expects PWCHAR
@ -294,7 +294,7 @@ int wmain( int argc, WCHAR *argv[] )
return -1;
}
//
//
// Get the drive's format
//
if( !Drive ) {
@ -331,16 +331,16 @@ int wmain( int argc, WCHAR *argv[] )
//
// Determine the drive's file system format
//
if( !GetVolumeInformationW( RootDirectory,
volumeName, sizeof(volumeName)/2,
&serialNumber, &maxComponent, &flags,
if( !GetVolumeInformationW( RootDirectory,
volumeName, sizeof(volumeName)/2,
&serialNumber, &maxComponent, &flags,
fileSystem, sizeof(fileSystem)/2)) {
PrintWin32Error( L"Could not query volume", GetLastError());
return -1;
}
if( !GetDiskFreeSpaceExW( RootDirectory,
if( !GetDiskFreeSpaceExW( RootDirectory,
&freeBytesAvailableToCaller,
&totalNumberOfBytes,
&totalNumberOfFreeBytes )) {
@ -362,7 +362,7 @@ int wmain( int argc, WCHAR *argv[] )
printf("Enter current volume label for drive %C: ", RootDirectory[0] );
fgetws( input, sizeof(input)/2, stdin );
input[ wcslen( input ) - 1] = 0;
if( !wcsicmp( input, volumeName )) {
break;
@ -377,41 +377,41 @@ int wmain( int argc, WCHAR *argv[] )
printf("DRIVE %C: WILL BE LOST!\n", RootDirectory[0] );
printf("Proceed with Format (Y/N)? " );
fgetws( input, sizeof(input)/2, stdin );
if( input[0] == L'Y' || input[0] == L'y' ) break;
if( input[0] == L'N' || input[0] == L'n' ) {
printf("\n");
return 0;
}
}
media = FMIFS_HARDDISK;
}
}
//
// Tell the user we're doing a long format if appropriate
//
if( !QuickFormat ) {
if( totalNumberOfBytes.QuadPart > 1024*1024*10 ) {
printf("Verifying %luM\n", (DWORD) (totalNumberOfBytes.QuadPart/(1024*1024)));
} else {
printf("Verifying %.1fM\n",
printf("Verifying %.1fM\n",
((float)(LONGLONG)totalNumberOfBytes.QuadPart)/(float)(1024.0*1024.0));
}
} else {
if( totalNumberOfBytes.QuadPart > 1024*1024*10 ) {
printf("QuickFormatting %luM\n", (DWORD) (totalNumberOfBytes.QuadPart/(1024*1024)));
} else {
printf("QuickFormatting %.2fM\n",
printf("QuickFormatting %.2fM\n",
((float)(LONGLONG)totalNumberOfBytes.QuadPart)/(float)(1024.0*1024.0));
}
printf("Creating file system structures.\n");
@ -419,7 +419,7 @@ int wmain( int argc, WCHAR *argv[] )
//
// Format away!
//
//
FormatEx( RootDirectory, media, Format, Label, QuickFormat,
ClusterSize, FormatExCallback );
if( Error ) return -1;
@ -449,22 +449,22 @@ int wmain( int argc, WCHAR *argv[] )
PrintWin32Error(L"Could not label volume", GetLastError());
return -1;
}
}
}
if( !GetVolumeInformationW( RootDirectory,
volumeName, sizeof(volumeName)/2,
&serialNumber, &maxComponent, &flags,
if( !GetVolumeInformationW( RootDirectory,
volumeName, sizeof(volumeName)/2,
&serialNumber, &maxComponent, &flags,
fileSystem, sizeof(fileSystem)/2)) {
PrintWin32Error( L"Could not query volume", GetLastError());
return -1;
}
//
//
// Print out some stuff including the formatted size
//
if( !GetDiskFreeSpaceExW( RootDirectory,
if( !GetDiskFreeSpaceExW( RootDirectory,
&freeBytesAvailableToCaller,
&totalNumberOfBytes,
&totalNumberOfFreeBytes )) {
@ -479,9 +479,9 @@ int wmain( int argc, WCHAR *argv[] )
//
// Get the drive's serial number
//
if( !GetVolumeInformationW( RootDirectory,
volumeName, sizeof(volumeName)/2,
&serialNumber, &maxComponent, &flags,
if( !GetVolumeInformationW( RootDirectory,
volumeName, sizeof(volumeName)/2,
&serialNumber, &maxComponent, &flags,
fileSystem, sizeof(fileSystem)/2)) {
PrintWin32Error( L"Could not query volume", GetLastError());
@ -489,7 +489,7 @@ int wmain( int argc, WCHAR *argv[] )
}
printf("\nVolume Serial Number is %04X-%04X\n", (unsigned int)(serialNumber >> 16),
(unsigned int)(serialNumber & 0xFFFF) );
return 0;
}

View file

@ -538,7 +538,7 @@ template<typename BASE> struct ResizeController : public BASE
prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
}
}
}
protected:
@ -602,7 +602,7 @@ template<typename BASE> struct CtlColorParent : public BASE
#define PM_DISPATCH_DRAWITEM (WM_APP+0x09)
/// draw message routing for ColorButton and PictureButton
/// draw message routing for ColorButton and PictureButton
template<typename BASE> struct OwnerDrawParent : public BASE
{
typedef BASE super;

View file

@ -827,7 +827,7 @@ struct ANSUNC DWebBrowserEvents2Impl : public SimpleComObject,
_callback->WindowSetWidth(Variant(pDispParams->rgvarg[0]));
break;
case DISPID_WINDOWSETHEIGHT: // sent when the put_height method is called on the WebOC
case DISPID_WINDOWSETHEIGHT: // sent when the put_height method is called on the WebOC
if (pDispParams->cArgs != 1)
return E_INVALIDARG;
_callback->WindowSetHeight(Variant(pDispParams->rgvarg[0]));

View file

@ -1,9 +1,9 @@
/* $Id$
*
* reactos/subsys/system/lsass/lsass.c
*
*
* ReactOS Operating System
*
*
* --------------------------------------------------------------------
*
* This software is free software; you can redistribute it and/or
@ -19,10 +19,10 @@
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
* MA 02139, USA.
*
* --------------------------------------------------------------------
*
*
* 19990704 (Emanuele Aliberti)
* Compiled successfully with egcs 1.1.2
*/

View file

@ -385,15 +385,15 @@ VOID DIALOG_FilePrint(VOID)
hdrFont.lfQuality = PROOF_QUALITY;
hdrFont.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN;
lstrcpy(hdrFont.lfFaceName, times_new_romanW);
font = CreateFontIndirect(&hdrFont);
/* Get Current Settings */
ZeroMemory(&printer, sizeof(printer));
printer.lStructSize = sizeof(printer);
printer.hwndOwner = Globals.hMainWnd;
printer.hInstance = Globals.hInstance;
/* Set some default flags */
printer.Flags = PD_RETURNDC;
printer.nFromPage = 0;
@ -414,10 +414,10 @@ VOID DIALOG_FilePrint(VOID)
di.lpszDocName = Globals.szFileTitle;
di.lpszOutput = NULL;
di.lpszDatatype = NULL;
di.fwType = 0;
di.fwType = 0;
if (StartDoc(printer.hDC, &di) <= 0) return;
/* Get the page dimensions in pixels. */
cWidthPels = GetDeviceCaps(printer.hDC, HORZRES);
cHeightPels = GetDeviceCaps(printer.hDC, VERTRES);
@ -431,7 +431,7 @@ VOID DIALOG_FilePrint(VOID)
return;
}
size = GetWindowText(Globals.hEdit, pTemp, size);
border = 150;
for (copycount=1; copycount <= printer.nCopies; copycount++) {
i = 0;
@ -445,10 +445,10 @@ VOID DIALOG_FilePrint(VOID)
dopage = 1;
else
dopage = 0;
old_font = SelectObject(printer.hDC, font);
GetTextExtentPoint32(printer.hDC, letterM, 1, &szMetric);
if (dopage) {
if (StartPage(printer.hDC) <= 0) {
static const WCHAR failedW[] = { 'S','t','a','r','t','P','a','g','e',' ','f','a','i','l','e','d',0 };
@ -463,14 +463,14 @@ VOID DIALOG_FilePrint(VOID)
*/
TextOut(printer.hDC, border*2, border+szMetric.cy/2, Globals.szFileTitle, lstrlen(Globals.szFileTitle));
}
/* The starting point for the main text */
xLeft = border*2;
yTop = border+szMetric.cy*4;
SelectObject(printer.hDC, old_font);
GetTextExtentPoint32(printer.hDC, letterM, 1, &szMetric);
GetTextExtentPoint32(printer.hDC, letterM, 1, &szMetric);
/* Since outputting strings is giving me problems, output the main
text one character at a time.
*/
@ -485,7 +485,7 @@ VOID DIALOG_FilePrint(VOID)
xLeft += szMetric.cx;
}
} while (i++<size && yTop<(cHeightPels-border*2));
if (dopage)
EndPage(printer.hDC);
pagecount++;

View file

@ -76,7 +76,7 @@ static int NOTEPAD_MenuCommand(WPARAM wParam)
case CMD_SEARCH: DIALOG_Search(); break;
case CMD_SEARCH_NEXT: DIALOG_SearchNext(); break;
case CMD_WRAP: DIALOG_EditWrap(); break;
case CMD_FONT: DIALOG_SelectFont(); break;
@ -206,7 +206,7 @@ static void HandleCommandLine(LPWSTR cmdline)
{
WCHAR delimiter;
int opt_print=0;
/* skip white space */
while (*cmdline == ' ') cmdline++;

View file

@ -49,7 +49,7 @@ static void draw_splitbar(HWND hWnd, int x)
RECT rt;
HGDIOBJ OldObj;
HDC hdc = GetDC(hWnd);
if(!SizingPattern)
{
const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
@ -144,7 +144,7 @@ ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
TCHAR buffer[MAX_PATH];
/* load "My Computer" string */
LoadString(hInst, IDS_MY_COMPUTER, buffer, sizeof(buffer)/sizeof(TCHAR));
g_pChildWnd = pChildWnd = HeapAlloc(GetProcessHeap(), 0, sizeof(ChildWnd));
if (!pChildWnd) return 0;
_tcsncpy(pChildWnd->szPath, buffer, MAX_PATH);
@ -240,7 +240,7 @@ ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
SizingBrush = CreatePatternBrush(SizingPattern);
}
pt = MAKEPOINTS(lParam);
GetClientRect(hWnd, &rt);
pt.x = min(max(pt.x, SPLIT_MIN), rt.right - SPLIT_MIN);
@ -317,7 +317,7 @@ ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
}
break;
case WM_CONTEXTMENU:
{
POINTS pt;
@ -343,13 +343,13 @@ ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
EnableMenuItem(mnu, ID_EDIT_RENAME, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
EnableMenuItem(mnu, ID_EDIT_MODIFY, MF_BYCOMMAND | (cnt == 1 ? MF_ENABLED : MF_DISABLED | MF_GRAYED));
EnableMenuItem(mnu, ID_EDIT_MODIFY_BIN, MF_BYCOMMAND | (cnt == 1 ? MF_ENABLED : MF_DISABLED | MF_GRAYED));
TrackPopupMenu(mnu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL);
}
}
break;
}
case WM_SIZE:
if (wParam != SIZE_MINIMIZED && pChildWnd != NULL) {
ResizeWnd(pChildWnd, LOWORD(lParam), HIWORD(lParam));

View file

@ -516,7 +516,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
{
DWORD llen, listlen, nl_len;
LPTSTR src, lines = NULL;
if (!(stringValueData = HeapAlloc(GetProcessHeap(), 0, valueDataLen)))
{
error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
@ -528,7 +528,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
error(hwnd, IDS_BAD_VALUE, valueName);
goto done;
}
/* convert \0 to \r\n */
src = stringValueData;
nl_len = _tcslen(_T("\r\n")) * sizeof(TCHAR);
@ -561,7 +561,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
BOOL EmptyLines = FALSE;
LPTSTR src, lines, nl;
DWORD linechars, buflen, c_nl, dest;
src = stringValueData;
buflen = sizeof(TCHAR);
lines = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen + sizeof(TCHAR));
@ -598,12 +598,12 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
src += linechars + (nl != NULL ? c_nl : 0);
}
lines[++dest] = _T('\0');
if(EmptyLines)
{
warning(hwnd, IDS_MULTI_SZ_EMPTY_STRING);
}
lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)lines, buflen);
HeapFree(GetProcessHeap(), 0, lines);
}
@ -636,7 +636,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
#ifndef UNICODE
LPWSTR u_valuename;
int len_vname = lstrlen(valueName);
if(len_vname > 0)
{
if(!(u_valuename = HeapAlloc(GetProcessHeap(), 0, (len_vname + 1) * sizeof(WCHAR))))
@ -658,7 +658,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
goto done;
}
/* force to use the unicode version, so editing strings in binary mode is correct */
lRet = RegQueryValueExW(hKey,
#ifndef UNICODE

View file

@ -217,7 +217,7 @@ void
BuildFilterStrings(TCHAR *Filter, PFILTERPAIR Pairs, int PairCount)
{
int i, c;
c = 0;
for(i = 0; i < PairCount; i++)
{
@ -233,12 +233,12 @@ static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME* pofn)
{
FILTERPAIR FilterPairs[3];
static TCHAR Filter[1024];
memset(pofn, 0, sizeof(OPENFILENAME));
pofn->lStructSize = sizeof(OPENFILENAME);
pofn->hwndOwner = hWnd;
pofn->hInstance = hInst;
/* create filter string */
FilterPairs[0].DisplayID = IDS_FLT_REGFILES;
FilterPairs[0].FilterID = IDS_FLT_REGFILES_FLT;
@ -247,7 +247,7 @@ static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME* pofn)
FilterPairs[2].DisplayID = IDS_FLT_ALLFILES;
FilterPairs[2].FilterID = IDS_FLT_ALLFILES_FLT;
BuildFilterStrings(Filter, FilterPairs, sizeof(FilterPairs) / sizeof(FILTERPAIR));
pofn->lpstrFilter = Filter;
pofn->lpstrCustomFilter = CustomFilterBuffer;
pofn->nMaxCustFilter = MAX_CUSTOM_FILTER_SIZE;
@ -326,7 +326,7 @@ static BOOL ExportRegistryFile(HWND hWnd)
ofn.lpfnHook = ImportRegistryFile_OFNHookProc;
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);
if (GetSaveFileName(&ofn)) {
BOOL result;
BOOL result;
/* FIXME - convert strings to ascii! */
result = export_registry_key((CHAR*)ofn.lpstrFile, (CHAR*)ExportKeyPath);
/*result = export_registry_key(ofn.lpstrFile, NULL);*/
@ -482,7 +482,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
REGSAM regsam = KEY_READ;
LONG lRet;
int item;
switch (LOWORD(wParam)) {
case ID_REGISTRY_IMPORTREGISTRYFILE:
ImportRegistryFile(hWnd);
@ -529,7 +529,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case ID_EDIT_MODIFY:
case ID_EDIT_MODIFY_BIN:
case ID_EDIT_DELETE:
regsam |= KEY_WRITE;
regsam |= KEY_WRITE;
break;
}
@ -570,7 +570,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if(MessageBox(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) == IDYES)
{
int ni, errs;
item = -1;
errs = 0;
while((ni = ListView_GetNextItem(g_pChildWnd->hListWnd, item, LVNI_SELECTED)) > -1)
@ -582,7 +582,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
item = ni;
}
RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
if(errs > 0)
{
@ -625,7 +625,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
default:
result = FALSE;
}
if(hKey)
RegCloseKey(hKey);
return result;

View file

@ -41,11 +41,11 @@ typedef struct
INT CharWidth;
HFONT hFont;
BOOL SbVisible;
INT LeftMargin;
INT AddressSpacing;
INT SplitSpacing;
BOOL EditingField;
INT CaretCol;
INT CaretLine;
@ -67,7 +67,7 @@ STDCALL
RegisterHexEditorClass(HINSTANCE hInstance)
{
WNDCLASSEX WndClass;
ZeroMemory(&WndClass, sizeof(WNDCLASSEX));
WndClass.cbSize = sizeof(WNDCLASSEX);
WndClass.style = CS_DBLCLKS;
@ -77,7 +77,7 @@ RegisterHexEditorClass(HINSTANCE hInstance)
WndClass.hCursor = LoadCursor(0, IDC_IBEAM);
WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
WndClass.lpszClassName = HEX_EDIT_CLASS_NAME;
return RegisterClassEx(&WndClass);
}
@ -94,11 +94,11 @@ static VOID
HEXEDIT_MoveCaret(PHEXEDIT_DATA hed, BOOL Scroll)
{
SCROLLINFO si;
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_POS;
GetScrollInfo(hed->hWndSelf, SB_VERT, &si);
if(Scroll)
{
if(si.nPos > hed->CaretLine)
@ -110,13 +110,13 @@ HEXEDIT_MoveCaret(PHEXEDIT_DATA hed, BOOL Scroll)
}
else if(hed->CaretLine >= (hed->nVisibleLinesComplete + si.nPos))
{
si.nPos = hed->CaretLine - hed->nVisibleLinesComplete + 1;
si.nPos = hed->CaretLine - hed->nVisibleLinesComplete + 1;
SetScrollInfo(hed->hWndSelf, SB_VERT, &si, TRUE);
GetScrollInfo(hed->hWndSelf, SB_VERT, &si);
InvalidateRect(hed->hWndSelf, NULL, TRUE);
}
}
if(hed->EditingField)
SetCaretPos(hed->LeftMargin + ((4 + hed->AddressSpacing + (3 * hed->CaretCol)) * hed->CharWidth) - 1, (hed->CaretLine - si.nPos) * hed->LineHeight);
else
@ -130,17 +130,17 @@ HEXEDIT_Update(PHEXEDIT_DATA hed)
RECT rcClient;
BOOL SbVisible;
DWORD bufsize, cvislines;
GetClientRect(hed->hWndSelf, &rcClient);
hed->style = GetWindowLong(hed->hWndSelf, GWL_STYLE);
bufsize = (hed->hBuffer ? LocalSize(hed->hBuffer) : 0);
hed->nLines = max(bufsize / hed->ColumnsPerLine, 1);
if(bufsize > hed->ColumnsPerLine && (bufsize % hed->ColumnsPerLine) > 0)
{
hed->nLines++;
}
if(hed->LineHeight > 0)
{
hed->nVisibleLinesComplete = cvislines = rcClient.bottom / hed->LineHeight;
@ -154,10 +154,10 @@ HEXEDIT_Update(PHEXEDIT_DATA hed)
{
hed->nVisibleLines = cvislines = 0;
}
SbVisible = bufsize > 0 && cvislines < hed->nLines;
ShowScrollBar(hed->hWndSelf, SB_VERT, SbVisible);
/* update scrollbar */
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_RANGE | SIF_PAGE;
@ -165,12 +165,12 @@ HEXEDIT_Update(PHEXEDIT_DATA hed)
si.nMax = ((bufsize > 0) ? hed->nLines - 1 : 0);
si.nPage = ((hed->LineHeight > 0) ? rcClient.bottom / hed->LineHeight : 0);
SetScrollInfo(hed->hWndSelf, SB_VERT, &si, TRUE);
if(IsWindowVisible(hed->hWndSelf) && SbVisible != hed->SbVisible)
{
InvalidateRect(hed->hWndSelf, NULL, TRUE);
}
hed->SbVisible = SbVisible;
}
@ -190,9 +190,9 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
UINT bufsize;
TCHAR hex[3], addr[17];
RECT rct;
FillRect(hDC, rc, (HBRUSH)(COLOR_WINDOW + 1));
if(hed->hBuffer)
{
bufsize = LocalSize(hed->hBuffer);
@ -202,7 +202,7 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
{
buf = NULL;
bufsize = 0;
if(ScrollPos + First == 0)
{
/* draw address */
@ -210,7 +210,7 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
TextOut(hDC, hed->LeftMargin, First * hed->LineHeight, addr, 4);
}
}
if(buf)
{
end = buf + bufsize;
@ -218,25 +218,25 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
linestart = (ScrollPos + First) * hed->ColumnsPerLine;
current = buf + linestart;
Last = min(hed->nLines - ScrollPos, Last);
while(First <= Last && current < end)
{
DWORD dh;
dx = hed->LeftMargin;
/* draw address */
_stprintf(addr, _T("%04X"), linestart);
TextOut(hDC, dx, dy, addr, 4);
dx += ((4 + hed->AddressSpacing) * hed->CharWidth);
dh = (3 * hed->CharWidth);
rct.left = dx;
rct.top = dy;
rct.right = rct.left + dh;
rct.bottom = dy + hed->LineHeight;
/* draw hex map */
dx += (hed->CharWidth / 2);
line = current;
@ -244,12 +244,12 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
{
rct.left += dh;
rct.right += dh;
_stprintf(hex, _T("%02X"), *(current++));
ExtTextOut(hDC, dx, dy, ETO_OPAQUE, &rct, hex, 2, NULL);
dx += dh;
}
/* draw ascii map */
dx = ((4 + hed->AddressSpacing + hed->SplitSpacing + (hed->ColumnsPerLine * 3)) * hed->CharWidth);
current = line;
@ -260,13 +260,13 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
TextOut(hDC, dx, dy, hex, 1);
dx += hed->CharWidth;
}
dy += hed->LineHeight;
linestart += hed->ColumnsPerLine;
First++;
}
}
LocalUnlock(hed->hBuffer);
}
@ -275,47 +275,47 @@ HEXEDIT_HitRegionTest(PHEXEDIT_DATA hed, POINTS pt)
{
WINDOWINFO wi;
int d;
if(pt.x <= hed->LeftMargin)
{
return HEHT_LEFTMARGIN;
}
pt.x -= hed->LeftMargin;
d = (4 * hed->CharWidth);
if(pt.x <= d)
{
return HEHT_ADDRESS;
}
pt.x -= d;
d = (hed->AddressSpacing * hed->CharWidth);
if(pt.x <= d)
{
return HEHT_ADDRESSSPACING;
}
pt.x -= d;
d = (3 * hed->ColumnsPerLine * hed->CharWidth);
if(pt.x <= d)
{
return HEHT_HEXDUMP;
}
pt.x -= d;
d = (hed->SplitSpacing * hed->CharWidth);
if(pt.x <= d)
{
return HEHT_HEXDUMPSPACING;
}
pt.x -= d;
d = (hed->ColumnsPerLine * hed->CharWidth);
if(pt.x <= d)
{
return HEHT_ASCIIDUMP;
}
return HEHT_RIGHTMARGIN;
}
@ -324,13 +324,13 @@ HEXEDIT_PositionFromPoint(PHEXEDIT_DATA hed, POINTS pt, DWORD Hit, POINT *EditPo
{
SCROLLINFO si;
DWORD Pos, bufsize;
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_POS;
GetScrollInfo(hed->hWndSelf, SB_VERT, &si);
EditPos->x = 0;
if(hed->LineHeight > 0)
{
EditPos->y = min(si.nPos + (pt.y / hed->LineHeight), hed->nLines - 1);
@ -339,7 +339,7 @@ HEXEDIT_PositionFromPoint(PHEXEDIT_DATA hed, POINTS pt, DWORD Hit, POINT *EditPo
{
EditPos->y = si.nPos;
}
switch(Hit)
{
case HEHT_LEFTMARGIN:
@ -349,19 +349,19 @@ HEXEDIT_PositionFromPoint(PHEXEDIT_DATA hed, POINTS pt, DWORD Hit, POINT *EditPo
pt.x -= hed->LeftMargin + ((4 + hed->AddressSpacing) * hed->CharWidth);
*EditField = TRUE;
break;
default:
pt.x -= hed->LeftMargin + ((4 + hed->AddressSpacing + hed->SplitSpacing + (3 * hed->ColumnsPerLine)) * hed->CharWidth);
*EditField = FALSE;
break;
}
if(pt.x > 0)
{
INT BlockWidth = (*EditField ? hed->CharWidth * 3 : hed->CharWidth);
EditPos->x = min(hed->ColumnsPerLine, pt.x / BlockWidth);
}
bufsize = (hed->hBuffer ? LocalSize(hed->hBuffer) : 0);
Pos = (EditPos->y * hed->ColumnsPerLine) + EditPos->x;
if(Pos > bufsize)
@ -381,12 +381,12 @@ HEXEDIT_HEM_LOADBUFFER(PHEXEDIT_DATA hed, PVOID Buffer, DWORD Size)
if(Buffer != NULL && Size > 0)
{
LPVOID buf;
if(hed->MaxBuffer > 0 && Size > hed->MaxBuffer)
{
Size = hed->MaxBuffer;
}
if(hed->hBuffer)
{
if(Size > 0)
@ -401,7 +401,7 @@ HEXEDIT_HEM_LOADBUFFER(PHEXEDIT_DATA hed, PVOID Buffer, DWORD Size)
hed->hBuffer = LocalFree(hed->hBuffer);
hed->Position = 0;
HEXEDIT_Update(hed);
return 0;
}
}
@ -409,7 +409,7 @@ HEXEDIT_HEM_LOADBUFFER(PHEXEDIT_DATA hed, PVOID Buffer, DWORD Size)
{
hed->hBuffer = LocalAlloc(LHND, Size);
}
if(Size > 0)
{
buf = LocalLock(hed->hBuffer);
@ -417,11 +417,11 @@ HEXEDIT_HEM_LOADBUFFER(PHEXEDIT_DATA hed, PVOID Buffer, DWORD Size)
{
memcpy(buf, Buffer, Size);
}
else
else
Size = 0;
LocalUnlock(hed->hBuffer);
}
hed->Position = 0;
HEXEDIT_Update(hed);
return Size;
@ -432,7 +432,7 @@ HEXEDIT_HEM_LOADBUFFER(PHEXEDIT_DATA hed, PVOID Buffer, DWORD Size)
hed->hBuffer = LocalFree(hed->hBuffer);
HEXEDIT_Update(hed);
}
return 0;
}
@ -440,19 +440,19 @@ static LRESULT
HEXEDIT_HEM_COPYBUFFER(PHEXEDIT_DATA hed, PVOID Buffer, DWORD Size)
{
DWORD nCpy;
if(!hed->hBuffer)
{
return 0;
}
if(Buffer != NULL && Size > 0)
{
nCpy = min(Size, LocalSize(hed->hBuffer));
if(nCpy > 0)
{
PVOID buf;
buf = LocalLock(hed->hBuffer);
if(buf)
{
@ -464,7 +464,7 @@ HEXEDIT_HEM_COPYBUFFER(PHEXEDIT_DATA hed, PVOID Buffer, DWORD Size)
}
return nCpy;
}
return (LRESULT)LocalSize(hed->hBuffer);
}
@ -486,25 +486,25 @@ static LRESULT
HEXEDIT_WM_NCCREATE(HWND hWnd, CREATESTRUCT *cs)
{
PHEXEDIT_DATA hed;
if(!(hed = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HEXEDIT_DATA))))
{
return FALSE;
}
hed->hWndSelf = hWnd;
hed->hWndParent = cs->hwndParent;
hed->style = cs->style;
hed->ColumnsPerLine = 8;
hed->LeftMargin = 2;
hed->AddressSpacing = 2;
hed->SplitSpacing = 2;
hed->EditingField = TRUE; /* in hexdump field */
SetWindowLongPtr(hWnd, 0, (DWORD_PTR)hed);
HEXEDIT_Update(hed);
return TRUE;
}
@ -516,15 +516,15 @@ HEXEDIT_WM_NCDESTROY(PHEXEDIT_DATA hed)
while(LocalUnlock(hed->hBuffer));
LocalFree(hed->hBuffer);
}
if(hed->hFont)
{
DeleteObject(hed->hFont);
}
SetWindowLongPtr(hed->hWndSelf, 0, (DWORD_PTR)0);
HeapFree(GetProcessHeap(), 0, hed);
return 0;
}
@ -555,54 +555,54 @@ HEXEDIT_WM_VSCROLL(PHEXEDIT_DATA hed, WORD ThumbPosition, WORD SbCmd)
{
int ScrollY;
SCROLLINFO si;
ZeroMemory(&si, sizeof(SCROLLINFO));
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_ALL;
GetScrollInfo(hed->hWndSelf, SB_VERT, &si);
ScrollY = si.nPos;
switch(SbCmd)
{
case SB_TOP:
si.nPos = si.nMin;
break;
case SB_BOTTOM:
si.nPos = si.nMax;
break;
case SB_LINEUP:
si.nPos--;
break;
case SB_LINEDOWN:
si.nPos++;
break;
case SB_PAGEUP:
si.nPos -= si.nPage;
break;
case SB_PAGEDOWN:
si.nPos += si.nPage;
break;
case SB_THUMBTRACK:
si.nPos = si.nTrackPos;
break;
}
si.fMask = SIF_POS;
SetScrollInfo(hed->hWndSelf, SB_VERT, &si, TRUE);
GetScrollInfo(hed->hWndSelf, SB_VERT, &si);
if(si.nPos != ScrollY)
{
ScrollWindow(hed->hWndSelf, 0, (ScrollY - si.nPos) * hed->LineHeight, NULL, NULL);
UpdateWindow(hed->hWndSelf);
}
return 0;
}
@ -612,12 +612,12 @@ HEXEDIT_WM_SETFONT(PHEXEDIT_DATA hed, HFONT hFont, BOOL bRedraw)
HDC hDC;
TEXTMETRIC tm;
HFONT hOldFont = 0;
if(hFont == 0)
{
hFont = HEXEDIT_GetFixedFont();
}
hed->hFont = hFont;
hDC = GetDC(hed->hWndSelf);
if(hFont)
@ -632,12 +632,12 @@ HEXEDIT_WM_SETFONT(PHEXEDIT_DATA hed, HFONT hFont, BOOL bRedraw)
SelectObject(hDC, hOldFont);
}
ReleaseDC(hed->hWndSelf, hDC);
if(bRedraw)
{
InvalidateRect(hed->hWndSelf, NULL, TRUE);
}
return 0;
}
@ -658,14 +658,14 @@ HEXEDIT_WM_PAINT(PHEXEDIT_DATA hed)
HFONT hOldFont;
HDC hTempDC;
DWORD height;
if(GetUpdateRect(hed->hWndSelf, &rc, FALSE) && (hed->LineHeight > 0))
{
ZeroMemory(&si, sizeof(SCROLLINFO));
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_POS;
GetScrollInfo(hed->hWndSelf, SB_VERT, &si);
height = (rc.bottom - rc.top);
nLines = height / hed->LineHeight;
if((height % hed->LineHeight) > 0)
@ -677,7 +677,7 @@ HEXEDIT_WM_PAINT(PHEXEDIT_DATA hed)
nLines = hed->nLines - si.nPos;
}
nFirst = rc.top / hed->LineHeight;
BeginPaint(hed->hWndSelf, &ps);
if(!(hTempDC = CreateCompatibleDC(ps.hdc)))
{
@ -696,14 +696,14 @@ HEXEDIT_WM_PAINT(PHEXEDIT_DATA hed)
BitBlt(ps.hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hTempDC, rc.left, rc.top, SRCCOPY);
SelectObject(hTempDC, hOldFont);
SelectObject(hTempDC, hbmpold);
DeleteObject(hbmp);
DeleteDC(hTempDC);
epaint:
EndPaint(hed->hWndSelf, &ps);
}
return 0;
}
@ -712,26 +712,26 @@ HEXEDIT_WM_MOUSEWHEEL(PHEXEDIT_DATA hed, int cyMoveLines, WORD ButtonsDown, LPPO
{
SCROLLINFO si;
int ScrollY;
SetFocus(hed->hWndSelf);
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_ALL;
GetScrollInfo(hed->hWndSelf, SB_VERT, &si);
ScrollY = si.nPos;
si.fMask = SIF_POS;
si.nPos += cyMoveLines;
SetScrollInfo(hed->hWndSelf, SB_VERT, &si, TRUE);
GetScrollInfo(hed->hWndSelf, SB_VERT, &si);
if(si.nPos != ScrollY)
{
ScrollWindow(hed->hWndSelf, 0, (ScrollY - si.nPos) * hed->LineHeight, NULL, NULL);
UpdateWindow(hed->hWndSelf);
}
return 0;
}
@ -747,16 +747,16 @@ HEXEDIT_WM_LBUTTONDOWN(PHEXEDIT_DATA hed, INT Buttons, POINTS Pt)
BOOL NewField;
POINT EditPos;
DWORD Hit = HEXEDIT_HitRegionTest(hed, Pt);
SetFocus(hed->hWndSelf);
hed->Position = HEXEDIT_PositionFromPoint(hed, Pt, Hit, &EditPos, &NewField);
hed->Position = HEXEDIT_PositionFromPoint(hed, Pt, Hit, &EditPos, &NewField);
hed->EditingField = NewField;
hed->CaretCol = EditPos.x;
hed->CaretLine = EditPos.y;
hed->CaretLine = EditPos.y;
HEXEDIT_MoveCaret(hed, TRUE);
return 0;
}
@ -765,17 +765,17 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
{
DWORD bufsize;
BOOL shift, control;
if(GetKeyState(VK_MENU) & 0x8000)
{
return FALSE;
}
shift = GetKeyState(VK_SHIFT) & 0x8000;
control = GetKeyState(VK_CONTROL) & 0x8000;
bufsize = (hed->hBuffer ? LocalSize(hed->hBuffer) : 0);
switch(VkCode)
{
case VK_LEFT:
@ -791,7 +791,7 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
}
HEXEDIT_MoveCaret(hed, TRUE);
break;
case VK_RIGHT:
if(hed->Position < bufsize)
{
@ -805,7 +805,7 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
}
HEXEDIT_MoveCaret(hed, TRUE);
break;
case VK_UP:
if(hed->Position > 0)
{
@ -822,7 +822,7 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
}
HEXEDIT_MoveCaret(hed, TRUE);
break;
case VK_DOWN:
if(hed->Position <= bufsize)
{
@ -847,7 +847,7 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
HEXEDIT_MoveCaret(hed, TRUE);
break;
}
return FALSE;
}
@ -862,33 +862,33 @@ INT_PTR CALLBACK
HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PHEXEDIT_DATA hed;
hed = (PHEXEDIT_DATA)GetWindowLongPtr(hWnd, (DWORD_PTR)0);
switch(uMsg)
{
case WM_ERASEBKGND:
return TRUE;
case WM_PAINT:
return HEXEDIT_WM_PAINT(hed);
case WM_KEYDOWN:
return HEXEDIT_WM_KEYDOWN(hed, (INT)wParam);
case WM_VSCROLL:
return HEXEDIT_WM_VSCROLL(hed, HIWORD(wParam), LOWORD(wParam));
case WM_SIZE:
return HEXEDIT_WM_SIZE(hed, (DWORD)wParam, LOWORD(lParam), HIWORD(lParam));
case WM_LBUTTONDOWN:
return HEXEDIT_WM_LBUTTONDOWN(hed, (INT)wParam, MAKEPOINTS(lParam));
case WM_MOUSEWHEEL:
{
UINT nScrollLines = 3;
int delta = 0;
SystemParametersInfoW(SPI_GETWHEELSCROLLLINES, 0, &nScrollLines, 0);
delta -= (SHORT)HIWORD(wParam);
if(abs(delta) >= WHEEL_DELTA && nScrollLines != 0)
@ -897,41 +897,41 @@ HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
break;
}
case HEM_LOADBUFFER:
return HEXEDIT_HEM_LOADBUFFER(hed, (PVOID)wParam, (DWORD)lParam);
case HEM_COPYBUFFER:
return HEXEDIT_HEM_COPYBUFFER(hed, (PVOID)wParam, (DWORD)lParam);
case HEM_SETMAXBUFFERSIZE:
return HEXEDIT_HEM_SETMAXBUFFERSIZE(hed, (DWORD)lParam);
case WM_SETFOCUS:
return HEXEDIT_WM_SETFOCUS(hed);
case WM_KILLFOCUS:
return HEXEDIT_WM_KILLFOCUS(hed);
case WM_GETDLGCODE:
return HEXEDIT_WM_GETDLGCODE((LPMSG)lParam);
case WM_SETFONT:
return HEXEDIT_WM_SETFONT(hed, (HFONT)wParam, (BOOL)LOWORD(lParam));
case WM_GETFONT:
return HEXEDIT_WM_GETFONT(hed);
case WM_CREATE:
return HEXEDIT_WM_CREATE(hed);
case WM_NCCREATE:
if(!hed)
{
return HEXEDIT_WM_NCCREATE(hWnd, (CREATESTRUCT*)lParam);
}
break;
case WM_NCDESTROY:
if(hed)
{
@ -939,7 +939,7 @@ HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
break;
}
return CallWindowProc(DefWindowProc, hWnd, uMsg, wParam, lParam);
}

View file

@ -100,7 +100,7 @@ BOOL IsDefaultValue(HWND hwndLV, int i)
{
PLINE_INFO lineinfo;
LVITEM Item;
Item.mask = LVIF_PARAM;
Item.iItem = i;
if(ListView_GetItem(hwndLV, &Item))
@ -276,10 +276,10 @@ static BOOL InitListViewImageLists(HWND hwndLV)
hico = LoadIcon(hInst, MAKEINTRESOURCE(IDI_BIN));
Image_Bin = ImageList_AddIcon(himl, hico);
hico = LoadIcon(hInst, MAKEINTRESOURCE(IDI_STRING));
Image_String = ImageList_AddIcon(himl, hico);
/* Fail if not all of the images were added. */
if (ImageList_GetImageCount(himl) < NUM_ICONS)
@ -362,10 +362,10 @@ static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSor
LINE_INFO*l, *r;
l = (LINE_INFO*)lParam1;
r = (LINE_INFO*)lParam2;
if (g_columnToSort == ~0UL)
if (g_columnToSort == ~0UL)
g_columnToSort = 0;
if (g_columnToSort == 1 && l->dwValType != r->dwValType)
return g_invertSort ? (int)r->dwValType - (int)l->dwValType : (int)l->dwValType - (int)r->dwValType;
if (g_columnToSort == 2) {
@ -400,7 +400,7 @@ BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
g_columnToSort = ((LPNMLISTVIEW)lParam)->iSubItem;
g_invertSort = FALSE;
}
ListView_SortItems(hWnd, CompareFunc, (WPARAM)hWnd);
return TRUE;
case NM_DBLCLK:
@ -449,7 +449,7 @@ BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
//if((ret = RenameValue(lineinfo->name, Info->item.pszText)) != ERROR_SUCCESS)
{
TCHAR msg[128], caption[128];
LoadString(hInst, IDS_ERR_RENVAL_CAPTION, caption, sizeof(caption)/sizeof(TCHAR));
if(_tcslen(Info->item.pszText) == 0)
{
@ -483,7 +483,7 @@ HWND CreateListView(HWND hwndParent, int id)
0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)id, hInst, NULL);
if (!hwndLV) return NULL;
/* Initialize the image list, and add items to the control. */
if (!CreateListColumns(hwndLV)) goto fail;
if (!InitListViewImageLists(hwndLV)) goto fail;
@ -507,9 +507,9 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
BOOL AddedDefault = FALSE;
if (!hwndLV) return FALSE;
ListView_EditLabel(hwndLV, -1);
SendMessage(hwndLV, WM_SETREDRAW, FALSE, 0);
count = ListView_GetItemCount(hwndLV);
for (i = 0; i < count; i++) {
@ -521,14 +521,14 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
}
g_columnToSort = ~0UL;
ListView_DeleteAllItems(hwndLV);
if(!hKey) return FALSE;
errCode = RegOpenKeyEx(hKey, keyPath, 0, KEY_READ, &hNewKey);
if (errCode != ERROR_SUCCESS) return FALSE;
/* get size information and resize the buffers if necessary */
errCode = RegQueryInfoKey(hNewKey, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL,
errCode = RegQueryInfoKey(hNewKey, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL,
&val_count, &max_val_name_len, &max_val_size, NULL, NULL);
#define BUF_HEAD_SPACE 2 /* FIXME: check why this is required with ROS ??? */

View file

@ -69,7 +69,7 @@ TCHAR szChildClass[MAX_LOADSTRING];
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
BOOL AclUiAvailable;
WNDCLASSEX wcFrame = {
sizeof(WNDCLASSEX),
CS_HREDRAW | CS_VREDRAW/*style*/,
@ -105,7 +105,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
};
ATOM hChildWndClass = RegisterClassEx(&wcChild); /* register child windows class */
hChildWndClass = hChildWndClass; /* warning eater */
RegisterHexEditorClass(hInstance);
hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_REGEDIT_MENU));
@ -113,7 +113,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
/* Initialize the Windows Common Controls DLL */
InitCommonControls();
AclUiAvailable = InitializeAclUiDll();
if(!AclUiAvailable)
{
@ -189,7 +189,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
hf = _fdopen(hCrt, "w");
*stdout = *hf;
setvbuf(stdout, NULL, _IONBF, 0);
wprintf(L"command line exit, hInstance = %d\n", hInstance);
getch();
FreeConsole();
@ -216,7 +216,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
/* Main message loop */
while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
if (!TranslateAccelerator(msg.hwnd, hAccel, &msg)
if (!TranslateAccelerator(msg.hwnd, hAccel, &msg)
&& !TranslateChildTabMessage(&msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);

View file

@ -35,7 +35,7 @@
/******************************************************************************
Implementation of the CRegKeySecurity interface
******************************************************************************/
SI_ACCESS RegAccess[] = {
{&GUID_NULL, KEY_ALL_ACCESS, (LPWSTR)MAKEINTRESOURCE(IDS_ACCESS_FULLCONTROL), SI_ACCESS_GENERAL | SI_ACCESS_SPECIFIC},
{&GUID_NULL, KEY_READ, (LPWSTR)MAKEINTRESOURCE(IDS_ACCESS_READ), SI_ACCESS_GENERAL},
@ -70,7 +70,7 @@ SI_INHERIT_TYPE RegInheritTypes[] = {
LPREGKEYSECURITY CRegKeySecurity_fnConstructor(HANDLE Handle, SE_OBJECT_TYPE ObjectType, SI_OBJECT_INFO *ObjectInfo, BOOL *Btn)
{
LPREGKEYSECURITY obj;
obj = (LPREGKEYSECURITY)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(REGKEYSECURITY));
if(obj != NULL)
{
@ -81,13 +81,13 @@ LPREGKEYSECURITY CRegKeySecurity_fnConstructor(HANDLE Handle, SE_OBJECT_TYPE Obj
obj->ObjectInfo = *ObjectInfo;
obj->Btn = Btn;
}
return obj;
}
HRESULT STDMETHODCALLTYPE
CRegKeySecurity_fnQueryInterface(LPREGKEYSECURITY this,
REFIID iid,
CRegKeySecurity_fnQueryInterface(LPREGKEYSECURITY this,
REFIID iid,
PVOID *pvObject)
{
if(IsEqualGUID(iid, &IID_IUnknown) ||
@ -96,7 +96,7 @@ CRegKeySecurity_fnQueryInterface(LPREGKEYSECURITY this,
*pvObject = this;
return S_OK;
}
*pvObject = NULL;
return E_NOINTERFACE;
}
@ -111,7 +111,7 @@ ULONG STDMETHODCALLTYPE
CRegKeySecurity_fnRelease(LPREGKEYSECURITY this)
{
ULONG rfc;
rfc = (ULONG)InterlockedDecrement(&this->ref);
if(rfc == 0)
{
@ -121,7 +121,7 @@ CRegKeySecurity_fnRelease(LPREGKEYSECURITY this)
}
HRESULT STDMETHODCALLTYPE
CRegKeySecurity_fnGetObjectInformation(LPREGKEYSECURITY this,
CRegKeySecurity_fnGetObjectInformation(LPREGKEYSECURITY this,
PSI_OBJECT_INFO pObjectInfo)
{
*pObjectInfo = this->ObjectInfo;
@ -129,7 +129,7 @@ CRegKeySecurity_fnGetObjectInformation(LPREGKEYSECURITY this,
}
HRESULT STDMETHODCALLTYPE
CRegKeySecurity_fnGetSecurity(LPREGKEYSECURITY this,
CRegKeySecurity_fnGetSecurity(LPREGKEYSECURITY this,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR* ppSecurityDescriptor,
BOOL fDefault)
@ -147,7 +147,7 @@ CRegKeySecurity_fnGetSecurity(LPREGKEYSECURITY this,
}
HRESULT STDMETHODCALLTYPE
CRegKeySecurity_fnSetSecurity(LPREGKEYSECURITY this,
CRegKeySecurity_fnSetSecurity(LPREGKEYSECURITY this,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor)
{
@ -157,7 +157,7 @@ CRegKeySecurity_fnSetSecurity(LPREGKEYSECURITY this,
}
HRESULT STDMETHODCALLTYPE
CRegKeySecurity_fnGetAccessRights(LPREGKEYSECURITY this,
CRegKeySecurity_fnGetAccessRights(LPREGKEYSECURITY this,
const GUID* pguidObjectType,
DWORD dwFlags,
PSI_ACCESS* ppAccess,
@ -171,7 +171,7 @@ CRegKeySecurity_fnGetAccessRights(LPREGKEYSECURITY this,
}
HRESULT STDMETHODCALLTYPE
CRegKeySecurity_fnMapGeneric(LPREGKEYSECURITY this,
CRegKeySecurity_fnMapGeneric(LPREGKEYSECURITY this,
const GUID* pguidObjectType,
UCHAR* pAceFlags,
ACCESS_MASK* pMask)
@ -182,7 +182,7 @@ CRegKeySecurity_fnMapGeneric(LPREGKEYSECURITY this,
}
HRESULT STDMETHODCALLTYPE
CRegKeySecurity_fnGetInheritTypes(LPREGKEYSECURITY this,
CRegKeySecurity_fnGetInheritTypes(LPREGKEYSECURITY this,
PSI_INHERIT_TYPE* ppInheritTypes,
ULONG* pcInheritTypes)
{
@ -197,7 +197,7 @@ CRegKeySecurity_fnGetInheritTypes(LPREGKEYSECURITY this,
}
HRESULT STDMETHODCALLTYPE
CRegKeySecurity_fnPropertySheetPageCallback(LPREGKEYSECURITY this,
CRegKeySecurity_fnPropertySheetPageCallback(LPREGKEYSECURITY this,
HWND hwnd,
UINT uMsg,
SI_PAGE_TYPE uPage)
@ -237,7 +237,7 @@ InitializeAclUiDll(VOID)
hAclUiDll = NULL;
return FALSE;
}
return TRUE;
}
@ -262,12 +262,12 @@ RegKeyEditPermissions(HWND hWndOwner,
HKEY hInfoKey;
LPREGKEYSECURITY RegKeySecurity;
SI_OBJECT_INFO ObjectInfo;
if(pfnEditSecurity == NULL)
{
return FALSE;
}
#ifndef UNICODE
/* aclui.dll only accepts unicode strings, convert them */
if(lpMachine != NULL)
@ -287,7 +287,7 @@ RegKeyEditPermissions(HWND hWndOwner,
}
else
Machine = NULL;
if(lpKeyName != NULL)
{
int lnKeyName = lstrlen(lpKeyName);
@ -313,20 +313,20 @@ RegKeyEditPermissions(HWND hWndOwner,
Machine = (LPWSTR)lpMachine;
KeyName = (LPWSTR)lpKeyName;
#endif
/* try to open the key again with more access rights */
if(RegOpenKeyEx(hKey, NULL, 0, READ_CONTROL, &hInfoKey) != ERROR_SUCCESS)
{
/* FIXME - print error with FormatMessage */
return FALSE;
}
ObjectInfo.dwFlags = SI_EDIT_ALL | SI_ADVANCED | SI_CONTAINER | SI_OWNER_RECURSE | SI_EDIT_PERMS;
ObjectInfo.hInstance = hInst;
ObjectInfo.pszServerName = Machine;
ObjectInfo.pszObjectName = KeyName;
ObjectInfo.pszPageTitle = KeyName;
if(!(RegKeySecurity = CRegKeySecurity_fnConstructor(hInfoKey, SE_REGISTRY_KEY, &ObjectInfo, &Result)))
{
/* FIXME - print error with FormatMessage */
@ -335,12 +335,12 @@ RegKeyEditPermissions(HWND hWndOwner,
/* display the security editor dialog */
pfnEditSecurity(hWndOwner, RegKeySecurity);
/* dereference the interface, it should be destroyed here */
CRegKeySecurity_fnRelease(RegKeySecurity);
RegCloseKey(hInfoKey);
#ifndef UNICODE
if(Machine != NULL)
{
@ -351,7 +351,7 @@ RegKeyEditPermissions(HWND hWndOwner,
HeapFree(GetProcessHeap(), 0, KeyName);
}
#endif
return Result;
}

View file

@ -24,36 +24,36 @@ typedef struct ifaceCRegKeySecurityVbtl ifaceCRegKeySecurityVbtl;
struct ifaceCRegKeySecurityVbtl
{
/* IUnknown */
HRESULT (STDMETHODCALLTYPE *QueryInterface)(LPREGKEYSECURITY this,
REFIID iid,
HRESULT (STDMETHODCALLTYPE *QueryInterface)(LPREGKEYSECURITY this,
REFIID iid,
PVOID *pvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(LPREGKEYSECURITY this);
ULONG (STDMETHODCALLTYPE *Release)(LPREGKEYSECURITY this);
/* CRegKeySecurity */
HRESULT (STDMETHODCALLTYPE *GetObjectInformation)(LPREGKEYSECURITY this,
HRESULT (STDMETHODCALLTYPE *GetObjectInformation)(LPREGKEYSECURITY this,
PSI_OBJECT_INFO pObjectInfo);
HRESULT (STDMETHODCALLTYPE *GetSecurity)(LPREGKEYSECURITY this,
HRESULT (STDMETHODCALLTYPE *GetSecurity)(LPREGKEYSECURITY this,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR* ppSecurityDescriptor,
BOOL fDefault);
HRESULT (STDMETHODCALLTYPE *SetSecurity)(LPREGKEYSECURITY this,
HRESULT (STDMETHODCALLTYPE *SetSecurity)(LPREGKEYSECURITY this,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor);
HRESULT (STDMETHODCALLTYPE *GetAccessRights)(LPREGKEYSECURITY this,
HRESULT (STDMETHODCALLTYPE *GetAccessRights)(LPREGKEYSECURITY this,
const GUID* pguidObjectType,
DWORD dwFlags,
PSI_ACCESS* ppAccess,
ULONG* pcAccesses,
ULONG* piDefaultAccess);
HRESULT (STDMETHODCALLTYPE *MapGeneric)(LPREGKEYSECURITY this,
HRESULT (STDMETHODCALLTYPE *MapGeneric)(LPREGKEYSECURITY this,
const GUID* pguidObjectType,
UCHAR* pAceFlags,
ACCESS_MASK* pMask);
HRESULT (STDMETHODCALLTYPE *GetInheritTypes)(LPREGKEYSECURITY this,
HRESULT (STDMETHODCALLTYPE *GetInheritTypes)(LPREGKEYSECURITY this,
PSI_INHERIT_TYPE* ppInheritTypes,
ULONG* pcInheritTypes);
HRESULT (STDMETHODCALLTYPE *PropertySheetPageCallback)(LPREGKEYSECURITY this,
HRESULT (STDMETHODCALLTYPE *PropertySheetPageCallback)(LPREGKEYSECURITY this,
HWND hwnd,
UINT uMsg,
SI_PAGE_TYPE uPage);
@ -78,27 +78,27 @@ ULONG STDMETHODCALLTYPE CRegKeySecurity_fnAddRef(LPREGKEYSECURITY this);
ULONG STDMETHODCALLTYPE CRegKeySecurity_fnRelease(LPREGKEYSECURITY this);
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnGetObjectInformation(LPREGKEYSECURITY this,
PSI_OBJECT_INFO pObjectInfo);
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnGetSecurity(LPREGKEYSECURITY this,
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnGetSecurity(LPREGKEYSECURITY this,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR* ppSecurityDescriptor,
BOOL fDefault);
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnSetSecurity(LPREGKEYSECURITY this,
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnSetSecurity(LPREGKEYSECURITY this,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor);
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnGetAccessRights(LPREGKEYSECURITY this,
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnGetAccessRights(LPREGKEYSECURITY this,
const GUID* pguidObjectType,
DWORD dwFlags,
PSI_ACCESS* ppAccess,
ULONG* pcAccesses,
ULONG* piDefaultAccess);
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnMapGeneric(LPREGKEYSECURITY this,
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnMapGeneric(LPREGKEYSECURITY this,
const GUID* pguidObjectType,
UCHAR* pAceFlags,
ACCESS_MASK* pMask);
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnGetInheritTypes(LPREGKEYSECURITY this,
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnGetInheritTypes(LPREGKEYSECURITY this,
PSI_INHERIT_TYPE* ppInheritTypes,
ULONG* pcInheritTypes);
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnPropertySheetPageCallback(LPREGKEYSECURITY this,
HRESULT STDMETHODCALLTYPE CRegKeySecurity_fnPropertySheetPageCallback(LPREGKEYSECURITY this,
HWND hwnd,
UINT uMsg,
SI_PAGE_TYPE uPage);
@ -109,7 +109,7 @@ static ifaceCRegKeySecurityVbtl efvt =
CRegKeySecurity_fnQueryInterface,
CRegKeySecurity_fnAddRef,
CRegKeySecurity_fnRelease,
/* CRegKeySecurity methods */
CRegKeySecurity_fnGetObjectInformation,
CRegKeySecurity_fnGetSecurity,

Some files were not shown because too many files have changed in this diff Show more