-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathKexComm.h
120 lines (98 loc) · 2.9 KB
/
KexComm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#pragma once
#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#include <VxKex.h>
#include <Windows.h>
#include <tchar.h>
#include <strsafe.h>
#include <malloc.h>
#include <stdarg.h>
#define T TEXT
#define ASSUME __assume
#define NORETURN __declspec(noreturn)
#define STATIC static
#define INLINE _inline
#define VOLATILE volatile
#define DECLSPEC_EXPORT __declspec(dllexport)
#define CHECKED(x) if (!(x)) goto Error
#define tWinMain _tWinMain
#define getch _getch
#define cprintf _tcprintf
#define caprintf _cprintf
#define cwprintf _cwprintf
#define strlen _tcslen
#define stricmp _tcsicmp
#define strnicmp _tcsnicmp
#define strcpy_s _tcscpy_s
#define strcat_s _tcscat_s
#define scprintf _sctprintf
#define vscprintf _vsctprintf
#define vsprintf_s _vstprintf_s
#define sprintf_s _stprintf_s
#define snprintf_s _sntprintf_s
#define sscanf_s _stscanf_s
#define StackAlloc _alloca
#define until (condition) while (!(condition))
#define unless (condition) if (!(condition))
typedef LPVOID *PPVOID;
typedef unsigned __int64 QWORD, *PQWORD, *LPQWORD, **PPQWORD;
typedef LONG KPRIORITY;
EXTERN_C VOID SetFriendlyAppName(
IN LPCTSTR lpszFriendlyName);
EXTERN_C LPCTSTR GetLastErrorAsString(
VOID);
EXTERN_C VOID MessageBoxV(
IN UINT uType OPTIONAL,
IN LPCTSTR lpszFmt,
IN va_list ap);
EXTERN_C VOID ErrorBoxF(
IN LPCTSTR lpszFmt, ...);
EXTERN_C NORETURN VOID CriticalErrorBoxF(
IN LPCTSTR lpszFmt, ...);
EXTERN_C VOID InfoBoxF(
IN LPCTSTR lpszFmt, ...);
EXTERN_C BOOL RegReadSz(
IN HKEY hKey,
IN LPCTSTR lpszSubKey,
IN LPCTSTR lpszValueName OPTIONAL,
OUT LPTSTR lpszData,
IN DWORD dwcchData);
EXTERN_C BOOL RegWriteSz(
IN HKEY hKey,
IN LPCTSTR lpszSubKey,
IN LPCTSTR lpszValueName OPTIONAL,
IN LPCTSTR lpszData OPTIONAL);
EXTERN_C BOOL RegReadDw(
IN HKEY hKey,
IN LPCTSTR lpszSubKey,
IN LPCTSTR lpszValueName OPTIONAL,
OUT LPDWORD lpdwData);
EXTERN_C BOOL RegWriteDw(
IN HKEY hKey,
IN LPCTSTR lpszSubKey,
IN LPCTSTR lpszValueName OPTIONAL,
IN DWORD dwData);
EXTERN_C BOOL RegDelValue(
IN HKEY hKey,
IN LPCTSTR lpszSubKey,
IN LPCTSTR lpszValueName);
HANDLE CreateTempFile(
IN LPCTSTR lpszPrefix,
IN DWORD dwDesiredAccess,
IN DWORD dwShareMode,
IN LPSECURITY_ATTRIBUTES lpSecurityAttributes);
BOOL WriteFileWF(
IN HANDLE hFile,
IN LPCWSTR lpszFmt, ...);
LPVOID __AutoHeapAllocHelper(
IN SIZE_T cb);
LPVOID __AutoStackAllocHelper(
IN LPVOID lpv);
VOID AutoFree(
IN LPVOID lpv);
#define __MAX_STACK_ALLOC_SIZE 1024
#define AutoAlloc(cb) (((cb) < __MAX_STACK_ALLOC_SIZE) ? __AutoStackAllocHelper(StackAlloc((cb) + 1)) : __AutoHeapAllocHelper((cb) + 1))
#ifdef UNICODE
#define WriteFileF WriteFileWF
#else
#define WriteFileF WriteFileAF
#endif