[reflection] Use coop handles for MonoMethod icalls (#4272)
[mono.git] / mono / io-layer / locking.c
index 305c0ab48527cb7fd053c050a04041e7c1d7b10c..86eb864365f043d173bf1e344414a56610491cdd 100644 (file)
@@ -6,6 +6,7 @@
  *
  * (C) 2002 Ximian, Inc.
  * Copyright (c) 2002-2009 Novell, Inc.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 #include <config.h>
 #include <stdio.h>
 #include <errno.h>
 #include <mono/io-layer/wapi.h>
 #include <mono/io-layer/wapi-private.h>
-#include <mono/io-layer/handles-private.h>
 #include <mono/io-layer/io-private.h>
 #include <mono/io-layer/io-trace.h>
 #include <mono/utils/mono-logger-internals.h>
+#include <mono/metadata/w32handle.h>
 
 gboolean
 _wapi_lock_file_region (int fd, off_t offset, off_t length)
@@ -124,7 +125,7 @@ LockFile (gpointer handle, guint32 offset_low, guint32 offset_high,
        off_t offset, length;
        int fd = GPOINTER_TO_UINT(handle);
        
-       ok = _wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
+       ok = mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
                                  (gpointer *)&file_handle);
        if (ok == FALSE) {
                g_warning ("%s: error looking up file handle %p", __func__,
@@ -171,7 +172,7 @@ UnlockFile (gpointer handle, guint32 offset_low,
        off_t offset, length;
        int fd = GPOINTER_TO_UINT(handle);
        
-       ok = _wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
+       ok = mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
                                  (gpointer *)&file_handle);
        if (ok == FALSE) {
                g_warning ("%s: error looking up file handle %p", __func__,