[PATCH] kernel32: Better stubs for SetVolumeMountPoint.
Johannes Obermayr
johannesobermayr at gmx.de
Sun Nov 4 16:14:22 CST 2012
Fixes: Bug 31703 (crash in TomTom HOME software)
Fixes not: Bug 7711 (detecting TomTom devices)
---
dlls/kernel32/kernel32.spec | 4 ++--
dlls/kernel32/volume.c | 47 +++++++++++++++++++++++++++++++++++++++++++
include/winbase.h | 2 +-
3 Dateien geändert, 50 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 0bd1adc..9b16dfe 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1179,8 +1179,8 @@
@ stub SetVDMCurrentDirectories
@ stdcall SetVolumeLabelA(str str)
@ stdcall SetVolumeLabelW(wstr wstr)
-@ stub SetVolumeMountPointA
-@ stub SetVolumeMountPointW
+@ stdcall SetVolumeMountPointA(str str)
+@ stdcall SetVolumeMountPointW(wstr wstr)
@ stdcall SetWaitableTimer(long ptr long ptr ptr long)
@ stdcall SetupComm(long long long)
@ stub ShowConsoleCursor
diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
index 200c293..fa3e3d9 100644
--- a/dlls/kernel32/volume.c
+++ b/dlls/kernel32/volume.c
@@ -998,6 +998,7 @@ BOOL WINAPI GetVolumeNameForVolumeMountPointW( LPCWSTR path, LPWSTR volume, DWOR
/* if length of input is > 3 then it must be a mounted folder */
if (lstrlenW(path) > 3)
{
+ // Remove error code from SetVolumeMountPointW
FIXME("Mounted Folders are not yet supported\n");
SetLastError( ERROR_NOT_A_REPARSE_POINT );
return FALSE;
@@ -1098,6 +1099,52 @@ err_ret:
}
/***********************************************************************
+ * SetVolumeMountPointW (KERNEL32.@)
+ */
+BOOL WINAPI SetVolumeMountPointW(LPCWSTR path, LPCWSTR volume)
+{
+ if (!path || !volume)
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return FALSE;
+ }
+
+ /* Abort if already mounted */
+ if (GetVolumeNameForVolumeMountPointW(path, (LPWSTR)volume, MAX_PATH))
+ {
+ SetLastError( ERROR_VOLUME_MOUNTED );
+ return FALSE;
+ }
+
+ /* We can use checks and error codes from GetVolumeNameForVolumeMountPointW */
+ /* ERROR_NOT_A_PARSE_POINT should be removed if it is implemented */
+ switch (GetLastError())
+ {
+ case ERROR_INVALID_NAME:
+ case ERROR_FILENAME_EXCED_RANGE:
+ case ERROR_NOT_A_REPARSE_POINT:
+ return FALSE;
+ break;
+ default:
+ break;
+ }
+
+ FIXME("(%s, %s), stub!\n", debugstr_w(path), debugstr_w(volume));
+
+ return FALSE;
+}
+
+/************************************************************************
+ * SetVolumeMountPointA (KERNEL32.@)
+ */
+BOOL WINAPI SetVolumeMountPointA(LPCSTR path, LPCSTR volume)
+{
+ FIXME("(%s, %s), stub!\n", debugstr_a(path), debugstr_a(path));
+
+ return FALSE;
+}
+
+/***********************************************************************
* DefineDosDeviceW (KERNEL32.@)
*/
BOOL WINAPI DefineDosDeviceW( DWORD flags, LPCWSTR devname, LPCWSTR targetpath )
diff --git a/include/winbase.h b/include/winbase.h
index a9abb30..936497e 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -2229,7 +2229,7 @@ WINBASEAPI BOOL WINAPI SetVolumeLabelA(LPCSTR,LPCSTR);
WINBASEAPI BOOL WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR);
#define SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel)
WINBASEAPI BOOL WINAPI SetVolumeMountPointA(LPCSTR,LPCSTR);
-WINBASEAPI BOOL WINAPI SetVolumeMountPointW(LPCSTR,LPCSTR);
+WINBASEAPI BOOL WINAPI SetVolumeMountPointW(LPCWSTR,LPCWSTR);
#define SetVolumeMountPoint WINELIB_NAME_AW(SetVolumeMountPoint)
WINBASEAPI BOOL WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,LPVOID,BOOL);
WINBASEAPI BOOL WINAPI SetupComm(HANDLE,DWORD,DWORD);
--
1.7.10.4
More information about the wine-patches
mailing list