20#define EXENAME_LENGTH (255 + 1)
43#define MAX_STRING 2000
71 Hist = (
WCHAR *)HistBuf;
76 for (; Hist < HistEnd; Hist +=
wcslen(Hist) + 1)
100 while (nameend >
name && nameend[-1] ==
L' ')
130 if (!AliasBuf)
return;
131 Alias = (
WCHAR *)AliasBuf;
136 for (; Alias < AliasEnd; Alias +=
wcslen(Alias) + 1)
155 if (!ExeNameBuf)
return;
156 ExeName = (
WCHAR *)ExeNameBuf;
161 for (; ExeName < ExeNameEnd; ExeName +=
wcslen(ExeName) + 1)
267 if (!bInQuotes && (*
p ==
L' ' || *
p ==
L'\t'))
269 bInQuotes ^= (*
p++ ==
L'"');
278 LPWSTR pArgStart, pArgEnd;
287 GetArg(&pArgStart, &pArgEnd);
289 while (
GetArg(&pArgStart, &pArgEnd))
292 WCHAR tmp = *pArgEnd;
304 else if (!
_wcsnicmp(pArgStart,
L"/EXENAME=", 9))
313 else if (!
_wcsnicmp(pArgStart,
L"/LISTSIZE=", 10))
317 else if (!
_wcsicmp(pArgStart,
L"/REINSTALL"))
321 else if (!
_wcsicmp(pArgStart,
L"/INSERT"))
325 else if (!
_wcsicmp(pArgStart,
L"/OVERSTRIKE"))
343 else if (!
_wcsnicmp(pArgStart,
L"/MACROFILE=", 11))
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
#define HeapFree(x, y, z)
BOOL WINAPI DECLSPEC_HOTPATCH AddConsoleAliasW(LPCWSTR lpSource, LPCWSTR lpTarget, LPCWSTR lpExeName)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleAliasesW(LPWSTR AliasBuffer, DWORD AliasBufferLength, LPWSTR ExeName)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleAliasesLengthW(LPWSTR lpExeName)
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleAliasExesW(LPWSTR lpExeNameBuffer, DWORD ExeNameBufferLength)
static WCHAR ExeNameBuffer[EXENAME_LENGTH]
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
LPWSTR WINAPI GetCommandLineW(VOID)
DWORD WINAPI GetConsoleCommandHistoryLengthW(LPCWSTR lpExeName)
static INT SetMacro(LPWSTR definition)
VOID WINAPI ExpungeConsoleCommandHistoryW(LPCWSTR lpExeName)
static VOID PrintHistory(VOID)
BOOL WINAPI SetConsoleNumberOfCommandsW(DWORD dwNumCommands, LPCWSTR lpExeName)
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)
DWORD WINAPI GetConsoleCommandHistoryW(LPWSTR lpHistory, DWORD cbHistory, LPCWSTR lpExeName)
#define IDS_INVALID_MACRO_DEF
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
_CRTIMP void __cdecl _wperror(_In_opt_z_ const wchar_t *_ErrMsg)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static DWORD LPSTR lpExeName
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP size_t __cdecl wcsspn(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define ENABLE_EXTENDED_FLAGS
#define ENABLE_INSERT_MODE
#define GetConsoleAliasExesLength
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
wchar_t * fgetws(wchar_t *buf, int bufsize, FILE *file)