79542: kernel32: Implement GetVolumePathName.

buildbot at kegel.com buildbot at kegel.com
Tue Oct 4 10:41:19 CDT 2011


This is an experimental automated build and test service.
Please feel free to ignore this email while we work the kinks out.

For more info about this message, see http://wiki.winehq.org/BuildBot

The Buildbot has detected a failed build on builder runtests-default while building Wine.
Full details are available at: http://buildbot.kegel.com/builders/runtests-default/builds/55 (though maybe not for long, as I'm still reinstalling the buildbot periodically while experimenting)
BUILD FAILED: failed shell_3

Errors:
* Call to xpconnect wrapped JSObject produced this error:  *
* Call to xpconnect wrapped JSObject produced this error:  *
alarum: failed command was ../../../wine ntdll_test.exe.so file.c 
fixme:ntdll:NtQueryInformationFile Unsupported class (3)
wine: Unhandled page fault on read access to 0x00212b18 at address 0x7bc47995 (thread 0040), starting debugger...
Unhandled exception: page fault on read access to 0x00212b18 in 32-bit code (0x7bc47995).
Register dump:
 CS:0073 SS:007b DS:007b ES:007b FS:0033 GS:003b
 EIP:7bc47995 ESP:0032f7e8 EBP:0032f814 EFLAGS:00010206(  R- --  I   - -P- )
 EAX:00212b18 EBX:7bcb0ff4 ECX:00110000 EDX:00212b18
 ESI:0032fe38 EDI:00000000
Stack dump:
0x0032f7e8:  00122b58 0000d4a8 00000002 ffffffff
0x0032f7f8:  0032f808 7bc34ca6 00110064 00000002
0x0032f808:  0032f838 00130000 00122b48 0032f838
0x0032f818:  7bc47cc0 00110014 00122b48 000effd0
0x0032f828:  00122b10 00110014 7bcb0ff4 0032fe38
0x0032f838:  0032f898 7bc4ae87 00110014 00122b08
Backtrace:
=>0 0x7bc47995 HEAP_CreateFreeBlock+0xbb(subheap=0x110014, ptr=0x122b48, size=0xeffd0) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/heap.c:583] in ntdll (0x0032f814)
  1 0x7bc47cc0 HEAP_ShrinkBlock+0x42(subheap=0x110014, pArena=0x122b08, size=0x38) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/heap.c:685] in ntdll (0x0032f838)
  2 0x7bc4ae87 RtlAllocateHeap+0x2a8(heap=0x110000, flags=0x2, size=0x38) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/heap.c:1699] in ntdll (0x0032f898)
  3 0x7bc5cc0b RtlDosPathNameToNtPathName_U+0x35c(dos_path="C:\windows\system32", ntpath=0x32fbb4, file_part=(nil), cd=(nil)) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/path.c:394] in ntdll (0x0032fb18)
  4 0x7b882554 GetVolumePathNameW+0x107(filename="C:\windows\system32", volumepathname="?Ir\sandbox\slave\(", buflen=0x14) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/kernel32/volume.c:1767] in kernel32 (0x0032fbf8)
  5 0x684d171b test_file_name_information+0x179() [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/tests/file.c:1304] in ntdll_test (0x0032fcc8)
  6 0x684d3d40 func_file+0x374() [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/tests/file.c:1726] in ntdll_test (0x0032fcf8)
  7 0x685029c7 run_test+0x9e(name="file.c") [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/tests/../../../include/wine/test.h:556] in ntdll_test (0x0032fd58)
  8 0x68502ddc main+0x23a(argc=<couldn't compute location>, argv=0x1103c8) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/tests/../../../include/wine/test.h:624] in ntdll_test (0x0032fe28)
  9 0x68502e66 __wine_spec_exe_entry+0x69(peb=0x7ffdf000) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/winecrt0/exe_entry.c:36] in ntdll_test (0x0032fe60)
  10 0x7b85fe64 call_process_entry+0xb() in kernel32 (0x0032fe78)
  11 0x7b85ffaa start_process+0x143(peb=0x7ffdf000) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/kernel32/process.c:1091] in kernel32 (0x0032fec8)
  12 0x7bc7c104 call_thread_func+0xb() in ntdll (0x0032fed8)
  13 0x7bc7c142 call_thread_entry_point+0x33(entry=0x7b85fe66, arg=0x7ffdf000) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/signal_i386.c:2499] in ntdll (0x0032ffb8)
  14 0x7bc53699 start_process+0x23(kernel_start=0x7b85fe66) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/loader.c:2612] in ntdll (0x0032ffe8)
  15 0x680280b9 wine_call_on_stack+0x1c() in libwine.so.1 (0x00000000)
