2003-02-19 21:09:05 +00:00
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#include <windows.h>
|
|
|
|
#include <WinInet.h>
|
|
|
|
|
2003-02-19 21:24:14 +00:00
|
|
|
#include "../exdll/exdll.h"
|
2003-02-19 21:09:05 +00:00
|
|
|
|
|
|
|
#define NSISFunction(funcname) void __declspec(dllexport) funcname(HWND hwndParent, int string_size, char *variables, stack_t **stacktop)
|
2003-02-20 17:33:46 +00:00
|
|
|
|
|
|
|
HMODULE hWinInet;
|
2003-02-19 21:09:05 +00:00
|
|
|
|
2003-11-12 20:24:53 +00:00
|
|
|
BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) {
|
2003-02-19 21:24:14 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************\
|
|
|
|
* FUNCTIONS *
|
|
|
|
\*************/
|
2003-02-19 21:09:05 +00:00
|
|
|
|
|
|
|
NSISFunction(AutodialOnline) {
|
2003-02-20 17:33:46 +00:00
|
|
|
EXDLL_INIT();
|
2003-02-19 21:09:05 +00:00
|
|
|
if (InternetAutodial(INTERNET_AUTODIAL_FORCE_ONLINE, 0))
|
|
|
|
pushstring("online");
|
|
|
|
else
|
|
|
|
pushstring("offline");
|
|
|
|
}
|
|
|
|
|
|
|
|
NSISFunction(AutodialUnattended) {
|
2003-02-20 17:33:46 +00:00
|
|
|
EXDLL_INIT();
|
2003-02-19 21:09:05 +00:00
|
|
|
if (InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED , 0))
|
|
|
|
pushstring("online");
|
|
|
|
else
|
|
|
|
pushstring("offline");
|
|
|
|
}
|
|
|
|
|
|
|
|
NSISFunction(AttemptConnect) {
|
2003-02-20 17:33:46 +00:00
|
|
|
EXDLL_INIT();
|
2003-02-19 21:09:05 +00:00
|
|
|
if (InternetAttemptConnect(0) == ERROR_SUCCESS)
|
|
|
|
pushstring("online");
|
|
|
|
else
|
|
|
|
pushstring("offline");
|
|
|
|
}
|
|
|
|
|
|
|
|
NSISFunction(GetConnectedState) {
|
|
|
|
DWORD dwState;
|
2003-02-20 17:33:46 +00:00
|
|
|
EXDLL_INIT();
|
2003-02-19 21:09:05 +00:00
|
|
|
|
|
|
|
if (InternetGetConnectedState(&dwState, 0))
|
|
|
|
pushstring("online");
|
|
|
|
else
|
|
|
|
pushstring("offline");
|
|
|
|
}
|
|
|
|
|
|
|
|
NSISFunction(AutodialHangup) {
|
2003-02-20 17:33:46 +00:00
|
|
|
EXDLL_INIT();
|
2003-02-19 21:09:05 +00:00
|
|
|
if (InternetAutodialHangup(0))
|
|
|
|
pushstring("success");
|
|
|
|
else
|
|
|
|
pushstring("failure");
|
|
|
|
|
|
|
|
}
|