Alexandre Julliard : kernel32: Get rid of the hardcoded NUL device in QueryDosDeviceW.

Alexandre Julliard julliard at wine.codeweavers.com
Thu May 21 07:24:24 CDT 2015


Module: wine
Branch: master
Commit: c4fb1f617dbe15ce6fa1e5602de4ade764388b92
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c4fb1f617dbe15ce6fa1e5602de4ade764388b92

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu May 21 17:35:59 2015 +0900

kernel32: Get rid of the hardcoded NUL device in QueryDosDeviceW.

---

 dlls/kernel32/volume.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
index 0bbf621..d06dd05 100644
--- a/dlls/kernel32/volume.c
+++ b/dlls/kernel32/volume.c
@@ -1258,7 +1258,6 @@ BOOL WINAPI DefineDosDeviceA(DWORD flags, LPCSTR devname, LPCSTR targetpath)
 DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
 {
     static const WCHAR auxW[] = {'A','U','X',0};
-    static const WCHAR nulW[] = {'N','U','L',0};
     static const WCHAR prnW[] = {'P','R','N',0};
     static const WCHAR comW[] = {'C','O','M',0};
     static const WCHAR lptW[] = {'L','P','T',0};
@@ -1376,7 +1375,7 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
         WCHAR *p = target;
         int i;
 
-        if (bufsize <= (sizeof(auxW)+sizeof(nulW)+sizeof(prnW))/sizeof(WCHAR))
+        if (bufsize <= (sizeof(auxW)+sizeof(prnW))/sizeof(WCHAR))
         {
             SetLastError( ERROR_INSUFFICIENT_BUFFER );
             return 0;
@@ -1386,8 +1385,6 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
 
         memcpy( p, auxW, sizeof(auxW) );
         p += sizeof(auxW) / sizeof(WCHAR);
-        memcpy( p, nulW, sizeof(nulW) );
-        p += sizeof(nulW) / sizeof(WCHAR);
         memcpy( p, prnW, sizeof(prnW) );
         p += sizeof(prnW) / sizeof(WCHAR);
 




More information about the wine-cvs mailing list