mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:52:56 +00:00
[CONSRV]
HeapAlloc --> RtlAllocateHeap HeapFree --> RtlFreeHeap GetProcessHeap --> RtlGetProcessHeap svn path=/branches/ros-csrss/; revision=58168
This commit is contained in:
parent
975ef54c09
commit
bc73176945
5 changed files with 52 additions and 52 deletions
|
@ -312,7 +312,7 @@ WaitBeforeReading(IN PGET_INPUT_INFO InputInfo,
|
||||||
{
|
{
|
||||||
PGET_INPUT_INFO CapturedInputInfo;
|
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;
|
if (!CapturedInputInfo) return STATUS_NO_MEMORY;
|
||||||
|
|
||||||
memmove(CapturedInputInfo, InputInfo, sizeof(GET_INPUT_INFO));
|
memmove(CapturedInputInfo, InputInfo, sizeof(GET_INPUT_INFO));
|
||||||
|
@ -324,7 +324,7 @@ WaitBeforeReading(IN PGET_INPUT_INFO InputInfo,
|
||||||
CapturedInputInfo,
|
CapturedInputInfo,
|
||||||
NULL))
|
NULL))
|
||||||
{
|
{
|
||||||
HeapFree(ConSrvHeap, 0, CapturedInputInfo);
|
RtlFreeHeap(ConSrvHeap, 0, CapturedInputInfo);
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -361,7 +361,7 @@ ReadInputBufferThread(IN PLIST_ENTRY WaitList,
|
||||||
if (Status != STATUS_PENDING)
|
if (Status != STATUS_PENDING)
|
||||||
{
|
{
|
||||||
WaitApiMessage->Status = Status;
|
WaitApiMessage->Status = Status;
|
||||||
HeapFree(ConSrvHeap, 0, InputInfo);
|
RtlFreeHeap(ConSrvHeap, 0, InputInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (Status == STATUS_PENDING ? FALSE : TRUE);
|
return (Status == STATUS_PENDING ? FALSE : TRUE);
|
||||||
|
@ -418,7 +418,7 @@ ReadInputBuffer(IN PGET_INPUT_INFO InputInfo,
|
||||||
if (Wait) // TRUE --> Read, we remove inputs from the buffer ; FALSE --> Peek, we keep inputs.
|
if (Wait) // TRUE --> Read, we remove inputs from the buffer ; FALSE --> Peek, we keep inputs.
|
||||||
{
|
{
|
||||||
RemoveEntryList(&Input->ListEntry);
|
RemoveEntryList(&Input->ListEntry);
|
||||||
HeapFree(ConSrvHeap, 0, Input);
|
RtlFreeHeap(ConSrvHeap, 0, Input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,7 +457,7 @@ ReadCharsThread(IN PLIST_ENTRY WaitList,
|
||||||
if (Status != STATUS_PENDING)
|
if (Status != STATUS_PENDING)
|
||||||
{
|
{
|
||||||
WaitApiMessage->Status = Status;
|
WaitApiMessage->Status = Status;
|
||||||
HeapFree(ConSrvHeap, 0, InputInfo);
|
RtlFreeHeap(ConSrvHeap, 0, InputInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (Status == STATUS_PENDING ? FALSE : TRUE);
|
return (Status == STATUS_PENDING ? FALSE : TRUE);
|
||||||
|
@ -485,7 +485,7 @@ ReadChars(IN PGET_INPUT_INFO InputInfo,
|
||||||
{
|
{
|
||||||
/* Starting a new line */
|
/* Starting a new line */
|
||||||
InputInfo->Console->LineMaxSize = max(256, nNumberOfCharsToRead);
|
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)
|
if (InputInfo->Console->LineBuffer == NULL)
|
||||||
{
|
{
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
|
@ -528,7 +528,7 @@ ReadChars(IN PGET_INPUT_INFO InputInfo,
|
||||||
LineInputKeyDown(InputInfo->Console, &Input->InputEvent.Event.KeyEvent);
|
LineInputKeyDown(InputInfo->Console, &Input->InputEvent.Event.KeyEvent);
|
||||||
ReadConsoleRequest->ControlKeyState = Input->InputEvent.Event.KeyEvent.dwControlKeyState;
|
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 */
|
/* Check if we have a complete line to read from */
|
||||||
|
@ -556,7 +556,7 @@ ReadChars(IN PGET_INPUT_INFO InputInfo,
|
||||||
if (InputInfo->Console->LinePos == InputInfo->Console->LineSize)
|
if (InputInfo->Console->LinePos == InputInfo->Console->LineSize)
|
||||||
{
|
{
|
||||||
/* Entire line has been read */
|
/* Entire line has been read */
|
||||||
HeapFree(ConSrvHeap, 0, InputInfo->Console->LineBuffer);
|
RtlFreeHeap(ConSrvHeap, 0, InputInfo->Console->LineBuffer);
|
||||||
InputInfo->Console->LineBuffer = NULL;
|
InputInfo->Console->LineBuffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -600,7 +600,7 @@ ReadChars(IN PGET_INPUT_INFO InputInfo,
|
||||||
/* Did read something */
|
/* Did read something */
|
||||||
WaitForMoreToRead = FALSE;
|
WaitForMoreToRead = FALSE;
|
||||||
}
|
}
|
||||||
HeapFree(ConSrvHeap, 0, Input);
|
RtlFreeHeap(ConSrvHeap, 0, Input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -773,7 +773,7 @@ CSR_API(SrvFlushConsoleInputBuffer)
|
||||||
CurrentEntry = RemoveHeadList(&Console->InputEvents);
|
CurrentEntry = RemoveHeadList(&Console->InputEvents);
|
||||||
Input = CONTAINING_RECORD(CurrentEntry, ConsoleInput, ListEntry);
|
Input = CONTAINING_RECORD(CurrentEntry, ConsoleInput, ListEntry);
|
||||||
/* Destroy the event */
|
/* Destroy the event */
|
||||||
HeapFree(ConSrvHeap, 0, Input);
|
RtlFreeHeap(ConSrvHeap, 0, Input);
|
||||||
}
|
}
|
||||||
ResetEvent(Console->ActiveEvent);
|
ResetEvent(Console->ActiveEvent);
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ CsrInitConsoleScreenBuffer(PCONSOLE Console,
|
||||||
Buffer->ShowX = 0;
|
Buffer->ShowX = 0;
|
||||||
Buffer->ShowY = 0;
|
Buffer->ShowY = 0;
|
||||||
Buffer->VirtualY = 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)
|
if (NULL == Buffer->Buffer)
|
||||||
{
|
{
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
@ -379,8 +379,8 @@ ConioDeleteScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapFree(ConSrvHeap, 0, Buffer->Buffer);
|
RtlFreeHeap(ConSrvHeap, 0, Buffer->Buffer);
|
||||||
HeapFree(ConSrvHeap, 0, Buffer);
|
RtlFreeHeap(ConSrvHeap, 0, Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
|
@ -506,7 +506,7 @@ DoWriteConsole(IN PCSR_API_MESSAGE ApiMessage,
|
||||||
(PWCHAR)WriteConsoleRequest->Buffer,
|
(PWCHAR)WriteConsoleRequest->Buffer,
|
||||||
WriteConsoleRequest->NrCharactersToWrite,
|
WriteConsoleRequest->NrCharactersToWrite,
|
||||||
NULL, 0, NULL, NULL);
|
NULL, 0, NULL, NULL);
|
||||||
Buffer = RtlAllocateHeap(GetProcessHeap(), 0, Length);
|
Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length);
|
||||||
if (Buffer)
|
if (Buffer)
|
||||||
{
|
{
|
||||||
WideCharToMultiByte(Console->OutputCodePage, 0,
|
WideCharToMultiByte(Console->OutputCodePage, 0,
|
||||||
|
@ -537,7 +537,7 @@ DoWriteConsole(IN PCSR_API_MESSAGE ApiMessage,
|
||||||
}
|
}
|
||||||
if (WriteConsoleRequest->Unicode)
|
if (WriteConsoleRequest->Unicode)
|
||||||
{
|
{
|
||||||
RtlFreeHeap(GetProcessHeap(), 0, Buffer);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -931,7 +931,7 @@ CSR_API(SrvWriteConsoleOutputString)
|
||||||
(PWCHAR)WriteOutputCodeRequest->pCode.UnicodeChar,
|
(PWCHAR)WriteOutputCodeRequest->pCode.UnicodeChar,
|
||||||
WriteOutputCodeRequest->Length,
|
WriteOutputCodeRequest->Length,
|
||||||
NULL, 0, NULL, NULL);
|
NULL, 0, NULL, NULL);
|
||||||
tmpString = String = RtlAllocateHeap(GetProcessHeap(), 0, Length);
|
tmpString = String = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length);
|
||||||
if (String)
|
if (String)
|
||||||
{
|
{
|
||||||
WideCharToMultiByte(Console->OutputCodePage, 0,
|
WideCharToMultiByte(Console->OutputCodePage, 0,
|
||||||
|
@ -996,7 +996,7 @@ CSR_API(SrvWriteConsoleOutputString)
|
||||||
|
|
||||||
if (tmpString)
|
if (tmpString)
|
||||||
{
|
{
|
||||||
RtlFreeHeap(GetProcessHeap(), 0, tmpString);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, tmpString);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConioUnlockScreenBuffer(Buff);
|
ConioUnlockScreenBuffer(Buff);
|
||||||
|
@ -1235,7 +1235,7 @@ CSR_API(SrvCreateConsoleScreenBuffer)
|
||||||
return Status;
|
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 (Buff != NULL)
|
||||||
{
|
{
|
||||||
if (Console->ActiveBuffer)
|
if (Console->ActiveBuffer)
|
||||||
|
|
|
@ -102,7 +102,7 @@ CsrInitConsole(PCONSOLE* NewConsole, int ShowCmd, PCSR_PROCESS ConsoleLeaderProc
|
||||||
*NewConsole = NULL;
|
*NewConsole = NULL;
|
||||||
|
|
||||||
/* Allocate a console structure */
|
/* Allocate a console structure */
|
||||||
Console = HeapAlloc(ConSrvHeap, HEAP_ZERO_MEMORY, sizeof(CONSOLE));
|
Console = RtlAllocateHeap(ConSrvHeap, HEAP_ZERO_MEMORY, sizeof(CONSOLE));
|
||||||
if (NULL == Console)
|
if (NULL == Console)
|
||||||
{
|
{
|
||||||
DPRINT1("Not enough memory for console creation.\n");
|
DPRINT1("Not enough memory for console creation.\n");
|
||||||
|
@ -146,7 +146,7 @@ CsrInitConsole(PCONSOLE* NewConsole, int ShowCmd, PCSR_PROCESS ConsoleLeaderProc
|
||||||
if (NULL == Console->ActiveEvent)
|
if (NULL == Console->ActiveEvent)
|
||||||
{
|
{
|
||||||
RtlFreeUnicodeString(&Console->Title);
|
RtlFreeUnicodeString(&Console->Title);
|
||||||
HeapFree(ConSrvHeap, 0, Console);
|
RtlFreeHeap(ConSrvHeap, 0, Console);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
Console->PrivateData = NULL;
|
Console->PrivateData = NULL;
|
||||||
|
@ -155,13 +155,13 @@ CsrInitConsole(PCONSOLE* NewConsole, int ShowCmd, PCSR_PROCESS ConsoleLeaderProc
|
||||||
GuiMode = DtbgIsDesktopVisible();
|
GuiMode = DtbgIsDesktopVisible();
|
||||||
|
|
||||||
/* allocate console screen buffer */
|
/* 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)
|
if (NULL == NewBuffer)
|
||||||
{
|
{
|
||||||
RtlFreeUnicodeString(&Console->Title);
|
RtlFreeUnicodeString(&Console->Title);
|
||||||
DeleteCriticalSection(&Console->Lock);
|
DeleteCriticalSection(&Console->Lock);
|
||||||
CloseHandle(Console->ActiveEvent);
|
CloseHandle(Console->ActiveEvent);
|
||||||
HeapFree(ConSrvHeap, 0, Console);
|
RtlFreeHeap(ConSrvHeap, 0, Console);
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
/* init screen buffer with defaults */
|
/* init screen buffer with defaults */
|
||||||
|
@ -200,12 +200,12 @@ CsrInitConsole(PCONSOLE* NewConsole, int ShowCmd, PCSR_PROCESS ConsoleLeaderProc
|
||||||
Status = GuiInitConsole(Console, ShowCmd);
|
Status = GuiInitConsole(Console, ShowCmd);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
HeapFree(ConSrvHeap,0, NewBuffer);
|
RtlFreeHeap(ConSrvHeap,0, NewBuffer);
|
||||||
RtlFreeUnicodeString(&Console->Title);
|
RtlFreeUnicodeString(&Console->Title);
|
||||||
DeleteCriticalSection(&Console->Lock);
|
DeleteCriticalSection(&Console->Lock);
|
||||||
CloseHandle(Console->ActiveEvent);
|
CloseHandle(Console->ActiveEvent);
|
||||||
DPRINT1("GuiInitConsole: failed, Status = 0x%08lx\n", Status);
|
DPRINT1("GuiInitConsole: failed, Status = 0x%08lx\n", Status);
|
||||||
HeapFree(ConSrvHeap, 0, Console);
|
RtlFreeHeap(ConSrvHeap, 0, Console);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -217,9 +217,9 @@ CsrInitConsole(PCONSOLE* NewConsole, int ShowCmd, PCSR_PROCESS ConsoleLeaderProc
|
||||||
RtlFreeUnicodeString(&Console->Title);
|
RtlFreeUnicodeString(&Console->Title);
|
||||||
DeleteCriticalSection(&Console->Lock);
|
DeleteCriticalSection(&Console->Lock);
|
||||||
CloseHandle(Console->ActiveEvent);
|
CloseHandle(Console->ActiveEvent);
|
||||||
HeapFree(ConSrvHeap, 0, NewBuffer);
|
RtlFreeHeap(ConSrvHeap, 0, NewBuffer);
|
||||||
DPRINT1("CsrInitConsoleScreenBuffer: failed\n");
|
DPRINT1("CsrInitConsoleScreenBuffer: failed\n");
|
||||||
HeapFree(ConSrvHeap, 0, Console);
|
RtlFreeHeap(ConSrvHeap, 0, Console);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -594,7 +594,7 @@ ConioDeleteConsole(PCONSOLE Console)
|
||||||
Event = (ConsoleInput *) Console->InputEvents.Flink;
|
Event = (ConsoleInput *) Console->InputEvents.Flink;
|
||||||
Console->InputEvents.Flink = Console->InputEvents.Flink->Flink;
|
Console->InputEvents.Flink = Console->InputEvents.Flink->Flink;
|
||||||
Console->InputEvents.Flink->Flink->Blink = &Console->InputEvents;
|
Console->InputEvents.Flink->Flink->Blink = &Console->InputEvents;
|
||||||
HeapFree(ConSrvHeap, 0, Event);
|
RtlFreeHeap(ConSrvHeap, 0, Event);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConioCleanupConsole(Console);
|
ConioCleanupConsole(Console);
|
||||||
|
@ -614,7 +614,7 @@ ConioDeleteConsole(PCONSOLE Console)
|
||||||
DeleteCriticalSection(&Console->Lock);
|
DeleteCriticalSection(&Console->Lock);
|
||||||
RtlFreeUnicodeString(&Console->Title);
|
RtlFreeUnicodeString(&Console->Title);
|
||||||
IntDeleteAllAliases(Console->Aliases);
|
IntDeleteAllAliases(Console->Aliases);
|
||||||
HeapFree(ConSrvHeap, 0, Console);
|
RtlFreeHeap(ConSrvHeap, 0, Console);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID WINAPI
|
VOID WINAPI
|
||||||
|
|
|
@ -710,7 +710,7 @@ GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create)
|
||||||
|
|
||||||
if (NULL == GuiData)
|
if (NULL == GuiData)
|
||||||
{
|
{
|
||||||
DPRINT1("GuiConsoleNcCreate: HeapAlloc failed\n");
|
DPRINT1("GuiConsoleNcCreate: RtlAllocateHeap failed\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,7 +743,7 @@ GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create)
|
||||||
{
|
{
|
||||||
DPRINT1("GuiConsoleNcCreate: CreateFont failed\n");
|
DPRINT1("GuiConsoleNcCreate: CreateFont failed\n");
|
||||||
DeleteCriticalSection(&GuiData->Lock);
|
DeleteCriticalSection(&GuiData->Lock);
|
||||||
HeapFree(ConSrvHeap, 0, GuiData);
|
RtlFreeHeap(ConSrvHeap, 0, GuiData);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
Dc = GetDC(hWnd);
|
Dc = GetDC(hWnd);
|
||||||
|
@ -752,7 +752,7 @@ GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create)
|
||||||
DPRINT1("GuiConsoleNcCreate: GetDC failed\n");
|
DPRINT1("GuiConsoleNcCreate: GetDC failed\n");
|
||||||
DeleteObject(GuiData->Font);
|
DeleteObject(GuiData->Font);
|
||||||
DeleteCriticalSection(&GuiData->Lock);
|
DeleteCriticalSection(&GuiData->Lock);
|
||||||
HeapFree(ConSrvHeap, 0, GuiData);
|
RtlFreeHeap(ConSrvHeap, 0, GuiData);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
OldFont = SelectObject(Dc, GuiData->Font);
|
OldFont = SelectObject(Dc, GuiData->Font);
|
||||||
|
@ -762,7 +762,7 @@ GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create)
|
||||||
ReleaseDC(hWnd, Dc);
|
ReleaseDC(hWnd, Dc);
|
||||||
DeleteObject(GuiData->Font);
|
DeleteObject(GuiData->Font);
|
||||||
DeleteCriticalSection(&GuiData->Lock);
|
DeleteCriticalSection(&GuiData->Lock);
|
||||||
HeapFree(ConSrvHeap, 0, GuiData);
|
RtlFreeHeap(ConSrvHeap, 0, GuiData);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (! GetTextMetricsW(Dc, &Metrics))
|
if (! GetTextMetricsW(Dc, &Metrics))
|
||||||
|
@ -772,7 +772,7 @@ GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create)
|
||||||
ReleaseDC(hWnd, Dc);
|
ReleaseDC(hWnd, Dc);
|
||||||
DeleteObject(GuiData->Font);
|
DeleteObject(GuiData->Font);
|
||||||
DeleteCriticalSection(&GuiData->Lock);
|
DeleteCriticalSection(&GuiData->Lock);
|
||||||
HeapFree(ConSrvHeap, 0, GuiData);
|
RtlFreeHeap(ConSrvHeap, 0, GuiData);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
GuiData->CharWidth = Metrics.tmMaxCharWidth;
|
GuiData->CharWidth = Metrics.tmMaxCharWidth;
|
||||||
|
@ -1312,7 +1312,7 @@ GuiConsoleHandleNcDestroy(HWND hWnd)
|
||||||
if (GuiData->ConsoleLibrary)
|
if (GuiData->ConsoleLibrary)
|
||||||
FreeLibrary(GuiData->ConsoleLibrary);
|
FreeLibrary(GuiData->ConsoleLibrary);
|
||||||
|
|
||||||
HeapFree(ConSrvHeap, 0, GuiData);
|
RtlFreeHeap(ConSrvHeap, 0, GuiData);
|
||||||
}
|
}
|
||||||
|
|
||||||
static COORD
|
static COORD
|
||||||
|
@ -1768,7 +1768,7 @@ GuiResizeBuffer(PCONSOLE Console, PCONSOLE_SCREEN_BUFFER ScreenBuffer, COORD Siz
|
||||||
if (Size.X == ScreenBuffer->MaxX && Size.Y == ScreenBuffer->MaxY)
|
if (Size.X == ScreenBuffer->MaxX && Size.Y == ScreenBuffer->MaxY)
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
Buffer = HeapAlloc(ConSrvHeap, 0, Size.X * Size.Y * 2);
|
Buffer = RtlAllocateHeap(ConSrvHeap, 0, Size.X * Size.Y * 2);
|
||||||
if (!Buffer)
|
if (!Buffer)
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
|
|
||||||
|
@ -1819,7 +1819,7 @@ GuiResizeBuffer(PCONSOLE Console, PCONSOLE_SCREEN_BUFFER ScreenBuffer, COORD Siz
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)InterlockedExchangePointer((PVOID volatile *)&ScreenBuffer->Buffer, Buffer);
|
(void)InterlockedExchangePointer((PVOID volatile *)&ScreenBuffer->Buffer, Buffer);
|
||||||
HeapFree(ConSrvHeap, 0, OldBuffer);
|
RtlFreeHeap(ConSrvHeap, 0, OldBuffer);
|
||||||
ScreenBuffer->MaxX = Size.X;
|
ScreenBuffer->MaxX = Size.X;
|
||||||
ScreenBuffer->MaxY = Size.Y;
|
ScreenBuffer->MaxY = Size.Y;
|
||||||
ScreenBuffer->VirtualY = 0;
|
ScreenBuffer->VirtualY = 0;
|
||||||
|
@ -2081,7 +2081,7 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
SetWindowLongW(hWnd, GWL_USERDATA, 0);
|
SetWindowLongW(hWnd, GWL_USERDATA, 0);
|
||||||
return 0;
|
return 0;
|
||||||
case PM_CREATE_CONSOLE:
|
case PM_CREATE_CONSOLE:
|
||||||
Buffer = HeapAlloc(ConSrvHeap, 0,
|
Buffer = RtlAllocateHeap(ConSrvHeap, 0,
|
||||||
Console->Title.Length + sizeof(WCHAR));
|
Console->Title.Length + sizeof(WCHAR));
|
||||||
if (NULL != Buffer)
|
if (NULL != Buffer)
|
||||||
{
|
{
|
||||||
|
@ -2107,7 +2107,7 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
(PVOID)Console);
|
(PVOID)Console);
|
||||||
if (NULL != Buffer)
|
if (NULL != Buffer)
|
||||||
{
|
{
|
||||||
HeapFree(ConSrvHeap, 0, Buffer);
|
RtlFreeHeap(ConSrvHeap, 0, Buffer);
|
||||||
}
|
}
|
||||||
if (NULL != NewWindow)
|
if (NULL != NewWindow)
|
||||||
{
|
{
|
||||||
|
@ -2247,7 +2247,7 @@ GuiChangeTitle(PCONSOLE Console)
|
||||||
{
|
{
|
||||||
PWCHAR Buffer, Title;
|
PWCHAR Buffer, Title;
|
||||||
|
|
||||||
Buffer = HeapAlloc(ConSrvHeap, 0,
|
Buffer = RtlAllocateHeap(ConSrvHeap, 0,
|
||||||
Console->Title.Length + sizeof(WCHAR));
|
Console->Title.Length + sizeof(WCHAR));
|
||||||
if (NULL != Buffer)
|
if (NULL != Buffer)
|
||||||
{
|
{
|
||||||
|
@ -2264,7 +2264,7 @@ GuiChangeTitle(PCONSOLE Console)
|
||||||
|
|
||||||
if (NULL != Buffer)
|
if (NULL != Buffer)
|
||||||
{
|
{
|
||||||
HeapFree(ConSrvHeap, 0, Buffer);
|
RtlFreeHeap(ConSrvHeap, 0, Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -2350,7 +2350,7 @@ GuiInitConsole(PCONSOLE Console, int ShowCmd)
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GuiData = HeapAlloc(ConSrvHeap, HEAP_ZERO_MEMORY,
|
GuiData = RtlAllocateHeap(ConSrvHeap, HEAP_ZERO_MEMORY,
|
||||||
sizeof(GUI_CONSOLE_DATA));
|
sizeof(GUI_CONSOLE_DATA));
|
||||||
if (!GuiData)
|
if (!GuiData)
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,15 +42,15 @@ HistoryCurrentBuffer(PCONSOLE Console)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Couldn't find the buffer, create a new one */
|
/* 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)
|
if (!Hist)
|
||||||
return NULL;
|
return NULL;
|
||||||
Hist->MaxEntries = Console->HistoryBufferSize;
|
Hist->MaxEntries = Console->HistoryBufferSize;
|
||||||
Hist->NumEntries = 0;
|
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)
|
if (!Hist->Entries)
|
||||||
{
|
{
|
||||||
HeapFree(ConSrvHeap, 0, Hist);
|
RtlFreeHeap(ConSrvHeap, 0, Hist);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Hist->ExeName.Length = Hist->ExeName.MaximumLength = ExeName.Length;
|
Hist->ExeName.Length = Hist->ExeName.MaximumLength = ExeName.Length;
|
||||||
|
@ -144,9 +144,9 @@ HistoryDeleteBuffer(PHISTORY_BUFFER Hist)
|
||||||
return;
|
return;
|
||||||
while (Hist->NumEntries != 0)
|
while (Hist->NumEntries != 0)
|
||||||
RtlFreeUnicodeString(&Hist->Entries[--Hist->NumEntries]);
|
RtlFreeUnicodeString(&Hist->Entries[--Hist->NumEntries]);
|
||||||
HeapFree(ConSrvHeap, 0, Hist->Entries);
|
RtlFreeHeap(ConSrvHeap, 0, Hist->Entries);
|
||||||
RemoveEntryList(&Hist->ListEntry);
|
RemoveEntryList(&Hist->ListEntry);
|
||||||
HeapFree(ConSrvHeap, 0, Hist);
|
RtlFreeHeap(ConSrvHeap, 0, Hist);
|
||||||
}
|
}
|
||||||
|
|
||||||
CSR_API(SrvGetConsoleCommandHistoryLength)
|
CSR_API(SrvGetConsoleCommandHistoryLength)
|
||||||
|
@ -281,7 +281,7 @@ CSR_API(SrvSetConsoleNumberOfCommands)
|
||||||
if (Hist)
|
if (Hist)
|
||||||
{
|
{
|
||||||
OldEntryList = Hist->Entries;
|
OldEntryList = Hist->Entries;
|
||||||
NewEntryList = HeapAlloc(ConSrvHeap, 0,
|
NewEntryList = RtlAllocateHeap(ConSrvHeap, 0,
|
||||||
MaxEntries * sizeof(UNICODE_STRING));
|
MaxEntries * sizeof(UNICODE_STRING));
|
||||||
if (!NewEntryList)
|
if (!NewEntryList)
|
||||||
{
|
{
|
||||||
|
@ -299,7 +299,7 @@ CSR_API(SrvSetConsoleNumberOfCommands)
|
||||||
Hist->MaxEntries = MaxEntries;
|
Hist->MaxEntries = MaxEntries;
|
||||||
Hist->Entries = memcpy(NewEntryList, Hist->Entries,
|
Hist->Entries = memcpy(NewEntryList, Hist->Entries,
|
||||||
Hist->NumEntries * sizeof(UNICODE_STRING));
|
Hist->NumEntries * sizeof(UNICODE_STRING));
|
||||||
HeapFree(ConSrvHeap, 0, OldEntryList);
|
RtlFreeHeap(ConSrvHeap, 0, OldEntryList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ConioUnlockConsole(Console);
|
ConioUnlockConsole(Console);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue