ReactOS  0.4.14-dev-41-g31d7680
history.c File Reference
#include <k32.h>
#include <debug.h>
Include dependency graph for history.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

static VOID IntExpungeConsoleCommandHistory (LPCVOID lpExeName, BOOLEAN bUnicode)
 
static DWORD IntGetConsoleCommandHistory (LPVOID lpHistory, DWORD cbHistory, LPCVOID lpExeName, BOOLEAN bUnicode)
 
static DWORD IntGetConsoleCommandHistoryLength (LPCVOID lpExeName, BOOL bUnicode)
 
static BOOL IntSetConsoleNumberOfCommands (DWORD dwNumCommands, LPCVOID lpExeName, BOOLEAN bUnicode)
 
VOID WINAPI DECLSPEC_HOTPATCH ExpungeConsoleCommandHistoryW (IN LPCWSTR lpExeName)
 
VOID WINAPI DECLSPEC_HOTPATCH ExpungeConsoleCommandHistoryA (IN LPCSTR lpExeName)
 
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryW (OUT LPWSTR lpHistory, IN DWORD cbHistory, IN LPCWSTR lpExeName)
 
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryA (OUT LPSTR lpHistory, IN DWORD cbHistory, IN LPCSTR lpExeName)
 
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryLengthW (IN LPCWSTR lpExeName)
 
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryLengthA (IN LPCSTR lpExeName)
 
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleNumberOfCommandsW (IN DWORD dwNumCommands, IN LPCWSTR lpExeName)
 
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleNumberOfCommandsA (IN DWORD dwNumCommands, IN LPCSTR lpExeName)
 
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCommandHistoryMode (IN DWORD dwMode)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file history.c.

Function Documentation

◆ ExpungeConsoleCommandHistoryA()

VOID WINAPI DECLSPEC_HOTPATCH ExpungeConsoleCommandHistoryA ( IN LPCSTR  lpExeName)

Definition at line 262 of file history.c.

263 {
265 }
static DWORD LPSTR lpExeName
Definition: process.c:72
static VOID IntExpungeConsoleCommandHistory(LPCVOID lpExeName, BOOLEAN bUnicode)
Definition: history.c:31

◆ ExpungeConsoleCommandHistoryW()

VOID WINAPI DECLSPEC_HOTPATCH ExpungeConsoleCommandHistoryW ( IN LPCWSTR  lpExeName)

Definition at line 250 of file history.c.

251 {
253 }
#define TRUE
Definition: types.h:120
static DWORD LPSTR lpExeName
Definition: process.c:72
static VOID IntExpungeConsoleCommandHistory(LPCVOID lpExeName, BOOLEAN bUnicode)
Definition: history.c:31

◆ GetConsoleCommandHistoryA()

DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryA ( OUT LPSTR  lpHistory,
IN DWORD  cbHistory,
IN LPCSTR  lpExeName 
)

Definition at line 288 of file history.c.

291 {
292  return IntGetConsoleCommandHistory(lpHistory, cbHistory, lpExeName, FALSE);
293 }
static DWORD IntGetConsoleCommandHistory(LPVOID lpHistory, DWORD cbHistory, LPCVOID lpExeName, BOOLEAN bUnicode)
Definition: history.c:77
static DWORD LPSTR lpExeName
Definition: process.c:72

◆ GetConsoleCommandHistoryLengthA()

DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryLengthA ( IN LPCSTR  lpExeName)

Definition at line 314 of file history.c.

315 {
317 }
static DWORD IntGetConsoleCommandHistoryLength(LPCVOID lpExeName, BOOL bUnicode)
Definition: history.c:138
static DWORD LPSTR lpExeName
Definition: process.c:72

◆ GetConsoleCommandHistoryLengthW()

DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryLengthW ( IN LPCWSTR  lpExeName)

Definition at line 302 of file history.c.

303 {
305 }
static DWORD IntGetConsoleCommandHistoryLength(LPCVOID lpExeName, BOOL bUnicode)
Definition: history.c:138
#define TRUE
Definition: types.h:120
static DWORD LPSTR lpExeName
Definition: process.c:72

◆ GetConsoleCommandHistoryW()

DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryW ( OUT LPWSTR  lpHistory,
IN DWORD  cbHistory,
IN LPCWSTR  lpExeName 
)

Definition at line 274 of file history.c.

277 {
278  return IntGetConsoleCommandHistory(lpHistory, cbHistory, lpExeName, TRUE);
279 }
static DWORD IntGetConsoleCommandHistory(LPVOID lpHistory, DWORD cbHistory, LPCVOID lpExeName, BOOLEAN bUnicode)
Definition: history.c:77
#define TRUE
Definition: types.h:120
static DWORD LPSTR lpExeName
Definition: process.c:72

