1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-06-28 11:55:08 +03:00
This commit is contained in:
Ilya Shipitsin 2018-04-20 18:57:27 +00:00 committed by GitHub
commit 4430e5f888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 0 additions and 2408 deletions

View File

@ -763,29 +763,6 @@ void CndMsgDlgFree(SOCK *s)
ReleaseSock(s);
}
// The thread to stop the password input dialog client forcibly
void CncPasswordDlgHaltThread(THREAD *thread, void *param)
{
CNC_CONNECT_ERROR_DLG_THREAD_PARAM *dp = (CNC_CONNECT_ERROR_DLG_THREAD_PARAM *)param;
// Validate arguments
if (thread == NULL || param == NULL)
{
return;
}
while (true)
{
if (dp->Session->Halt || dp->HaltThread)
{
break;
}
Wait(dp->Event, 100);
}
Disconnect(dp->Sock);
}
// Show the password input dialog
bool CncPasswordDlg(SESSION *session, UI_PASSWORD_DLG *dlg)
{
@ -1124,41 +1101,6 @@ void CncReleaseSocket()
ReleaseSock(s);
}
// Get the Session ID of the client notification service
UINT CncGetSessionId()
{
SOCK *s = CncConnect();
PACK *p;
UINT ret;
if (s == NULL)
{
return INFINITE;
}
p = NewPack();
PackAddStr(p, "function", "get_session_id");
SendPack(s, p);
FreePack(p);
p = RecvPack(s);
if (p == NULL)
{
Disconnect(s);
ReleaseSock(s);
return INFINITE;
}
ret = PackGetInt(p, "session_id");
FreePack(p);
Disconnect(s);
ReleaseSock(s);
return ret;
}
// Terminate the process of the client notification service
void CncExit()
{
@ -2039,28 +1981,6 @@ bool CiHasAccountSensitiveInformation(BUF *b)
return ret;
}
bool CiHasAccountSensitiveInformationFile(wchar_t *name)
{
bool ret = false;
BUF *b;
// Validate arguments
if (name == NULL)
{
return false;
}
b = ReadDumpW(name);
if (b == NULL)
{
return false;
}
ret = CiHasAccountSensitiveInformation(b);
FreeBuf(b);
return ret;
}
// Delete the sensitive information in the account information
bool CiEraseSensitiveInAccount(BUF *b)
@ -10373,35 +10293,6 @@ void CiWriteSettingToCfg(CLIENT *c, FOLDER *root)
}
}
// Create the inner VPN Server
SERVER *CiNewInnerVPNServer(CLIENT *c, bool relay_server)
{
SERVER *s = NULL;
// Validate arguments
if (c == NULL)
{
return NULL;
}
SetNatTLowPriority();
s = SiNewServerEx(false, true, relay_server);
return s;
}
// Stop the inner VPN Server
void CiFreeInnerVPNServer(CLIENT *c, SERVER *s)
{
// Validate arguments
if (c == NULL || s == NULL)
{
return;
}
SiReleaseServer(s);
}
// Apply settings of Inner VPN Server
void CiApplyInnerVPNServerConfig(CLIENT *c)
{
@ -10585,48 +10476,6 @@ CLIENT *CiNewClient()
return c;
}
// Examine whether two proxy server settings equal
bool CompareInternetSetting(INTERNET_SETTING *s1, INTERNET_SETTING *s2)
{
// Validate arguments
if (s1 == NULL || s2 == NULL)
{
return false;
}
if (s1->ProxyType != s2->ProxyType)
{
return false;
}
if (s1->ProxyType == PROXY_DIRECT)
{
return true;
}
if (s1->ProxyPort != s2->ProxyPort)
{
return false;
}
if (StrCmp(s1->ProxyHostName, s2->ProxyHostName) != 0)
{
return false;
}
if (StrCmp(s1->ProxyUsername, s2->ProxyUsername) != 0)
{
return false;
}
if (StrCmp(s1->ProxyPassword, s2->ProxyPassword) != 0)
{
return false;
}
return true;
}
// Send a global pulse
void CiSendGlobalPulse(CLIENT *c)
{
@ -10781,20 +10630,6 @@ void CiDecrementNumActiveSessions()
Unlock(ci_active_sessions_lock);
}
// Get the number of active sessions
UINT CiGetNumActiveSessions()
{
UINT ret;
Lock(ci_active_sessions_lock);
{
ret = ci_num_active_sessions;
}
Unlock(ci_active_sessions_lock);
return ret;
}
// Release the client
void CtReleaseClient(CLIENT *c)
{

View File

@ -598,9 +598,6 @@ void CcSetServiceToForegroundProcess(REMOTE_CLIENT *r);
char *CiGetFirstVLan(CLIENT *c);
void CiNormalizeAccountVLan(CLIENT *c);
bool CompareInternetSetting(INTERNET_SETTING *s1, INTERNET_SETTING *s2);
void CnStart();
void CnListenerProc(THREAD *thread, void *param);
@ -642,7 +639,6 @@ SOCK *CncConnect();
SOCK *CncConnectEx(UINT timeout);
void CncReleaseSocket();
void CncExit();
UINT CncGetSessionId();
bool CncExecDriverInstaller(char *arg);
SOCK *CncStatusPrinterWindowStart(SESSION *s);
void CncStatusPrinterWindowPrint(SOCK *s, wchar_t *str);
@ -651,7 +647,6 @@ void CncStatusPrinterWindowThreadProc(THREAD *thread, void *param);
bool CncConnectErrorDlg(SESSION *session, UI_CONNECTERROR_DLG *dlg);
void CncConnectErrorDlgHaltThread(THREAD *thread, void *param);
bool CncPasswordDlg(SESSION *session, UI_PASSWORD_DLG *dlg);
void CncPasswordDlgHaltThread(THREAD *thread, void *param);
void CncCheckCert(SESSION *session, UI_CHECKCERT *dlg);
void CncCheckCertHaltThread(THREAD *thread, void *param);
bool CncSecureSignDlg(SECURE_SIGN *sign);
@ -793,13 +788,9 @@ bool CiTryToParseAccount(BUF *b);
bool CiTryToParseAccountFile(wchar_t *name);
bool CiEraseSensitiveInAccount(BUF *b);
bool CiHasAccountSensitiveInformation(BUF *b);
bool CiHasAccountSensitiveInformationFile(wchar_t *name);
void CiApplyInnerVPNServerConfig(CLIENT *c);
SERVER *CiNewInnerVPNServer(CLIENT *c, bool relay_server);
void CiFreeInnerVPNServer(CLIENT *c, SERVER *s);
void CiIncrementNumActiveSessions();
void CiDecrementNumActiveSessions();
UINT CiGetNumActiveSessions();
BUF *EncryptPassword(char *password);
BUF *EncryptPassword2(char *password);

View File

@ -9736,39 +9736,6 @@ bool CmdEvalIpAndMask6(CONSOLE *c, wchar_t *str, void *param)
return true;
}
bool CmdEvalIpAndMask46(CONSOLE *c, wchar_t *str, void *param)
{
char tmp[MAX_SIZE];
TOKEN_LIST *t;
bool ret = false;
Zero(tmp, sizeof(tmp));
UniToStr(tmp, sizeof(tmp), str);
t = ParseToken(tmp, "/");
if (t == NULL)
{
return false;
}
if (t->NumTokens >= 1)
{
Trim(t->Token[0]);
if (IsIpStr4(t->Token[0]))
{
ret = CmdEvalIpAndMask4(c, str, param);
}
else
{
ret = CmdEvalIpAndMask6(c, str, param);
}
}
FreeToken(t);
return ret;
}
// Evaluate the network address and the subnet mask
bool CmdEvalNetworkAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param)
@ -9823,39 +9790,6 @@ bool CmdEvalNetworkAndSubnetMask6(CONSOLE *c, wchar_t *str, void *param)
return true;
}
bool CmdEvalNetworkAndSubnetMask46(CONSOLE *c, wchar_t *str, void *param)
{
char tmp[MAX_SIZE];
TOKEN_LIST *t;
bool ret = false;
Zero(tmp, sizeof(tmp));
UniToStr(tmp, sizeof(tmp), str);
t = ParseToken(tmp, "/");
if (t == NULL)
{
return false;
}
if (t->NumTokens >= 1)
{
Trim(t->Token[0]);
if (IsIpStr4(t->Token[0]))
{
ret = CmdEvalNetworkAndSubnetMask4(c, str, param);
}
else
{
ret = CmdEvalNetworkAndSubnetMask6(c, str, param);
}
}
FreeToken(t);
return ret;
}
// Evaluate the IP address and subnet mask
bool CmdEvalHostAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param)
@ -22763,28 +22697,6 @@ UINT PsListenerDelete(CONSOLE *c, char *cmd_name, wchar_t *str, void *param)
return 0;
}
// Draw a row
void CmdPrintRow(CONSOLE *c, wchar_t *title, wchar_t *tag, ...)
{
wchar_t buf[MAX_SIZE * 2];
wchar_t buf2[MAX_SIZE * 2];
va_list args;
// Validate arguments
if (title == NULL || c == NULL || tag == NULL)
{
return;
}
va_start(args, tag);
UniFormatArgs(buf, sizeof(buf), tag, args);
UniFormat(buf2, sizeof(buf2), L"[%s] %s", title, buf);
va_end(args);
c->Write(c, buf2);
}
// ServerInfoGet command
UINT PsServerInfoGet(CONSOLE *c, char *cmd_name, wchar_t *str, void *param)
{

View File

@ -325,7 +325,6 @@ void InRpcTtResult(PACK *p, TT_RESULT *t);
void CmdPrintError(CONSOLE *c, UINT err);
void CmdPrintAbout(CONSOLE *c);
void CmdPrintRow(CONSOLE *c, wchar_t *title, wchar_t *tag, ...);
wchar_t *CmdPromptPort(CONSOLE *c, void *param);
wchar_t *CmdPromptChoosePassword(CONSOLE *c, void *param);
bool CmdEvalPort(CONSOLE *c, wchar_t *str, void *param);
@ -346,10 +345,8 @@ wchar_t *GetConnectionTypeStr(UINT type);
bool CmdEvalHostAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalNetworkAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalNetworkAndSubnetMask6(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalNetworkAndSubnetMask46(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalIpAndMask4(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalIpAndMask6(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalIpAndMask46(CONSOLE *c, wchar_t *str, void *param);
wchar_t *GetLogSwitchStr(UINT i);
wchar_t *GetPacketLogNameStr(UINT i);
UINT StrToLogSwitchType(char *str);

View File

@ -6659,34 +6659,6 @@ void SetRadiusServerEx(HUB *hub, char *name, UINT port, char *secret, UINT inter
Unlock(hub->RadiusOptionLock);
}
// Get the difference between the traffic data
void CalcTrafficEntryDiff(TRAFFIC_ENTRY *diff, TRAFFIC_ENTRY *old, TRAFFIC_ENTRY *current)
{
// Validate arguments
Zero(diff, sizeof(TRAFFIC_ENTRY));
if (old == NULL || current == NULL || diff == NULL)
{
return;
}
if (current->BroadcastCount >= old->BroadcastCount)
{
diff->BroadcastCount = current->BroadcastCount - old->BroadcastCount;
}
if (current->BroadcastBytes >= old->BroadcastBytes)
{
diff->BroadcastBytes = current->BroadcastBytes - old->BroadcastBytes;
}
if (current->UnicastCount >= old->UnicastCount)
{
diff->UnicastCount = current->UnicastCount - old->UnicastCount;
}
if (current->UnicastBytes >= old->UnicastBytes)
{
diff->UnicastBytes = current->UnicastBytes - old->UnicastBytes;
}
}
// Add the traffic information for Virtual HUB
void IncrementHubTraffic(HUB *h)
{

View File

@ -638,7 +638,6 @@ USERLIST *FindUserList(LIST *o, char *filename);
bool IsUserMatchInUserList(LIST *o, char *filename, UINT64 user_hash);
bool IsUserMatchInUserListWithCacheExpires(LIST *o, char *filename, UINT64 user_hash, UINT64 lifetime);
bool IsUserMatchInUserListWithCacheExpiresAcl(LIST *o, char *name_in_acl, UINT64 user_hash, UINT64 lifetime);
void CalcTrafficEntryDiff(TRAFFIC_ENTRY *diff, TRAFFIC_ENTRY *old, TRAFFIC_ENTRY *current);
bool CheckMaxLoggedPacketsPerMinute(SESSION *s, UINT max_packets, UINT64 now);
void VgsSetUserAgentValue(char *str);
void VgsSetEmbTag(bool b);

View File

@ -287,23 +287,6 @@ void FreeEraseFileList(LIST *o)
ReleaseList(o);
}
// Show the deleting file list
void PrintEraseFileList(LIST *o)
{
UINT i;
// Validate arguments
if (o == NULL)
{
return;
}
for (i = 0;i < LIST_NUM(o);i++)
{
ERASE_FILE *f = LIST_DATA(o, i);
Print("%I64u - %s\n", f->UpdateTime, f->FullPath);
}
}
// Generate a deleting file list of the specified directory
void EnumEraseFile(LIST *o, char *dirname)
{
@ -614,23 +597,6 @@ void ELog(ERASER *e, char *name, ...)
va_end(args);
}
// Take the log of the server
void ServerLog(CEDAR *c, wchar_t *fmt, ...)
{
wchar_t buf[MAX_SIZE * 2];
va_list args;
// Validate arguments
if (fmt == NULL)
{
return;
}
va_start(args, fmt);
UniFormatArgs(buf, sizeof(buf), fmt, args);
WriteServerLog(c, buf);
va_end(args);
}
void SLog(CEDAR *c, char *name, ...)
{
wchar_t buf[MAX_SIZE * 2];
@ -672,22 +638,6 @@ void CLog(CLIENT *c, char *name, ...)
}
// Take the security log of the HUB
void HubLog(HUB *h, wchar_t *fmt, ...)
{
wchar_t buf[MAX_SIZE * 2];
va_list args;
// Validate arguments
if (fmt == NULL)
{
return;
}
va_start(args, fmt);
UniFormatArgs(buf, sizeof(buf), fmt, args);
WriteHubLog(h, buf);
va_end(args);
}
void ALog(ADMIN *a, HUB *h, char *name, ...)
{
wchar_t buf[MAX_SIZE * 2];
@ -880,34 +830,6 @@ void PPPLog(PPP_SESSION *p, char *name, ...)
WriteServerLog(p->Cedar, buf);
}
// Write an IPC log
void IPCLog(IPC *ipc, char *name, ...)
{
wchar_t buf[MAX_SIZE * 2];
va_list args;
HUB *h;
// Validate arguments
if (name == NULL)
{
return;
}
h = GetHub(ipc->Cedar, ipc->HubName);
if (h == NULL)
{
return;
}
va_start(args, name);
UniFormatArgs(buf, sizeof(buf), _UU(name), args);
WriteHubLog(h, buf);
va_end(args);
ReleaseHub(h);
}
// Save the security log of the HUB
void WriteHubLog(HUB *h, wchar_t *str)
{
@ -989,69 +911,6 @@ void WriteServerLog(CEDAR *c, wchar_t *str)
}
}
// Write a multi-line log
void WriteMultiLineLog(LOG *g, BUF *b)
{
// Validate arguments
if (g == NULL || b == NULL)
{
return;
}
SeekBuf(b, 0, 0);
while (true)
{
char *s = CfgReadNextLine(b);
if (s == NULL)
{
break;
}
if (IsEmptyStr(s) == false)
{
InsertStringRecord(g, s);
}
Free(s);
}
}
// Take the security log (variable-length argument) *abolished
void SecLog(HUB *h, char *fmt, ...)
{
char buf[MAX_SIZE * 2];
va_list args;
// Validate arguments
if (fmt == NULL)
{
return;
}
if (h->LogSetting.SaveSecurityLog == false)
{
return;
}
va_start(args, fmt);
FormatArgs(buf, sizeof(buf), fmt, args);
WriteSecurityLog(h, buf);
va_end(args);
}
// Take a security log
void WriteSecurityLog(HUB *h, char *str)
{
// Validate arguments
if (h == NULL || str == NULL)
{
return;
}
InsertStringRecord(h->SecurityLogger, str);
}
// Take a packet log
bool PacketLog(HUB *hub, SESSION *src_session, SESSION *dest_session, PKT *packet, UINT64 now)
{
@ -2272,46 +2131,6 @@ void ReplaceForCsv(char *str)
}
}
// Set the directory name of the log
void SetLogDirName(LOG *g, char *dir)
{
// Validate arguments
if (g == NULL || dir == NULL)
{
return;
}
LockLog(g);
{
if (g->DirName != NULL)
{
Free(g->DirName);
}
g->DirName = CopyStr(dir);
}
UnlockLog(g);
}
// Set the name of the log
void SetLogPrefix(LOG *g, char *prefix)
{
// Validate arguments
if (g == NULL || prefix == NULL)
{
return;
}
LockLog(g);
{
if (g->DirName != NULL)
{
Free(g->Prefix);
}
g->DirName = CopyStr(prefix);
}
UnlockLog(g);
}
// Set the switch type of log
void SetLogSwitchType(LOG *g, UINT switch_type)
{

View File

@ -223,8 +223,6 @@ char *StringRecordParseProc(RECORD *rec);
bool MakeLogFileName(LOG *g, char *name, UINT size, char *dir, char *prefix, UINT64 tick, UINT switch_type, UINT num, char *old_datestr);
void MakeLogFileNameStringFromTick(LOG *g, char *str, UINT size, UINT64 tick, UINT switch_type);
void WriteRecordToBuffer(BUF *b, RECORD *r);
void SetLogDirName(LOG *g, char *dir);
void SetLogPrefix(LOG *g, char *prefix);
void SetLogSwitchType(LOG *g, UINT switch_type);
bool PacketLog(HUB *hub, SESSION *src_session, SESSION *dest_session, PKT *packet, UINT64 now);
char *PacketLogParseProc(RECORD *rec);
@ -234,17 +232,12 @@ char *GenCsvLine(TOKEN_LIST *t);
void ReplaceForCsv(char *str);
char *PortStr(CEDAR *cedar, UINT port, bool udp);
char *TcpFlagStr(UCHAR flag);
void WriteSecurityLog(HUB *h, char *str);
void SecLog(HUB *h, char *fmt, ...);
void SiSetDefaultLogSetting(HUB_LOG *g);
void DebugLog(CEDAR *c, char *fmt, ...);
void HubLog(HUB *h, wchar_t *fmt, ...);
void ServerLog(CEDAR *c, wchar_t *fmt, ...);
void SLog(CEDAR *c, char *name, ...);
void WriteHubLog(HUB *h, wchar_t *str);
void HLog(HUB *h, char *name, ...);
void NLog(VH *v, char *name, ...);
void IPCLog(IPC *ipc, char *name, ...);
void PPPLog(PPP_SESSION *p, char *name, ...);
void IPsecLog(IKE_SERVER *ike, IKE_CLIENT *c, IKE_SA *ike_sa, IPSECSA *ipsec_sa, char *name, ...);
void EtherIPLog(ETHERIP_SERVER *s, char *name, ...);
@ -261,13 +254,11 @@ bool CheckEraserDiskFreeSpace(ERASER *e);
int CompareEraseFile(void *p1, void *p2);
LIST *GenerateEraseFileList(ERASER *e);
void FreeEraseFileList(LIST *o);
void PrintEraseFileList(LIST *o);
void EnumEraseFile(LIST *o, char *dirname);
SLOG *NewSysLog(char *hostname, UINT port, IP *ip);
void SetSysLog(SLOG *g, char *hostname, UINT port);
void FreeSysLog(SLOG *g);
void SendSysLog(SLOG *g, wchar_t *str);
void WriteMultiLineLog(LOG *g, BUF *b);
char *BuildHttpLogStr(HTTPLOG *h);
void MakeSafeLogStr(char *str);
void AddLogBufToStr(BUF *b, char *name, char *value);

View File

@ -903,95 +903,6 @@ void NodeInfoToStr(wchar_t *str, UINT size, NODE_INFO *info)
info->HubName, unique_id);
}
// Comparison of node information
bool CompareNodeInfo(NODE_INFO *a, NODE_INFO *b)
{
// Validate arguments
if (a == NULL || b == NULL)
{
return false;
}
if (StrCmp(a->ClientProductName, b->ClientProductName) != 0)
{
return false;
}
if (a->ClientProductVer != b->ClientProductVer)
{
return false;
}
if (a->ClientProductBuild != b->ClientProductBuild)
{
return false;
}
if (StrCmp(a->ServerProductName, b->ServerProductName) != 0)
{
return false;
}
if (a->ServerProductVer != b->ServerProductVer)
{
return false;
}
if (a->ServerProductBuild != b->ServerProductBuild)
{
return false;
}
if (StrCmp(a->ClientOsName, b->ClientOsName) != 0)
{
return false;
}
if (StrCmp(a->ClientOsVer, b->ClientOsVer) != 0)
{
return false;
}
if (StrCmp(a->ClientOsProductId, b->ClientOsProductId) != 0)
{
return false;
}
if (StrCmp(a->ClientHostname, b->ClientHostname) != 0)
{
return false;
}
if (a->ClientIpAddress != b->ClientIpAddress)
{
return false;
}
if (StrCmp(a->ServerHostname, b->ServerHostname) != 0)
{
return false;
}
if (a->ServerIpAddress != b->ServerIpAddress)
{
return false;
}
if (a->ServerPort != b->ServerPort)
{
return false;
}
if (StrCmp(a->ProxyHostname, b->ProxyHostname) != 0)
{
return false;
}
if (a->ProxyIpAddress != b->ProxyIpAddress)
{
return false;
}
if (a->ProxyPort != b->ProxyPort)
{
return false;
}
if (StrCmp(a->HubName, b->HubName) != 0)
{
return false;
}
if (Cmp(a->UniqueId, b->UniqueId, 16) != 0)
{
return false;
}
return true;
}
// Accept the password change
UINT ChangePasswordAccept(CONNECTION *c, PACK *p)
{

View File

@ -1849,23 +1849,6 @@ SKIP:
}
}
// Name comparison of sessions
int CompareSession(void *p1, void *p2)
{
SESSION *s1, *s2;
if (p1 == NULL || p2 == NULL)
{
return 0;
}
s1 = *(SESSION **)p1;
s2 = *(SESSION **)p2;
if (s1 == NULL || s2 == NULL)
{
return 0;
}
return StrCmpi(s1->Name, s2->Name);
}
// Create an RPC session
SESSION *NewRpcSession(CEDAR *cedar, CLIENT_OPTION *option)
{

View File

@ -413,7 +413,6 @@ void StopSession(SESSION *s);
void StopSessionEx(SESSION *s, bool no_wait);
bool SessionConnect(SESSION *s);
bool ClientConnect(CONNECTION *c);
int CompareSession(void *p1, void *p2);
PACKET_ADAPTER *NewPacketAdapter(PA_INIT *init, PA_GETCANCEL *getcancel, PA_GETNEXTPACKET *getnext,
PA_PUTPACKET *put, PA_FREE *free);
void FreePacketAdapter(PACKET_ADAPTER *pa);
@ -435,7 +434,6 @@ LIST *NewCancelList();
void ReleaseCancelList(LIST *o);
void AddCancelList(LIST *o, CANCEL *c);
void CancelList(LIST *o);
bool CompareNodeInfo(NODE_INFO *a, NODE_INFO *b);
bool IsPriorityHighestPacketForQoS(void *data, UINT size);
UINT GetNextDelayedPacketTickDiff(SESSION *s);

File diff suppressed because it is too large Load Diff

View File

@ -410,7 +410,6 @@ struct LED
};
void LedDrawString(LED *d, char *str, HFONT f);
void LedDrawRect(LED *d);
void LedMainDraw(LED *d, HANDLE h);
void LedSpecial(LED *d, HANDLE h, UINT n);
@ -575,7 +574,6 @@ struct WINUI_UPDATE_DLG_PARAM
// Function prototype
void InitWinUi(wchar_t *software_name, char *font, UINT fontsize);
void SetWinUiTitle(wchar_t *title);
void FreeWinUi();
WINUI_UPDATE *InitUpdateUi(wchar_t *title, char *name, char *family_name, UINT64 current_date, UINT current_build, UINT current_ver, char *client_id, bool use_suppress_flag);
@ -619,7 +617,6 @@ void UnselectEdit(HWND hWnd, UINT id);
UINT SendMsg(HWND hWnd, UINT id, UINT msg, WPARAM wParam, LPARAM lParam);
bool IsEmpty(HWND hWnd, UINT id);
UINT GetTextLen(HWND hWnd, UINT id, bool unicode);
UINT GetTextSize(HWND hWnd, UINT id, bool unicode);
UINT GetStyle(HWND hWnd, UINT id);
void SetStyle(HWND hWnd, UINT id, UINT style);
void RemoveStyle(HWND hWnd, UINT id, UINT style);
@ -632,23 +629,16 @@ void SetShow(HWND hWnd, UINT id, bool b);
bool IsHide(HWND hWnd, UINT id);
bool IsShow(HWND hWnd, UINT id);
void Top(HWND hWnd);
void NoTop(HWND hWnd);
void *GetParam(HWND hWnd);
void SetParam(HWND hWnd, void *param);
UINT DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, bool white_color);
void NoticeSettingChange();
void UiTest();
UINT DialogInternal(HWND hWnd, UINT id, DIALOG_PROC *proc, void *param);
UINT MsgBox(HWND hWnd, UINT flag, wchar_t *msg);
UINT MsgBoxEx(HWND hWnd, UINT flag, wchar_t *msg, ...);
void SetTextEx(HWND hWnd, UINT id, wchar_t *str, ...);
void SetTextExA(HWND hWnd, UINT id, char *str, ...);
void FormatText(HWND hWnd, UINT id, ...);
void FormatTextA(HWND hWnd, UINT id, ...);
void Center(HWND hWnd);
void GetWindowClientRect(HWND hWnd, struct tagRECT *rect);
void CenterParent(HWND hWnd);
void GetMonitorSize(UINT *width, UINT *height);
void DisableClose(HWND hWnd);
void EnableClose(HWND hWnd);
void InitFont();
@ -657,21 +647,16 @@ int CompareFont(void *p1, void *p2);
HFONT GetFont(char *name, UINT size, bool bold, bool italic, bool underline, bool strikeout);
double GetTextScalingFactor();
bool CalcFontSize(HFONT hFont, UINT *x, UINT *y);
bool GetFontSize(HFONT hFont, UINT *x, UINT *y);
void SetFont(HWND hWnd, UINT id, HFONT hFont);
void SetFontEx(HWND hWnd, UINT id, HFONT hFont, bool no_adjust_font_size);
void LimitText(HWND hWnd, UINT id, UINT count);
bool CheckTextLen(HWND hWnd, UINT id, UINT len, bool unicode);
bool CheckTextSize(HWND hWnd, UINT id, UINT size, bool unicode);
void Check(HWND hWnd, UINT id, bool b);
bool IsChecked(HWND hWnd, UINT id);
void SetIcon(HWND hWnd, UINT id, UINT icon_id);
void SetBitmap(HWND hWnd, UINT id, UINT bmp_id);
bool SecureDeviceWindow(HWND hWnd, WINUI_SECURE_BATCH *batch, UINT num_batch, UINT device_id, UINT bitmap_id);
UINT Dialog(HWND hWnd, UINT id, WINUI_DIALOG_PROC *proc, void *param);
UINT DialogEx(HWND hWnd, UINT id, WINUI_DIALOG_PROC *proc, void *param, bool white);
UINT DialogEx2(HWND hWnd, UINT id, WINUI_DIALOG_PROC *proc, void *param, bool white, bool meiryo);
HWND DialogCreateEx(HWND hWnd, UINT id, WINUI_DIALOG_PROC *proc, void *param, bool white);
UINT __stdcall InternalDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
UINT SecureDeviceWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
HFONT Font(UINT size, UINT bold);
@ -689,10 +674,6 @@ wchar_t *SaveDlg(HWND hWnd, wchar_t *filter, wchar_t *title, wchar_t *default_na
char *SaveDlgA(HWND hWnd, char *filter, char *title, char *default_name, char *default_ext);
wchar_t *MakeFilter(wchar_t *str);
char *MakeFilterA(char *str);
void PkcsUtil();
UINT PkcsUtilProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
void PkcsUtilWrite(HWND hWnd);
void PkcsUtilErase(HWND hWnd);
bool PassphraseDlg(HWND hWnd, char *pass, UINT pass_size, BUF *buf, bool p12);
UINT PassphraseDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
bool PasswordDlg(HWND hWnd, UI_PASSWORD_DLG *p);
@ -702,8 +683,6 @@ void PasswordDlgProcChange(HWND hWnd, UI_PASSWORD_DLG *p);
UINT CbAddStr(HWND hWnd, UINT id, wchar_t *str, UINT data);
UINT CbAddStrA(HWND hWnd, UINT id, char *str, UINT data);
UINT CbAddStr9xA(HWND hWnd, UINT id, char *str, UINT data);
UINT CbInsertStr(HWND hWnd, UINT id, UINT index, wchar_t *str, UINT data);
UINT CbInsertStr9xA(HWND hWnd, UINT id, UINT index, char *str, UINT data);
void CbSelectIndex(HWND hWnd, UINT id, UINT index);
UINT CbNum(HWND hWnd, UINT id);
UINT CbFindStr(HWND hWnd, UINT id, wchar_t *str);
@ -718,21 +697,9 @@ UINT CbGetSelectIndex(HWND hWnd, UINT id);
UINT CbGetSelect(HWND hWnd, UINT id);
void SetRange(HWND hWnd, UINT id, UINT start, UINT end);
void SetPos(HWND hWnd, UINT id, UINT pos);
UINT LbAddStr(HWND hWnd, UINT id, wchar_t *str, UINT data);
UINT LbAddStrA(HWND hWnd, UINT id, char *str, UINT data);
UINT LbInsertStr(HWND hWnd, UINT id, UINT index, wchar_t *str, UINT data);
UINT LbInsertStrA(HWND hWnd, UINT id, UINT index, char *str, UINT data);
void LbSelectIndex(HWND hWnd, UINT id, UINT index);
UINT LbNum(HWND hWnd, UINT id);
UINT LbFindStr(HWND hWnd, UINT id, wchar_t *str);
wchar_t *LbGetStr(HWND hWnd, UINT id);
UINT LbFindData(HWND hWnd, UINT id, UINT data);
UINT LbGetData(HWND hWnd, UINT id, UINT index);
void LbSelect(HWND hWnd, UINT id, int data);
void LbReset(HWND hWnd, UINT id);
void LbSetHeight(HWND hWnd, UINT id, UINT value);
UINT LbGetSelectIndex(HWND hWnd, UINT id);
UINT LbGetSelect(HWND hWnd, UINT id);
STATUS_WINDOW *StatusPrinterWindowStart(SOCK *s, wchar_t *account_name);
void StatusPrinterWindowStop(STATUS_WINDOW *sw);
void StatusPrinterWindowPrint(STATUS_WINDOW *sw, wchar_t *str);
@ -753,14 +720,12 @@ UINT LvInsertItemByImageListIdA(HWND hWnd, UINT id, UINT image, void *param, cha
void LvSetItem(HWND hWnd, UINT id, UINT index, UINT pos, wchar_t *str);
void LvSetItemA(HWND hWnd, UINT id, UINT index, UINT pos, char *str);
void LvSetItemParam(HWND hWnd, UINT id, UINT index, void *param);
void LvSetItemImage(HWND hWnd, UINT id, UINT index, UINT icon);
void LvSetItemImageByImageListId(HWND hWnd, UINT id, UINT index, UINT image);
void LvDeleteItem(HWND hWnd, UINT id, UINT index);
UINT LvNum(HWND hWnd, UINT id);
void *LvGetParam(HWND hWnd, UINT id, UINT index);
wchar_t *LvGetStr(HWND hWnd, UINT id, UINT index, UINT pos);
char *LvGetStrA(HWND hWnd, UINT id, UINT index, UINT pos);
void LvShow(HWND hWnd, UINT id, UINT index);
UINT LvSearchParam(HWND hWnd, UINT id, void *param);
UINT LvSearchStr(HWND hWnd, UINT id, UINT pos, wchar_t *str);
UINT LvSearchStrA(HWND hWnd, UINT id, UINT pos, char *str);
@ -775,7 +740,6 @@ UINT LvGetNextMasked(HWND hWnd, UINT id, UINT start);
bool LvIsMasked(HWND hWnd, UINT id);
bool LvIsSingleSelected(HWND hWnd, UINT id);
bool LvIsMultiMasked(HWND hWnd, UINT id);
UINT LvGetMaskedNum(HWND hWnd, UINT id);
void LvAutoSize(HWND hWnd, UINT id);
void LvSelect(HWND hWnd, UINT id, UINT index);
void LvSelectByParam(HWND hWnd, UINT id, void *param);
@ -807,7 +771,6 @@ void LvRemoveStyle(HWND hWnd, UINT id, UINT style);
HMENU LoadSubMenu(UINT menu_id, UINT pos, HMENU *parent_menu);
UINT GetMenuItemPos(HMENU hMenu, UINT id);
void DeleteMenuItem(HMENU hMenu, UINT pos);
void SetMenuItemEnable(HMENU hMenu, UINT pos, bool enable);
void SetMenuItemBold(HMENU hMenu, UINT pos, bool bold);
wchar_t *GetMenuStr(HMENU hMenu, UINT pos);
char *GetMenuStrA(HMENU hMenu, UINT pos);
@ -831,7 +794,6 @@ void LvSortHander(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT id);
void LvStandardHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT id);
void IpSet(HWND hWnd, UINT id, UINT ip);
UINT IpGet(HWND hWnd, UINT id);
void IpClear(HWND hWnd, UINT id);
bool IpIsFilled(HWND hWnd, UINT id);
UINT IpGetFilledNum(HWND hWnd, UINT id);
void About(HWND hWnd, CEDAR *cedar, wchar_t *product_name);
@ -844,7 +806,6 @@ char *StringDlgA(HWND hWnd, wchar_t *title, wchar_t *info, char *def, UINT icon,
UINT StringDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
void InitDialogInternational(HWND hWnd, void *pparam);
void AdjustWindowAndControlSize(HWND hWnd, bool *need_resize, double *factor_x, double *factor_y);
void GetWindowAndControlSizeResizeScale(HWND hWnd, bool *need_resize, double *factor_x, double *factor_y);
void AdjustDialogXY(UINT *x, UINT *y, UINT dlgfont_x, UINT dlgfont_y);
HFONT GetDialogDefaultFont();
HFONT GetDialogDefaultFontEx(bool meiryo);
@ -862,14 +823,7 @@ void KakushiThread(THREAD *thread, void *param);
KAKUSHI *InitKakushi();
void FreeKakushi(KAKUSHI *k);
void ShowEasterEgg(HWND hWnd);
bool ExecuteHamcoreExe(char *name);
bool IsRegistedToDontShowFreeEditionDialog(char *server_name);
void RegistToDontShowFreeEditionDialog(char *server_name);
void ShowFreeInfoDialog(HWND hWnd, FREEINFO *info);
UINT FreeInfoDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
FREEINFO *StartFreeInfoDlg(char *server_name);
void FreeInfoThread(THREAD *thread, void *param);
void EndFreeInfoDlg(FREEINFO *info);
bool Win32CnCheckAlreadyExists(bool lock);
void RegistWindowsFirewallAll();
void RegistWindowsFirewallAllEx(char *dir);
@ -891,7 +845,6 @@ HFONT GetMeiryoFont();
HFONT GetMeiryoFontEx(UINT font_size);
HFONT GetMeiryoFontEx2(UINT font_size, bool bold);
bool ShowWindowsNetworkConnectionDialog();
SOCK *WinConnectEx2(HWND hWnd, char *server, UINT port, UINT timeout, UINT icon_id, wchar_t *caption, wchar_t *info, bool try_start_ssl, bool ssl_no_tls);
SOCK *WinConnectEx3(HWND hWnd, char *server, UINT port, UINT timeout, UINT icon_id, wchar_t *caption, wchar_t *info, UINT *nat_t_error_code, char *nat_t_svc_name, bool try_start_ssl, bool ssl_no_tls);
UINT WinConnectDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
void WinConnectDlgThread(THREAD *thread, void *param);
@ -909,7 +862,6 @@ WIZARD_PAGE *NewWizardPage(UINT id, WINUI_WIZARD_PROC *proc, wchar_t *title);
void FreeWizardPage(WIZARD_PAGE *p);
void AddWizardPage(WIZARD *w, WIZARD_PAGE *p);
WIZARD_PAGE *GetWizardPage(WIZARD *w, UINT id);
UINT GetWizardPageIndex(WIZARD *w, UINT id);
void *CreateWizardPageInstance(WIZARD *w, WIZARD_PAGE *p);
void ShowWizard(HWND hWndParent, WIZARD *w, UINT start_id);
void SetWizardButton(WIZARD_PAGE *p, bool enable_next, bool enable_back, bool enable_close, bool is_finish);

View File

@ -536,15 +536,6 @@ bool CfgSaveExW3(CFG_RW *rw, FOLDER *f, wchar_t *name, UINT *written_size, bool
}
// Read the settings from the file
FOLDER *CfgRead(char *name)
{
wchar_t *name_w = CopyStrToUni(name);
FOLDER *ret = CfgReadW(name_w);
Free(name_w);
return ret;
}
FOLDER *CfgReadW(wchar_t *name)
{
wchar_t tmp[MAX_SIZE];
@ -1425,17 +1416,6 @@ void CfgAddData(BUF *b, UINT type, char *name, char *data, char *sub, UINT depth
Free(tmp);
}
// Convert the data type string to an integer value
UINT CfgStrToType(char *str)
{
if (!StrCmpi(str, TAG_INT)) return ITEM_TYPE_INT;
if (!StrCmpi(str, TAG_INT64)) return ITEM_TYPE_INT64;
if (!StrCmpi(str, TAG_BYTE)) return ITEM_TYPE_BYTE;
if (!StrCmpi(str, TAG_STRING)) return ITEM_TYPE_STRING;
if (!StrCmpi(str, TAG_BOOL)) return ITEM_TYPE_BOOL;
return 0;
}
// Convert the type of data to a string
char *CfgTypeToStr(UINT type)
{

View File

@ -226,7 +226,6 @@ void CfgAddLine(BUF *b, char *str, UINT depth);
void CfgAddDeclare(BUF *b, char *name, UINT depth);
void CfgAddEnd(BUF *b, UINT depth);
void CfgAddData(BUF *b, UINT type, char *name, char *data, char *sub, UINT depth);
UINT CfgStrToType(char *str);
char *CfgTypeToStr(UINT type);
void CfgAddItemText(BUF *b, ITEM *t, UINT depth);
bool CfgEnumFolderProc(FOLDER *f, void *param);
@ -242,7 +241,6 @@ bool CfgSaveEx(CFG_RW *rw, FOLDER *f, char *name);
bool CfgSaveExW(CFG_RW *rw, FOLDER *f, wchar_t *name);
bool CfgSaveExW2(CFG_RW *rw, FOLDER *f, wchar_t *name, UINT *written_size);
bool CfgSaveExW3(CFG_RW *rw, FOLDER *f, wchar_t *name, UINT *written_size, bool write_binary);
FOLDER *CfgRead(char *name);
FOLDER *CfgReadW(wchar_t *name);
FOLDER *CfgCreateRoot();
void CfgTest();

View File

@ -2759,10 +2759,6 @@ bool RsaGen(K **priv, K **pub, UINT bit)
}
// Confirm whether the certificate X is signed by the issuer of the certificate x_issuer
bool CheckX(X *x, X *x_issuer)
{
return CheckXEx(x, x_issuer, false, false);
}
bool CheckXEx(X *x, X *x_issuer, bool check_name, bool check_date)
{
K *k;

View File

@ -427,7 +427,6 @@ bool CompareName(NAME *n1, NAME *n2);
K *GetKFromX(X *x);
bool CheckSignature(X *x, K *k);
X *X509ToX(X509 *x509);
bool CheckX(X *x, X *x_issuer);
bool CheckXEx(X *x, X *x_issuer, bool check_name, bool check_date);
bool Asn1TimeToSystem(SYSTEMTIME *s, void *asn1_time);
bool StrToSystem(SYSTEMTIME *s, char *str);

View File

@ -725,24 +725,6 @@ void ConvertSafeFileName(char *dst, UINT size, char *src)
}
}
}
void ConvertSafeFileNameW(wchar_t *dst, UINT size, wchar_t *src)
{
UINT i;
// Validate arguments
if (dst == NULL || src == NULL)
{
return;
}
UniStrCpy(dst, size, src);
for (i = 0;i < UniStrLen(dst);i++)
{
if (UniIsSafeChar(dst[i]) == false)
{
dst[i] = L'_';
}
}
}
// Get the free disk space
bool GetDiskFree(char *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size)

View File

@ -370,7 +370,6 @@ int CompareDirListByName(void *p1, void *p2);
bool GetDiskFree(char *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size);
bool GetDiskFreeW(wchar_t *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size);
void ConvertSafeFileName(char *dst, UINT size, char *src);
void ConvertSafeFileNameW(wchar_t *dst, UINT size, wchar_t *src);
bool FileReplaceRename(char *old_name, char *new_name);
bool FileReplaceRenameW(wchar_t *old_name, wchar_t *new_name);
bool IsFile(char *name);

View File

@ -501,7 +501,6 @@ if (kernel_status_inited) { \
#define KS_FREEFIFO_COUNT 37 // Number of times the FIFO object is deleted
#define KS_READ_FIFO_COUNT 38 // Number of calls ReadFifo
#define KS_WRITE_FIFO_COUNT 39 // Number of calls WriteFifo
#define KS_PEEK_FIFO_COUNT 40 // Number of calls PeekFifo
// List related
#define KS_NEWLIST_COUNT 41 // Number of calls NewList
#define KS_FREELIST_COUNT 42 // Number of times the object LIST was deleted

View File

@ -831,18 +831,6 @@ LIST *NewCandidateList()
return NewList(ComapreCandidate);
}
// Fill a range of memory
void FillBytes(void *data, UINT size, UCHAR c)
{
UCHAR *buf = (UCHAR *)data;
UINT i;
for (i = 0;i < size;i++)
{
buf[i] = c;
}
}
// Examine whether the specified address points all-zero area
bool IsZero(void *data, UINT size)
{
@ -1116,28 +1104,6 @@ void *Pop(SK *s)
return ret;
}
// Peep
void *PeekQueue(QUEUE *q)
{
void *p = NULL;
// Validate arguments
if (q == NULL)
{
return NULL;
}
if (q->num_item == 0)
{
// No items
return NULL;
}
// Read from the FIFO
PeekFifo(q->fifo, &p, sizeof(void *));
return p;
}
// Get the number of queued items
UINT GetQueueNum(QUEUE *q)
{
@ -1360,22 +1326,6 @@ QUEUE *NewQueueFast()
return q;
}
// Set the comparison function to list
void SetCmp(LIST *o, COMPARE *cmp)
{
// Validate arguments
if (o == NULL || cmp == NULL)
{
return;
}
if (o->cmp != cmp)
{
o->cmp = cmp;
o->sorted = false;
}
}
// Clone the list
LIST *CloneList(LIST *o)
{
@ -1471,23 +1421,6 @@ void *Search(LIST *o, void *target)
}
}
// Insert an item to the list (Do not insert if it already exists)
void InsertDistinct(LIST *o, void *p)
{
// Validate arguments
if (o == NULL || p == NULL)
{
return;
}
if (IsInList(o, p))
{
return;
}
Insert(o, p);
}
// Insert an item to the list
void Insert(LIST *o, void *p)
{
@ -1566,18 +1499,6 @@ void Insert(LIST *o, void *p)
KS_INC(KS_INSERT_COUNT);
}
// Setting the sort flag
void SetSortFlag(LIST *o, bool sorted)
{
// Validate arguments
if (o == NULL)
{
return;
}
o->sorted = sorted;
}
// Sort the list
void Sort(LIST *o)
{
@ -1593,43 +1514,6 @@ void Sort(LIST *o)
// KS
KS_INC(KS_SORT_COUNT);
}
void SortEx(LIST *o, COMPARE *cmp)
{
// Validate arguments
if (o == NULL)
{
return;
}
qsort(o->p, o->num_item, sizeof(void *), (int(*)(const void *, const void *))cmp);
o->sorted = false;
// KS
KS_INC(KS_SORT_COUNT);
}
// Examine whether a certain string items are present in the list (Unicode version)
bool IsInListUniStr(LIST *o, wchar_t *str)
{
UINT i;
// Validate arguments
if (o == NULL || str == NULL)
{
return false;
}
for (i = 0;i < LIST_NUM(o);i++)
{
wchar_t *s = LIST_DATA(o, i);
if (UniStrCmpi(s, str) == 0)
{
return true;
}
}
return false;
}
// Replace the pointer in the list
bool ReplaceListPointer(LIST *o, void *oldptr, void *newptr)
@ -1968,26 +1852,6 @@ bool IsInt64InList(LIST *o, UINT64 i)
return false;
}
// Remove all int from the interger list
void DelAllInt(LIST *o)
{
UINT i;
// Validate arguments
if (o == NULL)
{
return;
}
for (i = 0;i < LIST_NUM(o);i++)
{
UINT *p = LIST_DATA(o, i);
Free(p);
}
DeleteAll(o);
}
// Release the integer list
void ReleaseIntList(LIST *o)
{
@ -2065,44 +1929,6 @@ void DelInt(LIST *o, UINT i)
ReleaseList(o2);
}
}
void DelInt64(LIST *o, UINT64 i)
{
LIST *o2 = NULL;
UINT j;
// Validate arguments
if (o == NULL)
{
return;
}
for (j = 0;j < LIST_NUM(o);j++)
{
UINT64 *p = LIST_DATA(o, j);
if (*p == i)
{
if (o2 == NULL)
{
o2 = NewListFast(NULL);
}
Add(o2, p);
}
}
for (j = 0;j < LIST_NUM(o2);j++)
{
UINT64 *p = LIST_DATA(o2, j);
Delete(o, p);
Free(p);
}
if (o2 != NULL)
{
ReleaseList(o2);
}
}
// Create a new list of integers
LIST *NewIntList(bool sorted)
@ -2154,41 +1980,6 @@ int CompareInt64(void *p1, void *p2)
return COMPARE_RET(*v1, *v2);
}
// Randomize the contents of the list
void RandomizeList(LIST *o)
{
LIST *o2;
UINT i;
// Validate arguments
if (o == NULL)
{
return;
}
o2 = NewListFast(NULL);
while (LIST_NUM(o) != 0)
{
UINT num = LIST_NUM(o);
UINT i = Rand32() % num;
void *p = LIST_DATA(o, i);
Add(o2, p);
Delete(o, p);
}
DeleteAll(o);
for (i = 0;i < LIST_NUM(o2);i++)
{
void *p = LIST_DATA(o2, i);
Add(o, p);
}
ReleaseList(o2);
}
// Add an integer to the list
void AddInt(LIST *o, UINT i)
{
@ -2220,16 +2011,6 @@ void InsertInt(LIST *o, UINT i)
Insert(o, Clone(&i, sizeof(UINT)));
}
void InsertInt64(LIST *o, UINT64 i)
{
// Validate arguments
if (o == NULL)
{
return;
}
Insert(o, Clone(&i, sizeof(UINT64)));
}
// Add an integer to the list (no duplicates)
void AddIntDistinct(LIST *o, UINT i)
@ -2271,19 +2052,6 @@ void InsertIntDistinct(LIST *o, UINT i)
InsertInt(o, i);
}
}
void InsertInt64Distinct(LIST *o, UINT64 i)
{
// Validate arguments
if (o == NULL)
{
return;
}
if (IsInt64InList(o, i) == false)
{
InsertInt64(o, i);
}
}
// String comparison function (Unicode)
int CompareUniStr(void *p1, void *p2)
@ -2406,32 +2174,6 @@ LIST *NewListEx2(COMPARE *cmp, bool fast, bool fast_malloc)
return o;
}
// Peek from the FIFO
UINT PeekFifo(FIFO *f, void *p, UINT size)
{
UINT read_size;
if (f == NULL || size == 0)
{
return 0;
}
// KS
KS_INC(KS_PEEK_FIFO_COUNT);
read_size = MIN(size, f->size);
if (read_size == 0)
{
return 0;
}
if (p != NULL)
{
Copy(p, (UCHAR *)f->p + f->pos, read_size);
}
return read_size;
}
// Read all data from FIFO
BUF *ReadFifoAll(FIFO *f)
{
@ -2528,25 +2270,6 @@ void ShrinkFifoMemory(FIFO *f)
}
}
// Write data to the front of FIFO
void WriteFifoFront(FIFO *f, void *p, UINT size)
{
// Validate arguments
if (f == NULL || size == 0)
{
return;
}
if (f->pos < size)
{
PadFifoFront(f, size - f->pos);
}
Copy(((UCHAR *)f->p) + (f->pos - size), p, size);
f->pos -= size;
f->size += size;
}
// Write to the FIFO
void WriteFifo(FIFO *f, void *p, UINT size)
{
@ -2587,34 +2310,6 @@ void WriteFifo(FIFO *f, void *p, UINT size)
KS_INC(KS_WRITE_FIFO_COUNT);
}
// Add a padding before the head of fifo
void PadFifoFront(FIFO *f, UINT size)
{
// Validate arguments
if (f == NULL || size == 0)
{
return;
}
f->memsize += size;
f->p = ReAlloc(f->p, f->memsize);
}
// Clear the FIFO
void ClearFifo(FIFO *f)
{
// Validate arguments
if (f == NULL)
{
return;
}
f->size = f->pos = 0;
f->memsize = FIFO_INIT_MEM_SIZE;
f->p = ReAlloc(f->p, f->memsize);
}
// Get the current pointer of the FIFO
UCHAR *GetFifoPointer(FIFO *f)
{
@ -2643,30 +2338,6 @@ UINT FifoSize(FIFO *f)
return f->size;
}
// Lock the FIFO
void LockFifo(FIFO *f)
{
// Validate arguments
if (f == NULL)
{
return;
}
Lock(f->lock);
}
// Unlock the FIFO
void UnlockFifo(FIFO *f)
{
// Validate arguments
if (f == NULL)
{
return;
}
Unlock(f->lock);
}
// Release the FIFO
void ReleaseFifo(FIFO *f)
{
@ -2755,12 +2426,6 @@ FIFO *NewFifoEx2(bool fast, bool fixed)
return f;
}
// Get the default memory reclaiming size of the FIFO
UINT GetFifoCurrentReallocMemSize()
{
return fifo_current_realloc_mem_size;
}
// Set the default memory reclaiming size of the FIFO
void SetFifoCurrentReallocMemSize(UINT size)
{
@ -2931,25 +2596,6 @@ bool DumpDataW(void *data, UINT size, wchar_t *filename)
return true;
}
bool DumpData(void *data, UINT size, char *filename)
{
IO *o;
// Validate arguments
if (filename == NULL || (size != 0 && data == NULL))
{
return false;
}
o = FileCreate(filename);
if (o == NULL)
{
return false;
}
FileWrite(o, data, size);
FileClose(o);
return true;
}
// Dump the contents of the buffer to the file
bool DumpBuf(BUF *b, char *filename)
@ -3714,28 +3360,6 @@ UINT64 Endian64(UINT64 src)
}
}
// Swap data of any
void Swap(void *buf, UINT size)
{
UCHAR *tmp, *src;
UINT i;
// Validate arguments
if (buf == NULL || size == 0)
{
return;
}
src = (UCHAR *)buf;
tmp = Malloc(size);
for (i = 0;i < size;i++)
{
tmp[size - i - 1] = src[i];
}
Copy(buf, tmp, size);
Free(buf);
}
// 16bit swap
USHORT Swap16(USHORT value)
{
@ -4263,25 +3887,6 @@ void *AddHead(void *src, UINT src_size, void *head, UINT head_size)
return ret;
}
// Clone the memory area (only the tail)
void *CloneTail(void *src, UINT src_size, UINT dst_size)
{
// Validate arguments
if (src_size != 0 && src == NULL)
{
return NULL;
}
if (src_size >= dst_size)
{
return Clone(((UCHAR *)src) + (src_size - dst_size), dst_size);
}
else
{
return Clone(src, src_size);
}
}
// Clone the memory area
void *Clone(void *addr, UINT size)
{

View File

@ -290,7 +290,6 @@ int CmpCaseIgnore(void *p1, void *p2, UINT size);
void ZeroMem(void *addr, UINT size);
void Zero(void *addr, UINT size);
void *Clone(void *addr, UINT size);
void *CloneTail(void *src, UINT src_size, UINT dst_size);
void *AddHead(void *src, UINT src_size, void *head, UINT head_size);
char B64_CodeToChar(BYTE c);
@ -300,7 +299,6 @@ int B64_Decode(char *set, char *source, int len);
UINT Encode64(char *dst, char *src);
UINT Decode64(char *dst, char *src);
void Swap(void *buf, UINT size);
USHORT Swap16(USHORT value);
UINT Swap32(UINT value);
UINT64 Swap64(UINT64 value);
@ -338,7 +336,6 @@ void AddBufStr(BUF *b, char *str);
bool DumpBuf(BUF *b, char *filename);
bool DumpBufW(BUF *b, wchar_t *filename);
bool DumpBufWIfNecessary(BUF *b, wchar_t *filename);
bool DumpData(void *data, UINT size, char *filename);
bool DumpDataW(void *data, UINT size, wchar_t *filename);
BUF *ReadDump(char *filename);
BUF *ReadDumpWithMaxSize(char *filename, UINT max_size);
@ -351,19 +348,13 @@ BUF *ReadRemainBuf(BUF *b);
UINT ReadBufRemainSize(BUF *b);
bool CompareBuf(BUF *b1, BUF *b2);
UINT PeekFifo(FIFO *f, void *p, UINT size);
UINT ReadFifo(FIFO *f, void *p, UINT size);
BUF *ReadFifoAll(FIFO *f);
void ShrinkFifoMemory(FIFO *f);
UCHAR *GetFifoPointer(FIFO *f);
UCHAR *FifoPtr(FIFO *f);
void WriteFifo(FIFO *f, void *p, UINT size);
void WriteFifoFront(FIFO *f, void *p, UINT size);
void PadFifoFront(FIFO *f, UINT size);
void ClearFifo(FIFO *f);
UINT FifoSize(FIFO *f);
void LockFifo(FIFO *f);
void UnlockFifo(FIFO *f);
void ReleaseFifo(FIFO *f);
void CleanupFifo(FIFO *f);
FIFO *NewFifo();
@ -371,16 +362,13 @@ FIFO *NewFifoFast();
FIFO *NewFifoEx(bool fast);
FIFO *NewFifoEx2(bool fast, bool fixed);
void InitFifo();
UINT GetFifoCurrentReallocMemSize();
void SetFifoCurrentReallocMemSize(UINT size);
void *Search(LIST *o, void *target);
void Sort(LIST *o);
void SortEx(LIST *o, COMPARE *cmp);
void Add(LIST *o, void *p);
void AddDistinct(LIST *o, void *p);
void Insert(LIST *o, void *p);
void InsertDistinct(LIST *o, void *p);
bool Delete(LIST *o, void *p);
bool DeleteKey(LIST *o, UINT key);
void DeleteAll(LIST *o);
@ -397,8 +385,6 @@ void CopyToArray(LIST *o, void *p);
void *ToArray(LIST *o);
void *ToArrayEx(LIST *o, bool fast);
LIST *CloneList(LIST *o);
void SetCmp(LIST *o, COMPARE *cmp);
void SetSortFlag(LIST *o, bool sorted);
int CompareStr(void *p1, void *p2);
bool InsertStr(LIST *o, char *str);
int CompareUniStr(void *p1, void *p2);
@ -406,17 +392,14 @@ bool IsInList(LIST *o, void *p);
bool IsInListKey(LIST *o, UINT key);
void *ListKeyToPointer(LIST *o, UINT key);
bool IsInListStr(LIST *o, char *str);
bool IsInListUniStr(LIST *o, wchar_t *str);
bool ReplaceListPointer(LIST *o, void *oldptr, void *newptr);
void AddInt(LIST *o, UINT i);
void AddInt64(LIST *o, UINT64 i);
void AddIntDistinct(LIST *o, UINT i);
void AddInt64Distinct(LIST *o, UINT64 i);
void DelInt(LIST *o, UINT i);
void DelInt64(LIST *o, UINT64 i);
void ReleaseIntList(LIST *o);
void ReleaseInt64List(LIST *o);
void DelAllInt(LIST *o);
bool IsIntInList(LIST *o, UINT i);
bool IsInt64InList(LIST *o, UINT64 i);
LIST *NewIntList(bool sorted);
@ -424,14 +407,10 @@ LIST *NewInt64List(bool sorted);
int CompareInt(void *p1, void *p2);
int CompareInt64(void *p1, void *p2);
void InsertInt(LIST *o, UINT i);
void InsertInt64(LIST *o, UINT64 i);
void InsertIntDistinct(LIST *o, UINT i);
void InsertInt64Distinct(LIST *o, UINT64 i);
void RandomizeList(LIST *o);
void *GetNext(QUEUE *q);
void *GetNextWithLock(QUEUE *q);
void *PeekQueue(QUEUE *q);
void InsertQueue(QUEUE *q, void *p);
void InsertQueueWithLock(QUEUE *q, void *p);
void InsertQueueInt(QUEUE *q, UINT value);
@ -460,7 +439,6 @@ BUF *CompressBuf(BUF *src_buf);
BUF *UncompressBuf(BUF *src_buf);
bool IsZero(void *data, UINT size);
void FillBytes(void *data, UINT size, UCHAR c);
LIST *NewStrMap();
void *StrMapSearch(LIST *map, char *key);

View File

@ -6872,23 +6872,6 @@ bool IsNetworkPrefixAddress6(IP *ip, IP *subnet)
return false;
}
// Check whether the unicast address is available
bool CheckUnicastAddress(IP *ip)
{
// Validate arguments
if (ip == NULL)
{
return false;
}
if ((GetIPAddrType6(ip) & IPV6_ADDR_UNICAST) == 0)
{
return false;
}
return true;
}
// Get the host address
void GetHostAddress6(IP *dst, IP *ip, IP *subnet)
{
@ -7827,17 +7810,6 @@ void CopyIP(IP *dst, IP *src)
Copy(dst, src, sizeof(IP));
}
// Check the length of the IPv6 subnet
bool CheckSubnetLength6(UINT i)
{
if (i >= 1 && i <= 127)
{
return true;
}
return false;
}
// Get the process ID of the corresponding TCP connection by the socket
UINT GetTcpProcessIdFromSocket(SOCK *s)
{
@ -8216,24 +8188,6 @@ void PrintTcpTableList(LIST *o)
Print("------\n\n");
}
// Comparison of TCP table items
int CompareTcpTable(void *p1, void *p2)
{
TCPTABLE *t1, *t2;
if (p1 == NULL || p2 == NULL)
{
return 0;
}
t1 = *(TCPTABLE **)p1;
t2 = *(TCPTABLE **)p2;
if (t1 == NULL || t2 == NULL)
{
return 0;
}
return Cmp(t1, t2, sizeof(TCPTABLE));
}
// Get the TCP table list
LIST *GetTcpTableList()
{
@ -14659,39 +14613,6 @@ typedef struct TCP_PORT_CHECK
bool ok;
} TCP_PORT_CHECK;
// The thread to check the TCP port
void CheckTCPPortThread(THREAD *thread, void *param)
{
TCP_PORT_CHECK *c;
SOCK *s;
// Validate arguments
if (thread == NULL || param == NULL)
{
return;
}
c = (TCP_PORT_CHECK *)param;
AddRef(c->ref);
NoticeThreadInit(thread);
AddWaitThread(thread);
s = Connect(c->hostname, c->port);
if (s != NULL)
{
c->ok = true;
Disconnect(s);
ReleaseSock(s);
}
if (Release(c->ref) == 0)
{
Free(c);
}
DelWaitThread(thread);
}
// Check whether the TCP port can be connected
bool CheckTCPPortEx(char *hostname, UINT port, UINT timeout)
{

View File

@ -1354,7 +1354,6 @@ void SetTimeout(SOCK *sock, UINT timeout);
UINT GetTimeout(SOCK *sock);
bool CheckTCPPort(char *hostname, UINT port);
bool CheckTCPPortEx(char *hostname, UINT port, UINT timeout);
void CheckTCPPortThread(THREAD *thread, void *param);
ROUTE_TABLE *GetRouteTable();
void FreeRouteTable(ROUTE_TABLE *t);
bool AddRouteEntryEx(ROUTE_ENTRY *e, bool *already_exists);
@ -1426,7 +1425,6 @@ UINT GetNumIpClient(IP *ip);
void SetLinuxArpFilter();
LIST *GetTcpTableList();
void FreeTcpTableList(LIST *o);
int CompareTcpTable(void *p1, void *p2);
void PrintTcpTableList(LIST *o);
TCPTABLE *GetTcpTableFromEndPoint(LIST *o, IP *local_ip, UINT local_port, IP *remote_ip, UINT remote_port);
UINT GetTcpProcessIdFromSocket(SOCK *s);
@ -1455,7 +1453,6 @@ SOCKET_TIMEOUT_PARAM *NewSocketTimeout(SOCK *sock);
void FreeSocketTimeout(SOCKET_TIMEOUT_PARAM *ttp);
void CopyIP(IP *dst, IP *src);
bool CheckSubnetLength6(UINT i);
bool IsIP6(IP *ip);
bool IsIP4(IP *ip);
bool IsSameIPVer(IP *ip1, IP *ip2);
@ -1489,7 +1486,6 @@ UINT GetIPAddrType6(IP *ip);
UINT GetIPv6AddrType(IPV6_ADDR *addr);
void GenerateMulticastMacAddress6(UCHAR *mac, IP *ip);
void GetSoliciationMulticastAddr6(IP *dst, IP *src);
bool CheckUnicastAddress(IP *ip);
bool IsNetworkPrefixAddress6(IP *ip, IP *subnet);
bool IsNetworkAddress6(IP *ip, IP *subnet);
void GetHostAddress6(IP *dst, IP *ip, IP *subnet);

View File

@ -838,32 +838,6 @@ bool DeleteSecCert(SECURE *sec, char *name)
return DeleteSecObjectByName(sec, name, SEC_X);
}
// Convert the the CK_DATE to the 64 bit time
UINT64 CkDateToUINT64(struct CK_DATE *ck_date)
{
SYSTEMTIME st;
char year[32], month[32], day[32];
// Validate arguments
if (ck_date == NULL)
{
return 0;
}
Zero(year, sizeof(year));
Zero(month, sizeof(month));
Zero(day, sizeof(day));
Copy(year, ck_date->year, 4);
Copy(month, ck_date->month, 2);
Copy(day, ck_date->day, 2);
st.wYear = ToInt(year);
st.wMonth = ToInt(month);
st.wDay = ToInt(day);
return SystemToUINT64(&st);
}
// Convert the 64 bit time to the CK_DATE
void UINT64ToCkDate(void *p_ck_date, UINT64 time64)
{

View File

@ -2021,23 +2021,6 @@ char *CopyBinToStrEx(void *data, UINT data_size)
return ret;
}
char *CopyBinToStr(void *data, UINT data_size)
{
char *ret;
UINT size;
// Validate arguments
if (data == NULL)
{
return NULL;
}
size = data_size * 2 + 1;
ret = ZeroMalloc(size);
BinToStr(ret, size, data, data_size);
return ret;
}
// Convert the binary data to a hexadecimal string
void BinToStr(char *str, UINT str_size, void *data, UINT data_size)

