Bump for 3.6-28
[LibreOffice.git] / extensions / source / update / check / onlinecheck.cxx
blob0a765399cce3a33b39024b4ee0a8d92e14d0b538
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifdef _MSC_VER
30 #pragma warning( disable: 4668 )
31 #endif
33 #include <sal/types.h>
34 #include <sal/macros.h>
36 #define WIN32_LEAN_AND_MEAN
37 #include <windows.h>
38 #include <wininet.h>
40 #ifdef UNICODE
41 #define _UNICODE
42 #endif
43 #include <tchar.h>
45 // #i71984
46 extern "C" bool SAL_CALL WNT_hasInternetConnection()
48 DWORD dwFlags;
49 TCHAR szConnectionName[1024];
51 #ifndef __MINGW32__
52 __try {
53 #endif
54 BOOL fIsConnected = InternetGetConnectedStateEx(
55 &dwFlags,
56 szConnectionName,
57 SAL_N_ELEMENTS(szConnectionName),
58 0 );
60 return fIsConnected ? true : false;
62 #ifndef __MINGW32__
63 } __except( EXCEPTION_EXECUTE_HANDLER ) {
64 return false;
66 #endif
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */