[runtime] Remove pre WinXP SP2 windows support code.
authorZoltan Varga <vargaz@gmail.com>
Thu, 9 Oct 2014 18:04:20 +0000 (14:04 -0400)
committerZoltan Varga <vargaz@gmail.com>
Thu, 9 Oct 2014 18:04:31 +0000 (14:04 -0400)
configure.ac
mono/metadata/process.c
winconfig.h

index c6c36c9eefbe2cce3aa4a24e2302536e8e66ccad..38b678c9d80255f947a3af7d89219bdf3da426dc 100644 (file)
@@ -115,7 +115,7 @@ case "$host" in
                        AC_DEFINE(MINGW_CROSS_COMPILE,1,[Cross-compiling using MinGW])
                fi
                HOST_CC="gcc"
-               # Windows 2000 is required that includes Internet Explorer 5.01
+               # Windows XP SP2 is required
                CPPFLAGS="$CPPFLAGS -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
                LDFLAGS="$LDFLAGS -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32"
                libmono_cflags="-mms-bitfields -mwindows"
index f0f53ebe8f94cca8df9963df8bb6579213420b42..d7cc110aec6bbca2ac91b363582f40410cf1fba0 100644 (file)
 #include <mono/utils/strenc.h>
 #include <mono/utils/mono-proclib.h>
 #include <mono/io-layer/io-layer.h>
-#ifndef HAVE_GETPROCESSID
-#if defined(_MSC_VER) || defined(HAVE_WINTERNL_H)
-#include <winternl.h>
-#ifndef NT_SUCCESS
-#define NT_SUCCESS(status) ((NTSTATUS) (status) >= 0)
-#endif /* !NT_SUCCESS */
-#else /* ! (defined(_MSC_VER) || defined(HAVE_WINTERNL_H)) */
-#include <ddk/ntddk.h>
-#include <ddk/ntapi.h>
-#endif /* (defined(_MSC_VER) || defined(HAVE_WINTERNL_H)) */
-#endif /* !HAVE_GETPROCESSID */
-/* FIXME: fix this code to not depend so much on the inetrnals */
+/* FIXME: fix this code to not depend so much on the internals */
 #include <mono/metadata/class-internals.h>
 
 #define LOGDEBUG(...)  
@@ -526,76 +515,6 @@ complete_path (const gunichar2 *appname, gchar **completed)
        return TRUE;
 }
 
-#ifndef HAVE_GETPROCESSID
-/* Run-time GetProcessId detection for Windows */
-#ifdef TARGET_WIN32
-#define HAVE_GETPROCESSID
-
-typedef DWORD (WINAPI *GETPROCESSID_PROC) (HANDLE);
-typedef DWORD (WINAPI *NTQUERYINFORMATIONPROCESS_PROC) (HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
-typedef DWORD (WINAPI *RTLNTSTATUSTODOSERROR_PROC) (NTSTATUS);
-
-static DWORD WINAPI GetProcessId_detect (HANDLE process);
-
-static GETPROCESSID_PROC GetProcessId = &GetProcessId_detect;
-static NTQUERYINFORMATIONPROCESS_PROC NtQueryInformationProcess_proc = NULL;
-static RTLNTSTATUSTODOSERROR_PROC RtlNtStatusToDosError_proc = NULL;
-
-static DWORD WINAPI GetProcessId_ntdll (HANDLE process)
-{
-       PROCESS_BASIC_INFORMATION pi;
-       NTSTATUS status;
-
-       status = NtQueryInformationProcess_proc (process, ProcessBasicInformation, &pi, sizeof (pi), NULL);
-       if (NT_SUCCESS (status)) {
-               return pi.UniqueProcessId;
-       } else {
-               SetLastError (RtlNtStatusToDosError_proc (status));
-               return 0;
-       }
-}
-
-static DWORD WINAPI GetProcessId_stub (HANDLE process)
-{
-       SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-static DWORD WINAPI GetProcessId_detect (HANDLE process)
-{
-       HMODULE module_handle;
-       GETPROCESSID_PROC GetProcessId_kernel;
-
-       /* Windows XP SP1 and above have GetProcessId API */
-       module_handle = GetModuleHandle (L"kernel32.dll");
-       if (module_handle != NULL) {
-               GetProcessId_kernel = (GETPROCESSID_PROC) GetProcAddress (module_handle, "GetProcessId");
-               if (GetProcessId_kernel != NULL) {
-                       GetProcessId = GetProcessId_kernel;
-                       return GetProcessId (process);
-               }
-       }
-
-       /* Windows 2000 and above have deprecated NtQueryInformationProcess API */
-       module_handle = GetModuleHandle (L"ntdll.dll");
-       if (module_handle != NULL) {
-               NtQueryInformationProcess_proc = (NTQUERYINFORMATIONPROCESS_PROC) GetProcAddress (module_handle, "NtQueryInformationProcess");
-               if (NtQueryInformationProcess_proc != NULL) {
-                       RtlNtStatusToDosError_proc = (RTLNTSTATUSTODOSERROR_PROC) GetProcAddress (module_handle, "RtlNtStatusToDosError");
-                       if (RtlNtStatusToDosError_proc != NULL) {
-                               GetProcessId = &GetProcessId_ntdll;
-                               return GetProcessId (process);
-                       }
-               }
-       }
-
-       /* Fall back to ERROR_CALL_NOT_IMPLEMENTED */
-       GetProcessId = &GetProcessId_stub;
-       return GetProcessId (process);
-}
-#endif /* HOST_WIN32 */
-#endif /* !HAVE_GETPROCESSID */
-
 MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoProcessStartInfo *proc_start_info, MonoProcInfo *process_info)
 {
        SHELLEXECUTEINFO shellex = {0};
index 0c690d3a35c4213b0746b82955c88b44bbb4f0e0..b6d74e1cb41832b4768000939b1050afb14e7b50 100644 (file)
 #endif
 
 #if _WIN32_WINNT < 0x0502
-/* Required for Vectored Exception Handling.
-   Interlocked* functions are also not available in XP SP1 and below
-*/
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0502
+#error "Mono requires WinXP SP2 or later"
 #endif /* _WIN32_WINNT < 0x0502 */
 
 /*
 /* #undef HAVE_GETPRIORITY */
 
 /* Define to 1 if you have the `GetProcessId' function. */
-#if (_WIN32_WINNT >= 0x0502)
 #define HAVE_GETPROCESSID 1
-#endif
 
 /* Define to 1 if you have the `getpwnam_r' function. */
 /* #undef HAVE_GETPWNAM_R */