View File

@ -207,7 +207,6 @@ bool IsEmptyStr(char *str);
void BinToStrEx(char *str, UINT str_size, void *data, UINT data_size);
void BinToStrEx2(char *str, UINT str_size, void *data, UINT data_size, char padding_char);
char *CopyBinToStrEx(void *data, UINT data_size);
char *CopyBinToStr(void *data, UINT data_size);
BUF *StrToBin(char *str);
void MacToStr(char *str, UINT size, UCHAR *mac_address);
void ToStr3(char *str, UINT size, UINT64 v);

View File

@ -589,33 +589,6 @@ void TrackChangeObjSize(UINT64 addr, UINT size, UINT64 new_addr)
UnlockTrackingList();
}
// Memory address comparison function
int CompareTrackingObject(const void *p1, const void *p2)
{
TRACKING_OBJECT *o1, *o2;
// Validate arguments
if (p1 == NULL || p2 == NULL)
{
return 0;
}
o1 = *(TRACKING_OBJECT **)p1;
o2 = *(TRACKING_OBJECT **)p2;
if (o1 == NULL || o2 == NULL)
{
return 0;
}
if (o1->Address > o2->Address)
{
return 1;
}
if (o1->Address == o2->Address)
{
return 0;
}
return -1;
}
// Search an object in the tracking list
TRACKING_OBJECT *SearchTrackingList(UINT64 Address)
{

View File

@ -166,7 +166,6 @@ void GetCallStackStr(char *str, UINT size, CALLSTACK_DATA *s);
void PrintCallStack(CALLSTACK_DATA *s);
void InitTracking();
void FreeTracking();
int CompareTrackingObject(const void *p1, const void *p2);
void LockTrackingList();
void UnlockTrackingList();
void InsertTrackingList(TRACKING_OBJECT *o);