Author: hbelusca
Date: Sun Jan 13 19:18:54 2013
New Revision: 58168
URL:
http://svn.reactos.org/svn/reactos?rev=58168&view=rev
Log:
[CONSRV]
HeapAlloc --> RtlAllocateHeap
HeapFree --> RtlFreeHeap
GetProcessHeap --> RtlGetProcessHeap
Modified:
branches/ros-csrss/win32ss/user/consrv/coninput.c
branches/ros-csrss/win32ss/user/consrv/conoutput.c
branches/ros-csrss/win32ss/user/consrv/console.c
branches/ros-csrss/win32ss/user/consrv/guiconsole.c
branches/ros-csrss/win32ss/user/consrv/lineinput.c
Modified: branches/ros-csrss/win32ss/user/consrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/coninput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/coninput.c [iso-8859-1] Sun Jan 13 19:18:54
2013
@@ -312,7 +312,7 @@
{
PGET_INPUT_INFO CapturedInputInfo;
- CapturedInputInfo = HeapAlloc(ConSrvHeap, 0, sizeof(GET_INPUT_INFO));
+ CapturedInputInfo = RtlAllocateHeap(ConSrvHeap, 0, sizeof(GET_INPUT_INFO));
if (!CapturedInputInfo) return STATUS_NO_MEMORY;
memmove(CapturedInputInfo, InputInfo, sizeof(GET_INPUT_INFO));
@@ -324,7 +324,7 @@
CapturedInputInfo,
NULL))
{
- HeapFree(ConSrvHeap, 0, CapturedInputInfo);
+ RtlFreeHeap(ConSrvHeap, 0, CapturedInputInfo);
return STATUS_NO_MEMORY;
}
}
@@ -361,7 +361,7 @@
if (Status != STATUS_PENDING)
{
WaitApiMessage->Status = Status;
- HeapFree(ConSrvHeap, 0, InputInfo);
+ RtlFreeHeap(ConSrvHeap, 0, InputInfo);
}
return (Status == STATUS_PENDING ? FALSE : TRUE);
@@ -418,7 +418,7 @@
if (Wait) // TRUE --> Read, we remove inputs from the buffer ; FALSE
--> Peek, we keep inputs.
{
RemoveEntryList(&Input->ListEntry);
- HeapFree(ConSrvHeap, 0, Input);
+ RtlFreeHeap(ConSrvHeap, 0, Input);
}
}
@@ -457,7 +457,7 @@
if (Status != STATUS_PENDING)
{
WaitApiMessage->Status = Status;
- HeapFree(ConSrvHeap, 0, InputInfo);
+ RtlFreeHeap(ConSrvHeap, 0, InputInfo);
}
return (Status == STATUS_PENDING ? FALSE : TRUE);
@@ -485,7 +485,7 @@
{
/* Starting a new line */
InputInfo->Console->LineMaxSize = max(256, nNumberOfCharsToRead);
- InputInfo->Console->LineBuffer = HeapAlloc(ConSrvHeap, 0,
InputInfo->Console->LineMaxSize * sizeof(WCHAR));
+ InputInfo->Console->LineBuffer = RtlAllocateHeap(ConSrvHeap, 0,
InputInfo->Console->LineMaxSize * sizeof(WCHAR));
if (InputInfo->Console->LineBuffer == NULL)
{
return STATUS_NO_MEMORY;
@@ -528,7 +528,7 @@
LineInputKeyDown(InputInfo->Console,
&Input->InputEvent.Event.KeyEvent);
ReadConsoleRequest->ControlKeyState =
Input->InputEvent.Event.KeyEvent.dwControlKeyState;
}
- HeapFree(ConSrvHeap, 0, Input);
+ RtlFreeHeap(ConSrvHeap, 0, Input);
}
/* Check if we have a complete line to read from */
@@ -556,7 +556,7 @@
if (InputInfo->Console->LinePos == InputInfo->Console->LineSize)
{
/* Entire line has been read */
- HeapFree(ConSrvHeap, 0, InputInfo->Console->LineBuffer);
+ RtlFreeHeap(ConSrvHeap, 0, InputInfo->Console->LineBuffer);
InputInfo->Console->LineBuffer = NULL;
}
@@ -600,7 +600,7 @@
/* Did read something */
WaitForMoreToRead = FALSE;
}
- HeapFree(ConSrvHeap, 0, Input);
+ RtlFreeHeap(ConSrvHeap, 0, Input);
}
}
@@ -773,7 +773,7 @@
CurrentEntry = RemoveHeadList(&Console->InputEvents);
Input = CONTAINING_RECORD(CurrentEntry, ConsoleInput, ListEntry);
/* Destroy the event */
- HeapFree(ConSrvHeap, 0, Input);
+ RtlFreeHeap(ConSrvHeap, 0, Input);
}
ResetEvent(Console->ActiveEvent);
Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Sun Jan 13 19:18:54
2013
@@ -69,7 +69,7 @@
Buffer->ShowX = 0;
Buffer->ShowY = 0;
Buffer->VirtualY = 0;
- Buffer->Buffer = HeapAlloc(ConSrvHeap, HEAP_ZERO_MEMORY, Buffer->MaxX *
Buffer->MaxY * 2);
+ Buffer->Buffer = RtlAllocateHeap(ConSrvHeap, HEAP_ZERO_MEMORY, Buffer->MaxX *
Buffer->MaxY * 2);
if (NULL == Buffer->Buffer)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -379,8 +379,8 @@
}
}
- HeapFree(ConSrvHeap, 0, Buffer->Buffer);
- HeapFree(ConSrvHeap, 0, Buffer);
+ RtlFreeHeap(ConSrvHeap, 0, Buffer->Buffer);
+ RtlFreeHeap(ConSrvHeap, 0, Buffer);
}
VOID FASTCALL
@@ -506,7 +506,7 @@
(PWCHAR)WriteConsoleRequest->Buffer,
WriteConsoleRequest->NrCharactersToWrite,
NULL, 0, NULL, NULL);
- Buffer = RtlAllocateHeap(GetProcessHeap(), 0, Length);
+ Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length);
if (Buffer)
{
WideCharToMultiByte(Console->OutputCodePage, 0,
@@ -537,7 +537,7 @@
}
if (WriteConsoleRequest->Unicode)
{
- RtlFreeHeap(GetProcessHeap(), 0, Buffer);
+ RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
}
}
@@ -931,7 +931,7 @@
(PWCHAR)WriteOutputCodeRequest->pCode.UnicodeChar,
WriteOutputCodeRequest->Length,
NULL, 0, NULL, NULL);
- tmpString = String = RtlAllocateHeap(GetProcessHeap(), 0, Length);
+ tmpString = String = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length);
if (String)
{
WideCharToMultiByte(Console->OutputCodePage, 0,
@@ -996,7 +996,7 @@
if (tmpString)
{
- RtlFreeHeap(GetProcessHeap(), 0, tmpString);
+ RtlFreeHeap(RtlGetProcessHeap(), 0, tmpString);
}
ConioUnlockScreenBuffer(Buff);
@@ -1235,7 +1235,7 @@
return Status;
}
- Buff = HeapAlloc(ConSrvHeap, HEAP_ZERO_MEMORY, sizeof(CONSOLE_SCREEN_BUFFER));
+ Buff = RtlAllocateHeap(ConSrvHeap, HEAP_ZERO_MEMORY, sizeof(CONSOLE_SCREEN_BUFFER));
if (Buff != NULL)
{
if (Console->ActiveBuffer)
Modified: branches/ros-csrss/win32ss/user/consrv/console.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/console.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/console.c [iso-8859-1] Sun Jan 13 19:18:54
2013
@@ -102,7 +102,7 @@
*NewConsole = NULL;
/* Allocate a console structure */
- Console = HeapAlloc(ConSrvHeap, HEAP_ZERO_MEMORY, sizeof(CONSOLE));
+ Console = RtlAllocateHeap(ConSrvHeap, HEAP_ZERO_MEMORY, sizeof(CONSOLE));
if (NULL == Console)
{
DPRINT1("Not enough memory for console creation.\n");
@@ -146,7 +146,7 @@
if (NULL == Console->ActiveEvent)
{
RtlFreeUnicodeString(&Console->Title);
- HeapFree(ConSrvHeap, 0, Console);
+ RtlFreeHeap(ConSrvHeap, 0, Console);
return STATUS_UNSUCCESSFUL;
}
Console->PrivateData = NULL;
@@ -155,13 +155,13 @@
GuiMode = DtbgIsDesktopVisible();
/* allocate console screen buffer */
- NewBuffer = HeapAlloc(ConSrvHeap, HEAP_ZERO_MEMORY, sizeof(CONSOLE_SCREEN_BUFFER));
+ NewBuffer = RtlAllocateHeap(ConSrvHeap, HEAP_ZERO_MEMORY,
sizeof(CONSOLE_SCREEN_BUFFER));
if (NULL == NewBuffer)
{
RtlFreeUnicodeString(&Console->Title);
DeleteCriticalSection(&Console->Lock);
CloseHandle(Console->ActiveEvent);
- HeapFree(ConSrvHeap, 0, Console);
+ RtlFreeHeap(ConSrvHeap, 0, Console);
return STATUS_INSUFFICIENT_RESOURCES;
}
/* init screen buffer with defaults */
@@ -200,12 +200,12 @@
Status = GuiInitConsole(Console, ShowCmd);
if (!NT_SUCCESS(Status))
{
- HeapFree(ConSrvHeap,0, NewBuffer);
+ RtlFreeHeap(ConSrvHeap,0, NewBuffer);
RtlFreeUnicodeString(&Console->Title);
DeleteCriticalSection(&Console->Lock);
CloseHandle(Console->ActiveEvent);
DPRINT1("GuiInitConsole: failed, Status = 0x%08lx\n", Status);
- HeapFree(ConSrvHeap, 0, Console);
+ RtlFreeHeap(ConSrvHeap, 0, Console);
return Status;
}
}
@@ -217,9 +217,9 @@
RtlFreeUnicodeString(&Console->Title);
DeleteCriticalSection(&Console->Lock);
CloseHandle(Console->ActiveEvent);
- HeapFree(ConSrvHeap, 0, NewBuffer);
+ RtlFreeHeap(ConSrvHeap, 0, NewBuffer);
DPRINT1("CsrInitConsoleScreenBuffer: failed\n");
- HeapFree(ConSrvHeap, 0, Console);
+ RtlFreeHeap(ConSrvHeap, 0, Console);
return Status;
}
@@ -594,7 +594,7 @@
Event = (ConsoleInput *) Console->InputEvents.Flink;
Console->InputEvents.Flink = Console->InputEvents.Flink->Flink;
Console->InputEvents.Flink->Flink->Blink =
&Console->InputEvents;
- HeapFree(ConSrvHeap, 0, Event);
+ RtlFreeHeap(ConSrvHeap, 0, Event);
}
ConioCleanupConsole(Console);
@@ -614,7 +614,7 @@
DeleteCriticalSection(&Console->Lock);
RtlFreeUnicodeString(&Console->Title);
IntDeleteAllAliases(Console->Aliases);
- HeapFree(ConSrvHeap, 0, Console);
+ RtlFreeHeap(ConSrvHeap, 0, Console);
}
VOID WINAPI
Modified: branches/ros-csrss/win32ss/user/consrv/guiconsole.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/g…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] Sun Jan 13 19:18:54
2013
@@ -710,7 +710,7 @@
if (NULL == GuiData)
{
- DPRINT1("GuiConsoleNcCreate: HeapAlloc failed\n");
+ DPRINT1("GuiConsoleNcCreate: RtlAllocateHeap failed\n");
return FALSE;
}
@@ -743,7 +743,7 @@
{
DPRINT1("GuiConsoleNcCreate: CreateFont failed\n");
DeleteCriticalSection(&GuiData->Lock);
- HeapFree(ConSrvHeap, 0, GuiData);
+ RtlFreeHeap(ConSrvHeap, 0, GuiData);
return FALSE;
}
Dc = GetDC(hWnd);
@@ -752,7 +752,7 @@
DPRINT1("GuiConsoleNcCreate: GetDC failed\n");
DeleteObject(GuiData->Font);
DeleteCriticalSection(&GuiData->Lock);
- HeapFree(ConSrvHeap, 0, GuiData);
+ RtlFreeHeap(ConSrvHeap, 0, GuiData);
return FALSE;
}
OldFont = SelectObject(Dc, GuiData->Font);
@@ -762,7 +762,7 @@
ReleaseDC(hWnd, Dc);
DeleteObject(GuiData->Font);
DeleteCriticalSection(&GuiData->Lock);
- HeapFree(ConSrvHeap, 0, GuiData);
+ RtlFreeHeap(ConSrvHeap, 0, GuiData);
return FALSE;
}
if (! GetTextMetricsW(Dc, &Metrics))
@@ -772,7 +772,7 @@
ReleaseDC(hWnd, Dc);
DeleteObject(GuiData->Font);
DeleteCriticalSection(&GuiData->Lock);
- HeapFree(ConSrvHeap, 0, GuiData);
+ RtlFreeHeap(ConSrvHeap, 0, GuiData);
return FALSE;
}
GuiData->CharWidth = Metrics.tmMaxCharWidth;
@@ -1312,7 +1312,7 @@
if (GuiData->ConsoleLibrary)
FreeLibrary(GuiData->ConsoleLibrary);
- HeapFree(ConSrvHeap, 0, GuiData);
+ RtlFreeHeap(ConSrvHeap, 0, GuiData);
}
static COORD
@@ -1768,7 +1768,7 @@
if (Size.X == ScreenBuffer->MaxX && Size.Y == ScreenBuffer->MaxY)
return STATUS_SUCCESS;
- Buffer = HeapAlloc(ConSrvHeap, 0, Size.X * Size.Y * 2);
+ Buffer = RtlAllocateHeap(ConSrvHeap, 0, Size.X * Size.Y * 2);
if (!Buffer)
return STATUS_NO_MEMORY;
@@ -1819,7 +1819,7 @@
}
(void)InterlockedExchangePointer((PVOID volatile *)&ScreenBuffer->Buffer,
Buffer);
- HeapFree(ConSrvHeap, 0, OldBuffer);
+ RtlFreeHeap(ConSrvHeap, 0, OldBuffer);
ScreenBuffer->MaxX = Size.X;
ScreenBuffer->MaxY = Size.Y;
ScreenBuffer->VirtualY = 0;
@@ -2081,8 +2081,8 @@
SetWindowLongW(hWnd, GWL_USERDATA, 0);
return 0;
case PM_CREATE_CONSOLE:
- Buffer = HeapAlloc(ConSrvHeap, 0,
- Console->Title.Length + sizeof(WCHAR));
+ Buffer = RtlAllocateHeap(ConSrvHeap, 0,
+ Console->Title.Length + sizeof(WCHAR));
if (NULL != Buffer)
{
memcpy(Buffer, Console->Title.Buffer, Console->Title.Length);
@@ -2107,7 +2107,7 @@
(PVOID)Console);
if (NULL != Buffer)
{
- HeapFree(ConSrvHeap, 0, Buffer);
+ RtlFreeHeap(ConSrvHeap, 0, Buffer);
}
if (NULL != NewWindow)
{
@@ -2247,8 +2247,8 @@
{
PWCHAR Buffer, Title;
- Buffer = HeapAlloc(ConSrvHeap, 0,
- Console->Title.Length + sizeof(WCHAR));
+ Buffer = RtlAllocateHeap(ConSrvHeap, 0,
+ Console->Title.Length + sizeof(WCHAR));
if (NULL != Buffer)
{
memcpy(Buffer, Console->Title.Buffer, Console->Title.Length);
@@ -2264,7 +2264,7 @@
if (NULL != Buffer)
{
- HeapFree(ConSrvHeap, 0, Buffer);
+ RtlFreeHeap(ConSrvHeap, 0, Buffer);
}
return TRUE;
@@ -2350,8 +2350,8 @@
return STATUS_UNSUCCESSFUL;
}
}
- GuiData = HeapAlloc(ConSrvHeap, HEAP_ZERO_MEMORY,
- sizeof(GUI_CONSOLE_DATA));
+ GuiData = RtlAllocateHeap(ConSrvHeap, HEAP_ZERO_MEMORY,
+ sizeof(GUI_CONSOLE_DATA));
if (!GuiData)
{
DPRINT1("Win32Csr: Failed to create GUI_CONSOLE_DATA\n");
Modified: branches/ros-csrss/win32ss/user/consrv/lineinput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/lineinput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/lineinput.c [iso-8859-1] Sun Jan 13 19:18:54
2013
@@ -42,15 +42,15 @@
}
/* Couldn't find the buffer, create a new one */
- Hist = HeapAlloc(ConSrvHeap, 0, sizeof(HISTORY_BUFFER) + ExeName.Length);
+ Hist = RtlAllocateHeap(ConSrvHeap, 0, sizeof(HISTORY_BUFFER) + ExeName.Length);
if (!Hist)
return NULL;
Hist->MaxEntries = Console->HistoryBufferSize;
Hist->NumEntries = 0;
- Hist->Entries = HeapAlloc(ConSrvHeap, 0, Hist->MaxEntries *
sizeof(UNICODE_STRING));
+ Hist->Entries = RtlAllocateHeap(ConSrvHeap, 0, Hist->MaxEntries *
sizeof(UNICODE_STRING));
if (!Hist->Entries)
{
- HeapFree(ConSrvHeap, 0, Hist);
+ RtlFreeHeap(ConSrvHeap, 0, Hist);
return NULL;
}
Hist->ExeName.Length = Hist->ExeName.MaximumLength = ExeName.Length;
@@ -144,9 +144,9 @@
return;
while (Hist->NumEntries != 0)
RtlFreeUnicodeString(&Hist->Entries[--Hist->NumEntries]);
- HeapFree(ConSrvHeap, 0, Hist->Entries);
+ RtlFreeHeap(ConSrvHeap, 0, Hist->Entries);
RemoveEntryList(&Hist->ListEntry);
- HeapFree(ConSrvHeap, 0, Hist);
+ RtlFreeHeap(ConSrvHeap, 0, Hist);
}
CSR_API(SrvGetConsoleCommandHistoryLength)
@@ -281,8 +281,8 @@
if (Hist)
{
OldEntryList = Hist->Entries;
- NewEntryList = HeapAlloc(ConSrvHeap, 0,
- MaxEntries * sizeof(UNICODE_STRING));
+ NewEntryList = RtlAllocateHeap(ConSrvHeap, 0,
+ MaxEntries * sizeof(UNICODE_STRING));
if (!NewEntryList)
{
Status = STATUS_NO_MEMORY;
@@ -299,7 +299,7 @@
Hist->MaxEntries = MaxEntries;
Hist->Entries = memcpy(NewEntryList, Hist->Entries,
Hist->NumEntries * sizeof(UNICODE_STRING));
- HeapFree(ConSrvHeap, 0, OldEntryList);
+ RtlFreeHeap(ConSrvHeap, 0, OldEntryList);
}
}
ConioUnlockConsole(Console);