Added patch to return correct device type for cd devices without medium.

This commit is contained in:
Sebastian Lackner
2015-03-30 04:11:47 +02:00
parent 7fb4b8cfc8
commit 41c3e670d9
5 changed files with 83 additions and 31 deletions

View File

@@ -0,0 +1,33 @@
From 1af79e37413d3d89f5290649d8e2b040ec0942af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 30 Mar 2015 03:03:03 +0200
Subject: kernel32: Return correct device type for cd devices without medium.
---
dlls/kernel32/volume.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
index 59eda44..38a72c5 100644
--- a/dlls/kernel32/volume.c
+++ b/dlls/kernel32/volume.c
@@ -1610,7 +1610,15 @@ UINT WINAPI GetDriveTypeW(LPCWSTR root) /* [in] String describing drive */
HANDLE handle;
UINT ret;
- if (!open_device_root( root, &handle )) return DRIVE_NO_ROOT_DIR;
+ if (!open_device_root( root, &handle ))
+ {
+ /* CD ROM devices do not necessarily have a volume, but a drive type */
+ ret = get_mountmgr_drive_type( root );
+ if (ret == DRIVE_CDROM || ret == DRIVE_REMOVABLE)
+ return ret;
+
+ return DRIVE_NO_ROOT_DIR;
+ }
status = NtQueryVolumeInformationFile( handle, &io, &info, sizeof(info), FileFsDeviceInformation );
NtClose( handle );
--
2.3.3

View File

@@ -0,0 +1 @@
Fixes: Return correct device type for cd devices without medium

View File

@@ -110,6 +110,7 @@ patch_enable_all ()
enable_iphlpapi_TCP_Table="$1"
enable_kernel32_Console_Handles="$1"
enable_kernel32_CopyFileEx="$1"
enable_kernel32_GetDriveTypeW="$1"
enable_kernel32_GetFinalPathNameByHandle="$1"
enable_kernel32_GetLogicalProcessorInformationEx="$1"
enable_kernel32_GetNumaProcessorNode="$1"
@@ -392,6 +393,9 @@ patch_enable ()
kernel32-CopyFileEx)
enable_kernel32_CopyFileEx="$2"
;;
kernel32-GetDriveTypeW)
enable_kernel32_GetDriveTypeW="$2"
;;
kernel32-GetFinalPathNameByHandle)
enable_kernel32_GetFinalPathNameByHandle="$2"
;;
@@ -1943,6 +1947,21 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-Multisampling
# |
# | This patchset fixes the following Wine bugs:
# | * [#12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE.
# |
# | Modified files:
# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h
# |
if test "$enable_wined3d_Multisampling" -eq 1; then
patch_apply wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch
(
echo '+ { "Austin English", "wined3d: Allow to specify multisampling AA quality levels via registry.", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-Revert_PixelFormat
# |
# | This patchset fixes the following Wine bugs:
@@ -1989,21 +2008,6 @@ if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-Multisampling
# |
# | This patchset fixes the following Wine bugs:
# | * [#12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE.
# |
# | Modified files:
# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h
# |
if test "$enable_wined3d_Multisampling" -eq 1; then
patch_apply wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch
(
echo '+ { "Austin English", "wined3d: Allow to specify multisampling AA quality levels via registry.", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-CSMT_Main
# |
# | This patchset fixes the following Wine bugs:
@@ -2633,6 +2637,18 @@ if test "$enable_kernel32_CopyFileEx" -eq 1; then
) >> "$patchlist"
fi
# Patchset kernel32-GetDriveTypeW
# |
# | Modified files:
# | * dlls/kernel32/volume.c
# |
if test "$enable_kernel32_GetDriveTypeW" -eq 1; then
patch_apply kernel32-GetDriveTypeW/0001-kernel32-Return-correct-device-type-for-cd-devices-w.patch
(
echo '+ { "Michael Müller", "kernel32: Return correct device type for cd devices without medium.", 1 },';
) >> "$patchlist"
fi
# Patchset kernel32-GetFinalPathNameByHandle
# |
# | This patchset fixes the following Wine bugs:
@@ -3792,6 +3808,21 @@ if test "$enable_server_CreateProcess_ACLs" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-OpenProcess
# |
# | This patchset fixes the following Wine bugs:
# | * [#37087] Return an error when trying to open a terminated process
# |
# | Modified files:
# | * server/process.c, server/process.h
# |
if test "$enable_server_OpenProcess" -eq 1; then
patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch
(
echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },';
) >> "$patchlist"
fi
# Patchset server-Misc_ACL
# |
# | This patchset fixes the following Wine bugs:
@@ -3809,21 +3840,6 @@ if test "$enable_server_Misc_ACL" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-OpenProcess
# |
# | This patchset fixes the following Wine bugs:
# | * [#37087] Return an error when trying to open a terminated process
# |
# | Modified files:
# | * server/process.c, server/process.h
# |
if test "$enable_server_OpenProcess" -eq 1; then
patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch
(
echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },';
) >> "$patchlist"
fi
# Patchset server-JobObjects
# |
# | This patchset fixes the following Wine bugs: