[RosApps|WineFile]
[reactos.git] / rosapps / applications / winfile / winefile.c
index d2413d1..54705f7 100644 (file)
@@ -1323,9 +1323,17 @@ static ChildWnd* alloc_child_window(LPCWSTR path, LPITEMIDLIST pidl, HWND hwnd)
 
        if (path)
        {
-               lstrcpyW(child->path, path);
+        int pathlen = strlenW(path);
+        const WCHAR *npath = path;
 
-               _wsplitpath(path, drv, dir, name, ext);
+        if (path[0] == '"' && path[pathlen - 1] == '"')
+        {
+            npath++;
+            pathlen--;
+        }
+        lstrcpynW(child->path, npath, pathlen + 1);
+        
+        _wsplitpath(child->path, drv, dir, name, ext);
        }
 
        lstrcpyW(child->filter_pattern, sAsterics);
@@ -1757,11 +1765,11 @@ static void PropDlg_DisplayValue(HWND hlbox, HWND hedit)
 
 static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCWSTR strFilename)
 {
-       static WCHAR sBackSlash[] = {'\\','\0'};
-       static WCHAR sTranslation[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n','\0'};
-       static WCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\',
+       static const WCHAR sBackSlash[] = {'\\','\0'};
+       static const WCHAR sTranslation[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n','\0'};
+       static const WCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\',
                                                                                '%','0','4','x','%','0','4','x','\\','%','s','\0'};
-        static WCHAR sFmt[] = {'%','d','.','%','d','.','%','d','.','%','d','\0'};
+        static const WCHAR sFmt[] = {'%','d','.','%','d','.','%','d','.','%','d','\0'};
        DWORD dwVersionDataLen = GetFileVersionInfoSizeW(strFilename, NULL);
 
        if (dwVersionDataLen) {
@@ -2056,8 +2064,8 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
        switch(nmsg) {
                case WM_CLOSE:
                        if (Globals.saveSettings)
-                               save_registry_settings();  
-                       
+                               save_registry_settings();
+
                        DestroyWindow(hwnd);
 
                         /* clear handle variables */
@@ -4278,7 +4286,7 @@ static BOOL show_frame(HWND hwndParent, int cmdshow, LPCWSTR path)
                                        WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER,
                                        0, 0, 0, 0,
                                        Globals.hMainWnd, 0, Globals.hInstance, &ccs);
-  
+
        CheckMenuItem(Globals.hMenuOptions, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
        CheckMenuItem(Globals.hMenuOptions, ID_VIEW_SAVESETTINGS, MF_BYCOMMAND);
 
@@ -4313,7 +4321,7 @@ static BOOL show_frame(HWND hwndParent, int cmdshow, LPCWSTR path)
 
 #ifndef __WINE__
         /* Shell Namespace as default: */
-       child = alloc_child_window(path, get_path_pidl(path,Globals.hMainWnd), Globals.hMainWnd);
+       child = alloc_child_window(path, get_path_pidl((LPWSTR)path,Globals.hMainWnd), Globals.hMainWnd);
 #else
        child = alloc_child_window(path, NULL, Globals.hMainWnd);
 #endif