22#define MAX_STRING 2000
50 Hist = (
WCHAR *)HistBuf;
55 for (; Hist < HistEnd; Hist +=
wcslen(Hist) + 1)
79 while (nameend >
name && nameend[-1] ==
L' ')
109 if (!AliasBuf)
return;
110 Alias = (
WCHAR *)AliasBuf;
115 for (; Alias < AliasEnd; Alias +=
wcslen(Alias) + 1)
134 if (!ExeNameBuf)
return;
135 ExeName = (
WCHAR *)ExeNameBuf;
140 for (; ExeName < ExeNameEnd; ExeName +=
wcslen(ExeName) + 1)
246 if (!bInQuotes && (*
p ==
L' ' || *
p ==
L'\t'))
248 bInQuotes ^= (*
p++ ==
L'"');
257 LPWSTR pArgStart, pArgEnd;
266 GetArg(&pArgStart, &pArgEnd);
268 while (
GetArg(&pArgStart, &pArgEnd))
271 WCHAR tmp = *pArgEnd;
283 else if (!
_wcsnicmp(pArgStart,
L"/EXENAME=", 9))
292 else if (!
_wcsnicmp(pArgStart,
L"/LISTSIZE=", 10))
296 else if (!
_wcsicmp(pArgStart,
L"/REINSTALL"))
300 else if (!
_wcsicmp(pArgStart,
L"/INSERT"))
304 else if (!
_wcsicmp(pArgStart,
L"/OVERSTRIKE"))
322 else if (!
_wcsnicmp(pArgStart,
L"/MACROFILE=", 11))
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
#define HeapFree(x, y, z)
BOOL WINAPI DECLSPEC_HOTPATCH AddConsoleAliasW(_In_ LPCWSTR Source, _In_ LPCWSTR Target, _In_ LPCWSTR ExeName)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleAliasExesW(LPWSTR lpExeNameBuffer, DWORD ExeNameBufferLength)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleAliasesW(_Out_writes_(AliasBufferLength) LPWSTR AliasBuffer, _In_ DWORD AliasBufferLength, _In_ LPCWSTR ExeName)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleAliasesLengthW(_In_ LPCWSTR ExeName)
static WCHAR ExeNameBuffer[EXENAME_LENGTH]
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryLengthW(IN LPCWSTR lpExeName)
VOID WINAPI DECLSPEC_HOTPATCH ExpungeConsoleCommandHistoryW(IN LPCWSTR lpExeName)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleCommandHistoryW(OUT LPWSTR lpHistory, IN DWORD cbHistory, IN LPCWSTR lpExeName)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleNumberOfCommandsW(IN DWORD dwNumCommands, IN LPCWSTR lpExeName)
LPWSTR WINAPI GetCommandLineW(void)
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
void CDECL _wperror(const wchar_t *str)
int CDECL fclose(FILE *file)
wchar_t *CDECL fgetws(wchar_t *s, int size, FILE *file)
FILE *CDECL _wfopen(const wchar_t *path, const wchar_t *mode)
_ACRTIMP int __cdecl _wtoi(const wchar_t *)
_ACRTIMP size_t __cdecl wcsspn(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
static INT SetMacro(LPWSTR definition)
static VOID PrintHistory(VOID)
static BOOL GetArg(WCHAR **pStart, WCHAR **pEnd)
static VOID PrintMacros(LPWSTR pszExeName, LPWSTR Indent)
static VOID ReadFromFile(LPWSTR FileName)
static VOID SetInsert(DWORD dwFlag)
WCHAR szStringBuf[MAX_STRING]
static LPWSTR RemoveQuotes(LPWSTR str)
static VOID PrintAllMacros(VOID)
#define IDS_INVALID_MACRO_DEF
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define ENABLE_EXTENDED_FLAGS
#define ENABLE_INSERT_MODE
#define GetConsoleAliasExesLength