]> granicus.if.org Git - curl/commitdiff
win: Basic support for Universal Windows Platform apps
authorMarco Deckel <marco.deckel@gmail.com>
Sun, 21 Aug 2016 11:44:33 +0000 (13:44 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 21 Aug 2016 11:56:22 +0000 (13:56 +0200)
Closes #820

lib/connect.c
lib/curl_setup.h
lib/getenv.c
lib/md5.c

index 0047f9a0ba19289f3ee81c97226ced0ca6a68343..7f8c0870a1b52c4f1fdf221c7065822a1408788b 100644 (file)
@@ -130,6 +130,9 @@ tcpkeepalive(struct Curl_easy *data,
       infof(data, "Failed to set SIO_KEEPALIVE_VALS on fd %d: %d\n",
             (int)sockfd, WSAGetLastError());
     }
+#elif defined(CURL_WINDOWS_APP)
+    (void)majorVersion;
+    detectOsState = DETECT_OS_VISTA_OR_LATER;
 #else
 #ifdef TCP_KEEPIDLE
     optval = curlx_sltosi(data->set.tcp_keepidle);
index e585ea6a5d05300891ae3567bde03f223d5f89c7..9f29b2e9ad4a5f2016f0a2254c72b8d086bc72eb 100644 (file)
@@ -747,4 +747,14 @@ endings either CRLF or LF so 't' is appropriate.
 #  endif
 #endif /* DONT_USE_RECV_BEFORE_SEND_WORKAROUNDS */
 
+/* Detect Windows App environment which has a restricted access
+ * to the Win32 APIs. */
+# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)
+#  include <winapifamily.h>
+#  if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
+     !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#    define CURL_WINDOWS_APP
+#  endif
+# endif
+
 #endif /* HEADER_CURL_SETUP_H */
index 50bb79f536b40eb42f5ab808153f2840984d75dd..89d181de3c2bf061cccf3f76978418ecc460ecaf 100644 (file)
@@ -30,7 +30,8 @@
 static
 char *GetEnv(const char *variable)
 {
-#ifdef _WIN32_WCE
+#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP)
+  (void)variable;
   return NULL;
 #else
 #ifdef WIN32
index 84adb99265fbcd1987699e9e166f7c8121608b8b..f818d3288137b3b98aff9d6c5b4a275581ec5022 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -124,7 +124,7 @@ static void MD5_Final(unsigned char digest[16], MD5_CTX *ctx)
   CC_MD5_Final(digest, ctx);
 }
 
-#elif defined(_WIN32)
+#elif defined(_WIN32) && !defined(CURL_WINDOWS_APP)
 
 #include <wincrypt.h>
 #include "curl_memory.h"