0x7bc47995 HEAP_CreateFreeBlock+0xbb [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/heap.c:583] in ntdll: movl	0x0(%eax),%eax
583	        (*(DWORD *)((char *)ptr + size) & ARENA_FLAG_FREE))
Modules:
Module	Address			Debug info	Name (34 modules)
ELF	68000000-6801d000	Deferred        ld-linux.so.2
ELF	6801f000-68160000	Dwarf           libwine.so.1
ELF	68172000-6818b000	Deferred        libpthread.so.0
ELF	6818b000-682e5000	Deferred        libc.so.6
ELF	682e6000-682ea000	Deferred        libdl.so.2
ELF	682eb000-68311000	Deferred        libm.so.6
ELF	68311000-68319000	Deferred        libnss_compat.so.2
ELF	68319000-68330000	Deferred        libnsl.so.1
ELF	68330000-6833a000	Deferred        libnss_nis.so.2
ELF	6833a000-68346000	Deferred        libnss_files.so.2
ELF	684a3000-68526000	Dwarf           ntdll_test<elf>
  \-PE	684b0000-68526000	\               ntdll_test
ELF	68526000-6867a000	Deferred        user32<elf>
  \-PE	68540000-6867a000	\               user32
ELF	6867a000-68735000	Deferred        gdi32<elf>
  \-PE	68690000-68735000	\               gdi32
ELF	68735000-6879b000	Deferred        advapi32<elf>
  \-PE	68740000-6879b000	\               advapi32
ELF	6879b000-687b6000	Deferred        version<elf>
  \-PE	687a0000-687b6000	\               version
ELF	687c8000-6883e000	Deferred        libfreetype.so.6
ELF	6883e000-68853000	Deferred        libz.so.1
ELF	68853000-68883000	Deferred        libfontconfig.so.1
ELF	68883000-688aa000	Deferred        libexpat.so.1
ELF	689e4000-689f4000	Deferred        libxext.so.6
ELF	689f4000-68b11000	Deferred        libx11.so.6
ELF	68b16000-68b30000	Deferred        libxcb.so.1
ELF	68b30000-68b34000	Deferred        libxau.so.6
ELF	68b34000-68b3a000	Deferred        libxdmcp.so.6
ELF	7b800000-7b9b2000	Dwarf           kernel32<elf>
  \-PE	7b810000-7b9b2000	\               kernel32
ELF	7bc00000-7bccd000	Dwarf           ntdll<elf>
  \-PE	7bc10000-7bccd000	\               ntdll
ELF	7bf00000-7bf04000	Deferred        <wine-loader>
Threads:
process  tid      prio (all id:s are in hex)
0000000e services.exe
	00000035    0
	0000001e    0
	00000018    0
	00000017    0
	00000015    0
	00000010    0
	0000000f    0
00000012 winedevice.exe
	0000001a    0
	00000019    0
	00000014    0
	00000013    0
0000001b plugplay.exe
	00000020    0
	0000001d    0
	0000001c    0
00000041 rpcss.exe
	0000002a    0
	00000009    0
	00000027    0
	00000024    0
	00000045    0
	0000000b    0
	00000042    0
	00000044    0
00000032 explorer.exe
	0000003e    0
0000003b (D) Z:\home\bob\wineslave.dir\sandbox\slave\runtests-default\build\dlls\ntdll\tests\ntdll_test.exe
	00000040    0 <==
Backtrace:
=>0 0x7bc47995 HEAP_CreateFreeBlock+0xbb(subheap=0x110014, ptr=0x122b48, size=0xeffd0) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/heap.c:583] in ntdll (0x0032f814)
  1 0x7bc47cc0 HEAP_ShrinkBlock+0x42(subheap=0x110014, pArena=0x122b08, size=0x38) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/heap.c:685] in ntdll (0x0032f838)
  2 0x7bc4ae87 RtlAllocateHeap+0x2a8(heap=0x110000, flags=0x2, size=0x38) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/heap.c:1699] in ntdll (0x0032f898)
  3 0x7bc5cc0b RtlDosPathNameToNtPathName_U+0x35c(dos_path="C:\windows\system32", ntpath=0x32fbb4, file_part=(nil), cd=(nil)) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/path.c:394] in ntdll (0x0032fb18)
  4 0x7b882554 GetVolumePathNameW+0x107(filename="C:\windows\system32", volumepathname="?Ir\sandbox\slave\(", buflen=0x14) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/kernel32/volume.c:1767] in kernel32 (0x0032fbf8)
  5 0x684d171b test_file_name_information+0x179() [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/tests/file.c:1304] in ntdll_test (0x0032fcc8)
  6 0x684d3d40 func_file+0x374() [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/tests/file.c:1726] in ntdll_test (0x0032fcf8)
  7 0x685029c7 run_test+0x9e(name="file.c") [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/tests/../../../include/wine/test.h:556] in ntdll_test (0x0032fd58)
  8 0x68502ddc main+0x23a(argc=<couldn't compute location>, argv=0x1103c8) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/tests/../../../include/wine/test.h:624] in ntdll_test (0x0032fe28)
  9 0x68502e66 __wine_spec_exe_entry+0x69(peb=0x7ffdf000) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/winecrt0/exe_entry.c:36] in ntdll_test (0x0032fe60)
  10 0x7b85fe64 call_process_entry+0xb() in kernel32 (0x0032fe78)
  11 0x7b85ffaa start_process+0x143(peb=0x7ffdf000) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/kernel32/process.c:1091] in kernel32 (0x0032fec8)
  12 0x7bc7c104 call_thread_func+0xb() in ntdll (0x0032fed8)
  13 0x7bc7c142 call_thread_entry_point+0x33(entry=0x7b85fe66, arg=0x7ffdf000) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/signal_i386.c:2499] in ntdll (0x0032ffb8)
  14 0x7bc53699 start_process+0x23(kernel_start=0x7b85fe66) [/home/bob/wineslave.dir/sandbox/slave/runtests-default/build/dlls/ntdll/loader.c:2612] in ntdll (0x0032ffe8)
  15 0x680280b9 wine_call_on_stack+0x1c() in libwine.so.1 (0x00000000)
make: *** [file.ok] Error 5

-------------- next part --------------
From: Erich Hoover <ehoover at mines.edu>
Subject: kernel32: Implement GetVolumePathName.
Message-Id: <CAEU2+vq3jCLjYUrOU1A0NCFzEBxK51tCtZRsgeMRHkFBBQ4chg at mail.gmail.com>
Date: Tue, 4 Oct 2011 09:32:50 -0600

Real Name:
    Erich Hoover

Description:
    This patch implements GetVolumePathName by using the full folder
path and working backward until stat() returns a different device.  I
encountered issues with having this function unimplemented after
installing Portal 2 and attempting to launch the game for the first
time (the "completing installation" failed).  After looking into the
issue, I found that steam has been updated in such a way that the
"first run installation" calls CreateFile using FILE_OPEN_BY_FILE_ID
(lookup by inode).  Since my steam installation is on a different
filesystem than my root partition, this meant that steam passed the
wrong root search path to CreateFile and resulted in steam being
unable to locate its files.

Changelog:
    kernel32: Implement GetVolumePathName.

From 38a40a75dbe570167ad1cf993100f174998b9a91 Mon Sep 17 00:00:00 2001
From: Erich Hoover <ehoover at mines.edu>
Date: Tue, 4 Oct 2011 09:16:00 -0600
Subject: kernel32: Implement GetVolumePathName.

---
 dlls/kernel32/volume.c |   92 +++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 83 insertions(+), 9 deletions(-)

diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
index a937f6b..27753e9 100644
--- a/dlls/kernel32/volume.c
+++ b/dlls/kernel32/volume.c
@@ -1730,22 +1730,96 @@ BOOL WINAPI GetVolumePathNameA(LPCSTR filename, LPSTR volumepathname, DWORD bufl
 
 /***********************************************************************
  *           GetVolumePathNameW   (KERNEL32.@)
+ *
+ * This routine is intended to find the most basic path on the same filesystem
+ * for any particular path name.  Since we can have very complicated drive/path
+ * relationships on Unix systems, due to symbolic links, the safest way to
+ * handle this is to start with the full path and work our way back folder by
+ * folder unil we find a folder on a different drive (or run out of folders).
  */
 BOOL WINAPI GetVolumePathNameW(LPCWSTR filename, LPWSTR volumepathname, DWORD buflen)
 {
-    const WCHAR *p = filename;
+    NTSTATUS status = STATUS_SUCCESS;
+    WCHAR *volumenameW = NULL, *c;
+    UNICODE_STRING nt_name;
+    ANSI_STRING unix_name;
+    int first_run = TRUE;
+    dev_t search_dev = 0;
+    int pos, last_pos;
+    struct stat st;
 
-    FIXME("(%s, %p, %d), stub!\n", debugstr_w(filename), volumepathname, buflen);
+    if (!filename || !volumepathname)
+    {
+        SetLastError( ERROR_INVALID_PARAMETER );
+        return FALSE;
+    }
+    last_pos = pos = strlenW( filename ) + 1;
+    if (!(volumenameW = HeapAlloc( GetProcessHeap(), 0, pos * sizeof(WCHAR) )))
+    {
+        SetLastError( ERROR_NOT_ENOUGH_MEMORY );
+        return FALSE;
+    }
+    strcpyW( volumenameW, filename );
 
-    if (p && tolowerW(p[0]) >= 'a' && tolowerW(p[0]) <= 'z' && p[1] ==':' && p[2] == '\\' && buflen >= 4)
+    do
     {
-        volumepathname[0] = p[0];
-        volumepathname[1] = ':';
-        volumepathname[2] = '\\';
-        volumepathname[3] = 0;
-        return TRUE;
+        volumenameW[pos] = '\0';
+        if (!RtlDosPathNameToNtPathName_U( volumenameW, &nt_name, NULL, NULL ))
+        {
+            status = STATUS_OBJECT_PATH_NOT_FOUND;
+            goto cleanup;
+        }
+        status = wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, FALSE );
+        RtlFreeUnicodeString( &nt_name );
+        if (status != STATUS_SUCCESS)
+            goto cleanup;
+        if (stat( unix_name.Buffer, &st ) != 0)
+        {
+            RtlFreeAnsiString( &unix_name );
+            status = STATUS_OBJECT_PATH_NOT_FOUND;
+            goto cleanup;
+        }
+        RtlFreeAnsiString( &unix_name );
+        if (first_run)
+        {
+            first_run = FALSE;
+            search_dev = st.st_dev;
+        }
+        else if (st.st_dev != search_dev)
+        {
+            /* folder is on a new filesystem, return the last folder */
+            break;
+        }
+        last_pos = pos;
+        c = strrchrW( volumenameW, '\\' );
+        if (c != NULL)
+            pos = c-volumenameW;
+    } while (c != NULL);
+
+    /* include the terminating backslash unless returning the full path */
+    if (filename[last_pos] != '\0')
+        last_pos++;
+    /* require room to NULL terminate the string */
+    if ((filename[last_pos] == '\\' && last_pos * sizeof(WCHAR) <= buflen)
+        || (last_pos+1) * sizeof(WCHAR) <= buflen)
+    {
+        memcpy(volumepathname, filename, last_pos*sizeof(WCHAR));
+        /* remove the terminating backslash if the buffer is one byte short */
+        if (filename[last_pos] == '\\' && (last_pos+1) * sizeof(WCHAR) > buflen)
+            last_pos--;
+        volumepathname[last_pos] = '\0';
+        TRACE("Successfully translated path %s to mount-point %s\n",
+              debugstr_w(filename), debugstr_w(volumepathname));
     }
-    return FALSE;
+    else
+        status = STATUS_BUFFER_OVERFLOW;
+
+cleanup:
+    HeapFree( GetProcessHeap(), 0, volumenameW );
+
+    if (status != STATUS_SUCCESS)
+        SetLastError( RtlNtStatusToDosError(status) );
+    return (status == STATUS_SUCCESS);
 }
 
 /***********************************************************************
-- 
1.7.1



More information about the wine-tests-results mailing list