Commit 21049ffb authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

winefile: Replace TCHAR with WCHAR.

parent 575b7bf3
...@@ -102,9 +102,9 @@ typedef struct _Entry { ...@@ -102,9 +102,9 @@ typedef struct _Entry {
typedef struct { typedef struct {
Entry entry; Entry entry;
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
TCHAR volname[_MAX_FNAME]; WCHAR volname[_MAX_FNAME];
TCHAR fs[_MAX_DIR]; WCHAR fs[_MAX_DIR];
DWORD drive_type; DWORD drive_type;
DWORD fs_flags; DWORD fs_flags;
} Root; } Root;
...@@ -160,8 +160,8 @@ typedef struct { ...@@ -160,8 +160,8 @@ typedef struct {
int split_pos; int split_pos;
BOOL header_wdths_ok; BOOL header_wdths_ok;
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
TCHAR filter_pattern[MAX_PATH]; WCHAR filter_pattern[MAX_PATH];
int filter_flags; int filter_flags;
Root root; Root root;
...@@ -175,7 +175,7 @@ static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd); ...@@ -175,7 +175,7 @@ static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd);
static void refresh_child(ChildWnd* child); static void refresh_child(ChildWnd* child);
static void refresh_drives(void); static void refresh_drives(void);
static void get_path(Entry* dir, PTSTR path); static void get_path(Entry* dir, PTSTR path);
static void format_date(const FILETIME* ft, TCHAR* buffer, int visible_cols); static void format_date(const FILETIME* ft, WCHAR* buffer, int visible_cols);
static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam); static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam); static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
...@@ -188,14 +188,14 @@ WINEFILE_GLOBALS Globals; ...@@ -188,14 +188,14 @@ WINEFILE_GLOBALS Globals;
static int last_split; static int last_split;
/* some common string constants */ /* some common string constants */
static const TCHAR sEmpty[] = {'\0'}; static const WCHAR sEmpty[] = {'\0'};
static const WCHAR sSpace[] = {' ', '\0'}; static const WCHAR sSpace[] = {' ', '\0'};
static const TCHAR sNumFmt[] = {'%','d','\0'}; static const WCHAR sNumFmt[] = {'%','d','\0'};
static const TCHAR sQMarks[] = {'?','?','?','\0'}; static const WCHAR sQMarks[] = {'?','?','?','\0'};
/* window class names */ /* window class names */
static const TCHAR sWINEFILEFRAME[] = {'W','F','S','_','F','r','a','m','e','\0'}; static const WCHAR sWINEFILEFRAME[] = {'W','F','S','_','F','r','a','m','e','\0'};
static const TCHAR sWINEFILETREE[] = {'W','F','S','_','T','r','e','e','\0'}; static const WCHAR sWINEFILETREE[] = {'W','F','S','_','T','r','e','e','\0'};
static void format_longlong(LPWSTR ret, ULONGLONG val) static void format_longlong(LPWSTR ret, ULONGLONG val)
{ {
...@@ -223,7 +223,7 @@ static LPTSTR load_string(LPTSTR buffer, DWORD size, UINT id) ...@@ -223,7 +223,7 @@ static LPTSTR load_string(LPTSTR buffer, DWORD size, UINT id)
/* display error message for the specified WIN32 error code */ /* display error message for the specified WIN32 error code */
static void display_error(HWND hwnd, DWORD error) static void display_error(HWND hwnd, DWORD error)
{ {
TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; WCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
PTSTR msg; PTSTR msg;
if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
...@@ -239,7 +239,7 @@ static void display_error(HWND hwnd, DWORD error) ...@@ -239,7 +239,7 @@ static void display_error(HWND hwnd, DWORD error)
/* display network error message using WNetGetLastErrorW() */ /* display network error message using WNetGetLastErrorW() */
static void display_network_error(HWND hwnd) static void display_network_error(HWND hwnd)
{ {
TCHAR msg[BUFFER_LEN], provider[BUFFER_LEN], b2[BUFFER_LEN]; WCHAR msg[BUFFER_LEN], provider[BUFFER_LEN], b2[BUFFER_LEN];
DWORD error; DWORD error;
if (WNetGetLastErrorW(&error, msg, BUFFER_LEN, provider, BUFFER_LEN) == NO_ERROR) if (WNetGetLastErrorW(&error, msg, BUFFER_LEN, provider, BUFFER_LEN) == NO_ERROR)
...@@ -373,7 +373,7 @@ static void read_directory_win(Entry* dir, LPCTSTR path) ...@@ -373,7 +373,7 @@ static void read_directory_win(Entry* dir, LPCTSTR path)
HANDLE hFile; HANDLE hFile;
#endif #endif
TCHAR buffer[MAX_PATH], *p; WCHAR buffer[MAX_PATH], *p;
for(p=buffer; *path; ) for(p=buffer; *path; )
*p++ = *path++; *p++ = *path++;
...@@ -468,7 +468,7 @@ static Entry* find_entry_win(Entry* dir, LPCTSTR name) ...@@ -468,7 +468,7 @@ static Entry* find_entry_win(Entry* dir, LPCTSTR name)
static Entry* read_tree_win(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd) static Entry* read_tree_win(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
{ {
TCHAR buffer[MAX_PATH]; WCHAR buffer[MAX_PATH];
Entry* entry = &root->entry; Entry* entry = &root->entry;
LPCTSTR s = path; LPCTSTR s = path;
PTSTR d = buffer; PTSTR d = buffer;
...@@ -629,7 +629,7 @@ static Entry* find_entry_unix(Entry* dir, LPCTSTR name) ...@@ -629,7 +629,7 @@ static Entry* find_entry_unix(Entry* dir, LPCTSTR name)
static Entry* read_tree_unix(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd) static Entry* read_tree_unix(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
{ {
TCHAR buffer[MAX_PATH]; WCHAR buffer[MAX_PATH];
Entry* entry = &root->entry; Entry* entry = &root->entry;
LPCTSTR s = path; LPCTSTR s = path;
PTSTR d = buffer; PTSTR d = buffer;
...@@ -767,7 +767,7 @@ static LPITEMIDLIST get_to_absolute_pidl(Entry* entry, HWND hwnd) ...@@ -767,7 +767,7 @@ static LPITEMIDLIST get_to_absolute_pidl(Entry* entry, HWND hwnd)
return idl; return idl;
} else if (entry->etype == ET_WINDOWS) { } else if (entry->etype == ET_WINDOWS) {
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
get_path(entry, path); get_path(entry, path);
...@@ -784,7 +784,7 @@ static HICON extract_icon(IShellFolder* folder, LPCITEMIDLIST pidl) ...@@ -784,7 +784,7 @@ static HICON extract_icon(IShellFolder* folder, LPCITEMIDLIST pidl)
IExtractIcon* pExtract; IExtractIcon* pExtract;
if (SUCCEEDED(IShellFolder_GetUIObjectOf(folder, 0, 1, (LPCITEMIDLIST*)&pidl, &IID_IExtractIcon, 0, (LPVOID*)&pExtract))) { if (SUCCEEDED(IShellFolder_GetUIObjectOf(folder, 0, 1, (LPCITEMIDLIST*)&pidl, &IID_IExtractIcon, 0, (LPVOID*)&pExtract))) {
TCHAR path[_MAX_PATH]; WCHAR path[_MAX_PATH];
unsigned flags; unsigned flags;
HICON hicon; HICON hicon;
int idx; int idx;
...@@ -1102,7 +1102,7 @@ static int compareExt(const void* arg1, const void* arg2) ...@@ -1102,7 +1102,7 @@ static int compareExt(const void* arg1, const void* arg2)
{ {
const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data; const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data; const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
const TCHAR *name1, *name2, *ext1, *ext2; const WCHAR *name1, *name2, *ext1, *ext2;
int cmp = compareType(fd1, fd2); int cmp = compareType(fd1, fd2);
if (cmp) if (cmp)
...@@ -1207,7 +1207,7 @@ static void SortDirectory(Entry* dir, SORT_ORDER sortOrder) ...@@ -1207,7 +1207,7 @@ static void SortDirectory(Entry* dir, SORT_ORDER sortOrder)
static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd) static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
{ {
TCHAR buffer[MAX_PATH]; WCHAR buffer[MAX_PATH];
Entry* entry; Entry* entry;
LPCTSTR s; LPCTSTR s;
PTSTR d; PTSTR d;
...@@ -1287,9 +1287,9 @@ static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND ...@@ -1287,9 +1287,9 @@ static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND
static Entry* read_tree(Root* root, LPCTSTR path, LPITEMIDLIST pidl, LPTSTR drv, SORT_ORDER sortOrder, HWND hwnd) static Entry* read_tree(Root* root, LPCTSTR path, LPITEMIDLIST pidl, LPTSTR drv, SORT_ORDER sortOrder, HWND hwnd)
{ {
#if !defined(_NO_EXTENSIONS) && defined(__WINE__) #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
static const TCHAR sSlash[] = {'/', '\0'}; static const WCHAR sSlash[] = {'/', '\0'};
#endif #endif
static const TCHAR sBackslash[] = {'\\', '\0'}; static const WCHAR sBackslash[] = {'\\', '\0'};
#ifdef _SHELL_FOLDERS #ifdef _SHELL_FOLDERS
if (pidl) if (pidl)
...@@ -1348,10 +1348,10 @@ enum TYPE_FILTER { ...@@ -1348,10 +1348,10 @@ enum TYPE_FILTER {
static ChildWnd* alloc_child_window(LPCTSTR path, LPITEMIDLIST pidl, HWND hwnd) static ChildWnd* alloc_child_window(LPCTSTR path, LPITEMIDLIST pidl, HWND hwnd)
{ {
TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT]; WCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
TCHAR dir_path[MAX_PATH]; WCHAR dir_path[MAX_PATH];
TCHAR b1[BUFFER_LEN]; WCHAR b1[BUFFER_LEN];
static const TCHAR sAsterics[] = {'*', '\0'}; static const WCHAR sAsterics[] = {'*', '\0'};
ChildWnd* child = HeapAlloc(GetProcessHeap(), 0, sizeof(ChildWnd)); ChildWnd* child = HeapAlloc(GetProcessHeap(), 0, sizeof(ChildWnd));
Root* root = &child->root; Root* root = &child->root;
...@@ -1468,8 +1468,8 @@ static void get_path(Entry* dir, PTSTR path) ...@@ -1468,8 +1468,8 @@ static void get_path(Entry* dir, PTSTR path)
if (entry->up) { if (entry->up) {
if (l > 0) { if (l > 0) {
memmove(path+l+1, path, len*sizeof(TCHAR)); memmove(path+l+1, path, len*sizeof(WCHAR));
memcpy(path+1, name, l*sizeof(TCHAR)); memcpy(path+1, name, l*sizeof(WCHAR));
len += l+1; len += l+1;
#ifndef _NO_EXTENSIONS #ifndef _NO_EXTENSIONS
...@@ -1482,8 +1482,8 @@ static void get_path(Entry* dir, PTSTR path) ...@@ -1482,8 +1482,8 @@ static void get_path(Entry* dir, PTSTR path)
entry = entry->up; entry = entry->up;
} else { } else {
memmove(path+l, path, len*sizeof(TCHAR)); memmove(path+l, path, len*sizeof(WCHAR));
memcpy(path, name, l*sizeof(TCHAR)); memcpy(path, name, l*sizeof(WCHAR));
len += l; len += l;
break; break;
} }
...@@ -1690,7 +1690,7 @@ static HWND create_child_window(ChildWnd* child) ...@@ -1690,7 +1690,7 @@ static HWND create_child_window(ChildWnd* child)
struct ExecuteDialog { struct ExecuteDialog {
TCHAR cmd[MAX_PATH]; WCHAR cmd[MAX_PATH];
int cmdshow; int cmdshow;
}; };
...@@ -1722,7 +1722,7 @@ static INT_PTR CALLBACK ExecuteDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam ...@@ -1722,7 +1722,7 @@ static INT_PTR CALLBACK ExecuteDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam
static INT_PTR CALLBACK DestinationDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) static INT_PTR CALLBACK DestinationDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
{ {
TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; WCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
switch(nmsg) { switch(nmsg) {
case WM_INITDIALOG: case WM_INITDIALOG:
...@@ -1758,7 +1758,7 @@ static INT_PTR CALLBACK DestinationDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, ...@@ -1758,7 +1758,7 @@ static INT_PTR CALLBACK DestinationDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam,
struct FilterDialog { struct FilterDialog {
TCHAR pattern[MAX_PATH]; WCHAR pattern[MAX_PATH];
int flags; int flags;
}; };
...@@ -1805,7 +1805,7 @@ static INT_PTR CALLBACK FilterDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, ...@@ -1805,7 +1805,7 @@ static INT_PTR CALLBACK FilterDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam,
struct PropertiesDialog { struct PropertiesDialog {
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
Entry entry; Entry entry;
void* pVersionData; void* pVersionData;
}; };
...@@ -1846,9 +1846,9 @@ static void PropDlg_DisplayValue(HWND hlbox, HWND hedit) ...@@ -1846,9 +1846,9 @@ static void PropDlg_DisplayValue(HWND hlbox, HWND hedit)
static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCTSTR strFilename) static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCTSTR strFilename)
{ {
static TCHAR sBackSlash[] = {'\\','\0'}; static WCHAR sBackSlash[] = {'\\','\0'};
static TCHAR 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 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 TCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\', static WCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\',
'%','0','4','x','%','0','4','x','\\','%','s','\0'}; '%','0','4','x','%','0','4','x','\\','%','s','\0'};
DWORD dwVersionDataLen = GetFileVersionInfoSizeW(strFilename, NULL); DWORD dwVersionDataLen = GetFileVersionInfoSizeW(strFilename, NULL);
...@@ -1884,8 +1884,8 @@ static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCTSTR st ...@@ -1884,8 +1884,8 @@ static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCTSTR st
LPCSTR* p; LPCSTR* p;
for(p=InfoStrings; *p; ++p) { for(p=InfoStrings; *p; ++p) {
TCHAR subblock[200]; WCHAR subblock[200];
TCHAR infoStr[100]; WCHAR infoStr[100];
LPCTSTR pTxt; LPCTSTR pTxt;
UINT nValLen; UINT nValLen;
...@@ -1915,8 +1915,8 @@ static INT_PTR CALLBACK PropertiesDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wpa ...@@ -1915,8 +1915,8 @@ static INT_PTR CALLBACK PropertiesDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wpa
switch(nmsg) { switch(nmsg) {
case WM_INITDIALOG: { case WM_INITDIALOG: {
static const TCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'}; static const WCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'};
TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; WCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
LPWIN32_FIND_DATA pWFD; LPWIN32_FIND_DATA pWFD;
dlg = (struct PropertiesDialog*) lparam; dlg = (struct PropertiesDialog*) lparam;
...@@ -2098,7 +2098,7 @@ static void toggle_child(HWND hwnd, UINT cmd, HWND hchild) ...@@ -2098,7 +2098,7 @@ static void toggle_child(HWND hwnd, UINT cmd, HWND hchild)
static BOOL activate_drive_window(LPCTSTR path) static BOOL activate_drive_window(LPCTSTR path)
{ {
TCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE]; WCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE];
HWND child_wnd; HWND child_wnd;
_wsplitpath(path, drv1, 0, 0, 0); _wsplitpath(path, drv1, 0, 0, 0);
...@@ -2149,7 +2149,7 @@ static BOOL activate_fs_window(LPCTSTR filesys) ...@@ -2149,7 +2149,7 @@ static BOOL activate_fs_window(LPCTSTR filesys)
static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
{ {
TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; WCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
switch(nmsg) { switch(nmsg) {
case WM_CLOSE: case WM_CLOSE:
...@@ -2186,7 +2186,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM ...@@ -2186,7 +2186,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
break; break;
if (cmd>=ID_DRIVE_FIRST && cmd<=ID_DRIVE_FIRST+0xFF) { if (cmd>=ID_DRIVE_FIRST && cmd<=ID_DRIVE_FIRST+0xFF) {
TCHAR drv[_MAX_DRIVE], path[MAX_PATH]; WCHAR drv[_MAX_DRIVE], path[MAX_PATH];
ChildWnd* child; ChildWnd* child;
LPCTSTR root = Globals.drives; LPCTSTR root = Globals.drives;
int i; int i;
...@@ -2216,7 +2216,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM ...@@ -2216,7 +2216,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
break; break;
case ID_WINDOW_NEW: { case ID_WINDOW_NEW: {
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
ChildWnd* child; ChildWnd* child;
GetCurrentDirectoryW(MAX_PATH, path); GetCurrentDirectoryW(MAX_PATH, path);
...@@ -2323,7 +2323,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM ...@@ -2323,7 +2323,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
#ifdef __WINE__ #ifdef __WINE__
case ID_DRIVE_UNIX_FS: { case ID_DRIVE_UNIX_FS: {
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
char cpath[MAX_PATH]; char cpath[MAX_PATH];
ChildWnd* child; ChildWnd* child;
...@@ -2340,7 +2340,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM ...@@ -2340,7 +2340,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
#endif #endif
#ifdef _SHELL_FOLDERS #ifdef _SHELL_FOLDERS
case ID_DRIVE_SHELL_NS: { case ID_DRIVE_SHELL_NS: {
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
ChildWnd* child; ChildWnd* child;
if (activate_fs_window(RS(b1,IDS_SHELL))) if (activate_fs_window(RS(b1,IDS_SHELL)))
...@@ -2403,7 +2403,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM ...@@ -2403,7 +2403,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
} }
static TCHAR g_pos_names[COLUMNS][20] = { static WCHAR g_pos_names[COLUMNS][20] = {
{'\0'} /* symbol */ {'\0'} /* symbol */
}; };
...@@ -2686,7 +2686,7 @@ static BOOL pattern_match(LPCTSTR str, LPCTSTR pattern) ...@@ -2686,7 +2686,7 @@ static BOOL pattern_match(LPCTSTR str, LPCTSTR pattern)
static BOOL pattern_imatch(LPCTSTR str, LPCTSTR pattern) static BOOL pattern_imatch(LPCTSTR str, LPCTSTR pattern)
{ {
TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; WCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
lstrcpyW(b1, str); lstrcpyW(b1, str);
lstrcpyW(b2, pattern); lstrcpyW(b2, pattern);
...@@ -2782,10 +2782,10 @@ static int insert_entries(Pane* pane, Entry* dir, LPCTSTR pattern, int filter_fl ...@@ -2782,10 +2782,10 @@ static int insert_entries(Pane* pane, Entry* dir, LPCTSTR pattern, int filter_fl
static void format_bytes(LPTSTR buffer, LONGLONG bytes) static void format_bytes(LPTSTR buffer, LONGLONG bytes)
{ {
static const TCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'}; static const WCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'};
static const TCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'}; static const WCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'};
static const TCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'}; static const WCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'};
static const TCHAR sFmtB[] = {'%', 'u', 0}; static const WCHAR sFmtB[] = {'%', 'u', 0};
float fBytes = (float)bytes; float fBytes = (float)bytes;
...@@ -2802,7 +2802,7 @@ static void format_bytes(LPTSTR buffer, LONGLONG bytes) ...@@ -2802,7 +2802,7 @@ static void format_bytes(LPTSTR buffer, LONGLONG bytes)
static void set_space_status(void) static void set_space_status(void)
{ {
ULARGE_INTEGER ulFreeBytesToCaller, ulTotalBytes, ulFreeBytes; ULARGE_INTEGER ulFreeBytesToCaller, ulTotalBytes, ulFreeBytes;
TCHAR fmt[64], b1[64], b2[64], buffer[BUFFER_LEN]; WCHAR fmt[64], b1[64], b2[64], buffer[BUFFER_LEN];
if (GetDiskFreeSpaceExW(NULL, &ulFreeBytesToCaller, &ulTotalBytes, &ulFreeBytes)) { if (GetDiskFreeSpaceExW(NULL, &ulFreeBytesToCaller, &ulTotalBytes, &ulFreeBytes)) {
format_bytes(b1, ulFreeBytesToCaller.QuadPart); format_bytes(b1, ulFreeBytesToCaller.QuadPart);
...@@ -2819,7 +2819,7 @@ static WNDPROC g_orgTreeWndProc; ...@@ -2819,7 +2819,7 @@ static WNDPROC g_orgTreeWndProc;
static void create_tree_window(HWND parent, Pane* pane, UINT id, UINT id_header, LPCTSTR pattern, int filter_flags) static void create_tree_window(HWND parent, Pane* pane, UINT id, UINT id_header, LPCTSTR pattern, int filter_flags)
{ {
static const TCHAR sListBox[] = {'L','i','s','t','B','o','x','\0'}; static const WCHAR sListBox[] = {'L','i','s','t','B','o','x','\0'};
static int s_init = 0; static int s_init = 0;
Entry* entry = pane->root; Entry* entry = pane->root;
...@@ -2858,7 +2858,7 @@ static void InitChildWindow(ChildWnd* child) ...@@ -2858,7 +2858,7 @@ static void InitChildWindow(ChildWnd* child)
} }
static void format_date(const FILETIME* ft, TCHAR* buffer, int visible_cols) static void format_date(const FILETIME* ft, WCHAR* buffer, int visible_cols)
{ {
SYSTEMTIME systime; SYSTEMTIME systime;
FILETIME lft; FILETIME lft;
...@@ -2952,7 +2952,7 @@ static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str ...@@ -2952,7 +2952,7 @@ static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str
int x = dis->rcItem.left; int x = dis->rcItem.left;
RECT rt; RECT rt;
LPCTSTR s = str; LPCTSTR s = str;
TCHAR b[128]; WCHAR b[128];
LPTSTR d = b; LPTSTR d = b;
int pos; int pos;
...@@ -2981,7 +2981,7 @@ static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str ...@@ -2981,7 +2981,7 @@ static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str
static BOOL is_exe_file(LPCTSTR ext) static BOOL is_exe_file(LPCTSTR ext)
{ {
static const TCHAR executable_extensions[][4] = { static const WCHAR executable_extensions[][4] = {
{'C','O','M','\0'}, {'C','O','M','\0'},
{'E','X','E','\0'}, {'E','X','E','\0'},
{'B','A','T','\0'}, {'B','A','T','\0'},
...@@ -2994,8 +2994,8 @@ static BOOL is_exe_file(LPCTSTR ext) ...@@ -2994,8 +2994,8 @@ static BOOL is_exe_file(LPCTSTR ext)
{'\0'} {'\0'}
}; };
TCHAR ext_buffer[_MAX_EXT]; WCHAR ext_buffer[_MAX_EXT];
const TCHAR (*p)[4]; const WCHAR (*p)[4];
LPCTSTR s; LPCTSTR s;
LPTSTR d; LPTSTR d;
...@@ -3035,7 +3035,7 @@ static enum FILE_TYPE get_file_type(LPCTSTR filename) ...@@ -3035,7 +3035,7 @@ static enum FILE_TYPE get_file_type(LPCTSTR filename)
static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol) static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol)
{ {
TCHAR buffer[BUFFER_LEN]; WCHAR buffer[BUFFER_LEN];
DWORD attrs; DWORD attrs;
int visible_cols = pane->visible_cols; int visible_cols = pane->visible_cols;
COLORREF bkcolor, textcolor; COLORREF bkcolor, textcolor;
...@@ -3273,8 +3273,8 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi ...@@ -3273,8 +3273,8 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi
#ifndef _NO_EXTENSIONS #ifndef _NO_EXTENSIONS
if (entry->bhfi_valid) { if (entry->bhfi_valid) {
if (visible_cols & COL_INDEX) { if (visible_cols & COL_INDEX) {
static const TCHAR fmtlow[] = {'%','X',0}; static const WCHAR fmtlow[] = {'%','X',0};
static const TCHAR fmthigh[] = {'%','X','%','0','8','X',0}; static const WCHAR fmthigh[] = {'%','X','%','0','8','X',0};
if (entry->bhfi.nFileIndexHigh) if (entry->bhfi.nFileIndexHigh)
wsprintfW(buffer, fmthigh, wsprintfW(buffer, fmthigh,
...@@ -3307,10 +3307,10 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi ...@@ -3307,10 +3307,10 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi
/* show file attributes */ /* show file attributes */
if (visible_cols & COL_ATTRIBUTES) { if (visible_cols & COL_ATTRIBUTES) {
#ifdef _NO_EXTENSIONS #ifdef _NO_EXTENSIONS
static const TCHAR s4Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'}; static const WCHAR s4Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
lstrcpyW(buffer, s4Tabs); lstrcpyW(buffer, s4Tabs);
#else #else
static const TCHAR s11Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'}; static const WCHAR s11Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
lstrcpyW(buffer, s11Tabs); lstrcpyW(buffer, s11Tabs);
#endif #endif
...@@ -3342,7 +3342,7 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi ...@@ -3342,7 +3342,7 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi
/*TODO /*TODO
if (flags.security) { if (flags.security) {
static const TCHAR sSecTabs[] = { static const WCHAR sSecTabs[] = {
' ','\t',' ','\t',' ','\t',' ', ' ','\t',' ','\t',' ','\t',' ',
' ','\t',' ', ' ','\t',' ',
' ','\t',' ','\t',' ','\t',' ', ' ','\t',' ','\t',' ','\t',' ',
...@@ -3527,7 +3527,7 @@ static LRESULT pane_notify(Pane* pane, NMHDR* pnmh) ...@@ -3527,7 +3527,7 @@ static LRESULT pane_notify(Pane* pane, NMHDR* pnmh)
static void scan_entry(ChildWnd* child, Entry* entry, int idx, HWND hwnd) static void scan_entry(ChildWnd* child, Entry* entry, int idx, HWND hwnd)
{ {
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
HCURSOR old_cursor = SetCursor(LoadCursorW(0, (LPCWSTR)IDC_WAIT)); HCURSOR old_cursor = SetCursor(LoadCursorW(0, (LPCWSTR)IDC_WAIT));
/* delete sub entries in left pane */ /* delete sub entries in left pane */
...@@ -3654,7 +3654,7 @@ static void refresh_right_pane(ChildWnd* child) ...@@ -3654,7 +3654,7 @@ static void refresh_right_pane(ChildWnd* child)
static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd) static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd)
{ {
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
if (!entry) if (!entry)
return; return;
...@@ -3685,7 +3685,7 @@ static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd) ...@@ -3685,7 +3685,7 @@ static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd)
static void refresh_child(ChildWnd* child) static void refresh_child(ChildWnd* child)
{ {
TCHAR path[MAX_PATH], drv[_MAX_DRIVE+1]; WCHAR path[MAX_PATH], drv[_MAX_DRIVE+1];
Entry* entry; Entry* entry;
int idx; int idx;
...@@ -3726,7 +3726,7 @@ static void create_drive_bar(void) ...@@ -3726,7 +3726,7 @@ static void create_drive_bar(void)
{ {
TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}; TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0};
#ifndef _NO_EXTENSIONS #ifndef _NO_EXTENSIONS
TCHAR b1[BUFFER_LEN]; WCHAR b1[BUFFER_LEN];
#endif #endif
int btn = 1; int btn = 1;
PTSTR p; PTSTR p;
...@@ -3769,7 +3769,7 @@ static void create_drive_bar(void) ...@@ -3769,7 +3769,7 @@ static void create_drive_bar(void)
for(p=Globals.drives; *p; ) { for(p=Globals.drives; *p; ) {
#ifdef _NO_EXTENSIONS #ifdef _NO_EXTENSIONS
/* insert drive letter */ /* insert drive letter */
TCHAR b[3] = {tolower(*p)}; WCHAR b[3] = {tolower(*p)};
SendMessageW(Globals.hdrivebar, TB_ADDSTRINGW, 0, (LPARAM)b); SendMessageW(Globals.hdrivebar, TB_ADDSTRINGW, 0, (LPARAM)b);
#endif #endif
switch(GetDriveTypeW(p)) { switch(GetDriveTypeW(p)) {
...@@ -3820,7 +3820,7 @@ static BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow) ...@@ -3820,7 +3820,7 @@ static BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow)
static BOOL launch_entry(Entry* entry, HWND hwnd, UINT nCmdShow) static BOOL launch_entry(Entry* entry, HWND hwnd, UINT nCmdShow)
{ {
TCHAR cmd[MAX_PATH]; WCHAR cmd[MAX_PATH];
#ifdef _SHELL_FOLDERS #ifdef _SHELL_FOLDERS
if (entry->etype == ET_SHELL) { if (entry->etype == ET_SHELL) {
...@@ -3990,7 +3990,7 @@ static BOOL is_directory(LPCTSTR target) ...@@ -3990,7 +3990,7 @@ static BOOL is_directory(LPCTSTR target)
static BOOL prompt_target(Pane* pane, LPTSTR source, LPTSTR target) static BOOL prompt_target(Pane* pane, LPTSTR source, LPTSTR target)
{ {
TCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
int len; int len;
get_path(pane->cur, path); get_path(pane->cur, path);
...@@ -4014,8 +4014,8 @@ static BOOL prompt_target(Pane* pane, LPTSTR source, LPTSTR target) ...@@ -4014,8 +4014,8 @@ static BOOL prompt_target(Pane* pane, LPTSTR source, LPTSTR target)
/* If the target already exists as directory, create a new target below this. */ /* If the target already exists as directory, create a new target below this. */
if (is_directory(path)) { if (is_directory(path)) {
TCHAR fname[_MAX_FNAME], ext[_MAX_EXT]; WCHAR fname[_MAX_FNAME], ext[_MAX_EXT];
static const TCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'}; static const WCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'};
_wsplitpath(source, NULL, NULL, fname, ext); _wsplitpath(source, NULL, NULL, fname, ext);
...@@ -4305,7 +4305,7 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM ...@@ -4305,7 +4305,7 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
break; break;
case ID_FILE_MOVE: { case ID_FILE_MOVE: {
TCHAR source[BUFFER_LEN], target[BUFFER_LEN]; WCHAR source[BUFFER_LEN], target[BUFFER_LEN];
if (prompt_target(pane, source, target)) { if (prompt_target(pane, source, target)) {
SHFILEOPSTRUCT shfo = {hwnd, FO_MOVE, source, target}; SHFILEOPSTRUCT shfo = {hwnd, FO_MOVE, source, target};
...@@ -4319,7 +4319,7 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM ...@@ -4319,7 +4319,7 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
break;} break;}
case ID_FILE_COPY: { case ID_FILE_COPY: {
TCHAR source[BUFFER_LEN], target[BUFFER_LEN]; WCHAR source[BUFFER_LEN], target[BUFFER_LEN];
if (prompt_target(pane, source, target)) { if (prompt_target(pane, source, target)) {
SHFILEOPSTRUCT shfo = {hwnd, FO_COPY, source, target}; SHFILEOPSTRUCT shfo = {hwnd, FO_COPY, source, target};
...@@ -4333,7 +4333,7 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM ...@@ -4333,7 +4333,7 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
break;} break;}
case ID_FILE_DELETE: { case ID_FILE_DELETE: {
TCHAR path[BUFFER_LEN]; WCHAR path[BUFFER_LEN];
SHFILEOPSTRUCT shfo = {hwnd, FO_DELETE, path, NULL, FOF_ALLOWUNDO}; SHFILEOPSTRUCT shfo = {hwnd, FO_DELETE, path, NULL, FOF_ALLOWUNDO};
get_path(pane->cur, path); get_path(pane->cur, path);
...@@ -4530,7 +4530,7 @@ static LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM ...@@ -4530,7 +4530,7 @@ static LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
static void InitInstance(HINSTANCE hinstance) static void InitInstance(HINSTANCE hinstance)
{ {
static const TCHAR sFont[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'}; static const WCHAR sFont[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
WNDCLASSEX wcFrame; WNDCLASSEX wcFrame;
WNDCLASS wcChild; WNDCLASS wcChild;
...@@ -4619,9 +4619,9 @@ static void InitInstance(HINSTANCE hinstance) ...@@ -4619,9 +4619,9 @@ static void InitInstance(HINSTANCE hinstance)
static BOOL show_frame(HWND hwndParent, int cmdshow, LPCTSTR path) static BOOL show_frame(HWND hwndParent, int cmdshow, LPCTSTR path)
{ {
static const TCHAR sMDICLIENT[] = {'M','D','I','C','L','I','E','N','T','\0'}; static const WCHAR sMDICLIENT[] = {'M','D','I','C','L','I','E','N','T','\0'};
TCHAR buffer[MAX_PATH], b1[BUFFER_LEN]; WCHAR buffer[MAX_PATH], b1[BUFFER_LEN];
ChildWnd* child; ChildWnd* child;
HMENU hMenuFrame, hMenuWindow; HMENU hMenuFrame, hMenuWindow;
windowOptions opts; windowOptions opts;
...@@ -4723,8 +4723,8 @@ static BOOL show_frame(HWND hwndParent, int cmdshow, LPCTSTR path) ...@@ -4723,8 +4723,8 @@ static BOOL show_frame(HWND hwndParent, int cmdshow, LPCTSTR path)
if (child->hwnd && path && path[0]) if (child->hwnd && path && path[0])
{ {
int index,count; int index,count;
TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT]; WCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
TCHAR fullname[_MAX_FNAME+_MAX_EXT+1]; WCHAR fullname[_MAX_FNAME+_MAX_EXT+1];
memset(name,0,sizeof(name)); memset(name,0,sizeof(name));
memset(name,0,sizeof(ext)); memset(name,0,sizeof(ext));
...@@ -4771,7 +4771,7 @@ static int g_foundPrevInstance = 0; ...@@ -4771,7 +4771,7 @@ static int g_foundPrevInstance = 0;
static BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lparam) static BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lparam)
{ {
TCHAR cls[128]; WCHAR cls[128];
GetClassName(hwnd, cls, 128); GetClassName(hwnd, cls, 128);
...@@ -4837,7 +4837,7 @@ int APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE previnstance, LPSTR cmdline, ...@@ -4837,7 +4837,7 @@ int APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE previnstance, LPSTR cmdline,
#endif #endif
{ /* convert ANSI cmdline into WCS path string */ { /* convert ANSI cmdline into WCS path string */
TCHAR buffer[MAX_PATH]; WCHAR buffer[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, cmdline, -1, buffer, MAX_PATH); MultiByteToWideChar(CP_ACP, 0, cmdline, -1, buffer, MAX_PATH);
winefile_main(hinstance, cmdshow, buffer); winefile_main(hinstance, cmdshow, buffer);
} }
......
...@@ -128,11 +128,11 @@ typedef struct ...@@ -128,11 +128,11 @@ typedef struct
HWND hdrivebar; HWND hdrivebar;
HFONT hfont; HFONT hfont;
TCHAR num_sep; WCHAR num_sep;
SIZE spaceSize; SIZE spaceSize;
HIMAGELIST himl; HIMAGELIST himl;
TCHAR drives[BUFFER_LEN]; WCHAR drives[BUFFER_LEN];
BOOL prescan_node; /*TODO*/ BOOL prescan_node; /*TODO*/
BOOL saveSettings; BOOL saveSettings;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment