1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-25 10:59:53 +03:00

remove unused functions (identified by cppcheck)

[src/Cedar/WinUi.c:6589]: (style) The function 'LbSelect' is never used.
[src/Cedar/WinUi.c:7412]: (style) The function 'PkcsUtilErase' is never used.
[src/Cedar/WinUi.c:7340]: (style) The function 'PkcsUtilWrite' is never used.
[src/Cedar/WinUi.c:2054]: (style) The function 'ShowFreeInfoDialog' is never used.
This commit is contained in:
Ilya Shipitsin 2018-02-08 15:17:59 +05:00
parent 046fa9fb0e
commit 343c8261e8
2 changed files with 0 additions and 143 deletions

View File

@ -2050,19 +2050,6 @@ UINT FreeInfoDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void
return 0;
}
// Display the dialog about the Free Edition
void ShowFreeInfoDialog(HWND hWnd, FREEINFO *info)
{
// Validate arguments
if (info == NULL)
{
return;
}
Dialog(hWnd, D_FREEINFO, FreeInfoDialogProc, info);
Set(info->Event);
}
// Show the Easter Egg
void ShowEasterEgg(HWND hWnd)
{
@ -6585,34 +6572,6 @@ UINT LbFindData(HWND hWnd, UINT id, UINT data)
return INFINITE;
}
// Search by specifying the data
void LbSelect(HWND hWnd, UINT id, int data)
{
UINT index;
// Validate arguments
if (hWnd == NULL)
{
return;
}
if (data == INFINITE)
{
// Get the first item
LbSelectIndex(hWnd, id, 0);
return;
}
index = LbFindData(hWnd, id, data);
if (index == INFINITE)
{
// Can not be found
return;
}
// Select
LbSelectIndex(hWnd, id, index);
}
// Password input dialog state change
void PasswordDlgProcChange(HWND hWnd, UI_PASSWORD_DLG *p)
{
@ -7336,104 +7295,6 @@ UINT PassphraseDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *
return 0;
}
// PKCS writing
void PkcsUtilWrite(HWND hWnd)
{
wchar_t *filename;
BUF *in_buf;
char filename_ansi[MAX_SIZE];
char pass[MAX_SIZE];
// Validate arguments
if (hWnd == NULL)
{
return;
}
filename = OpenDlg(hWnd, _UU("DLG_PKCS12_FILTER"), _UU("PKCS_UTIL_SAVEDLG_TITLE"));
if (filename == NULL)
{
return;
}
UniToStr(filename_ansi, sizeof(filename_ansi), filename);
in_buf = ReadDump(filename_ansi);
if (in_buf == NULL)
{
MsgBoxEx(hWnd, MB_ICONEXCLAMATION, _UU("PKCS_UTIL_READ_ERROR"), filename);
}
else
{
if (PassphraseDlg(hWnd, pass, sizeof(pass), in_buf, true))
{
P12 *p12 = BufToP12(in_buf);
if (p12 == NULL)
{
MsgBox(hWnd, MB_ICONEXCLAMATION, _UU("PKCS_UTIL_BAD_FILE"));
}
else
{
X *x = NULL;
K *k = NULL;
BUF *b;
ParseP12(p12, &x, &k, pass);
FreeP12(p12);
p12 = NewP12(x, k, NULL);
FreeX(x);
FreeK(k);
b = P12ToBuf(p12);
FreeP12(p12);
if (b != NULL)
{
// Batch processing
WINUI_SECURE_BATCH batch[] =
{
{WINUI_SECURE_WRITE_DATA, _SS("PKCS_UTIL_SECA_FILENAME"), false,
b, NULL, NULL, NULL, NULL, NULL},
};
if (SecureDeviceWindow(hWnd, batch, sizeof(batch) / sizeof(batch[0]), 2, 0))
{
MsgBoxEx(hWnd, MB_ICONINFORMATION, _UU("PKCS_UTIL_WRITE_OK_MSG"), filename);
}
}
FreeBuf(b);
}
}
FreeBuf(in_buf);
}
Free(filename);
}
// PKCS erase
void PkcsUtilErase(HWND hWnd)
{
// Validate arguments
if (hWnd == NULL)
{
return;
}
if (MsgBox(hWnd, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2,
_UU("PKCS_MAKE_SURE")) == IDYES)
{
// Batch processing
WINUI_SECURE_BATCH batch[] =
{
{WINUI_SECURE_DELETE_OBJECT, _SS("PKCS_UTIL_SECA_FILENAME"), false,
NULL, NULL, NULL, NULL, NULL, NULL},
};
if (SecureDeviceWindow(hWnd, batch, sizeof(batch) / sizeof(batch[0]), 2, 0))
{
MsgBox(hWnd, MB_ICONINFORMATION, _UU("PKCS_UTIL_DELETE_OK_MSG"));
}
}
}
// [Save File] dialog
wchar_t *SaveDlg(HWND hWnd, wchar_t *filter, wchar_t *title, wchar_t *default_name, wchar_t *default_ext)
{

View File

@ -674,8 +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 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);
@ -703,7 +701,6 @@ void LbSelectIndex(HWND hWnd, UINT id, UINT index);
UINT LbNum(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);
STATUS_WINDOW *StatusPrinterWindowStart(SOCK *s, wchar_t *account_name);
void StatusPrinterWindowStop(STATUS_WINDOW *sw);
@ -829,7 +826,6 @@ KAKUSHI *InitKakushi();
void FreeKakushi(KAKUSHI *k);
void ShowEasterEgg(HWND hWnd);
void RegistToDontShowFreeEditionDialog(char *server_name);
void ShowFreeInfoDialog(HWND hWnd, FREEINFO *info);
UINT FreeInfoDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
bool Win32CnCheckAlreadyExists(bool lock);
void RegistWindowsFirewallAll();