◆ IntExpungeConsoleCommandHistory()

static VOID IntExpungeConsoleCommandHistory ( LPCVOID  lpExeName,
BOOLEAN  bUnicode 
)
static

Definition at line 31 of file history.c.

32 {
33  CONSOLE_API_MESSAGE ApiMessage;
34  PCONSOLE_EXPUNGECOMMANDHISTORY ExpungeCommandHistoryRequest = &ApiMessage.Data.ExpungeCommandHistoryRequest;
35  PCSR_CAPTURE_BUFFER CaptureBuffer;
36 
37  USHORT NumChars = (USHORT)(lpExeName ? (bUnicode ? wcslen(lpExeName) : strlen(lpExeName)) : 0);
38 
39  if (lpExeName == NULL || NumChars == 0)
40  {
42  return;
43  }
44 
45  ExpungeCommandHistoryRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
46  ExpungeCommandHistoryRequest->ExeLength = NumChars * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR));
47  ExpungeCommandHistoryRequest->Unicode =
48  ExpungeCommandHistoryRequest->Unicode2 = bUnicode;
49 
50  // CaptureBuffer = CsrAllocateCaptureBuffer(1, IntStringSize(lpExeName, bUnicode));
51  CaptureBuffer = CsrAllocateCaptureBuffer(1, ExpungeCommandHistoryRequest->ExeLength);
52  if (!CaptureBuffer)
53  {
54  DPRINT1("CsrAllocateCaptureBuffer failed!\n");
56  return;
57  }
58 
59  CsrCaptureMessageBuffer(CaptureBuffer,
61  ExpungeCommandHistoryRequest->ExeLength,
62  (PVOID)&ExpungeCommandHistoryRequest->ExeName);
63 
65  CaptureBuffer,
67  sizeof(*ExpungeCommandHistoryRequest));
68 
69  CsrFreeCaptureBuffer(CaptureBuffer);
70 
71  if (!NT_SUCCESS(ApiMessage.Status))
72  BaseSetLastNTError(ApiMessage.Status);
73 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
VOID NTAPI CsrFreeCaptureBuffer(IN PCSR_CAPTURE_BUFFER CaptureBuffer)
Definition: capture.c:189
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
PCSR_CAPTURE_BUFFER NTAPI CsrAllocateCaptureBuffer(IN ULONG ArgumentCount, IN ULONG BufferSize)
Definition: capture.c:90
NTSTATUS NTAPI CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL, IN CSR_API_NUMBER ApiNumber, IN ULONG DataLength)
Definition: connect.c:365
char CHAR
Definition: xmlstorage.h:175
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
static DWORD LPSTR lpExeName
Definition: process.c:72
NTSTATUS Status
Definition: csrmsg.h:112
VOID NTAPI CsrCaptureMessageBuffer(IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer, IN PVOID MessageBuffer OPTIONAL, IN ULONG MessageLength, OUT PVOID *CapturedData)
Definition: capture.c:169
smooth NULL
Definition: ftsmooth.c:416
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:409
#define NtCurrentPeb()
Definition: FLS.c:20
unsigned short USHORT
Definition: pedump.c:61
#define DPRINT1
Definition: precomp.h:8
CONSOLE_EXPUNGECOMMANDHISTORY ExpungeCommandHistoryRequest
Definition: conmsg.h:986
union _CONSOLE_API_MESSAGE::@3390 Data
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CONSRV_SERVERDLL_INDEX
Definition: conmsg.h:15

Referenced by ExpungeConsoleCommandHistoryA(), and ExpungeConsoleCommandHistoryW().

◆ IntGetConsoleCommandHistory()

static DWORD IntGetConsoleCommandHistory ( LPVOID  lpHistory,
DWORD  cbHistory,
LPCVOID  lpExeName,
BOOLEAN  bUnicode 
)
static

Definition at line 77 of file history.c.

