From 8b146afe467766aad1caf1c31a757132561dc007 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Fri, 27 Nov 2015 16:23:28 -0500 Subject: [PATCH] Disable use of Win32 specific p/invokes when built for the mobile profile --- .../System.Data/System/Data/Common/AdapterUtil.cs | 4 ++++ .../System/Data/SqlClient/TdsParserStaticMethods.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs b/mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs index 1116bfda764..8fdd50b67a8 100644 --- a/mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs +++ b/mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs @@ -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; } diff --git a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs index 853e76fc23f..26807bf6c1e 100644 --- a/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs +++ b/mcs/class/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs @@ -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 } -- 2.25.1