[w32handle] Replace mono_w32handle_{ref,unref} by mono_w32handle_{duplicate, close...
[mono.git] / mono / metadata / w32file.c
index 919965c1639ff43e809e0b4373ada759c7126413..296a84d6a47055af2eddaecfb48ce827f1b93eb0 100644 (file)
@@ -1073,8 +1073,7 @@ ves_icall_System_IO_MonoIO_DuplicateHandle (HANDLE source_process_handle, HANDLE
        ret=DuplicateHandle (source_process_handle, source_handle, target_process_handle, target_handle, access, inherit, options);
        MONO_EXIT_GC_SAFE;
 #else
-       mono_w32handle_ref (source_handle);
-       *target_handle = source_handle;
+       *target_handle = mono_w32handle_duplicate (source_handle);
        ret = TRUE;
 #endif