78 {
79  CONSOLE_API_MESSAGE ApiMessage;
80  PCONSOLE_GETCOMMANDHISTORY GetCommandHistoryRequest = &ApiMessage.Data.GetCommandHistoryRequest;
81  PCSR_CAPTURE_BUFFER CaptureBuffer;
82 
83  USHORT NumChars = (USHORT)(lpExeName ? (bUnicode ? wcslen(lpExeName) : strlen(lpExeName)) : 0);
84 
85  if (lpExeName == NULL || NumChars == 0)
86  {
88  return 0;
89  }
90 
91  GetCommandHistoryRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
92  GetCommandHistoryRequest->HistoryLength = cbHistory;
93  GetCommandHistoryRequest->ExeLength = NumChars * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR));
94  GetCommandHistoryRequest->Unicode =
95  GetCommandHistoryRequest->Unicode2 = bUnicode;
96 
97  // CaptureBuffer = CsrAllocateCaptureBuffer(2, IntStringSize(lpExeName, bUnicode) +
98  // HistoryLength);
99  CaptureBuffer = CsrAllocateCaptureBuffer(2, GetCommandHistoryRequest->ExeLength +
100  GetCommandHistoryRequest->HistoryLength);
101  if (!CaptureBuffer)
102  {
103  DPRINT1("CsrAllocateCaptureBuffer failed!\n");
105  return 0;
106  }
107 
108  CsrCaptureMessageBuffer(CaptureBuffer,
109  (PVOID)lpExeName,
110  GetCommandHistoryRequest->ExeLength,
111  (PVOID)&GetCommandHistoryRequest->ExeName);
112 
113  CsrAllocateMessagePointer(CaptureBuffer, GetCommandHistoryRequest->HistoryLength,
114  (PVOID*)&GetCommandHistoryRequest->History);
115 
117  CaptureBuffer,
119  sizeof(*GetCommandHistoryRequest));
120  if (!NT_SUCCESS(ApiMessage.Status))
121  {
122  CsrFreeCaptureBuffer(CaptureBuffer);
123  BaseSetLastNTError(ApiMessage.Status);
124  return 0;
125  }
126 
127  RtlCopyMemory(lpHistory,
128  GetCommandHistoryRequest->History,
129  GetCommandHistoryRequest->HistoryLength);
130 
131  CsrFreeCaptureBuffer(CaptureBuffer);
132 
133  return GetCommandHistoryRequest->HistoryLength;
134 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
VOID NTAPI CsrFreeCaptureBuffer(IN PCSR_CAPTURE_BUFFER CaptureBuffer)
Definition: capture.c:189
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
ULONG NTAPI CsrAllocateMessagePointer(IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer, IN ULONG MessageLength, OUT PVOID *CapturedData)
Definition: capture.c:133
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
PCSR_CAPTURE_BUFFER NTAPI CsrAllocateCaptureBuffer(IN ULONG ArgumentCount, IN ULONG BufferSize)
Definition: capture.c:90
NTSTATUS NTAPI CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL, IN CSR_API_NUMBER ApiNumber, IN ULONG DataLength)
Definition: connect.c:365
char CHAR
Definition: xmlstorage.h:175
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
static DWORD LPSTR lpExeName
Definition: process.c:72
NTSTATUS Status
Definition: csrmsg.h:112
VOID NTAPI CsrCaptureMessageBuffer(IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer, IN PVOID MessageBuffer OPTIONAL, IN ULONG MessageLength, OUT PVOID *CapturedData)
Definition: capture.c:169
smooth NULL
Definition: ftsmooth.c:416
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:409
CONSOLE_GETCOMMANDHISTORY GetCommandHistoryRequest
Definition: conmsg.h:984
#define NtCurrentPeb()
Definition: FLS.c:20
unsigned short USHORT
Definition: pedump.c:61
#define DPRINT1
Definition: precomp.h:8
union _CONSOLE_API_MESSAGE::@3390 Data
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CONSRV_SERVERDLL_INDEX
Definition: conmsg.h:15

Referenced by GetConsoleCommandHistoryA(), and GetConsoleCommandHistoryW().

◆ IntGetConsoleCommandHistoryLength()

static DWORD IntGetConsoleCommandHistoryLength ( LPCVOID  lpExeName,
BOOL  bUnicode 
)
static

Definition at line 138 of file history.c.

139 {
140  CONSOLE_API_MESSAGE ApiMessage;
141  PCONSOLE_GETCOMMANDHISTORYLENGTH GetCommandHistoryLengthRequest = &ApiMessage.Data.GetCommandHistoryLengthRequest;
142  PCSR_CAPTURE_BUFFER CaptureBuffer;
143 
144  USHORT NumChars = (USHORT)(lpExeName ? (bUnicode ? wcslen(lpExeName) : strlen(lpExeName)) : 0);
145 
146  if (lpExeName == NULL || NumChars == 0)
147  {
149  return 0;
150  }
151 
152  GetCommandHistoryLengthRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
153  GetCommandHistoryLengthRequest->ExeLength = NumChars * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR));
154  GetCommandHistoryLengthRequest->Unicode =
155  GetCommandHistoryLengthRequest->Unicode2 = bUnicode;
156 
157  // CaptureBuffer = CsrAllocateCaptureBuffer(1, IntStringSize(lpExeName, bUnicode));
158  CaptureBuffer = CsrAllocateCaptureBuffer(1, GetCommandHistoryLengthRequest->ExeLength);
159  if (!CaptureBuffer)
160  {
161  DPRINT1("CsrAllocateCaptureBuffer failed!\n");
163  return 0;
164  }
165 
166  CsrCaptureMessageBuffer(CaptureBuffer,
167  (PVOID)lpExeName,
168  GetCommandHistoryLengthRequest->ExeLength,
169  (PVOID)&GetCommandHistoryLengthRequest->ExeName);
170 
172  CaptureBuffer,
174  sizeof(*GetCommandHistoryLengthRequest));
175 
176  CsrFreeCaptureBuffer(CaptureBuffer);
177 
178  if (!NT_SUCCESS(ApiMessage.Status))
179  {
180  BaseSetLastNTError(ApiMessage.Status);
181  return 0;
182  }
183 
184  return GetCommandHistoryLengthRequest->HistoryLength;
185 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
VOID NTAPI CsrFreeCaptureBuffer(IN PCSR_CAPTURE_BUFFER CaptureBuffer)
Definition: capture.c:189
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
PCSR_CAPTURE_BUFFER NTAPI CsrAllocateCaptureBuffer(IN ULONG ArgumentCount, IN ULONG BufferSize)
Definition: capture.c:90
NTSTATUS NTAPI CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL, IN CSR_API_NUMBER ApiNumber, IN ULONG DataLength)
Definition: connect.c:365
char CHAR
Definition: xmlstorage.h:175
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
static DWORD LPSTR lpExeName
Definition: process.c:72
NTSTATUS Status
Definition: csrmsg.h:112
VOID NTAPI CsrCaptureMessageBuffer(IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer, IN PVOID MessageBuffer OPTIONAL, IN ULONG MessageLength, OUT PVOID *CapturedData)
Definition: capture.c:169
smooth NULL
Definition: ftsmooth.c:416
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:409
CONSOLE_GETCOMMANDHISTORYLENGTH GetCommandHistoryLengthRequest
Definition: conmsg.h:985
#define NtCurrentPeb()
Definition: FLS.c:20
unsigned short USHORT
Definition: pedump.c:61
#define DPRINT1
Definition: precomp.h:8
union _CONSOLE_API_MESSAGE::@3390 Data
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CONSRV_SERVERDLL_INDEX
Definition: conmsg.h:15

Referenced by GetConsoleCommandHistoryLengthA(), and GetConsoleCommandHistoryLengthW().

◆ IntSetConsoleNumberOfCommands()

static BOOL IntSetConsoleNumberOfCommands ( DWORD  dwNumCommands,
LPCVOID  lpExeName,
BOOLEAN  bUnicode 
)
static

Definition at line 189 of file history.c.

192 {
193  CONSOLE_API_MESSAGE ApiMessage;
194  PCONSOLE_SETHISTORYNUMBERCOMMANDS SetHistoryNumberCommandsRequest = &ApiMessage.Data.SetHistoryNumberCommandsRequest;
195  PCSR_CAPTURE_BUFFER CaptureBuffer;
196 
197  USHORT NumChars = (USHORT)(lpExeName ? (bUnicode ? wcslen(lpExeName) : strlen(lpExeName)) : 0);
198 
199  if (lpExeName == NULL || NumChars == 0)
200  {
202  return FALSE;
203  }
204 
205  SetHistoryNumberCommandsRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
206  SetHistoryNumberCommandsRequest->NumCommands = dwNumCommands;
207  SetHistoryNumberCommandsRequest->ExeLength = NumChars * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR));
208  SetHistoryNumberCommandsRequest->Unicode =
209  SetHistoryNumberCommandsRequest->Unicode2 = bUnicode;
210 
211  // CaptureBuffer = CsrAllocateCaptureBuffer(1, IntStringSize(lpExeName, bUnicode));
212  CaptureBuffer = CsrAllocateCaptureBuffer(1, SetHistoryNumberCommandsRequest->ExeLength);
213  if (!CaptureBuffer)
214  {
215  DPRINT1("CsrAllocateCaptureBuffer failed!\n");
217  return FALSE;
218  }
219 
220  CsrCaptureMessageBuffer(CaptureBuffer,
221  (PVOID)lpExeName,
222  SetHistoryNumberCommandsRequest->ExeLength,
223  (PVOID)&SetHistoryNumberCommandsRequest->ExeName);
224 
226  CaptureBuffer,
228  sizeof(*SetHistoryNumberCommandsRequest));
229 
230  CsrFreeCaptureBuffer(CaptureBuffer);
231 
232  if (!NT_SUCCESS(ApiMessage.Status))
233  {
234  BaseSetLastNTError(ApiMessage.Status);
235  return FALSE;
236  }
237 
238  return TRUE;
239 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
VOID NTAPI CsrFreeCaptureBuffer(IN PCSR_CAPTURE_BUFFER CaptureBuffer)
Definition: capture.c:189
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
PCSR_CAPTURE_BUFFER NTAPI CsrAllocateCaptureBuffer(IN ULONG ArgumentCount, IN ULONG BufferSize)
Definition: capture.c:90
NTSTATUS NTAPI CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL, IN CSR_API_NUMBER ApiNumber, IN ULONG DataLength)
Definition: connect.c:365
char CHAR
Definition: xmlstorage.h:175
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
static DWORD LPSTR lpExeName
Definition: process.c:72
NTSTATUS Status
Definition: csrmsg.h:112
VOID NTAPI CsrCaptureMessageBuffer(IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer, IN PVOID MessageBuffer OPTIONAL, IN ULONG MessageLength, OUT PVOID *CapturedData)
Definition: capture.c:169
smooth NULL
Definition: ftsmooth.c:416
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:409
CONSOLE_SETHISTORYNUMBERCOMMANDS SetHistoryNumberCommandsRequest
Definition: conmsg.h:988
#define NtCurrentPeb()
Definition: FLS.c:20
unsigned short USHORT
Definition: pedump.c:61
#define DPRINT1
Definition: precomp.h:8
union _CONSOLE_API_MESSAGE::@3390 Data
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CONSRV_SERVERDLL_INDEX
Definition: conmsg.h:15

Referenced by SetConsoleNumberOfCommandsA(), and SetConsoleNumberOfCommandsW().

◆ SetConsoleCommandHistoryMode()

BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCommandHistoryMode ( IN DWORD  dwMode)

Definition at line 352 of file history.c.

353 {
354  CONSOLE_API_MESSAGE ApiMessage;
355  PCONSOLE_SETHISTORYMODE SetHistoryModeRequest = &ApiMessage.Data.SetHistoryModeRequest;
356 
357  SetHistoryModeRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
358  SetHistoryModeRequest->Mode = dwMode;
359 
361  NULL,
363  sizeof(*SetHistoryModeRequest));
364  if (!NT_SUCCESS(ApiMessage.Status))
365  {
366  BaseSetLastNTError(ApiMessage.Status);
367  return FALSE;
368  }
369 
370  return TRUE;
371 }
#define TRUE
Definition: types.h:120
NTSTATUS NTAPI CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL, IN CSR_API_NUMBER ApiNumber, IN ULONG DataLength)
Definition: connect.c:365
NTSTATUS Status
Definition: csrmsg.h:112
smooth NULL
Definition: ftsmooth.c:416
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
CONSOLE_SETHISTORYMODE SetHistoryModeRequest
Definition: conmsg.h:989
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define NtCurrentPeb()
Definition: FLS.c:20
union _CONSOLE_API_MESSAGE::@3390 Data
#define CONSRV_SERVERDLL_INDEX
Definition: conmsg.h:15

◆ SetConsoleNumberOfCommandsA()

BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleNumberOfCommandsA ( IN DWORD  dwNumCommands,
IN LPCSTR  lpExeName 
)

Definition at line 339 of file history.c.

341 {
342  return IntSetConsoleNumberOfCommands(dwNumCommands, lpExeName, FALSE);
343 }
static DWORD LPSTR lpExeName
Definition: process.c:72
static BOOL IntSetConsoleNumberOfCommands(DWORD dwNumCommands, LPCVOID lpExeName, BOOLEAN bUnicode)
Definition: history.c:189

◆ SetConsoleNumberOfCommandsW()

BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleNumberOfCommandsW ( IN DWORD  dwNumCommands,
IN LPCWSTR  lpExeName 
)

Definition at line 326 of file history.c.

328 {
329  return IntSetConsoleNumberOfCommands(dwNumCommands, lpExeName, TRUE);
330 }
#define TRUE
Definition: types.h:120
static DWORD LPSTR lpExeName
Definition: process.c:72
static BOOL IntSetConsoleNumberOfCommands(DWORD dwNumCommands, LPCVOID lpExeName, BOOLEAN bUnicode)
Definition: history.c:189