Adding WinUWP compilation support to WebRTC.

Windows UWP allows an application to be built that targets
across all Windows 10 based systems and the Windows store.

Change-Id: I69694bb7e83fb01ad6db2438b065b55738cf01fd
Bug: webrtc:10046
Reviewed-on: https://webrtc-review.googlesource.com/c/110570
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25814}
diff --git a/rtc_base/win32.cc b/rtc_base/win32.cc
index e3482e3..480d97b 100644
--- a/rtc_base/win32.cc
+++ b/rtc_base/win32.cc
@@ -331,6 +331,11 @@
   }
   // Replace forward slashes with backslashes
   std::replace(wfilename, wfilename + wlen, L'/', L'\\');
+#if defined(WINUWP)
+  // WinUWP sandboxed store applications require the paths to remain as
+  // relative paths.
+  filename->assign(wfilename);
+#else
   // Convert to complete filename
   DWORD full_len = ::GetFullPathName(wfilename, 0, nullptr, nullptr);
   if (0 == full_len) {
@@ -360,9 +365,18 @@
     // Already in long-path form.
   }
   filename->assign(start);
+#endif  // defined(WINUWP)
+
   return true;
 }
 
+// Windows UWP applications cannot obtain versioning information from
+// the sandbox with intention (as behehaviour based on OS versioning rather
+// than feature discovery / compilation flags is discoraged and Windows
+// 10 is living continously updated version unlike previous versions
+// of Windows).
+#if !defined(WINUWP)
+
 bool GetOsVersion(int* major, int* minor, int* build) {
   OSVERSIONINFO info = {0};
   info.dwOSVersionInfoSize = sizeof(info);
@@ -399,4 +413,6 @@
   return ret;
 }
 
+#endif  // !defined(WINUWP)
+
 }  // namespace rtc