mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
UNICODE for WINE version
svn path=/trunk/; revision=11227
This commit is contained in:
parent
26a5b94393
commit
475d618db9
1 changed files with 36 additions and 7 deletions
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
||||||
|
#define NONAMELESSUNION
|
||||||
#include "winefile.h"
|
#include "winefile.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
|
@ -39,6 +40,10 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
|
extern int swprintf(wchar_t*, const wchar_t*, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _NO_EXTENSIONS
|
#ifdef _NO_EXTENSIONS
|
||||||
#undef _LEFT_FILES
|
#undef _LEFT_FILES
|
||||||
#endif
|
#endif
|
||||||
|
@ -442,17 +447,25 @@ static void read_directory_unix(Entry* dir, LPCTSTR path)
|
||||||
Entry* last = NULL;
|
Entry* last = NULL;
|
||||||
Entry* entry;
|
Entry* entry;
|
||||||
|
|
||||||
int level = dir->level + 1;
|
#ifdef UNICODE
|
||||||
|
char cpath[MAX_PATH];
|
||||||
|
|
||||||
DIR* pdir = opendir(path);
|
WideCharToMultiByte(CP_UNIXCP, 0, path, -1, cpath, MAX_PATH, NULL, NULL);
|
||||||
|
#else
|
||||||
|
const char* cpath = path;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DIR* pdir = opendir(cpath);
|
||||||
|
|
||||||
|
int level = dir->level + 1;
|
||||||
|
|
||||||
if (pdir) {
|
if (pdir) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
struct dirent* ent;
|
struct dirent* ent;
|
||||||
TCHAR buffer[MAX_PATH], *p;
|
char buffer[MAX_PATH], *p, *s;
|
||||||
|
|
||||||
for(p=buffer; *path; )
|
for(p=buffer,s=cpath; *s; )
|
||||||
*p++ = *path++;
|
*p++ = *s++;
|
||||||
|
|
||||||
if (p==buffer || p[-1]!='/')
|
if (p==buffer || p[-1]!='/')
|
||||||
*p++ = '/';
|
*p++ = '/';
|
||||||
|
@ -468,7 +481,12 @@ static void read_directory_unix(Entry* dir, LPCTSTR path)
|
||||||
|
|
||||||
entry->etype = ET_UNIX;
|
entry->etype = ET_UNIX;
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
|
MultiByteToWideChar(CP_UNIXCP, 0, ent->d_name, -1, entry->data.cFileName, MAX_PATH);
|
||||||
|
#else
|
||||||
lstrcpy(entry->data.cFileName, ent->d_name);
|
lstrcpy(entry->data.cFileName, ent->d_name);
|
||||||
|
#endif
|
||||||
|
|
||||||
entry->data.dwFileAttributes = ent->d_name[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0;
|
entry->data.dwFileAttributes = ent->d_name[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0;
|
||||||
|
|
||||||
strcpy(p, ent->d_name);
|
strcpy(p, ent->d_name);
|
||||||
|
@ -1957,18 +1975,28 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
|
||||||
#ifdef __WINE__
|
#ifdef __WINE__
|
||||||
case ID_DRIVE_UNIX_FS: {
|
case ID_DRIVE_UNIX_FS: {
|
||||||
TCHAR path[MAX_PATH];
|
TCHAR path[MAX_PATH];
|
||||||
|
#ifdef UNICODE
|
||||||
|
char cpath[MAX_PATH];
|
||||||
|
#endif
|
||||||
ChildWnd* child;
|
ChildWnd* child;
|
||||||
|
|
||||||
if (activate_fs_window(RS(b1,IDS_UNIXFS)))
|
if (activate_fs_window(RS(b1,IDS_UNIXFS)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
|
getcwd(cpath, MAX_PATH);
|
||||||
|
MultiByteToWideChar(CP_UNIXCP, 0, cpath, -1, path, MAX_PATH);
|
||||||
|
#else
|
||||||
getcwd(path, MAX_PATH);
|
getcwd(path, MAX_PATH);
|
||||||
|
#endif
|
||||||
child = alloc_child_window(path, NULL, hwnd);
|
child = alloc_child_window(path, NULL, hwnd);
|
||||||
|
|
||||||
if (!create_child_window(child))
|
if (!create_child_window(child))
|
||||||
free(child);
|
free(child);
|
||||||
break;}
|
break;}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _SHELL_FOLDERS
|
#ifdef _SHELL_FOLDERS
|
||||||
case ID_DRIVE_SHELL_NS: {
|
case ID_DRIVE_SHELL_NS: {
|
||||||
TCHAR path[MAX_PATH];
|
TCHAR path[MAX_PATH];
|
||||||
|
@ -2003,7 +2031,7 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
|
||||||
ShellAbout(hwnd, RS(b2,IDS_WINE), RS(b1,IDS_WINEFILE), 0);
|
ShellAbout(hwnd, RS(b2,IDS_WINE), RS(b1,IDS_WINEFILE), 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_ABOUT: /*ID_ABOUT_WINE:*/
|
case ID_ABOUT:
|
||||||
ShellAbout(hwnd, RS(b1,IDS_WINEFILE), NULL, 0);
|
ShellAbout(hwnd, RS(b1,IDS_WINEFILE), NULL, 0);
|
||||||
break;
|
break;
|
||||||
#endif /* _NO_EXTENSIONS */
|
#endif /* _NO_EXTENSIONS */
|
||||||
|
@ -2767,7 +2795,7 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi
|
||||||
{
|
{
|
||||||
ULONGLONG size;
|
ULONGLONG size;
|
||||||
|
|
||||||
size = ((ULONGLONG)entry->data.nFileSizeHigh << 32) | entry->data.nFileSizeLow;
|
size = ((ULONGLONG)entry->data.nFileSizeHigh << 32) | entry->data.nFileSizeLow;
|
||||||
|
|
||||||
_stprintf(buffer, sLongNumFmt, size);
|
_stprintf(buffer, sLongNumFmt, size);
|
||||||
|
|
||||||
|
@ -2877,6 +2905,7 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi
|
||||||
' ','\t',' ','\t',' ','\t',' ',
|
' ','\t',' ','\t',' ','\t',' ',
|
||||||
'\0'
|
'\0'
|
||||||
};
|
};
|
||||||
|
|
||||||
DWORD rights = get_access_mask();
|
DWORD rights = get_access_mask();
|
||||||
|
|
||||||
tcscpy(buffer, sSecTabs);
|
tcscpy(buffer, sSecTabs);
|
||||||
|
|
Loading…
Reference in a new issue