------------------------------------------------------------ revno: 13048 revision-id: squid3@treenet.co.nz-20131206121554-ivl5iwvm342lrnek parent: squid3@treenet.co.nz-20131206121511-z0v3emn36dax4ujz committer: Amos Jeffries branch nick: 3.4 timestamp: Fri 2013-12-06 05:15:54 -0700 message: Windows: fix compile errors in WinSvc.cc Fix defined by unused symbol errors in WinSvc.cc Also, set the service error mode to prevent Windows Error Reporting dialog boxes appearing. This is an iCelero Project ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20131206121554-ivl5iwvm342lrnek # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # testament_sha1: c8d9ea49233dd6169a03005411c5bca8192304c2 # timestamp: 2013-12-06 12:23:10 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # base_revision_id: squid3@treenet.co.nz-20131206121511-\ # z0v3emn36dax4ujz # # Begin patch === modified file 'src/WinSvc.cc' --- src/WinSvc.cc 2012-10-08 08:40:01 +0000 +++ src/WinSvc.cc 2013-12-06 12:15:54 +0000 @@ -32,7 +32,10 @@ */ #include "squid.h" +#include "Debug.h" +#include "globals.h" #include "protos.h" +#include "SquidConfig.h" #if _SQUID_WINDOWS_ #ifndef _MSWSOCK_ @@ -46,17 +49,17 @@ /* forward declarations */ static void WIN32_Exit(void); -static void WIN32_Abort(int); - static unsigned int GetOSVersion(); void WIN32_svcstatusupdate(DWORD, DWORD); void WINAPI WIN32_svcHandler(DWORD); +extern "C" void WINAPI SquidWinSvcMain(DWORD, char **); + #if USE_WIN32_SERVICE +static void WIN32_Abort(int); static int WIN32_StoreKey(const char *, DWORD, unsigned char *, int); static int WIN32_create_key(void); static void WIN32_build_argv (char *); #endif -extern "C" void WINAPI SquidWinSvcMain(DWORD, char **); #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ void Squid_Win32InvalidParameterHandler(const wchar_t*, const wchar_t*, const wchar_t*, unsigned int, uintptr_t); @@ -68,8 +71,6 @@ static int s_iInitCount = 0; static HANDLE NotifyAddrChange_thread = INVALID_HANDLE_VALUE; -static int Squid_Aborting = 0; - #undef NotifyAddrChange typedef DWORD(WINAPI * PFNotifyAddrChange) (OUT PHANDLE, IN LPOVERLAPPED); #define NOTIFYADDRCHANGE "NotifyAddrChange" @@ -108,6 +109,8 @@ NULL, /* key[3] */ NULL /* key[4] */ }; + +static int Squid_Aborting = 0; #endif /* ====================================================================== */ @@ -388,17 +391,16 @@ /* PUBLIC FUNCTIONS */ /* ====================================================================== */ +#if USE_WIN32_SERVICE void WIN32_Abort(int sig) { -#if USE_WIN32_SERVICE svcStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR; svcStatus.dwServiceSpecificExitCode = 1; -#endif - Squid_Aborting = 1; WIN32_Exit(); } +#endif void WIN32_IpAddrChangeMonitorExit() @@ -924,6 +926,7 @@ char *c; char stderr_path[256]; + SetErrorMode(SEM_NOGPFAULTERRORBOX); if ((argc == 2) && strstr(argv[1], _WIN_SQUID_SERVICE_OPTION)) { strcpy(stderr_path, argv[0]); strcat(stderr_path,".log");