Disable use of Win32 specific p/invokes when built for the mobile profile
authorSebastien Pouliot <sebastien@xamarin.com>
Fri, 27 Nov 2015 21:23:28 +0000 (16:23 -0500)
committerMarek Safar <marek.safar@gmail.com>
Tue, 3 May 2016 09:40:06 +0000 (11:40 +0200)
mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs

index 1116bfda7643e5c469c326133001c17b0f565ecd..8fdd50b67a811c195cf7fb4b6535e2a64bd8af8f 100644 (file)
@@ -2087,6 +2087,9 @@ namespace System.Data.Common {
             const int ERROR_MORE_DATA = 234; // winerror.h
 
             string value;
+#if MOBILE
+            value = ADP.MachineName();
+#else
             if (IsPlatformNT5) {
                 int length = 0; // length parameter must be zero if buffer is null
                 // query for the required length
@@ -2112,6 +2115,7 @@ namespace System.Data.Common {
             else {
                 value = ADP.MachineName();
             }
+#endif
             return value;
         }
 
index 853e76fc23f376e5c6969d10cf5fc6f55b34d23f..26807bf6c1e63a9c238edb60b20832f2d3db542f 100644 (file)
@@ -113,7 +113,11 @@ namespace System.Data.SqlClient {
         [ResourceExposure(ResourceScope.None)] // SxS: we use this method for TDS login only
         [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]
         static internal int GetCurrentProcessIdForTdsLoginOnly() {
+#if MOBILE
+            return 0;
+#else
             return SafeNativeMethods.GetCurrentProcessId();
+#endif
         }