mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-09-25 20:59:20 +03:00
New vpndrvinst implementation, independent from Cedar and Mayaqua
This greatly improves performance and reduces the binary's size (~0.2 MB vs ~5 MB). All recent Windows versions are supported, starting with Vista. No dialogs are created, aside from error/warning ones in case of failure. The only dependency (aside from Windows libraries) is libhamcore.
This commit is contained in:
36
src/vpndrvinst/Dialog.c
Normal file
36
src/vpndrvinst/Dialog.c
Normal file
@ -0,0 +1,36 @@
|
||||
#include "Dialog.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
int ShowMessage(const char *title, const char *message, const unsigned int type, const va_list args)
|
||||
{
|
||||
char buf[MAX_MESSAGE_SIZE];
|
||||
vsnprintf(buf, sizeof(buf), message, args);
|
||||
return MessageBox(NULL, buf, title, type);
|
||||
}
|
||||
|
||||
int ShowInformation(const char *title, const char *message, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, message);
|
||||
const int ret = ShowMessage(title, message, MB_OK | MB_ICONINFORMATION, args);
|
||||
va_end(args);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ShowWarning(const char *title, const char *message, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, message);
|
||||
const int ret = ShowMessage(title, message, MB_OK | MB_ICONWARNING, args);
|
||||
va_end(args);
|
||||
|
||||
return ret;
|
||||
}
|
Reference in New Issue
Block a user