summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-08-04 09:07:36 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-08-04 09:07:36 +0000
commitfe4b2dd2f262de62e03b19eaa3aa740095c1d6f8 (patch)
treec3a3e21093982b1aa0c9cce9e78f536fecdfa6d7 /sal
parent0fbc22fa5ef13ab5ad58cb77ad773e1b4bc060f2 (diff)
INTEGRATION: CWS onlineupdate3 (1.1.2); FILE ADDED
2006/07/27 10:44:47 hro 1.1.2.1: #i66949# Added internet connection check for win32
Diffstat (limited to 'sal')
-rw-r--r--sal/systools/win32/onlineupdate/onlinecheck.cxx62
1 files changed, 62 insertions, 0 deletions
diff --git a/sal/systools/win32/onlineupdate/onlinecheck.cxx b/sal/systools/win32/onlineupdate/onlinecheck.cxx
new file mode 100644
index 000000000000..6fc98941d3ff
--- /dev/null
+++ b/sal/systools/win32/onlineupdate/onlinecheck.cxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: onlinecheck.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: ihi $ $Date: 2006-08-04 10:07:36 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#pragma warning( disable: 4668 )
+
+#include <sal/types.h>
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <wininet.h>
+
+#ifdef UNICODE
+#define _UNICODE
+#endif
+#include <tchar.h>
+
+#define elementsof(a) (sizeof(a)/sizeof((a)[0]))
+
+sal_Bool SAL_CALL hasInternetConnection()
+{
+ DWORD dwFlags;
+ TCHAR szConnectionName[1024];
+
+ BOOL fIsConnected = InternetGetConnectedStateEx(
+ &dwFlags,
+ szConnectionName,
+ elementsof(szConnectionName),
+ 0 );
+
+ return fIsConnected ? sal_True : sal_False;
+}