ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
270 discussions
Start a n
N
ew thread
[khornicek] 43186: - remove wgl* stubs added in r512, they don't belong here
by khornicek@svn.reactos.org
Author: khornicek Date: Sun Sep 27 14:41:16 2009 New Revision: 43186 URL:
http://svn.reactos.org/svn/reactos?rev=43186&view=rev
Log: - remove wgl* stubs added in r512, they don't belong here Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/dll/win32/gdi32/misc/stubsa.c trunk/reactos/dll/win32/gdi32/misc/stubsw.c Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Sun Sep 27 14:41:16 2009 @@ -677,241 +677,6 @@ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } - - -/* - * @unimplemented - */ -BOOL -WINAPI -wglCopyContext( - HGLRC hglrcSrc, - HGLRC hglrcDst, - UINT mask - ) -{ - if(!hglrcSrc || !hglrcDst) - return FALSE; - - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -HGLRC -WINAPI -wglCreateContext( - HDC hDc - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/* - * @unimplemented - */ -HGLRC -WINAPI -wglCreateLayerContext( - HDC hDc, - int a1 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -wglDeleteContext( - HGLRC hglrc - ) -{ - if (hglrc == NULL) return FALSE; - - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -HGLRC -WINAPI -wglGetCurrentContext(VOID) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/* - * @unimplemented - */ -HDC -WINAPI -wglGetCurrentDC(VOID) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/* - * @unimplemented - */ -PROC -WINAPI -wglGetProcAddress( - LPCSTR func - ) -{ - if(!func) return NULL; - - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -wglMakeCurrent( - HDC a0, - HGLRC a1 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -wglShareLists( - HGLRC hglrc1, - HGLRC hglrc2 - ) -{ - if (hglrc1 == NULL) return FALSE; - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -wglDescribeLayerPlane( - HDC a0, - int a1, - int a2, - UINT a3, - LPLAYERPLANEDESCRIPTOR a4 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -int -WINAPI -wglSetLayerPaletteEntries( - HDC a0, - int a1, - int a2, - int a3, - CONST COLORREF *a4 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/* - * @unimplemented - */ -int -WINAPI -wglGetLayerPaletteEntries( - HDC a0, - int a1, - int a2, - int a3, - COLORREF *a4 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -wglRealizeLayerPalette( - HDC a0, - int a1, - BOOL a2 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -wglSwapLayerBuffers( - HDC a0, - UINT a1 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - /* === AFTER THIS POINT I GUESS... ========= * (based on stack size in Norlander's .def) Modified: trunk/reactos/dll/win32/gdi32/misc/stubsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubsa.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubsa.c [iso-8859-1] Sun Sep 27 14:41:16 2009 @@ -124,46 +124,6 @@ */ BOOL WINAPI -wglUseFontBitmapsA( - HDC a0, - DWORD a1, - DWORD a2, - DWORD a3 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -wglUseFontOutlinesA( - HDC a0, - DWORD a1, - DWORD a2, - DWORD a3, - FLOAT a4, - FLOAT a5, - int a6, - LPGLYPHMETRICSFLOAT a7 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI UpdateICMRegKeyA( DWORD a0, LPSTR a1, Modified: trunk/reactos/dll/win32/gdi32/misc/stubsw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubsw.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubsw.c [iso-8859-1] Sun Sep 27 14:41:16 2009 @@ -112,46 +112,6 @@ */ BOOL WINAPI -wglUseFontBitmapsW( - HDC a0, - DWORD a1, - DWORD a2, - DWORD a3 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -wglUseFontOutlinesW( - HDC a0, - DWORD a1, - DWORD a2, - DWORD a3, - FLOAT a4, - FLOAT a5, - int a6, - LPGLYPHMETRICSFLOAT a7 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI UpdateICMRegKeyW( DWORD a0, LPWSTR a1,
15 years, 2 months
1
0
0
0
[dreimer] 43185: Sync WinFile to Wine 1.1.30
by dreimer@svn.reactos.org
Author: dreimer Date: Sun Sep 27 14:09:24 2009 New Revision: 43185 URL:
http://svn.reactos.org/svn/reactos?rev=43185&view=rev
Log: Sync WinFile to Wine 1.1.30 Modified: trunk/rosapps/applications/winfile/It.rc trunk/rosapps/applications/winfile/splitpath.c trunk/rosapps/applications/winfile/winefile.c trunk/rosapps/applications/winfile/winefile.h Modified: trunk/rosapps/applications/winfile/It.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/It.rc…
============================================================================== --- trunk/rosapps/applications/winfile/It.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/It.rc [iso-8859-1] Sun Sep 27 14:09:24 2009 @@ -164,7 +164,7 @@ IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select destination" +CAPTION "Seleziona destinazione" FONT 8, "MS Shell Dlg" { CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 @@ -177,6 +177,6 @@ STRINGTABLE { - IDS_FONT_SEL_DLG_NAME "Applica le impostazioni dei font" - IDS_FONT_SEL_ERROR "Si è verificato un errore durante la selezione del nuovo font." + IDS_FONT_SEL_DLG_NAME "Applica le impostazioni dei caratteri" + IDS_FONT_SEL_ERROR "Si è verificato un errore durante la selezione del nuovo carattere." } Modified: trunk/rosapps/applications/winfile/splitpath.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/split…
============================================================================== --- trunk/rosapps/applications/winfile/splitpath.c [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/splitpath.c [iso-8859-1] Sun Sep 27 14:09:24 2009 @@ -18,9 +18,6 @@ #include "winefile.h" - -#ifdef __WINE__ -#ifdef UNICODE void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext) { @@ -75,81 +72,23 @@ } } -#else /* UNICODE */ - -void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext) -{ - const CHAR* end; /* end of processed string */ - const CHAR* p; /* search pointer */ - const CHAR* s; /* copy pointer */ - - /* extract drive name */ - if (path[0] && path[1]==':') { - if (drv) { - *drv++ = *path++; - *drv++ = *path++; - *drv = '\0'; - } - } else if (drv) - *drv = '\0'; - - /* search for end of string or stream separator */ - for(end=path; *end && *end!=':'; ) - end++; - - /* search for begin of file extension */ - for(p=end; p>path && *--p!='\\' && *p!='/'; ) - if (*p == '.') { - end = p; - break; - } - - if (ext) - for(s=end; (*ext=*s++); ) - ext++; - - /* search for end of directory name */ - for(p=end; p>path; ) - if (*--p=='\\' || *p=='/') { - p++; - break; - } - - if (name) { - for(s=p; s<end; ) - *name++ = *s++; - - *name = '\0'; - } - - if (dir) { - for(s=path; s<p; ) - *dir++ = *s++; - - *dir = '\0'; - } -} - -#endif /* UNICODE */ -#endif /* __WINE__ */ - /* void main() // test splipath() { - 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]; - _tsplitpath(L"x\\y", drv, dir, name, ext); - _tsplitpath(L"x\\", drv, dir, name, ext); - _tsplitpath(L"\\x", drv, dir, name, ext); - _tsplitpath(L"x", drv, dir, name, ext); - _tsplitpath(L"", drv, dir, name, ext); - _tsplitpath(L".x", drv, dir, name, ext); - _tsplitpath(L":x", drv, dir, name, ext); - _tsplitpath(L"a:x", drv, dir, name, ext); - _tsplitpath(L"a.b:x", drv, dir, name, ext); - _tsplitpath(L"W:\\/\\abc/Z:~", drv, dir, name, ext); - _tsplitpath(L"abc.EFGH:12345", drv, dir, name, ext); - _tsplitpath(L"
C:/dos/command.com
", drv, dir, name, ext); + _wsplitpath(L"x\\y", drv, dir, name, ext); + _wsplitpath(L"x\\", drv, dir, name, ext); + _wsplitpath(L"\\x", drv, dir, name, ext); + _wsplitpath(L"x", drv, dir, name, ext); + _wsplitpath(L"", drv, dir, name, ext); + _wsplitpath(L".x", drv, dir, name, ext); + _wsplitpath(L":x", drv, dir, name, ext); + _wsplitpath(L"a:x", drv, dir, name, ext); + _wsplitpath(L"a.b:x", drv, dir, name, ext); + _wsplitpath(L"W:\\/\\abc/Z:~", drv, dir, name, ext); + _wsplitpath(L"abc.EFGH:12345", drv, dir, name, ext); + _wsplitpath(L"
C:/dos/command.com
", drv, dir, name, ext); } */ Modified: trunk/rosapps/applications/winfile/winefile.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/winef…
============================================================================== --- trunk/rosapps/applications/winfile/winefile.c [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/winefile.c [iso-8859-1] Sun Sep 27 14:09:24 2009 @@ -86,7 +86,7 @@ BOOL scanned; int level; - WIN32_FIND_DATA data; + WIN32_FIND_DATAW data; #ifndef _NO_EXTENSIONS BY_HANDLE_FILE_INFORMATION bhfi; @@ -102,9 +102,9 @@ typedef struct { Entry entry; - TCHAR path[MAX_PATH]; - TCHAR volname[_MAX_FNAME]; - TCHAR fs[_MAX_DIR]; + WCHAR path[MAX_PATH]; + WCHAR volname[_MAX_FNAME]; + WCHAR fs[_MAX_DIR]; DWORD drive_type; DWORD fs_flags; } Root; @@ -160,8 +160,8 @@ int split_pos; BOOL header_wdths_ok; - TCHAR path[MAX_PATH]; - TCHAR filter_pattern[MAX_PATH]; + WCHAR path[MAX_PATH]; + WCHAR filter_pattern[MAX_PATH]; int filter_flags; Root root; @@ -170,12 +170,12 @@ -static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd); +static void read_directory(Entry* dir, LPCWSTR path, SORT_ORDER sortOrder, HWND hwnd); static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd); static void refresh_child(ChildWnd* child); static void refresh_drives(void); -static void get_path(Entry* dir, PTSTR path); -static void format_date(const FILETIME* ft, TCHAR* buffer, int visible_cols); +static void get_path(Entry* dir, PWSTR path); +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 ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam); @@ -188,14 +188,14 @@ static int last_split; /* some common string constants */ -static const TCHAR sEmpty[] = {'\0'}; +static const WCHAR sEmpty[] = {'\0'}; static const WCHAR sSpace[] = {' ', '\0'}; -static const TCHAR sNumFmt[] = {'%','d','\0'}; -static const TCHAR sQMarks[] = {'?','?','?','\0'}; +static const WCHAR sNumFmt[] = {'%','d','\0'}; +static const WCHAR sQMarks[] = {'?','?','?','\0'}; /* window class names */ -static const TCHAR 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 sWINEFILEFRAME[] = {'W','F','S','_','F','r','a','m','e','\0'}; +static const WCHAR sWINEFILETREE[] = {'W','F','S','_','T','r','e','e','\0'}; static void format_longlong(LPWSTR ret, ULONGLONG val) { @@ -211,9 +211,9 @@ /* load resource string */ -static LPTSTR load_string(LPTSTR buffer, DWORD size, UINT id) -{ - LoadString(Globals.hInstance, id, buffer, size); +static LPWSTR load_string(LPWSTR buffer, DWORD size, UINT id) +{ + LoadStringW(Globals.hInstance, id, buffer, size); return buffer; } @@ -223,27 +223,27 @@ /* display error message for the specified WIN32 error code */ static void display_error(HWND hwnd, DWORD error) { - TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; - PTSTR msg; - - if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, - 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL)) - MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK); + WCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; + PWSTR msg; + + if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PWSTR)&msg, 0, NULL)) + MessageBoxW(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK); else - MessageBox(hwnd, RS(b1,IDS_ERROR), RS(b2,IDS_WINEFILE), MB_OK); + MessageBoxW(hwnd, RS(b1,IDS_ERROR), RS(b2,IDS_WINEFILE), MB_OK); LocalFree(msg); } -/* display network error message using WNetGetLastError() */ +/* display network error message using WNetGetLastErrorW() */ 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; - if (WNetGetLastError(&error, msg, BUFFER_LEN, provider, BUFFER_LEN) == NO_ERROR) - MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK); + if (WNetGetLastErrorW(&error, msg, BUFFER_LEN, provider, BUFFER_LEN) == NO_ERROR) + MessageBoxW(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK); } static inline BOOL get_check(HWND hwnd, INT id) @@ -263,7 +263,7 @@ LOGFONTW lFont; HDC hdc = GetDC(hwnd); - chFont.lStructSize = sizeof(CHOOSEFONT); + chFont.lStructSize = sizeof(CHOOSEFONTW); chFont.hwndOwner = hwnd; chFont.hDC = NULL; chFont.lpLogFont = &lFont; @@ -360,20 +360,20 @@ } -static void read_directory_win(Entry* dir, LPCTSTR path) +static void read_directory_win(Entry* dir, LPCWSTR path) { Entry* first_entry = NULL; Entry* last = NULL; Entry* entry; int level = dir->level + 1; - WIN32_FIND_DATA w32fd; + WIN32_FIND_DATAW w32fd; HANDLE hFind; #ifndef _NO_EXTENSIONS HANDLE hFile; #endif - TCHAR buffer[MAX_PATH], *p; + WCHAR buffer[MAX_PATH], *p; for(p=buffer; *path; ) *p++ = *path++; @@ -381,14 +381,14 @@ p[0] = '*'; p[1] = '\0'; - hFind = FindFirstFile(buffer, &w32fd); + hFind = FindFirstFileW(buffer, &w32fd); if (hFind != INVALID_HANDLE_VALUE) { do { #ifdef _NO_EXTENSIONS /* hide directory entry "." */ if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - LPCTSTR name = w32fd.cFileName; + LPCWSTR name = w32fd.cFileName; if (name[0]=='.' && name[1]=='\0') continue; @@ -402,7 +402,7 @@ if (last) last->next = entry; - memcpy(&entry->data, &w32fd, sizeof(WIN32_FIND_DATA)); + memcpy(&entry->data, &w32fd, sizeof(WIN32_FIND_DATAW)); entry->down = NULL; entry->up = dir; entry->expanded = FALSE; @@ -413,9 +413,9 @@ entry->etype = ET_WINDOWS; entry->bhfi_valid = FALSE; - lstrcpy(p, entry->data.cFileName); - - hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, + lstrcpyW(p, entry->data.cFileName); + + hFile = CreateFileW(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); if (hFile != INVALID_HANDLE_VALUE) { @@ -427,7 +427,7 @@ #endif last = entry; - } while(FindNextFile(hFind, &w32fd)); + } while(FindNextFileW(hFind, &w32fd)); if (last) last->next = NULL; @@ -440,13 +440,13 @@ } -static Entry* find_entry_win(Entry* dir, LPCTSTR name) +static Entry* find_entry_win(Entry* dir, LPCWSTR name) { Entry* entry; for(entry=dir->down; entry; entry=entry->next) { - LPCTSTR p = name; - LPCTSTR q = entry->data.cFileName; + LPCWSTR p = name; + LPCWSTR q = entry->data.cFileName; do { if (!*p || *p == '\\' || *p == '/') @@ -466,14 +466,14 @@ } -static Entry* read_tree_win(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd) -{ - TCHAR buffer[MAX_PATH]; +static Entry* read_tree_win(Root* root, LPCWSTR path, SORT_ORDER sortOrder, HWND hwnd) +{ + WCHAR buffer[MAX_PATH]; Entry* entry = &root->entry; - LPCTSTR s = path; - PTSTR d = buffer; - - HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT)); + LPCWSTR s = path; + PWSTR d = buffer; + + HCURSOR old_cursor = SetCursor(LoadCursorW(0, (LPCWSTR)IDC_WAIT)); #ifndef _NO_EXTENSIONS entry->etype = ET_WINDOWS; @@ -527,7 +527,7 @@ return SystemTimeToFileTime(&stime, ftime); } -static void read_directory_unix(Entry* dir, LPCTSTR path) +static void read_directory_unix(Entry* dir, LPCWSTR path) { Entry* first_entry = NULL; Entry* last = NULL; @@ -535,14 +535,9 @@ DIR* pdir; int level = dir->level + 1; -#ifdef UNICODE char cpath[MAX_PATH]; WideCharToMultiByte(CP_UNIXCP, 0, path, -1, cpath, MAX_PATH, NULL, NULL); -#else - const char* cpath = path; -#endif - pdir = opendir(cpath); if (pdir) { @@ -569,11 +564,7 @@ entry->etype = ET_UNIX; strcpy(p, ent->d_name); -#ifdef UNICODE MultiByteToWideChar(CP_UNIXCP, 0, p, -1, entry->data.cFileName, MAX_PATH); -#else - lstrcpy(entry->data.cFileName, p); -#endif if (!stat(buffer, &st)) { entry->data.dwFileAttributes = p[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0; @@ -619,13 +610,13 @@ dir->scanned = TRUE; } -static Entry* find_entry_unix(Entry* dir, LPCTSTR name) +static Entry* find_entry_unix(Entry* dir, LPCWSTR name) { Entry* entry; for(entry=dir->down; entry; entry=entry->next) { - LPCTSTR p = name; - LPCTSTR q = entry->data.cFileName; + LPCWSTR p = name; + LPCWSTR q = entry->data.cFileName; do { if (!*p || *p == '/') @@ -636,14 +627,14 @@ return 0; } -static Entry* read_tree_unix(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd) -{ - TCHAR buffer[MAX_PATH]; +static Entry* read_tree_unix(Root* root, LPCWSTR path, SORT_ORDER sortOrder, HWND hwnd) +{ + WCHAR buffer[MAX_PATH]; Entry* entry = &root->entry; - LPCTSTR s = path; - PTSTR d = buffer; - - HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT)); + LPCWSTR s = path; + PWSTR d = buffer; + + HCURSOR old_cursor = SetCursor(LoadCursorW(0, (LPCWSTR)IDC_WAIT)); entry->etype = ET_UNIX; @@ -678,68 +669,11 @@ #ifdef _SHELL_FOLDERS -#ifdef UNICODE -#define get_strret get_strretW -#define path_from_pidl path_from_pidlW -#else -#define get_strret get_strretA -#define path_from_pidl path_from_pidlA -#endif - - static void free_strret(STRRET* str) { if (str->uType == STRRET_WSTR) IMalloc_Free(Globals.iMalloc, str->UNION_MEMBER(pOleStr)); } - - -#ifndef UNICODE - -static LPSTR strcpyn(LPSTR dest, LPCSTR source, size_t count) -{ - LPCSTR s; - LPSTR d = dest; - - for(s=source; count&&(*d++=*s++); ) - count--; - - return dest; -} - -static void get_strretA(STRRET* str, const SHITEMID* shiid, LPSTR buffer, int len) -{ - switch(str->uType) { - case STRRET_WSTR: - WideCharToMultiByte(CP_ACP, 0, str->UNION_MEMBER(pOleStr), -1, buffer, len, NULL, NULL); - break; - - case STRRET_OFFSET: - strcpyn(buffer, (LPCSTR)shiid+str->UNION_MEMBER(uOffset), len); - break; - - case STRRET_CSTR: - strcpyn(buffer, str->UNION_MEMBER(cStr), len); - } -} - -static HRESULT path_from_pidlA(IShellFolder* folder, LPITEMIDLIST pidl, LPSTR buffer, int len) -{ - STRRET str; - - /* SHGDN_FORPARSING: get full path of id list */ - HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str); - - if (SUCCEEDED(hr)) { - get_strretA(&str, &pidl->mkid, buffer, len); - free_strret(&str); - } else - buffer[0] = '\0'; - - return hr; -} - -#endif static LPWSTR wcscpyn(LPWSTR dest, LPCWSTR source, size_t count) { @@ -769,28 +703,11 @@ } -static HRESULT name_from_pidl(IShellFolder* folder, LPITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags) +static HRESULT name_from_pidl(IShellFolder* folder, LPITEMIDLIST pidl, LPWSTR buffer, int len, SHGDNF flags) { STRRET str; HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, flags, &str); - - if (SUCCEEDED(hr)) { - get_strret(&str, &pidl->mkid, buffer, len); - free_strret(&str); - } else - buffer[0] = '\0'; - - return hr; -} - - -static HRESULT path_from_pidlW(IShellFolder* folder, LPITEMIDLIST pidl, LPWSTR buffer, int len) -{ - STRRET str; - - /* SHGDN_FORPARSING: get full path of id list */ - HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str); if (SUCCEEDED(hr)) { get_strretW(&str, &pidl->mkid, buffer, len); @@ -802,20 +719,31 @@ } +static HRESULT path_from_pidlW(IShellFolder* folder, LPITEMIDLIST pidl, LPWSTR buffer, int len) +{ + STRRET str; + + /* SHGDN_FORPARSING: get full path of id list */ + HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str); + + if (SUCCEEDED(hr)) { + get_strretW(&str, &pidl->mkid, buffer, len); + free_strret(&str); + } else + buffer[0] = '\0'; + + return hr; +} + + /* create an item id list from a file system path */ -static LPITEMIDLIST get_path_pidl(LPTSTR path, HWND hwnd) +static LPITEMIDLIST get_path_pidl(LPWSTR path, HWND hwnd) { LPITEMIDLIST pidl; HRESULT hr; ULONG len; - -#ifdef UNICODE LPWSTR buffer = path; -#else - WCHAR buffer[MAX_PATH]; - MultiByteToWideChar(CP_ACP, 0, path, -1, buffer, MAX_PATH); -#endif hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL); if (FAILED(hr)) @@ -839,7 +767,7 @@ return idl; } else if (entry->etype == ET_WINDOWS) { - TCHAR path[MAX_PATH]; + WCHAR path[MAX_PATH]; get_path(entry, path); @@ -853,10 +781,10 @@ static HICON extract_icon(IShellFolder* folder, LPCITEMIDLIST pidl) { - IExtractIcon* pExtract; - - if (SUCCEEDED(IShellFolder_GetUIObjectOf(folder, 0, 1, (LPCITEMIDLIST*)&pidl, &IID_IExtractIcon, 0, (LPVOID*)&pExtract))) { - TCHAR path[_MAX_PATH]; + IExtractIconW* pExtract; + + if (SUCCEEDED(IShellFolder_GetUIObjectOf(folder, 0, 1, (LPCITEMIDLIST*)&pidl, &IID_IExtractIconW, 0, (LPVOID*)&pExtract))) { + WCHAR path[_MAX_PATH]; unsigned flags; HICON hicon; int idx; @@ -866,7 +794,7 @@ if (idx == -1) idx = 0; /* special case for some control panel applications */ - if ((int)ExtractIconEx(path, idx, 0, &hicon, 1) > 0) + if ((int)ExtractIconExW(path, idx, 0, &hicon, 1) > 0) flags &= ~GIL_DONTCACHE; } else { HICON hIconLarge = 0; @@ -907,7 +835,7 @@ IShellFolder* child = NULL; HRESULT hr; - HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT)); + HCURSOR old_cursor = SetCursor(LoadCursorW(0, (LPCWSTR)IDC_WAIT)); #ifndef _NO_EXTENSIONS entry->etype = ET_SHELL; @@ -953,10 +881,10 @@ } -static void fill_w32fdata_shell(IShellFolder* folder, LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* w32fdata) +static void fill_w32fdata_shell(IShellFolder* folder, LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATAW* w32fdata) { if (!(attribs & SFGAO_FILESYSTEM) || - FAILED(SHGetDataFromIDList(folder, pidl, SHGDFIL_FINDDATA, w32fdata, sizeof(WIN32_FIND_DATA)))) { + FAILED(SHGetDataFromIDListW(folder, pidl, SHGDFIL_FINDDATA, w32fdata, sizeof(WIN32_FIND_DATAW)))) { WIN32_FILE_ATTRIBUTE_DATA fad; IDataObject* pDataObj; @@ -971,10 +899,10 @@ IDataObject_Release(pDataObj); if (SUCCEEDED(hr)) { - LPCTSTR path = (LPCTSTR)GlobalLock(medium.UNION_MEMBER(hGlobal)); + LPCWSTR path = GlobalLock(medium.UNION_MEMBER(hGlobal)); UINT sem_org = SetErrorMode(SEM_FAILCRITICALERRORS); - if (GetFileAttributesEx(path, GetFileExInfoStandard, &fad)) { + if (GetFileAttributesExW(path, GetFileExInfoStandard, &fad)) { w32fdata->dwFileAttributes = fad.dwFileAttributes; w32fdata->ftCreationTime = fad.ftCreationTime; w32fdata->ftLastAccessTime = fad.ftLastAccessTime; @@ -1049,7 +977,7 @@ if (last) last->next = entry; - memset(&entry->data, 0, sizeof(WIN32_FIND_DATA)); + memset(&entry->data, 0, sizeof(WIN32_FIND_DATAW)); entry->bhfi_valid = FALSE; attribs = ~SFGAO_FILESYSTEM; /*SFGAO_HASSUBFOLDER|SFGAO_FOLDER; SFGAO_FILESYSTEM sorgt dafür, daà "My Documents" anstatt von "Martin's Documents" angezeigt wird */ @@ -1129,7 +1057,7 @@ }; /* distinguish between ".", ".." and any other directory names */ -static int TypeOrderFromDirname(LPCTSTR name) +static int TypeOrderFromDirname(LPCWSTR name) { if (name[0] == '.') { if (name[1] == '\0') @@ -1143,7 +1071,7 @@ } /* directories first... */ -static int compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2) +static int compareType(const WIN32_FIND_DATAW* fd1, const WIN32_FIND_DATAW* fd2) { int order1 = fd1->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE; int order2 = fd2->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE; @@ -1160,21 +1088,21 @@ static int compareName(const void* arg1, const void* arg2) { - const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data; - const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data; + const WIN32_FIND_DATAW* fd1 = &(*(const Entry* const*)arg1)->data; + const WIN32_FIND_DATAW* fd2 = &(*(const Entry* const*)arg2)->data; int cmp = compareType(fd1, fd2); if (cmp) return cmp; - return lstrcmpi(fd1->cFileName, fd2->cFileName); + return lstrcmpiW(fd1->cFileName, fd2->cFileName); } static int compareExt(const void* arg1, const void* arg2) { - const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data; - const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data; - const TCHAR *name1, *name2, *ext1, *ext2; + const WIN32_FIND_DATAW* fd1 = &(*(const Entry* const*)arg1)->data; + const WIN32_FIND_DATAW* fd2 = &(*(const Entry* const*)arg2)->data; + const WCHAR *name1, *name2, *ext1, *ext2; int cmp = compareType(fd1, fd2); if (cmp) @@ -1196,17 +1124,17 @@ else ext2 = sEmpty; - cmp = lstrcmpi(ext1, ext2); + cmp = lstrcmpiW(ext1, ext2); if (cmp) return cmp; - return lstrcmpi(name1, name2); + return lstrcmpiW(name1, name2); } static int compareSize(const void* arg1, const void* arg2) { - const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data; - const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data; + const WIN32_FIND_DATAW* fd1 = &(*(const Entry* const*)arg1)->data; + const WIN32_FIND_DATAW* fd2 = &(*(const Entry* const*)arg2)->data; int cmp = compareType(fd1, fd2); if (cmp) @@ -1226,8 +1154,8 @@ static int compareDate(const void* arg1, const void* arg2) { - const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data; - const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data; + const WIN32_FIND_DATAW* fd1 = &(*(const Entry* const*)arg1)->data; + const WIN32_FIND_DATAW* fd2 = &(*(const Entry* const*)arg2)->data; int cmp = compareType(fd1, fd2); if (cmp) @@ -1277,12 +1205,12 @@ } -static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd) -{ - TCHAR buffer[MAX_PATH]; +static void read_directory(Entry* dir, LPCWSTR path, SORT_ORDER sortOrder, HWND hwnd) +{ + WCHAR buffer[MAX_PATH]; Entry* entry; - LPCTSTR s; - PTSTR d; + LPCWSTR s; + PWSTR d; #ifdef _SHELL_FOLDERS if (dir->etype == ET_SHELL) @@ -1323,7 +1251,7 @@ for(entry=dir->down; entry; entry=entry->next) if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - lstrcpy(d, entry->data.cFileName); + lstrcpyW(d, entry->data.cFileName); read_directory_unix(entry, buffer); SortDirectory(entry, sortOrder); } @@ -1345,7 +1273,7 @@ for(entry=dir->down; entry; entry=entry->next) if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - lstrcpy(d, entry->data.cFileName); + lstrcpyW(d, entry->data.cFileName); read_directory_win(entry, buffer); SortDirectory(entry, sortOrder); } @@ -1356,12 +1284,12 @@ } -static Entry* read_tree(Root* root, LPCTSTR path, LPITEMIDLIST pidl, LPTSTR drv, SORT_ORDER sortOrder, HWND hwnd) +static Entry* read_tree(Root* root, LPCWSTR path, LPITEMIDLIST pidl, LPWSTR drv, SORT_ORDER sortOrder, HWND hwnd) { #if !defined(_NO_EXTENSIONS) && defined(__WINE__) - static const TCHAR sSlash[] = {'/', '\0'}; -#endif - static const TCHAR sBackslash[] = {'\\', '\0'}; + static const WCHAR sSlash[] = {'/', '\0'}; +#endif + static const WCHAR sBackslash[] = {'\\', '\0'}; #ifdef _SHELL_FOLDERS if (pidl) @@ -1381,27 +1309,27 @@ #if !defined(_NO_EXTENSIONS) && defined(__WINE__) if (*path == '/') { - /* read unix file system tree */ - root->drive_type = GetDriveType(path); - - lstrcat(drv, sSlash); + /* read unix file system tree */ + root->drive_type = GetDriveTypeW(path); + + lstrcatW(drv, sSlash); load_string(root->volname, sizeof(root->volname)/sizeof(root->volname[0]), IDS_ROOT_FS); root->fs_flags = 0; load_string(root->fs, sizeof(root->fs)/sizeof(root->fs[0]), IDS_UNIXFS); - lstrcpy(root->path, sSlash); + lstrcpyW(root->path, sSlash); return read_tree_unix(root, path, sortOrder, hwnd); } #endif /* read WIN32 file system tree */ - root->drive_type = GetDriveType(path); - - lstrcat(drv, sBackslash); - GetVolumeInformation(drv, root->volname, _MAX_FNAME, 0, 0, &root->fs_flags, root->fs, _MAX_DIR); - - lstrcpy(root->path, drv); + root->drive_type = GetDriveTypeW(path); + + lstrcatW(drv, sBackslash); + GetVolumeInformationW(drv, root->volname, _MAX_FNAME, 0, 0, &root->fs_flags, root->fs, _MAX_DIR); + + lstrcpyW(root->path, drv); return read_tree_win(root, path, sortOrder, hwnd); } @@ -1418,12 +1346,12 @@ }; -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]; - TCHAR dir_path[MAX_PATH]; - TCHAR b1[BUFFER_LEN]; - static const TCHAR sAsterics[] = {'*', '\0'}; +static ChildWnd* alloc_child_window(LPCWSTR path, LPITEMIDLIST pidl, HWND hwnd) +{ + WCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT]; + WCHAR dir_path[MAX_PATH]; + WCHAR b1[BUFFER_LEN]; + static const WCHAR sAsterics[] = {'*', '\0'}; ChildWnd* child = HeapAlloc(GetProcessHeap(), 0, sizeof(ChildWnd)); Root* root = &child->root; @@ -1456,18 +1384,18 @@ if (path) { - lstrcpy(child->path, path); - - _tsplitpath(path, drv, dir, name, ext); - } - - lstrcpy(child->filter_pattern, sAsterics); + lstrcpyW(child->path, path); + + _wsplitpath(path, drv, dir, name, ext); + } + + lstrcpyW(child->filter_pattern, sAsterics); child->filter_flags = TF_ALL; root->entry.level = 0; - lstrcpy(dir_path, drv); - lstrcat(dir_path, dir); + lstrcpyW(dir_path, drv); + lstrcatW(dir_path, dir); entry = read_tree(root, dir_path, pidl, drv, child->sortOrder, hwnd); #ifdef _SHELL_FOLDERS @@ -1475,7 +1403,7 @@ load_string(root->entry.data.cFileName, sizeof(root->entry.data.cFileName)/sizeof(root->entry.data.cFileName[0]), IDS_DESKTOP); else #endif - wsprintf(root->entry.data.cFileName, RS(b1,IDS_TITLEFMT), drv, root->fs); + wsprintfW(root->entry.data.cFileName, RS(b1,IDS_TITLEFMT), drv, root->fs); root->entry.data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; @@ -1497,7 +1425,7 @@ /* get full path of specified directory entry */ -static void get_path(Entry* dir, PTSTR path) +static void get_path(Entry* dir, PWSTR path) { Entry* entry; int len = 0; @@ -1519,18 +1447,18 @@ if (SUCCEEDED(hr) && (attribs&SFGAO_FILESYSTEM)) { IShellFolder* parent = dir->up? dir->up->folder: Globals.iDesktop; - hr = path_from_pidl(parent, dir->pidl, path, MAX_PATH); + hr = path_from_pidlW(parent, dir->pidl, path, MAX_PATH); } } else #endif { for(entry=dir; entry; level++) { - LPCTSTR name; + LPCWSTR name; int l; { - LPCTSTR s; + LPCWSTR s; name = entry->data.cFileName; s = name; @@ -1540,8 +1468,8 @@ if (entry->up) { if (l > 0) { - memmove(path+l+1, path, len*sizeof(TCHAR)); - memcpy(path+1, name, l*sizeof(TCHAR)); + memmove(path+l+1, path, len*sizeof(WCHAR)); + memcpy(path+1, name, l*sizeof(WCHAR)); len += l+1; #ifndef _NO_EXTENSIONS @@ -1554,8 +1482,8 @@ entry = entry->up; } else { - memmove(path+l, path, len*sizeof(TCHAR)); - memcpy(path, name, l*sizeof(TCHAR)); + memmove(path+l, path, len*sizeof(WCHAR)); + memcpy(path, name, l*sizeof(WCHAR)); len += l; break; } @@ -1580,7 +1508,7 @@ DWORD type; HKEY hKey; windowOptions opts; - LOGFONT logfont; + LOGFONTW logfont; RegOpenKeyExW( HKEY_CURRENT_USER, registry_key, 0, KEY_QUERY_VALUE, &hKey ); @@ -1605,11 +1533,11 @@ size=sizeof(logfont); if( RegQueryValueExW( hKey, reg_logfont, NULL, &type, (LPBYTE) &logfont, &size ) != ERROR_SUCCESS ) - GetObject(GetStockObject(DEFAULT_GUI_FONT),sizeof(logfont),&logfont); + GetObjectW(GetStockObject(DEFAULT_GUI_FONT),sizeof(logfont),&logfont); RegCloseKey( hKey ); - Globals.hfont = CreateFontIndirect(&logfont); + Globals.hfont = CreateFontIndirectW(&logfont); return opts; } @@ -1618,7 +1546,7 @@ WINDOWINFO wi; HKEY hKey; INT width, height; - LOGFONT logfont; + LOGFONTW logfont; wi.cbSize = sizeof( WINDOWINFO ); GetWindowInfo(Globals.hMainWnd, &wi); @@ -1646,9 +1574,9 @@ (LPBYTE) &width, sizeof(DWORD) ); RegSetValueExW( hKey, reg_height, 0, REG_DWORD, (LPBYTE) &height, sizeof(DWORD) ); - GetObject(Globals.hfont, sizeof(logfont), &logfont); + GetObjectW(Globals.hfont, sizeof(logfont), &logfont); RegSetValueExW( hKey, reg_logfont, 0, REG_BINARY, - (LPBYTE) &logfont, sizeof(LOGFONT) ); + (LPBYTE)&logfont, sizeof(LOGFONTW) ); /* TODO: Save more settings here (List vs. Detailed View, etc.) */ RegCloseKey( hKey ); @@ -1660,14 +1588,14 @@ RECT rt; if (IsWindowVisible(Globals.htoolbar)) { - SendMessage(Globals.htoolbar, WM_SIZE, 0, 0); + SendMessageW(Globals.htoolbar, WM_SIZE, 0, 0); GetClientRect(Globals.htoolbar, &rt); prect->top = rt.bottom+3; prect->bottom -= rt.bottom+3; } if (IsWindowVisible(Globals.hdrivebar)) { - SendMessage(Globals.hdrivebar, WM_SIZE, 0, 0); + SendMessageW(Globals.hdrivebar, WM_SIZE, 0, 0); GetClientRect(Globals.hdrivebar, &rt); new_top = --prect->top + rt.bottom+3; MoveWindow(Globals.hdrivebar, 0, prect->top, rt.right, new_top, TRUE); @@ -1678,8 +1606,8 @@ if (IsWindowVisible(Globals.hstatusbar)) { int parts[] = {300, 500}; - SendMessage(Globals.hstatusbar, WM_SIZE, 0, 0); - SendMessage(Globals.hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts); + SendMessageW(Globals.hstatusbar, WM_SIZE, 0, 0); + SendMessageW(Globals.hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts); GetClientRect(Globals.hstatusbar, &rt); prect->bottom -= rt.bottom; } @@ -1719,7 +1647,7 @@ newchild = NULL; child->hwnd = (HWND) wparam; - SetWindowLongPtr(child->hwnd, GWLP_USERDATA, (LPARAM)child); + SetWindowLongPtrW(child->hwnd, GWLP_USERDATA, (LPARAM)child); } return CallNextHookEx(hcbthook, code, wparam, lparam); @@ -1727,11 +1655,11 @@ static HWND create_child_window(ChildWnd* child) { - MDICREATESTRUCT mcs; + MDICREATESTRUCTW mcs; int idx; mcs.szClass = sWINEFILETREE; - mcs.szTitle = (LPTSTR)child->path; + mcs.szTitle = child->path; mcs.hOwner = Globals.hInstance; mcs.x = child->pos.rcNormalPosition.left; mcs.y = child->pos.rcNormalPosition.top; @@ -1740,10 +1668,10 @@ mcs.style = 0; mcs.lParam = 0; - hcbthook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId()); + hcbthook = SetWindowsHookExW(WH_CBT, CBTProc, 0, GetCurrentThreadId()); newchild = child; - child->hwnd = (HWND) SendMessage(Globals.hmdiclient, WM_MDICREATE, 0, (LPARAM)&mcs); + child->hwnd = (HWND)SendMessageW(Globals.hmdiclient, WM_MDICREATE, 0, (LPARAM)&mcs); if (!child->hwnd) { UnhookWindowsHookEx(hcbthook); return 0; @@ -1751,18 +1679,18 @@ UnhookWindowsHookEx(hcbthook); - SendMessage(child->left.hwnd, LB_SETITEMHEIGHT, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3)); - SendMessage(child->right.hwnd, LB_SETITEMHEIGHT, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3)); - - idx = SendMessage(child->left.hwnd, LB_FINDSTRING, 0, (LPARAM)child->left.cur); - SendMessage(child->left.hwnd, LB_SETCURSEL, idx, 0); + SendMessageW(child->left.hwnd, LB_SETITEMHEIGHT, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3)); + SendMessageW(child->right.hwnd, LB_SETITEMHEIGHT, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3)); + + idx = SendMessageW(child->left.hwnd, LB_FINDSTRING, 0, (LPARAM)child->left.cur); + SendMessageW(child->left.hwnd, LB_SETCURSEL, idx, 0); return child->hwnd; } struct ExecuteDialog { - TCHAR cmd[MAX_PATH]; + WCHAR cmd[MAX_PATH]; int cmdshow; }; @@ -1779,7 +1707,7 @@ int id = (int)wparam; if (id == IDOK) { - GetWindowText(GetDlgItem(hwnd, 201), dlg->cmd, MAX_PATH); + GetWindowTextW(GetDlgItem(hwnd, 201), dlg->cmd, MAX_PATH); dlg->cmdshow = get_check(hwnd,214) ? SW_SHOWMINIMIZED : SW_SHOWNORMAL; EndDialog(hwnd, id); } else if (id == IDCANCEL) @@ -1794,12 +1722,12 @@ 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) { case WM_INITDIALOG: - SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam); - SetWindowText(GetDlgItem(hwnd, 201), (LPCTSTR)lparam); + SetWindowLongPtrW(hwnd, GWLP_USERDATA, lparam); + SetWindowTextW(GetDlgItem(hwnd, 201), (LPCWSTR)lparam); return 1; case WM_COMMAND: { @@ -1807,8 +1735,8 @@ switch(id) { case IDOK: { - LPTSTR dest = (LPTSTR) GetWindowLongPtr(hwnd, GWLP_USERDATA); - GetWindowText(GetDlgItem(hwnd, 201), dest, MAX_PATH); + LPWSTR dest = (LPWSTR)GetWindowLongPtrW(hwnd, GWLP_USERDATA); + GetWindowTextW(GetDlgItem(hwnd, 201), dest, MAX_PATH); EndDialog(hwnd, id); break;} @@ -1817,7 +1745,7 @@ break; case 254: - MessageBox(hwnd, RS(b1,IDS_NO_IMPL), RS(b2,IDS_WINEFILE), MB_OK); + MessageBoxW(hwnd, RS(b1,IDS_NO_IMPL), RS(b2,IDS_WINEFILE), MB_OK); break; } @@ -1830,7 +1758,7 @@ struct FilterDialog { - TCHAR pattern[MAX_PATH]; + WCHAR pattern[MAX_PATH]; int flags; }; @@ -1841,7 +1769,7 @@ switch(nmsg) { case WM_INITDIALOG: dlg = (struct FilterDialog*) lparam; - SetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern); + SetWindowTextW(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern); set_check(hwnd, IDC_VIEW_TYPE_DIRECTORIES, dlg->flags&TF_DIRECTORIES); set_check(hwnd, IDC_VIEW_TYPE_PROGRAMS, dlg->flags&TF_PROGRAMS); set_check(hwnd, IDC_VIEW_TYPE_DOCUMENTS, dlg->flags&TF_DOCUMENTS); @@ -1855,7 +1783,7 @@ if (id == IDOK) { int flags = 0; - GetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern, MAX_PATH); + GetWindowTextW(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern, MAX_PATH); flags |= get_check(hwnd, IDC_VIEW_TYPE_DIRECTORIES) ? TF_DIRECTORIES : 0; flags |= get_check(hwnd, IDC_VIEW_TYPE_PROGRAMS) ? TF_PROGRAMS : 0; @@ -1877,7 +1805,7 @@ struct PropertiesDialog { - TCHAR path[MAX_PATH]; + WCHAR path[MAX_PATH]; Entry entry; void* pVersionData; }; @@ -1906,32 +1834,32 @@ static void PropDlg_DisplayValue(HWND hlbox, HWND hedit) { - int idx = SendMessage(hlbox, LB_GETCURSEL, 0, 0); + int idx = SendMessageW(hlbox, LB_GETCURSEL, 0, 0); if (idx != LB_ERR) { - LPCTSTR pValue = (LPCTSTR) SendMessage(hlbox, LB_GETITEMDATA, idx, 0); + LPCWSTR pValue = (LPCWSTR)SendMessageW(hlbox, LB_GETITEMDATA, idx, 0); if (pValue) - SetWindowText(hedit, pValue); - } -} - -static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCTSTR strFilename) -{ - static TCHAR 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 TCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\', + SetWindowTextW(hedit, pValue); + } +} + +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','\\', '%','0','4','x','%','0','4','x','\\','%','s','\0'}; - DWORD dwVersionDataLen = GetFileVersionInfoSize(strFilename, NULL); + DWORD dwVersionDataLen = GetFileVersionInfoSizeW(strFilename, NULL); if (dwVersionDataLen) { dlg->pVersionData = HeapAlloc(GetProcessHeap(), 0, dwVersionDataLen); - if (GetFileVersionInfo(strFilename, 0, dwVersionDataLen, dlg->pVersionData)) { + if (GetFileVersionInfoW(strFilename, 0, dwVersionDataLen, dlg->pVersionData)) { LPVOID pVal; UINT nValLen; - if (VerQueryValue(dlg->pVersionData, sBackSlash, &pVal, &nValLen)) { + if (VerQueryValueW(dlg->pVersionData, sBackSlash, &pVal, &nValLen)) { if (nValLen == sizeof(VS_FIXEDFILEINFO)) { VS_FIXEDFILEINFO* pFixedFileInfo = (VS_FIXEDFILEINFO*)pVal; char buffer[BUFFER_LEN]; @@ -1945,7 +1873,7 @@ } /* Read the list of languages and code pages. */ - if (VerQueryValue(dlg->pVersionData, sTranslation, &pVal, &nValLen)) { + if (VerQueryValueW(dlg->pVersionData, sTranslation, &pVal, &nValLen)) { struct LANGANDCODEPAGE* pTranslate = (struct LANGANDCODEPAGE*)pVal; struct LANGANDCODEPAGE* pEnd = (struct LANGANDCODEPAGE*)((LPBYTE)pVal+nValLen); @@ -1956,30 +1884,24 @@ LPCSTR* p; for(p=InfoStrings; *p; ++p) { - TCHAR subblock[200]; -#ifdef UNICODE - TCHAR infoStr[100]; -#endif - LPCTSTR pTxt; + WCHAR subblock[200]; + WCHAR infoStr[100]; + LPCWSTR pTxt; UINT nValLen; LPCSTR pInfoString = *p; -#ifdef UNICODE MultiByteToWideChar(CP_ACP, 0, pInfoString, -1, infoStr, 100); -#else -#define infoStr pInfoString -#endif - wsprintf(subblock, sStringFileInfo, pTranslate->wLanguage, pTranslate->wCodePage, infoStr); + wsprintfW(subblock, sStringFileInfo, pTranslate->wLanguage, pTranslate->wCodePage, infoStr); /* Retrieve file description for language and code page */ - if (VerQueryValue(dlg->pVersionData, subblock, (PVOID)&pTxt, &nValLen)) { - int idx = SendMessage(hlbox, LB_ADDSTRING, 0L, (LPARAM)infoStr); - SendMessage(hlbox, LB_SETITEMDATA, idx, (LPARAM) pTxt); + if (VerQueryValueW(dlg->pVersionData, subblock, (PVOID)&pTxt, &nValLen)) { + int idx = SendMessageW(hlbox, LB_ADDSTRING, 0L, (LPARAM)infoStr); + SendMessageW(hlbox, LB_SETITEMDATA, idx, (LPARAM)pTxt); } } } - SendMessage(hlbox, LB_SETCURSEL, 0, 0); + SendMessageW(hlbox, LB_SETCURSEL, 0, 0); PropDlg_DisplayValue(hlbox, GetDlgItem(hwnd,IDC_LIST_PROP_VERSION_VALUES)); } @@ -1993,26 +1915,26 @@ switch(nmsg) { case WM_INITDIALOG: { - static const TCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'}; - TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; - LPWIN32_FIND_DATA pWFD; + static const WCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'}; + WCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; + LPWIN32_FIND_DATAW pWFD; dlg = (struct PropertiesDialog*) lparam; - pWFD = (LPWIN32_FIND_DATA) &dlg->entry.data; - - GetWindowText(hwnd, b1, MAX_PATH); - wsprintf(b2, b1, pWFD->cFileName); - SetWindowText(hwnd, b2); + pWFD = (LPWIN32_FIND_DATAW)&dlg->entry.data; + + GetWindowTextW(hwnd, b1, MAX_PATH); + wsprintfW(b2, b1, pWFD->cFileName); + SetWindowTextW(hwnd, b2); format_date(&pWFD->ftLastWriteTime, b1, COL_DATE|COL_TIME); - SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_LASTCHANGE), b1); + SetWindowTextW(GetDlgItem(hwnd, IDC_STATIC_PROP_LASTCHANGE), b1); format_longlong( b1, ((ULONGLONG)pWFD->nFileSizeHigh << 32) | pWFD->nFileSizeLow ); - wsprintf(b2, sByteFmt, b1); - SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_SIZE), b2); - - SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_FILENAME), pWFD->cFileName); - SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_PATH), dlg->path); + wsprintfW(b2, sByteFmt, b1); + SetWindowTextW(GetDlgItem(hwnd, IDC_STATIC_PROP_SIZE), b2); + + SetWindowTextW(GetDlgItem(hwnd, IDC_STATIC_PROP_FILENAME), pWFD->cFileName); + SetWindowTextW(GetDlgItem(hwnd, IDC_STATIC_PROP_PATH), dlg->path); set_check(hwnd, IDC_CHECK_READONLY, pWFD->dwFileAttributes&FILE_ATTRIBUTE_READONLY); set_check(hwnd, IDC_CHECK_ARCHIVE, pWFD->dwFileAttributes&FILE_ATTRIBUTE_ARCHIVE); @@ -2057,7 +1979,7 @@ get_path(entry, dlg.path); memcpy(&dlg.entry, entry, sizeof(Entry)); - DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_DIALOG_PROPERTIES), hwnd, PropertiesDialogDlgProc, (LPARAM)&dlg); + DialogBoxParamW(Globals.hInstance, MAKEINTRESOURCEW(IDD_DIALOG_PROPERTIES), hwnd, PropertiesDialogDlgProc, (LPARAM)&dlg); } @@ -2174,22 +2096,22 @@ resize_frame_client(hwnd); } -static BOOL activate_drive_window(LPCTSTR path) -{ - TCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE]; +static BOOL activate_drive_window(LPCWSTR path) +{ + WCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE]; HWND child_wnd; - _tsplitpath(path, drv1, 0, 0, 0); + _wsplitpath(path, drv1, 0, 0, 0); /* search for a already open window for the same drive */ for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) { - ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA); + ChildWnd* child = (ChildWnd*)GetWindowLongPtrW(child_wnd, GWLP_USERDATA); if (child) { - _tsplitpath(child->root.path, drv2, 0, 0, 0); - - if (!lstrcmpi(drv2, drv1)) { - SendMessage(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0); + _wsplitpath(child->root.path, drv2, 0, 0, 0); + + if (!lstrcmpiW(drv2, drv1)) { + SendMessageW(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0); if (IsIconic(child_wnd)) ShowWindow(child_wnd, SW_SHOWNORMAL); @@ -2202,17 +2124,17 @@ return FALSE; } -static BOOL activate_fs_window(LPCTSTR filesys) +static BOOL activate_fs_window(LPCWSTR filesys) { HWND child_wnd; /* search for a already open window of the given file system name */ for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) { - ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA); + ChildWnd* child = (ChildWnd*) GetWindowLongPtrW(child_wnd, GWLP_USERDATA); if (child) { - if (!lstrcmpi(child->root.fs, filesys)) { - SendMessage(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0); + if (!lstrcmpiW(child->root.fs, filesys)) { + SendMessageW(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0); if (IsIconic(child_wnd)) ShowWindow(child_wnd, SW_SHOWNORMAL); @@ -2227,7 +2149,7 @@ 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) { case WM_CLOSE: @@ -2250,23 +2172,23 @@ break; case WM_INITMENUPOPUP: { - HWND hwndClient = (HWND) SendMessage(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0); - - if (!SendMessage(hwndClient, WM_INITMENUPOPUP, wparam, lparam)) + HWND hwndClient = (HWND)SendMessageW(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0); + + if (!SendMessageW(hwndClient, WM_INITMENUPOPUP, wparam, lparam)) return 0; break;} case WM_COMMAND: { UINT cmd = LOWORD(wparam); - HWND hwndClient = (HWND) SendMessage(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0); - - if (SendMessage(hwndClient, WM_DISPATCH_COMMAND, wparam, lparam)) + HWND hwndClient = (HWND)SendMessageW(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0); + + if (SendMessageW(hwndClient, WM_DISPATCH_COMMAND, wparam, lparam)) break; 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; - LPCTSTR root = Globals.drives; + LPCWSTR root = Globals.drives; int i; for(i=cmd-ID_DRIVE_FIRST; i--; root++) @@ -2276,28 +2198,28 @@ if (activate_drive_window(root)) return 0; - _tsplitpath(root, drv, 0, 0, 0); - - if (!SetCurrentDirectory(drv)) { + _wsplitpath(root, drv, 0, 0, 0); + + if (!SetCurrentDirectoryW(drv)) { display_error(hwnd, GetLastError()); return 0; } - GetCurrentDirectory(MAX_PATH, path); /*TODO: store last directory per drive */ + GetCurrentDirectoryW(MAX_PATH, path); /*TODO: store last directory per drive */ child = alloc_child_window(path, NULL, hwnd); if (!create_child_window(child)) HeapFree(GetProcessHeap(), 0, child); } else switch(cmd) { case ID_FILE_EXIT: - SendMessage(hwnd, WM_CLOSE, 0, 0); + SendMessageW(hwnd, WM_CLOSE, 0, 0); break; case ID_WINDOW_NEW: { - TCHAR path[MAX_PATH]; + WCHAR path[MAX_PATH]; ChildWnd* child; - GetCurrentDirectory(MAX_PATH, path); + GetCurrentDirectoryW(MAX_PATH, path); child = alloc_child_window(path, NULL, hwnd); if (!create_child_window(child)) @@ -2309,19 +2231,19 @@ break; case ID_WINDOW_CASCADE: - SendMessage(Globals.hmdiclient, WM_MDICASCADE, 0, 0); + SendMessageW(Globals.hmdiclient, WM_MDICASCADE, 0, 0); break; case ID_WINDOW_TILE_HORZ: - SendMessage(Globals.hmdiclient, WM_MDITILE, MDITILE_HORIZONTAL, 0); + SendMessageW(Globals.hmdiclient, WM_MDITILE, MDITILE_HORIZONTAL, 0); break; case ID_WINDOW_TILE_VERT: - SendMessage(Globals.hmdiclient, WM_MDITILE, MDITILE_VERTICAL, 0); + SendMessageW(Globals.hmdiclient, WM_MDITILE, MDITILE_VERTICAL, 0); break; case ID_WINDOW_ARRANGE: - SendMessage(Globals.hmdiclient, WM_MDIICONARRANGE, 0, 0); + SendMessageW(Globals.hmdiclient, WM_MDIICONARRANGE, 0, 0); break; case ID_SELECT_FONT: @@ -2351,8 +2273,8 @@ memset(&dlg, 0, sizeof(struct ExecuteDialog)); - if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_EXECUTE), hwnd, ExecuteDialogDlgProc, (LPARAM)&dlg) == IDOK) { - HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow); + if (DialogBoxParamW(Globals.hInstance, MAKEINTRESOURCEW(IDD_EXECUTE), hwnd, ExecuteDialogDlgProc, (LPARAM)&dlg) == IDOK) { + HINSTANCE hinst = ShellExecuteW(hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow); if (PtrToUlong(hinst) <= 32) display_error(hwnd, GetLastError()); @@ -2391,7 +2313,7 @@ break;} case ID_HELP: - WinHelp(hwnd, RS(b1,IDS_WINEFILE), HELP_INDEX, 0); + WinHelpW(hwnd, RS(b1,IDS_WINEFILE), HELP_INDEX, 0); break; #ifndef _NO_EXTENSIONS @@ -2401,21 +2323,15 @@ #ifdef __WINE__ case ID_DRIVE_UNIX_FS: { - TCHAR path[MAX_PATH]; -#ifdef UNICODE + WCHAR path[MAX_PATH]; char cpath[MAX_PATH]; -#endif ChildWnd* child; if (activate_fs_window(RS(b1,IDS_UNIXFS))) break; -#ifdef UNICODE getcwd(cpath, MAX_PATH); MultiByteToWideChar(CP_UNIXCP, 0, cpath, -1, path, MAX_PATH); -#else - getcwd(path, MAX_PATH); -#endif child = alloc_child_window(path, NULL, hwnd); if (!create_child_window(child)) @@ -2424,13 +2340,13 @@ #endif #ifdef _SHELL_FOLDERS case ID_DRIVE_SHELL_NS: { - TCHAR path[MAX_PATH]; + WCHAR path[MAX_PATH]; ChildWnd* child; if (activate_fs_window(RS(b1,IDS_SHELL))) break; - GetCurrentDirectory(MAX_PATH, path); + GetCurrentDirectoryW(MAX_PATH, path); child = alloc_child_window(path, get_path_pidl(path,hwnd), hwnd); if (!create_child_window(child)) @@ -2442,8 +2358,8 @@ /*TODO: There are even more menu items! */ case ID_ABOUT: - ShellAbout(hwnd, RS(b1,IDS_WINEFILE), NULL, - LoadImage( Globals.hInstance, MAKEINTRESOURCE(IDI_WINEFILE), + ShellAboutW(hwnd, RS(b1,IDS_WINEFILE), NULL, + LoadImageW( Globals.hInstance, MAKEINTRESOURCEW(IDI_WINEFILE), IMAGE_ICON, 48, 48, LR_SHARED )); break; @@ -2452,18 +2368,18 @@ STRING_SelectLanguageByNumber(wParam - PM_FIRST_LANGUAGE); else */if ((cmd<IDW_FIRST_CHILD || cmd>=IDW_FIRST_CHILD+0x100) && (cmd<SC_SIZE || cmd>SC_RESTORE)) - MessageBox(hwnd, RS(b2,IDS_NO_IMPL), RS(b1,IDS_WINEFILE), MB_OK); - - return DefFrameProc(hwnd, Globals.hmdiclient, nmsg, wparam, lparam); + MessageBoxW(hwnd, RS(b2,IDS_NO_IMPL), RS(b1,IDS_WINEFILE), MB_OK); + + return DefFrameProcW(hwnd, Globals.hmdiclient, nmsg, wparam, lparam); } break;} case WM_SIZE: resize_frame(hwnd, LOWORD(lparam), HIWORD(lparam)); - break; /* do not pass message to DefFrameProc */ + break; /* do not pass message to DefFrameProcW */ case WM_DEVICECHANGE: - SendMessage(hwnd, WM_COMMAND, MAKELONG(ID_REFRESH,0), 0); + SendMessageW(hwnd, WM_COMMAND, MAKELONG(ID_REFRESH,0), 0); break; #ifndef _NO_EXTENSIONS @@ -2480,14 +2396,14 @@ #endif /* _NO_EXTENSIONS */ default: - return DefFrameProc(hwnd, Globals.hmdiclient, nmsg, wparam, lparam); + return DefFrameProcW(hwnd, Globals.hmdiclient, nmsg, wparam, lparam); } return 0; } -static TCHAR g_pos_names[COLUMNS][20] = { +static WCHAR g_pos_names[COLUMNS][20] = { {'\0'} /* symbol */ }; @@ -2528,7 +2444,7 @@ hdl.prc = &rt; hdl.pwpos = ℘ - SendMessage(child->left.hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hdl); + SendMessageW(child->left.hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hdl); DeferWindowPos(hdwp, child->left.hwndHeader, wp.hwndInsertAfter, wp.x-1, wp.y, child->split_pos-SPLIT_WIDTH/2+1, wp.cy, wp.flags); @@ -2548,15 +2464,15 @@ static HWND create_header(HWND parent, Pane* pane, UINT id) { - HD_ITEM hdi; + HDITEMW hdi; int idx; - HWND hwnd = CreateWindow(WC_HEADER, 0, WS_CHILD|WS_VISIBLE|HDS_HORZ|HDS_FULLDRAG/*TODO: |HDS_BUTTONS + sort orders*/, + HWND hwnd = CreateWindowW(WC_HEADERW, 0, WS_CHILD|WS_VISIBLE|HDS_HORZ|HDS_FULLDRAG/*TODO: |HDS_BUTTONS + sort orders*/, 0, 0, 0, 0, parent, (HMENU)ULongToHandle(id), Globals.hInstance, 0); if (!hwnd) return 0; - SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), FALSE); + SendMessageW(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), FALSE); hdi.mask = HDI_TEXT|HDI_WIDTH|HDI_FORMAT; @@ -2564,7 +2480,7 @@ hdi.pszText = g_pos_names[idx]; hdi.fmt = HDF_STRING | g_pos_align[idx]; hdi.cxy = pane->widths[idx]; - SendMessage(hwnd, HDM_INSERTITEM, idx, (LPARAM) &hdi); + SendMessageW(hwnd, HDM_INSERTITEMW, idx, (LPARAM)&hdi); } return hwnd; @@ -2599,7 +2515,7 @@ static BOOL calc_widths(Pane* pane, BOOL anyway) { int col, x, cx, spc=3*Globals.spaceSize.cx; - int entries = SendMessage(pane->hwnd, LB_GETCOUNT, 0, 0); + int entries = SendMessageW(pane->hwnd, LB_GETCOUNT, 0, 0); int orgWidths[COLUMNS]; int orgPositions[COLUMNS+1]; HFONT hfontOld; @@ -2618,7 +2534,7 @@ hfontOld = SelectObject(hdc, Globals.hfont); for(cnt=0; cnt<entries; cnt++) { - Entry* entry = (Entry*) SendMessage(pane->hwnd, LB_GETITEMDATA, cnt, 0); + Entry* entry = (Entry*)SendMessageW(pane->hwnd, LB_GETITEMDATA, cnt, 0); DRAWITEMSTRUCT dis; @@ -2660,7 +2576,7 @@ pane->positions[COLUMNS] = x; - SendMessage(pane->hwnd, LB_SETHORIZONTALEXTENT, x, 0); + SendMessageW(pane->hwnd, LB_SETHORIZONTALEXTENT, x, 0); /* no change? */ if (!anyway && !memcmp(orgWidths, pane->widths, sizeof(orgWidths))) @@ -2687,7 +2603,7 @@ { HFONT hfontOld; int x, cx; - int entries = SendMessage(pane->hwnd, LB_GETCOUNT, 0, 0); + int entries = SendMessageW(pane->hwnd, LB_GETCOUNT, 0, 0); int cnt; HDC hdc; @@ -2697,7 +2613,7 @@ hfontOld = SelectObject(hdc, Globals.hfont); for(cnt=0; cnt<entries; cnt++) { - Entry* entry = (Entry*) SendMessage(pane->hwnd, LB_GETITEMDATA, cnt, 0); + Entry* entry = (Entry*)SendMessageW(pane->hwnd, LB_GETITEMDATA, cnt, 0); DRAWITEMSTRUCT dis; dis.CtlType = 0; @@ -2737,11 +2653,11 @@ x += pane->widths[col]; } - SendMessage(pane->hwnd, LB_SETHORIZONTALEXTENT, x, 0); -} - - -static BOOL pattern_match(LPCTSTR str, LPCTSTR pattern) + SendMessageW(pane->hwnd, LB_SETHORIZONTALEXTENT, x, 0); +} + + +static BOOL pattern_match(LPCWSTR str, LPCWSTR pattern) { for( ; *str&&*pattern; str++,pattern++) { if (*pattern == '*') { @@ -2768,14 +2684,14 @@ return TRUE; } -static BOOL pattern_imatch(LPCTSTR str, LPCTSTR pattern) -{ - TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; - - lstrcpy(b1, str); - lstrcpy(b2, pattern); - CharUpper(b1); - CharUpper(b2); +static BOOL pattern_imatch(LPCWSTR str, LPCWSTR pattern) +{ + WCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; + + lstrcpyW(b1, str); + lstrcpyW(b2, pattern); + CharUpperW(b1); + CharUpperW(b2); return pattern_match(b1, b2); } @@ -2787,12 +2703,12 @@ FT_DOCUMENT = 2 }; -static enum FILE_TYPE get_file_type(LPCTSTR filename); +static enum FILE_TYPE get_file_type(LPCWSTR filename); /* insert listbox entries after index idx */ -static int insert_entries(Pane* pane, Entry* dir, LPCTSTR pattern, int filter_flags, int idx) +static int insert_entries(Pane* pane, Entry* dir, LPCWSTR pattern, int filter_flags, int idx) { Entry* entry = dir; @@ -2852,7 +2768,7 @@ if (idx != -1) idx++; - SendMessage(pane->hwnd, LB_INSERTSTRING, idx, (LPARAM) entry); + SendMessageW(pane->hwnd, LB_INSERTSTRING, idx, (LPARAM)entry); if (pane->treePane && entry->expanded) idx = insert_entries(pane, entry->down, pattern, filter_flags, idx); @@ -2864,12 +2780,12 @@ } -static void format_bytes(LPTSTR buffer, LONGLONG bytes) -{ - static const TCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'}; - static const TCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'}; - static const TCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'}; - static const TCHAR sFmtB[] = {'%', 'u', 0}; +static void format_bytes(LPWSTR buffer, LONGLONG bytes) +{ + static const WCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'}; + static const WCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'}; + static const WCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'}; + static const WCHAR sFmtB[] = {'%', 'u', 0}; float fBytes = (float)bytes; @@ -2886,36 +2802,36 @@ static void set_space_status(void) { ULARGE_INTEGER ulFreeBytesToCaller, ulTotalBytes, ulFreeBytes; - TCHAR fmt[64], b1[64], b2[64], buffer[BUFFER_LEN]; - - if (GetDiskFreeSpaceEx(NULL, &ulFreeBytesToCaller, &ulTotalBytes, &ulFreeBytes)) { + WCHAR fmt[64], b1[64], b2[64], buffer[BUFFER_LEN]; + + if (GetDiskFreeSpaceExW(NULL, &ulFreeBytesToCaller, &ulTotalBytes, &ulFreeBytes)) { format_bytes(b1, ulFreeBytesToCaller.QuadPart); format_bytes(b2, ulTotalBytes.QuadPart); - wsprintf(buffer, RS(fmt,IDS_FREE_SPACE_FMT), b1, b2); + wsprintfW(buffer, RS(fmt,IDS_FREE_SPACE_FMT), b1, b2); } else - lstrcpy(buffer, sQMarks); - - SendMessage(Globals.hstatusbar, SB_SETTEXT, 0, (LPARAM)buffer); + lstrcpyW(buffer, sQMarks); + + SendMessageW(Globals.hstatusbar, SB_SETTEXTW, 0, (LPARAM)buffer); } static WNDPROC g_orgTreeWndProc; -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 void create_tree_window(HWND parent, Pane* pane, UINT id, UINT id_header, LPCWSTR pattern, int filter_flags) +{ + static const WCHAR sListBox[] = {'L','i','s','t','B','o','x','\0'}; static int s_init = 0; Entry* entry = pane->root; - pane->hwnd = CreateWindow(sListBox, sEmpty, WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL| + pane->hwnd = CreateWindowW(sListBox, sEmpty, WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL| LBS_DISABLENOSCROLL|LBS_NOINTEGRALHEIGHT|LBS_OWNERDRAWFIXED|LBS_NOTIFY, 0, 0, 0, 0, parent, (HMENU)ULongToHandle(id), Globals.hInstance, 0); - SetWindowLongPtr(pane->hwnd, GWLP_USERDATA, (LPARAM)pane); - g_orgTreeWndProc = (WNDPROC) SetWindowLongPtr(pane->hwnd, GWLP_WNDPROC, (LPARAM)TreeWndProc); - - SendMessage(pane->hwnd, WM_SETFONT, (WPARAM)Globals.hfont, FALSE); + SetWindowLongPtrW(pane->hwnd, GWLP_USERDATA, (LPARAM)pane); + g_orgTreeWndProc = (WNDPROC)SetWindowLongPtrW(pane->hwnd, GWLP_WNDPROC, (LPARAM)TreeWndProc); + + SendMessageW(pane->hwnd, WM_SETFONT, (WPARAM)Globals.hfont, FALSE); /* insert entries into listbox */ if (entry) @@ -2942,7 +2858,7 @@ } -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; FILETIME lft; @@ -2954,13 +2870,13 @@ return; if (!FileTimeToLocalFileTime(ft, &lft)) - {err: lstrcpy(buffer,sQMarks); return;} + {err: lstrcpyW(buffer,sQMarks); return;} if (!FileTimeToSystemTime(&lft, &systime)) goto err; if (visible_cols & COL_DATE) { - len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer, BUFFER_LEN); + len = GetDateFormatW(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer, BUFFER_LEN); if (!len) goto err; } @@ -2971,30 +2887,30 @@ buffer[len++] = ' '; - if (!GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer+len, BUFFER_LEN-len)) + if (!GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer+len, BUFFER_LEN-len)) buffer[len] = '\0'; } } -static void calc_width(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) +static void calc_width(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCWSTR str) { RECT rt = {0, 0, 0, 0}; - DrawText(dis->hDC, str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX); + DrawTextW(dis->hDC, str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX); if (rt.right > pane->widths[col]) pane->widths[col] = rt.right; } -static void calc_tabbed_width(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) +static void calc_tabbed_width(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCWSTR str) { RECT rt = {0, 0, 0, 0}; /* DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2}; - DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/ - - DrawText(dis->hDC, str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8)); + DrawTextExW(dis->hDC, (LPWSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/ + + DrawTextW(dis->hDC, str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8)); /*FIXME rt (0,0) ??? */ if (rt.right > pane->widths[col]) @@ -3002,7 +2918,7 @@ } -static void output_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str, DWORD flags) +static void output_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCWSTR str, DWORD flags) { int x = dis->rcItem.left; RECT rt; @@ -3012,10 +2928,10 @@ rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx; rt.bottom = dis->rcItem.bottom; - DrawText(dis->hDC, str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags); -} - -static void output_tabbed_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) + DrawTextW(dis->hDC, str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags); +} + +static void output_tabbed_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCWSTR str) { int x = dis->rcItem.left; RECT rt; @@ -3026,18 +2942,18 @@ rt.bottom = dis->rcItem.bottom; /* DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2}; - DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/ - - DrawText(dis->hDC, str, -1, &rt, DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8)); -} - -static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) + DrawTextExW(dis->hDC, (LPWSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/ + + DrawTextW(dis->hDC, str, -1, &rt, DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8)); +} + +static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCWSTR str) { int x = dis->rcItem.left; RECT rt; - LPCTSTR s = str; - TCHAR b[128]; - LPTSTR d = b; + LPCWSTR s = str; + WCHAR b[128]; + LPWSTR d = b; int pos; rt.left = x+pane->positions[col]+Globals.spaceSize.cx; @@ -3049,7 +2965,7 @@ *d++ = *s++; /* insert number separator characters */ - pos = lstrlen(s) % 3; + pos = lstrlenW(s) % 3; while(*s) if (pos--) @@ -3059,13 +2975,13 @@ pos = 3; } - DrawText(dis->hDC, b, d-b, &rt, DT_RIGHT|DT_SINGLELINE|DT_NOPREFIX|DT_END_ELLIPSIS); -} - - -static BOOL is_exe_file(LPCTSTR ext) -{ - static const TCHAR executable_extensions[][4] = { + DrawTextW(dis->hDC, b, d-b, &rt, DT_RIGHT|DT_SINGLELINE|DT_NOPREFIX|DT_END_ELLIPSIS); +} + + +static BOOL is_exe_file(LPCWSTR ext) +{ + static const WCHAR executable_extensions[][4] = { {'C','O','M','\0'}, {'E','X','E','\0'}, {'B','A','T','\0'}, @@ -3078,33 +2994,33 @@ {'\0'} }; - TCHAR ext_buffer[_MAX_EXT]; - const TCHAR (*p)[4]; - LPCTSTR s; - LPTSTR d; + WCHAR ext_buffer[_MAX_EXT]; + const WCHAR (*p)[4]; + LPCWSTR s; + LPWSTR d; for(s=ext+1,d=ext_buffer; (*d=tolower(*s)); s++) d++; for(p=executable_extensions; (*p)[0]; p++) - if (!lstrcmpi(ext_buffer, *p)) + if (!lstrcmpiW(ext_buffer, *p)) return TRUE; return FALSE; } -static BOOL is_registered_type(LPCTSTR ext) +static BOOL is_registered_type(LPCWSTR ext) { /* check if there exists a classname for this file extension in the registry */ - if (!RegQueryValue(HKEY_CLASSES_ROOT, ext, NULL, NULL)) + if (!RegQueryValueW(HKEY_CLASSES_ROOT, ext, NULL, NULL)) return TRUE; return FALSE; } -static enum FILE_TYPE get_file_type(LPCTSTR filename) -{ - LPCTSTR ext = strrchrW(filename, '.'); +static enum FILE_TYPE get_file_type(LPCWSTR filename) +{ + LPCWSTR ext = strrchrW(filename, '.'); if (!ext) ext = sEmpty; @@ -3119,7 +3035,7 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol) { - TCHAR buffer[BUFFER_LEN]; + WCHAR buffer[BUFFER_LEN]; DWORD attrs; int visible_cols = pane->visible_cols; COLORREF bkcolor, textcolor; @@ -3246,7 +3162,7 @@ if (pane->treePane && entry) { RECT rt = {0}; - DrawText(dis->hDC, entry->data.cFileName, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX); + DrawTextW(dis->hDC, entry->data.cFileName, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX); focusRect.right = dis->rcItem.left+pane->positions[col+1]+TREE_LINE_DX + rt.right +2; } @@ -3357,14 +3273,14 @@ #ifndef _NO_EXTENSIONS if (entry->bhfi_valid) { if (visible_cols & COL_INDEX) { - static const TCHAR fmtlow[] = {'%','X',0}; - static const TCHAR fmthigh[] = {'%','X','%','0','8','X',0}; + static const WCHAR fmtlow[] = {'%','X',0}; + static const WCHAR fmthigh[] = {'%','X','%','0','8','X',0}; if (entry->bhfi.nFileIndexHigh) - wsprintf(buffer, fmthigh, + wsprintfW(buffer, fmthigh, entry->bhfi.nFileIndexHigh, entry->bhfi.nFileIndexLow ); else - wsprintf(buffer, fmtlow, entry->bhfi.nFileIndexLow ); + wsprintfW(buffer, fmtlow, entry->bhfi.nFileIndexLow ); if (calcWidthCol == -1) output_text(pane, dis, col, buffer, DT_RIGHT); @@ -3375,7 +3291,7 @@ } if (visible_cols & COL_LINKS) { - wsprintf(buffer, sNumFmt, entry->bhfi.nNumberOfLinks); + wsprintfW(buffer, sNumFmt, entry->bhfi.nNumberOfLinks); if (calcWidthCol == -1) output_text(pane, dis, col, buffer, DT_CENTER); @@ -3391,11 +3307,11 @@ /* show file attributes */ if (visible_cols & COL_ATTRIBUTES) { #ifdef _NO_EXTENSIONS - static const TCHAR s4Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'}; - lstrcpy(buffer, s4Tabs); + static const WCHAR s4Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'}; + lstrcpyW(buffer, s4Tabs); #else - static const TCHAR s11Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'}; - lstrcpy(buffer, s11Tabs); + static const WCHAR s11Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'}; + lstrcpyW(buffer, s11Tabs); #endif if (attrs & FILE_ATTRIBUTE_NORMAL) buffer[ 0] = 'N'; @@ -3426,7 +3342,7 @@ /*TODO if (flags.security) { - static const TCHAR sSecTabs[] = { + static const WCHAR sSecTabs[] = { ' ','\t',' ','\t',' ','\t',' ', ' ','\t',' ', ' ','\t',' ','\t',' ','\t',' ', @@ -3437,7 +3353,7 @@ DWORD rights = get_access_mask(); - lstrcpy(buffer, sSecTabs); + lstrcpyW(buffer, sSecTabs); if (rights & FILE_READ_DATA) buffer[ 0] = 'R'; if (rights & FILE_WRITE_DATA) buffer[ 2] = 'W'; @@ -3514,7 +3430,7 @@ static void set_header(Pane* pane) { - HD_ITEM item; + HDITEMW item; int scroll_pos = GetScrollPos(pane->hwnd, SB_HORZ); int i=0, x=0; @@ -3523,18 +3439,18 @@ for(; x+pane->widths[i]<scroll_pos && i<COLUMNS; i++) { x += pane->widths[i]; - SendMessage(pane->hwndHeader, HDM_SETITEM, i, (LPARAM) &item); + SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item); } if (i < COLUMNS) { x += pane->widths[i]; item.cxy = x - scroll_pos; - SendMessage(pane->hwndHeader, HDM_SETITEM, i++, (LPARAM) &item); + SendMessageW(pane->hwndHeader, HDM_SETITEMW, i++, (LPARAM)&item); for(; i<COLUMNS; i++) { item.cxy = pane->widths[i]; x += pane->widths[i]; - SendMessage(pane->hwndHeader, HDM_SETITEM, i, (LPARAM) &item); + SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item); } } } @@ -3542,8 +3458,8 @@ static LRESULT pane_notify(Pane* pane, NMHDR* pnmh) { switch(pnmh->code) { - case HDN_ITEMCHANGED: { - HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh; + case HDN_ITEMCHANGEDW: { + LPNMHEADERW phdn = (LPNMHEADERW)pnmh; int idx = phdn->iItem; int dx = phdn->pitem->cxy - pane->widths[idx]; int i; @@ -3579,8 +3495,8 @@ rt_clip.right = pane->positions[idx+1]; RedrawWindow(pane->hwnd, &rt_clip, 0, RDW_INVALIDATE|RDW_UPDATENOW); - if (pnmh->code == HDN_ENDTRACK) { - SendMessage(pane->hwnd, LB_SETHORIZONTALEXTENT, pane->positions[COLUMNS], 0); + if (pnmh->code == HDN_ENDTRACKW) { + SendMessageW(pane->hwnd, LB_SETHORIZONTALEXTENT, pane->positions[COLUMNS], 0); if (GetScrollPos(pane->hwnd, SB_HORZ) != scroll_pos) set_header(pane); @@ -3590,15 +3506,15 @@ return FALSE; } - case HDN_DIVIDERDBLCLICK: { - HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh; - HD_ITEM item; + case HDN_DIVIDERDBLCLICKW: { + LPNMHEADERW phdn = (LPNMHEADERW)pnmh; + HDITEMW item; calc_single_width(pane, phdn->iItem); item.mask = HDI_WIDTH; item.cxy = pane->widths[phdn->iItem]; - SendMessage(pane->hwndHeader, HDM_SETITEM, phdn->iItem, (LPARAM) &item); + SendMessageW(pane->hwndHeader, HDM_SETITEMW, phdn->iItem, (LPARAM)&item); InvalidateRect(pane->hwnd, 0, TRUE); break;} } @@ -3611,22 +3527,22 @@ static void scan_entry(ChildWnd* child, Entry* entry, int idx, HWND hwnd) { - TCHAR path[MAX_PATH]; - HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT)); + WCHAR path[MAX_PATH]; + HCURSOR old_cursor = SetCursor(LoadCursorW(0, (LPCWSTR)IDC_WAIT)); /* delete sub entries in left pane */ for(;;) { - LRESULT res = SendMessage(child->left.hwnd, LB_GETITEMDATA, idx+1, 0); + LRESULT res = SendMessageW(child->left.hwnd, LB_GETITEMDATA, idx+1, 0); Entry* sub = (Entry*) res; if (res==LB_ERR || !sub || sub->level<=entry->level) break; - SendMessage(child->left.hwnd, LB_DELETESTRING, idx+1, 0); + SendMessageW(child->left.hwnd, LB_DELETESTRING, idx+1, 0); } /* empty right pane */ - SendMessage(child->right.hwnd, LB_RESETCONTENT, 0, 0); + SendMessageW(child->right.hwnd, LB_RESETCONTENT, 0, 0); /* release memory */ free_entries(entry); @@ -3681,7 +3597,7 @@ if (!(p->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) return FALSE; - idx = SendMessage(child->left.hwnd, LB_FINDSTRING, 0, (LPARAM)dir); + idx = SendMessageW(child->left.hwnd, LB_FINDSTRING, 0, (LPARAM)dir); dir->expanded = TRUE; @@ -3704,19 +3620,19 @@ static void collapse_entry(Pane* pane, Entry* dir) { - int idx = SendMessage(pane->hwnd, LB_FINDSTRING, 0, (LPARAM)dir); + int idx = SendMessageW(pane->hwnd, LB_FINDSTRING, 0, (LPARAM)dir); ShowWindow(pane->hwnd, SW_HIDE); /* hide sub entries */ for(;;) { - LRESULT res = SendMessage(pane->hwnd, LB_GETITEMDATA, idx+1, 0); + LRESULT res = SendMessageW(pane->hwnd, LB_GETITEMDATA, idx+1, 0); Entry* sub = (Entry*) res; if (res==LB_ERR || !sub || sub->level<=dir->level) break; - SendMessage(pane->hwnd, LB_DELETESTRING, idx+1, 0); + SendMessageW(pane->hwnd, LB_DELETESTRING, idx+1, 0); } dir->expanded = FALSE; @@ -3727,7 +3643,7 @@ static void refresh_right_pane(ChildWnd* child) { - SendMessage(child->right.hwnd, LB_RESETCONTENT, 0, 0); + SendMessageW(child->right.hwnd, LB_RESETCONTENT, 0, 0); insert_entries(&child->right, child->right.root, child->filter_pattern, child->filter_flags, -1); calc_widths(&child->right, FALSE); @@ -3738,7 +3654,7 @@ static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd) { - TCHAR path[MAX_PATH]; + WCHAR path[MAX_PATH]; if (!entry) return; @@ -3756,25 +3672,25 @@ refresh_right_pane(child); get_path(entry, path); - lstrcpy(child->path, path); + lstrcpyW(child->path, path); if (child->hwnd) /* only change window title, if the window already exists */ - SetWindowText(child->hwnd, path); + SetWindowTextW(child->hwnd, path); if (path[0]) - if (SetCurrentDirectory(path)) + if (SetCurrentDirectoryW(path)) set_space_status(); } static void refresh_child(ChildWnd* child) { - TCHAR path[MAX_PATH], drv[_MAX_DRIVE+1]; + WCHAR path[MAX_PATH], drv[_MAX_DRIVE+1]; Entry* entry; int idx; get_path(child->left.cur, path); - _tsplitpath(path, drv, NULL, NULL, NULL); + _wsplitpath(path, drv, NULL, NULL, NULL); child->right.root = NULL; @@ -3801,8 +3717,8 @@ set_curdir(child, entry, 0, child->hwnd); - idx = SendMessage(child->left.hwnd, LB_FINDSTRING, 0, (LPARAM)child->left.cur); - SendMessage(child->left.hwnd, LB_SETCURSEL, idx, 0); + idx = SendMessageW(child->left.hwnd, LB_FINDSTRING, 0, (LPARAM)child->left.cur); + SendMessageW(child->left.hwnd, LB_SETCURSEL, idx, 0); } @@ -3810,12 +3726,12 @@ { TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}; #ifndef _NO_EXTENSIONS - TCHAR b1[BUFFER_LEN]; + WCHAR b1[BUFFER_LEN]; #endif int btn = 1; - PTSTR p; - - GetLogicalDriveStrings(BUFFER_LEN, Globals.drives); + PWSTR p; + + GetLogicalDriveStringsW(BUFFER_LEN, Globals.drives); Globals.hdrivebar = CreateToolbarEx(Globals.hMainWnd, WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST, IDW_DRIVEBAR, 2, Globals.hInstance, IDB_DRIVEBAR, &drivebarBtn, @@ -3827,25 +3743,25 @@ b1[0] = '/'; b1[1] = '\0'; b1[2] = '\0'; - SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1); + SendMessageW(Globals.hdrivebar, TB_ADDSTRINGW, 0, (LPARAM)b1); drivebarBtn.idCommand = ID_DRIVE_UNIX_FS; - SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn); + SendMessageW(Globals.hdrivebar, TB_INSERTBUTTONW, btn++, (LPARAM)&drivebarBtn); drivebarBtn.iString++; #endif #ifdef _SHELL_FOLDERS /* insert shell namespace button */ load_string(b1, sizeof(b1)/sizeof(b1[0]), IDS_SHELL); - b1[lstrlen(b1)+1] = '\0'; - SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1); + b1[lstrlenW(b1)+1] = '\0'; + SendMessageW(Globals.hdrivebar, TB_ADDSTRINGW, 0, (LPARAM)b1); drivebarBtn.idCommand = ID_DRIVE_SHELL_NS; - SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn); + SendMessageW(Globals.hdrivebar, TB_INSERTBUTTONW, btn++, (LPARAM)&drivebarBtn); drivebarBtn.iString++; #endif /* register windows drive root strings */ - SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)Globals.drives); + SendMessageW(Globals.hdrivebar, TB_ADDSTRINGW, 0, (LPARAM)Globals.drives); #endif drivebarBtn.idCommand = ID_DRIVE_FIRST; @@ -3853,10 +3769,10 @@ for(p=Globals.drives; *p; ) { #ifdef _NO_EXTENSIONS /* insert drive letter */ - TCHAR b[3] = {tolower(*p)}; - SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b); -#endif - switch(GetDriveType(p)) { + WCHAR b[3] = {tolower(*p)}; + SendMessageW(Globals.hdrivebar, TB_ADDSTRINGW, 0, (LPARAM)b); +#endif + switch(GetDriveTypeW(p)) { case DRIVE_REMOVABLE: drivebarBtn.iBitmap = 1; break; case DRIVE_CDROM: drivebarBtn.iBitmap = 3; break; case DRIVE_REMOTE: drivebarBtn.iBitmap = 4; break; @@ -3864,7 +3780,7 @@ default:/*DRIVE_FIXED*/ drivebarBtn.iBitmap = 2; } - SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn); + SendMessageW(Globals.hdrivebar, TB_INSERTBUTTONW, btn++, (LPARAM)&drivebarBtn); drivebarBtn.idCommand++; drivebarBtn.iString++; @@ -3885,13 +3801,13 @@ /* update window layout */ GetClientRect(Globals.hMainWnd, &rect); - SendMessage(Globals.hMainWnd, WM_SIZE, 0, MAKELONG(rect.right, rect.bottom)); -} - - -static BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow) -{ - HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow); + SendMessageW(Globals.hMainWnd, WM_SIZE, 0, MAKELONG(rect.right, rect.bottom)); +} + + +static BOOL launch_file(HWND hwnd, LPCWSTR cmd, UINT nCmdShow) +{ + HINSTANCE hinst = ShellExecuteW(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow); if (PtrToUlong(hinst) <= 32) { display_error(hwnd, GetLastError()); @@ -3904,15 +3820,15 @@ static BOOL launch_entry(Entry* entry, HWND hwnd, UINT nCmdShow) { - TCHAR cmd[MAX_PATH]; + WCHAR cmd[MAX_PATH]; #ifdef _SHELL_FOLDERS if (entry->etype == ET_SHELL) { BOOL ret = TRUE; - SHELLEXECUTEINFO shexinfo; - - shexinfo.cbSize = sizeof(SHELLEXECUTEINFO); + SHELLEXECUTEINFOW shexinfo; + + shexinfo.cbSize = sizeof(SHELLEXECUTEINFOW); shexinfo.fMask = SEE_MASK_IDLIST; shexinfo.hwnd = hwnd; shexinfo.lpVerb = NULL; @@ -3922,7 +3838,7 @@ shexinfo.nShow = nCmdShow; shexinfo.lpIDList = get_to_absolute_pidl(entry, hwnd); - if (!ShellExecuteEx(&shexinfo)) { + if (!ShellExecuteExW(&shexinfo)) { display_error(hwnd, GetLastError()); ret = FALSE; } @@ -3953,7 +3869,7 @@ if (!scanned_old) { - int idx = SendMessage(child->left.hwnd, LB_GETCURSEL, 0, 0); + int idx = SendMessageW(child->left.hwnd, LB_GETCURSEL, 0, 0); scan_entry(child, entry, idx, hwnd); } @@ -3972,9 +3888,9 @@ expand_entry(child, child->left.cur); if (!pane->treePane) focus_entry: { - int idxstart = SendMessage(child->left.hwnd, LB_GETCURSEL, 0, 0); - int idx = SendMessage(child->left.hwnd, LB_FINDSTRING, idxstart, (LPARAM)entry); - SendMessage(child->left.hwnd, LB_SETCURSEL, idx, 0); + int idxstart = SendMessageW(child->left.hwnd, LB_GETCURSEL, 0, 0); + int idx = SendMessageW(child->left.hwnd, LB_FINDSTRING, idxstart, (LPARAM)entry); + SendMessageW(child->left.hwnd, LB_SETCURSEL, idx, 0); set_curdir(child, entry, idx, hwnd); } } @@ -4061,25 +3977,25 @@ } -static BOOL is_directory(LPCTSTR target) +static BOOL is_directory(LPCWSTR target) { /*TODO correctly handle UNIX paths */ - DWORD target_attr = GetFileAttributes(target); + DWORD target_attr = GetFileAttributesW(target); if (target_attr == INVALID_FILE_ATTRIBUTES) return FALSE; return target_attr&FILE_ATTRIBUTE_DIRECTORY? TRUE: FALSE; } - -static BOOL prompt_target(Pane* pane, LPTSTR source, LPTSTR target) -{ - TCHAR path[MAX_PATH]; + +static BOOL prompt_target(Pane* pane, LPWSTR source, LPWSTR target) +{ + WCHAR path[MAX_PATH]; int len; get_path(pane->cur, path); - if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_SELECT_DESTINATION), pane->hwnd, DestinationDlgProc, (LPARAM)path) != IDOK) + if (DialogBoxParamW(Globals.hInstance, MAKEINTRESOURCEW(IDD_SELECT_DESTINATION), pane->hwnd, DestinationDlgProc, (LPARAM)path) != IDOK) return FALSE; get_path(pane->cur, source); @@ -4087,23 +4003,23 @@ /* convert relative targets to absolute paths */ if (path[0]!='/' && path[1]!=':') { get_path(pane->cur->up, target); - len = lstrlen(target); + len = lstrlenW(target); if (target[len-1]!='\\' && target[len-1]!='/') target[len++] = '/'; - lstrcpy(target+len, path); + lstrcpyW(target+len, path); } else - lstrcpy(target, path); + lstrcpyW(target, path); /* If the target already exists as directory, create a new target below this. */ if (is_directory(path)) { - TCHAR fname[_MAX_FNAME], ext[_MAX_EXT]; - static const TCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'}; - - _tsplitpath(source, NULL, NULL, fname, ext); - - wsprintf(target, sAppend, path, fname, ext); + WCHAR fname[_MAX_FNAME], ext[_MAX_EXT]; + static const WCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'}; + + _wsplitpath(source, NULL, NULL, fname, ext); + + wsprintfW(target, sAppend, path, fname, ext); } return TRUE; @@ -4202,7 +4118,7 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) { - ChildWnd* child = (ChildWnd*) GetWindowLongPtr(hwnd, GWLP_USERDATA); + ChildWnd* child = (ChildWnd*)GetWindowLongPtrW(hwnd, GWLP_USERDATA); ASSERT(child); switch(nmsg) { @@ -4225,7 +4141,7 @@ case WM_NCDESTROY: free_child_window(child); - SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); + SetWindowLongPtrW(hwnd, GWLP_USERDATA, 0); break; case WM_PAINT: { @@ -4253,7 +4169,7 @@ ScreenToClient(hwnd, &pt); if (pt.x>=child->split_pos-SPLIT_WIDTH/2 && pt.x<child->split_pos+SPLIT_WIDTH/2+1) { - SetCursor(LoadCursor(0, IDC_SIZEWE)); + SetCursor(LoadCursorW(0, (LPCWSTR)IDC_SIZEWE)); return TRUE; } } @@ -4310,7 +4226,7 @@ resize_tree(child, rt.right, rt.bottom); last_split = -1; ReleaseCapture(); - SetCursor(LoadCursor(0, IDC_ARROW)); + SetCursor(LoadCursorW(0, (LPCWSTR)IDC_ARROW)); } break; @@ -4352,7 +4268,7 @@ #ifndef _NO_EXTENSIONS case WM_GETMINMAXINFO: - DefMDIChildProc(hwnd, nmsg, wparam, lparam); + DefMDIChildProcW(hwnd, nmsg, wparam, lparam); {LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam; @@ -4362,7 +4278,7 @@ #endif /* _NO_EXTENSIONS */ case WM_SETFOCUS: - if (SetCurrentDirectory(child->path)) + if (SetCurrentDirectoryW(child->path)) set_space_status(); SetFocus(child->focus_pane? child->right.hwnd: child->left.hwnd); break; @@ -4389,42 +4305,42 @@ break; case ID_FILE_MOVE: { - TCHAR source[BUFFER_LEN], target[BUFFER_LEN]; + WCHAR source[BUFFER_LEN], target[BUFFER_LEN]; if (prompt_target(pane, source, target)) { - SHFILEOPSTRUCT shfo = {hwnd, FO_MOVE, source, target}; - - source[lstrlen(source)+1] = '\0'; - target[lstrlen(target)+1] = '\0'; - - if (!SHFileOperation(&shfo)) + SHFILEOPSTRUCTW shfo = {hwnd, FO_MOVE, source, target}; + + source[lstrlenW(source)+1] = '\0'; + target[lstrlenW(target)+1] = '\0'; + + if (!SHFileOperationW(&shfo)) refresh_child(child); } break;} case ID_FILE_COPY: { - TCHAR source[BUFFER_LEN], target[BUFFER_LEN]; + WCHAR source[BUFFER_LEN], target[BUFFER_LEN]; if (prompt_target(pane, source, target)) { - SHFILEOPSTRUCT shfo = {hwnd, FO_COPY, source, target}; - - source[lstrlen(source)+1] = '\0'; - target[lstrlen(target)+1] = '\0'; - - if (!SHFileOperation(&shfo)) + SHFILEOPSTRUCTW shfo = {hwnd, FO_COPY, source, target}; + + source[lstrlenW(source)+1] = '\0'; + target[lstrlenW(target)+1] = '\0'; + + if (!SHFileOperationW(&shfo)) refresh_child(child); } break;} case ID_FILE_DELETE: { - TCHAR path[BUFFER_LEN]; - SHFILEOPSTRUCT shfo = {hwnd, FO_DELETE, path, NULL, FOF_ALLOWUNDO}; + WCHAR path[BUFFER_LEN]; + SHFILEOPSTRUCTW shfo = {hwnd, FO_DELETE, path, NULL, FOF_ALLOWUNDO}; get_path(pane->cur, path); - path[lstrlen(path)+1] = '\0'; - - if (!SHFileOperation(&shfo)) + path[lstrlenW(path)+1] = '\0'; + + if (!SHFileOperationW(&shfo)) refresh_child(child); break;} @@ -4448,11 +4364,11 @@ struct FilterDialog dlg; memset(&dlg, 0, sizeof(struct FilterDialog)); - lstrcpy(dlg.pattern, child->filter_pattern); + lstrcpyW(dlg.pattern, child->filter_pattern); dlg.flags = child->filter_flags; - if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_DIALOG_VIEW_TYPE), hwnd, FilterDialogDlgProc, (LPARAM)&dlg) == IDOK) { - lstrcpy(child->filter_pattern, dlg.pattern); + if (DialogBoxParamW(Globals.hInstance, MAKEINTRESOURCEW(IDD_DIALOG_VIEW_TYPE), hwnd, FilterDialogDlgProc, (LPARAM)&dlg) == IDOK) { + lstrcpyW(child->filter_pattern, dlg.pattern); child->filter_flags = dlg.flags; refresh_right_pane(child); } @@ -4481,8 +4397,8 @@ switch(HIWORD(wparam)) { case LBN_SELCHANGE: { - int idx = SendMessage(pane->hwnd, LB_GETCURSEL, 0, 0); - Entry* entry = (Entry*) SendMessage(pane->hwnd, LB_GETITEMDATA, idx, 0); + int idx = SendMessageW(pane->hwnd, LB_GETCURSEL, 0, 0); + Entry* entry = (Entry*)SendMessageW(pane->hwnd, LB_GETITEMDATA, idx, 0); if (pane == &child->left) set_curdir(child, entry, idx, hwnd); @@ -4513,15 +4429,15 @@ pt_clnt.x = pt.x = (short)LOWORD(lparam); pt_clnt.y = pt.y = (short)HIWORD(lparam); ScreenToClient(hpanel, &pt_clnt); - SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt_clnt.x, pt_clnt.y)); - SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt_clnt.x, pt_clnt.y)); + SendMessageW(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt_clnt.x, pt_clnt.y)); + SendMessageW(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt_clnt.x, pt_clnt.y)); /* now create the popup menu using shell namespace and IContextMenu */ pane = GetFocus()==child->left.hwnd? &child->left: &child->right; - idx = SendMessage(pane->hwnd, LB_GETCURSEL, 0, 0); + idx = SendMessageW(pane->hwnd, LB_GETCURSEL, 0, 0); if (idx != -1) { - Entry* entry = (Entry*) SendMessage(pane->hwnd, LB_GETITEMDATA, idx, 0); + Entry* entry = (Entry*)SendMessageW(pane->hwnd, LB_GETITEMDATA, idx, 0); LPITEMIDLIST pidl_abs = get_to_absolute_pidl(entry, hwnd); @@ -4575,7 +4491,7 @@ /* fall through */ default: def: - return DefMDIChildProc(hwnd, nmsg, wparam, lparam); + return DefMDIChildProcW(hwnd, nmsg, wparam, lparam); } return 0; @@ -4584,8 +4500,8 @@ static LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) { - ChildWnd* child = (ChildWnd*) GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); - Pane* pane = (Pane*) GetWindowLongPtr(hwnd, GWLP_USERDATA); + ChildWnd* child = (ChildWnd*)GetWindowLongPtrW(GetParent(hwnd), GWLP_USERDATA); + Pane* pane = (Pane*)GetWindowLongPtrW(hwnd, GWLP_USERDATA); ASSERT(child); switch(nmsg) { @@ -4597,7 +4513,7 @@ case WM_SETFOCUS: child->focus_pane = pane==&child->right? 1: 0; - SendMessage(hwnd, LB_SETSEL, TRUE, 1); + SendMessageW(hwnd, LB_SETSEL, TRUE, 1); /*TODO: check menu items */ break; @@ -4608,16 +4524,16 @@ } } - return CallWindowProc(g_orgTreeWndProc, hwnd, nmsg, wparam, lparam); + return CallWindowProcW(g_orgTreeWndProc, hwnd, nmsg, wparam, lparam); } 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'}; - - WNDCLASSEX wcFrame; - WNDCLASS wcChild; + static const WCHAR sFont[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'}; + + WNDCLASSEXW wcFrame; + WNDCLASSW wcChild; ATOM hChildClass; int col; @@ -4635,25 +4551,20 @@ /* register frame window class */ - wcFrame.cbSize = sizeof(WNDCLASSEX); + wcFrame.cbSize = sizeof(WNDCLASSEXW); wcFrame.style = 0; wcFrame.lpfnWndProc = FrameWndProc; wcFrame.cbClsExtra = 0; wcFrame.cbWndExtra = 0; wcFrame.hInstance = hinstance; - wcFrame.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_WINEFILE)); - wcFrame.hCursor = LoadCursor(0, IDC_ARROW); + wcFrame.hIcon = LoadIconW(hinstance, MAKEINTRESOURCEW(IDI_WINEFILE)); + wcFrame.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); wcFrame.hbrBackground = 0; wcFrame.lpszMenuName = 0; wcFrame.lpszClassName = sWINEFILEFRAME; - wcFrame.hIconSm = (HICON)LoadImage(hinstance, - MAKEINTRESOURCE(IDI_WINEFILE), - IMAGE_ICON, - GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), - LR_SHARED); - - Globals.hframeClass = RegisterClassEx(&wcFrame); + wcFrame.hIconSm = LoadImageW(hinstance, MAKEINTRESOURCEW(IDI_WINEFILE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED); + + Globals.hframeClass = RegisterClassExW(&wcFrame); /* register tree windows class */ @@ -4664,17 +4575,17 @@ wcChild.cbWndExtra = 0; wcChild.hInstance = hinstance; wcChild.hIcon = 0; - wcChild.hCursor = LoadCursor(0, IDC_ARROW); + wcChild.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); wcChild.hbrBackground = 0; wcChild.lpszMenuName = 0; wcChild.lpszClassName = sWINEFILETREE; - hChildClass = RegisterClass(&wcChild); - - - Globals.haccel = LoadAccelerators(hinstance, MAKEINTRESOURCE(IDA_WINEFILE)); - - Globals.hfont = CreateFont(-MulDiv(8,GetDeviceCaps(hdc,LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sFont); + hChildClass = RegisterClassW(&wcChild); + + + Globals.haccel = LoadAcceleratorsW(hinstance, MAKEINTRESOURCEW(IDA_WINEFILE)); + + Globals.hfont = CreateFontW(-MulDiv(8,GetDeviceCaps(hdc,LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sFont); ReleaseDC(0, hdc); @@ -4684,7 +4595,7 @@ CoInitialize(NULL); CoGetMalloc(MEMCTX_TASK, &Globals.iMalloc); SHGetDesktopFolder(&Globals.iDesktop); - Globals.cfStrFName = RegisterClipboardFormat(CFSTR_FILENAME); + Globals.cfStrFName = RegisterClipboardFormatW(CFSTR_FILENAMEW); #endif /* load column strings */ @@ -4706,11 +4617,11 @@ } -static BOOL show_frame(HWND hwndParent, int cmdshow, LPCTSTR path) -{ - static const TCHAR sMDICLIENT[] = {'M','D','I','C','L','I','E','N','T','\0'}; - - TCHAR buffer[MAX_PATH], b1[BUFFER_LEN]; +static BOOL show_frame(HWND hwndParent, int cmdshow, LPCWSTR path) +{ + static const WCHAR sMDICLIENT[] = {'M','D','I','C','L','I','E','N','T','\0'}; + + WCHAR buffer[MAX_PATH], b1[BUFFER_LEN]; ChildWnd* child; HMENU hMenuFrame, hMenuWindow; windowOptions opts; @@ -4721,7 +4632,7 @@ return TRUE; opts = load_registry_settings(); - hMenuFrame = LoadMenu(Globals.hInstance, MAKEINTRESOURCE(IDM_WINEFILE)); + hMenuFrame = LoadMenuW(Globals.hInstance, MAKEINTRESOURCEW(IDM_WINEFILE)); hMenuWindow = GetSubMenu(hMenuFrame, GetMenuItemCount(hMenuFrame)-2); Globals.hMenuFrame = hMenuFrame; @@ -4733,12 +4644,12 @@ /* create main window */ - Globals.hMainWnd = CreateWindowEx(0, MAKEINTRESOURCE(Globals.hframeClass), RS(b1,IDS_WINE_FILE), WS_OVERLAPPEDWINDOW, + Globals.hMainWnd = CreateWindowExW(0, MAKEINTRESOURCEW(Globals.hframeClass), RS(b1,IDS_WINE_FILE), WS_OVERLAPPEDWINDOW, opts.start_x, opts.start_y, opts.width, opts.height, hwndParent, Globals.hMenuFrame, Globals.hInstance, 0/*lpParam*/); - Globals.hmdiclient = CreateWindowEx(0, sMDICLIENT, NULL, + Globals.hmdiclient = CreateWindowExW(0, sMDICLIENT, NULL, WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER, 0, 0, 0, 0, Globals.hMainWnd, 0, Globals.hInstance, &ccs); @@ -4766,18 +4677,18 @@ CheckMenuItem(Globals.hMenuOptions, ID_VIEW_TOOL_BAR, MF_BYCOMMAND|MF_CHECKED); } - Globals.hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, Globals.hMainWnd, IDW_STATUSBAR); + Globals.hstatusbar = CreateStatusWindowW(WS_CHILD|WS_VISIBLE, 0, Globals.hMainWnd, IDW_STATUSBAR); CheckMenuItem(Globals.hMenuOptions, ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED); -/* CreateStatusWindow does not accept WS_BORDER - Globals.hstatusbar = CreateWindowEx(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0, +/* CreateStatusWindowW does not accept WS_BORDER + Globals.hstatusbar = CreateWindowExW(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_BORDER|CCS_NODIVIDER, 0,0,0,0, Globals.hMainWnd, (HMENU)IDW_STATUSBAR, hinstance, 0);*/ /*TODO: read paths from registry */ if (!path || !*path) { - GetCurrentDirectory(MAX_PATH, buffer); + GetCurrentDirectoryW(MAX_PATH, buffer); path = buffer; } @@ -4803,7 +4714,7 @@ SetWindowPlacement(child->hwnd, &child->pos); - Globals.himl = ImageList_LoadBitmap(Globals.hInstance, MAKEINTRESOURCE(IDB_IMAGES), 16, 0, RGB(0,255,0)); + Globals.himl = ImageList_LoadImageW(Globals.hInstance, MAKEINTRESOURCEW(IDB_IMAGES), 16, 0, RGB(0,255,0), IMAGE_BITMAP, 0); Globals.prescan_node = FALSE; @@ -4812,25 +4723,25 @@ if (child->hwnd && path && path[0]) { int index,count; - TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT]; - TCHAR fullname[_MAX_FNAME+_MAX_EXT+1]; + WCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT]; + WCHAR fullname[_MAX_FNAME+_MAX_EXT+1]; memset(name,0,sizeof(name)); memset(name,0,sizeof(ext)); - _tsplitpath(path, drv, dir, name, ext); + _wsplitpath(path, drv, dir, name, ext); if (name[0]) { - count = SendMessage(child->right.hwnd, LB_GETCOUNT, 0, 0); - lstrcpy(fullname,name); - lstrcat(fullname,ext); + count = SendMessageW(child->right.hwnd, LB_GETCOUNT, 0, 0); + lstrcpyW(fullname,name); + lstrcatW(fullname,ext); for (index = 0; index < count; index ++) { - Entry* entry = (Entry*) SendMessage(child->right.hwnd, LB_GETITEMDATA, index, 0); - if (lstrcmp(entry->data.cFileName,fullname)==0 || - lstrcmp(entry->data.cAlternateFileName,fullname)==0) + Entry* entry = (Entry*)SendMessageW(child->right.hwnd, LB_GETITEMDATA, index, 0); + if (lstrcmpW(entry->data.cFileName,fullname)==0 || + lstrcmpW(entry->data.cAlternateFileName,fullname)==0) { - SendMessage(child->right.hwnd, LB_SETCURSEL, index, 0); + SendMessageW(child->right.hwnd, LB_SETCURSEL, index, 0); SetFocus(child->right.hwnd); break; } @@ -4860,11 +4771,11 @@ static BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lparam) { - TCHAR cls[128]; + WCHAR cls[128]; GetClassName(hwnd, cls, 128); - if (!lstrcmp(cls, (LPCTSTR)lparam)) { + if (!lstrcmpW(cls, (LPCWSTR)lparam)) { g_foundPrevInstance++; return FALSE; } @@ -4873,7 +4784,7 @@ } /* search for window of given class name to allow only one running instance */ -static int find_window_class(LPCTSTR classname) +static int find_window_class(LPCWSTR classname) { EnumWindows(EnumWndProc, (LPARAM)classname); @@ -4885,10 +4796,10 @@ #endif -static int winefile_main(HINSTANCE hinstance, int cmdshow, LPCTSTR path) +static int winefile_main(HINSTANCE hinstance, int cmdshow, LPCWSTR path) { MSG msg; - + InitInstance(hinstance); if( !show_frame(0, cmdshow, path) ) @@ -4897,15 +4808,15 @@ return 1; } - while(GetMessage(&msg, 0, 0, 0)) { + while(GetMessageW(&msg, 0, 0, 0)) { if (Globals.hmdiclient && TranslateMDISysAccel(Globals.hmdiclient, &msg)) continue; - if (Globals.hMainWnd && TranslateAccelerator(Globals.hMainWnd, Globals.haccel, &msg)) + if (Globals.hMainWnd && TranslateAcceleratorW(Globals.hMainWnd, Globals.haccel, &msg)) continue; TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageW(&msg); } ExitInstance(); @@ -4914,7 +4825,7 @@ } -#if defined(UNICODE) && defined(_MSC_VER) +#if defined(_MSC_VER) int APIENTRY wWinMain(HINSTANCE hinstance, HINSTANCE previnstance, LPWSTR cmdline, int cmdshow) #else int APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE previnstance, LPSTR cmdline, int cmdshow) @@ -4925,15 +4836,11 @@ return 1; #endif -#if defined(UNICODE) && !defined(_MSC_VER) { /* convert ANSI cmdline into WCS path string */ - TCHAR buffer[MAX_PATH]; + WCHAR buffer[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, cmdline, -1, buffer, MAX_PATH); winefile_main(hinstance, cmdshow, buffer); } -#else - winefile_main(hinstance, cmdshow, cmdline); -#endif return 0; } Modified: trunk/rosapps/applications/winfile/winefile.h URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/winef…
============================================================================== --- trunk/rosapps/applications/winfile/winefile.h [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/winefile.h [iso-8859-1] Sun Sep 27 14:09:24 2009 @@ -43,7 +43,7 @@ #include <locale.h> #include <time.h> -#include <shellapi.h> /* for ShellExecute() */ +#include <shellapi.h> /* for ShellExecuteW() */ #include <shlobj.h> /* for SHFormatDrive() */ #ifndef _NO_EXTENSIONS @@ -128,11 +128,11 @@ HWND hdrivebar; HFONT hfont; - TCHAR num_sep; + WCHAR num_sep; SIZE spaceSize; HIMAGELIST himl; - TCHAR drives[BUFFER_LEN]; + WCHAR drives[BUFFER_LEN]; BOOL prescan_node; /*TODO*/ BOOL saveSettings; @@ -145,18 +145,4 @@ extern WINEFILE_GLOBALS Globals; -#ifdef __WINE__ - -#ifdef UNICODE extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); -#define _tsplitpath _wsplitpath -#else -extern void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext); -#define _tsplitpath _splitpath -#endif - -#else - -#include <tchar.h> /* for _tsplitpath() */ - -#endif
15 years, 2 months
1
0
0
0
[dreimer] 43184: Sync xcopy, winhlp32 and wordpad to Wine 1.1.30
by dreimer@svn.reactos.org
Author: dreimer Date: Sun Sep 27 14:09:18 2009 New Revision: 43184 URL:
http://svn.reactos.org/svn/reactos?rev=43184&view=rev
Log: Sync xcopy, winhlp32 and wordpad to Wine 1.1.30 Added: trunk/reactos/base/applications/cmdutils/xcopy/Ja.rc (with props) trunk/reactos/base/applications/winhlp32/Ro.rc (with props) Modified: trunk/reactos/base/applications/cmdutils/xcopy/rsrc.rc trunk/reactos/base/applications/winhlp32/It.rc trunk/reactos/base/applications/winhlp32/rsrc.rc trunk/reactos/base/applications/wordpad/print.c trunk/reactos/base/applications/wordpad/wordpad.c Added: trunk/reactos/base/applications/cmdutils/xcopy/Ja.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/xcopy/Ja.rc (added) +++ trunk/reactos/base/applications/cmdutils/xcopy/Ja.rc [iso-8859-1] Sun Sep 27 14:09:18 2009 @@ -1,0 +1,84 @@ +/* + * XCOPY - Wine-compatible xcopy program + * Japanese language support + * + * Copyright (C) 2007 J. Edmeades + * Copyright (C) 2009 Akihiro Sagawa + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "xcopy.h" + +#pragma code_page(65001) + +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT + +STRINGTABLE +{ + STRING_INVPARMS, "ãã©ã¡ã¼ã¿ã®æ°ãéãã¾ããxcopy /? ã§ä½¿ãæ¹ã表示ãã¾ã\n" + STRING_INVPARM, "ç¡å¹ãªãã©ã¡ã¼ã¿ '%s' ã§ããxcopy /? ã§ä½¿ãæ¹ã表示ãã¾ã\n" + STRING_PAUSE, "ã³ãã¼ãéå§ããã«ã¯ <enter> ãæ¼ãã¦ãã ãã\n" + STRING_SIMCOPY, "%d ãã¡ã¤ã«ãã³ãã¼ãããè¦è¾¼ã¿ã§ãã\n" + STRING_COPY, "%d ãã¡ã¤ã«ãã³ãã¼ãã¾ãã\n" + STRING_QISDIR, "éãå ã® '%s' ã¯ãã¡ã¤ã«åã§ããã\n" \ + "ãã£ã¬ã¯ããªã§ãã?\n" \ + "(F - ãã¡ã¤ã«ãD - ãã£ã¬ã¯ããª)\n" + STRING_SRCPROMPT,"%s? (Yes|No)\n" + STRING_OVERWRITE,"%s ãä¸æ¸ããã¾ãã? (Yes|No|All)\n" + STRING_COPYFAIL, "'%s' ãã '%s' ã¸ã®ã³ãã¼ã¯å¤±æãã¾ãããæ»ãå¤ %d\n" + STRING_OPENFAIL, "'%s' ãéãã¾ãã\n" + STRING_READFAIL, "'%s' ã®èªã¿è¾¼ã¿ä¸ã«å¤±æãã¾ãã\n" + STRING_YES_CHAR, "Y" + STRING_NO_CHAR, "N" + STRING_ALL_CHAR, "A" + STRING_FILE_CHAR,"F" + STRING_DIR_CHAR, "D" + + STRING_HELP, +"XCOPY - éãå ã®ãã¡ã¤ã«ããã£ã¬ã¯ããªãéãå ã«ã³ãã¼ãã¾ã\n\ +\n\ +æ§æ:\n\ +XCOPY éãå [éãå ] [/I] [/S] [/Q] [/F] [/L] [/W] [/T] [/N] [/U]\n\ +\t [/R] [/H] [/C] [/P] [/A] [/M] [/E] [/D] [/Y] [/-Y]\n\ +\n\ +ãªãã·ã§ã³:\n\ +\n\ +[/I] éãå ãåå¨ãããè¤æ°ã®ãã¡ã¤ã«ãã³ãã¼ããã¨ãã¯ãéãå ã\n\ +\tãã£ã¬ã¯ããªã¨ã¿ãªãã¾ãã\n\ +[/S] ãã£ã¬ã¯ããªã¨ãµããã£ã¬ã¯ããªãã³ãã¼ãã¾ãã\n\ +[/E] 空ãã£ã¬ã¯ããªãå«ãããã£ã¬ã¯ããªã¨ãµããã£ã¬ã¯ããªãã³ãã¼ã\n\ +[/Q] ã³ãã¼ä¸ã«ãã¡ã¤ã«åãä¸è¦§ã«ãã¾ãããããªãã¡å¯¡é»ã§ãã\n\ +[/F] ã³ãã¼ä¸ã«ãã«ãã¹ã§éãå ã¨éãå ã®ååã表示ãã¾ãã\n\ +[/L] æä½ã模æ¬å®è¡ããã³ãã¼äºå®ã®ãã¡ã¤ã«åã表示ãã¾ãã\n\ +[/W] ã³ãã¼ãéå§ããåã«ç¢ºèªã®ã¡ãã»ã¼ã¸ã表示ãã¾ãã\n\ +[/T] 空ã®ãã£ã¬ã¯ããªæ§é ãä½æãã¾ããããã¡ã¤ã«ã¯ã³ãã¼ãã¾ããã\n\ +[/Y] ãã¡ã¤ã«ãä¸æ¸ãããæã«ç¢ºèªã®ã¡ãã»ã¼ã¸ã表示ãã¾ããã\n\ +[/-Y] ãã¡ã¤ã«ãä¸æ¸ãããæã«ç¢ºèªã®ã¡ãã»ã¼ã¸ã表示ãã¾ãã\n\ +[/P] åãã¡ã¤ã«ã®ã³ãã¼åã«ç¢ºèªã®ã¡ãã»ã¼ã¸ã表示ãã¾ãã\n\ +[/N] çããã¡ã¤ã«åãå©ç¨ãã¦ã³ãã¼ãã¾ãã\n\ +[/U] éãå ã«ãããã¡ã¤ã«ã ãã³ãã¼ãã¾ãã\n\ +[/R] èªã¿åãå°ç¨ãã¡ã¤ã«ãä¸æ¸ããã¾ãã\n\ +[/H] é ããã¡ã¤ã«ãã·ã¹ãã ãã¡ã¤ã«ãã³ãã¼ãã¾ãã\n\ +[/C] ã³ãã¼ä¸ã«ã¨ã©ã¼ãèµ·ãã£ã¦ãç¶è¡ãã¾ãã\n\ +[/A] ã¢ã¼ã«ã¤ãå±æ§ã®ãã¡ã¤ã«ã ãã³ãã¼ãã¾ãã\n\ +[/M] ã¢ã¼ã«ã¤ãå±æ§ã®ãã¡ã¤ã«ã ãã³ãã¼ããã¢ã¼ã«ã¤ãå±æ§ã\n\ +\tåãé¤ãã¾ãã\n\ +[/D | /D:æ-æ¥-å¹´] æ°ãããã¡ã¤ã«ãæå®ãããæ¥ä»ä»¥éã«å¤æ´ããã\n\ +\t\tãã¡ã¤ã«ãã³ãã¼ãã¾ããæ¥ä»ãæå®ãããªãå ´åã¯ã\n\ +\t\tã³ãã¼å ãã³ãã¼å ããå¤ããã¡ã¤ã«ã ãã³ãã¼ãã¾ãã\n\n" + +} +#pragma code_page(default) Propchange: trunk/reactos/base/applications/cmdutils/xcopy/Ja.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/cmdutils/xcopy/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/xcopy/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/xcopy/rsrc.rc [iso-8859-1] Sun Sep 27 14:09:18 2009 @@ -30,6 +30,7 @@ #include "De.rc" #include "En.rc" #include "Fr.rc" +#include "Ja.rc" #include "Ko.rc" #include "Lt.rc" #include "Nl.rc" Modified: trunk/reactos/base/applications/winhlp32/It.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/It.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/It.rc [iso-8859-1] Sun Sep 27 14:09:18 2009 @@ -31,7 +31,7 @@ MENUITEM "&Apri...", MNID_FILE_OPEN MENUITEM SEPARATOR MENUITEM "S&tampa", MNID_FILE_PRINT - MENUITEM "&Setup stampante...", MNID_FILE_SETUP + MENUITEM "&Installazione stampante...", MNID_FILE_SETUP MENUITEM SEPARATOR MENUITEM "&Esci", MNID_FILE_EXIT } Added: trunk/reactos/base/applications/winhlp32/Ro.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/Ro.rc (added) +++ trunk/reactos/base/applications/winhlp32/Ro.rc [iso-8859-1] Sun Sep 27 14:09:18 2009 @@ -1,0 +1,133 @@ +/* + * Help Viewer + * + * Copyright 1996 Ulrich Schmid + * Copyright 2002 Sylvain Petreolle <spetreolle(a)yahoo.fr> + * Copyright 2009 Michael Stefaniuc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "winhelp_res.h" + +LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL + +#pragma code_page(65001) + +/* Menu */ + +MAIN_MENU MENU +{ + POPUP "&FiÈier" { + MENUITEM "&Deschide", MNID_FILE_OPEN + MENUITEM SEPARATOR + MENUITEM "&TipÄreÈte", MNID_FILE_PRINT + MENUITEM "&Setare imprimantÄ", MNID_FILE_SETUP + MENUITEM SEPARATOR + MENUITEM "&IeÈire", MNID_FILE_EXIT + } + POPUP "&Editare" { + MENUITEM "&CopiazÄ...", MNID_EDIT_COPYDLG + MENUITEM SEPARATOR + MENUITEM "&AdnoteazÄ...", MNID_EDIT_ANNOTATE + } + POPUP "&Se&mn de carte" { + MENUITEM "&DefineÈte...", MNID_BKMK_DEFINE + } + POPUP "&OpÈiuni" { + POPUP "&Ajutor întotdeauna vizibil" + BEGIN + MENUITEM "Implicit", MNID_OPTS_HELP_DEFAULT + MENUITEM "Vizibil", MNID_OPTS_HELP_VISIBLE + MENUITEM "Invizibil", MNID_OPTS_HELP_NONVISIBLE + END + MENUITEM "Istorie", MNID_OPTS_HISTORY + POPUP "&Font" + BEGIN + MENUITEM "Mic", MNID_OPTS_FONTS_SMALL + MENUITEM "Normal", MNID_OPTS_FONTS_NORMAL + MENUITEM "Mare", MNID_OPTS_FONTS_LARGE + END + MENUITEM "UtilizeazÄ culorile sistemului", MNID_OPTS_SYSTEM_COLORS + } + POPUP "&Ajutor" { + MENUITEM "Ajut&or despre ajutor", MNID_HELP_HELPON + MENUITEM "Ãn&totdeauna deasupra", MNID_HELP_HELPTOP + MENUITEM SEPARATOR + MENUITEM "&InformaÈii...", MNID_HELP_ABOUT +#ifdef WINELIB + MENUITEM "&Despre Wine", MNID_HELP_WINE +#endif + } +} + +IDD_INDEX DIALOG DISCARDABLE 0, 0, 200, 190 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +FONT 8, "MS Shell Dlg" +CAPTION "Index" +{ + LISTBOX IDC_INDEXLIST, 10, 10, 180, 150, LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_BORDER +} + +IDD_SEARCH DIALOG DISCARDABLE 0, 0, 200, 190 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +FONT 8, "MS Shell Dlg" +CAPTION "CÄutare" +{ + LTEXT "ÃncÄ neimplementatÄ", -1, 10, 10, 180, 150 +} + +/* Strings */ +STRINGTABLE DISCARDABLE +{ +STID_WINE_HELP, "Ajutor Wine" +STID_WHERROR, "EROARE" +STID_WARNING, "AVERTISMENT" +STID_INFO, "InformaÈie" +STID_NOT_IMPLEMENTED, "Neimplementat" +STID_HLPFILE_ERROR_s, "Eroare la citirea fiÈierului de ajutor â%sâ" +STID_INDEX, "&Index" +STID_CONTENTS, "Rezumat" +STID_BACK, "Ãn&apoi" +STID_ALL_FILES, "Toate fiÈierele (*.*)" +STID_HELP_FILES_HLP, "FiÈierele de ajutor (*.hlp)" +STID_FILE_NOT_FOUND_s "FiÈierul â%sâ nu poate fi gÄsit. VreÈi sÄ-l cautaÈi?" +STID_NO_RICHEDIT "Nu am gÄsit o implementare pentru richedit... Abandonez" +STID_PSH_INDEX, "Subiecte de ajutor:" +} + +CONTEXT_MENU MENU +BEGIN + POPUP "" + BEGIN + MENUITEM "Adnotare...", MNID_CTXT_ANNOTATE + MENUITEM "CopiazÄ", MNID_CTXT_COPY + MENUITEM "TipÄreÈte...", MNID_CTXT_PRINT + POPUP "Fonturi" + BEGIN + MENUITEM "Mic", MNID_CTXT_FONTS_SMALL + MENUITEM "Normal", MNID_CTXT_FONTS_NORMAL + MENUITEM "Mare", MNID_CTXT_FONTS_LARGE + END + POPUP "Ajutorul întotdeauna vizibil" + BEGIN + MENUITEM "Implicit", MNID_CTXT_HELP_DEFAULT + MENUITEM "Vizibil", MNID_CTXT_HELP_VISIBLE + MENUITEM "Invizibil", MNID_CTXT_HELP_NONVISIBLE + END + MENUITEM "UtilizeazÄ culorile sistemului", MNID_CTXT_SYSTEM_COLORS + END +END +#pragma code_page(default) Propchange: trunk/reactos/base/applications/winhlp32/Ro.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/winhlp32/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/rsrc.rc [iso-8859-1] Sun Sep 27 14:09:18 2009 @@ -42,6 +42,7 @@ #include "Pl.rc" #include "Pt.rc" #include "Rm.rc" +#include "Ro.rc" #include "Ru.rc" #include "Si.rc" #include "Sk.rc" Modified: trunk/reactos/base/applications/wordpad/print.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/print.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/print.c [iso-8859-1] Sun Sep 27 14:09:18 2009 @@ -97,7 +97,7 @@ WS_VISIBLE | WS_CHILD, 5, 5, 100, 15, hRebarWnd, ULongToHandle(command), hInstance, NULL); - rb.cbSize = sizeof(rb); + rb.cbSize = REBARBANDINFOW_V6_SIZE; rb.fMask = RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_CHILD | RBBIM_IDEALSIZE | RBBIM_ID; rb.fStyle = RBBS_NOGRIPPER | RBBS_VARIABLEHEIGHT; rb.hwndChild = hButton; @@ -448,7 +448,7 @@ WS_VISIBLE | WS_CHILD, 0, 0, 0, 0, hReBar, NULL, NULL, NULL); - rb.cbSize = sizeof(rb); + rb.cbSize = REBARBANDINFOW_V6_SIZE; rb.fMask = RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_CHILD | RBBIM_IDEALSIZE | RBBIM_ID; rb.fStyle = RBBS_NOGRIPPER | RBBS_VARIABLEHEIGHT; rb.hwndChild = hStatic; Modified: trunk/reactos/base/applications/wordpad/wordpad.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/wordpad.c [iso-8859-1] Sun Sep 27 14:09:18 2009 @@ -644,7 +644,7 @@ REBARBANDINFOW rbbinfo; int index = SendMessageW(hwndReBar, RB_IDTOINDEX, BANDID_FONTLIST, 0); - rbbinfo.cbSize = sizeof(rbbinfo); + rbbinfo.cbSize = REBARBANDINFOW_V6_SIZE; rbbinfo.fMask = RBBIM_STYLE; SendMessageW(hwndReBar, RB_GETBANDINFO, index, (LPARAM)&rbbinfo); @@ -1795,7 +1795,7 @@ SendMessageW(hToolBarWnd, TB_AUTOSIZE, 0, 0); - rbb.cbSize = sizeof(rbb); + rbb.cbSize = REBARBANDINFOW_V6_SIZE; rbb.fMask = RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_CHILD | RBBIM_STYLE | RBBIM_ID; rbb.fStyle = RBBS_CHILDEDGE | RBBS_BREAK | RBBS_NOGRIPPER; rbb.cx = 0;
15 years, 2 months
1
0
0
0
[dgorbachev] 43183: Fix undefined behavior, already fixed in Wine.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sun Sep 27 13:56:35 2009 New Revision: 43183 URL:
http://svn.reactos.org/svn/reactos?rev=43183&view=rev
Log: Fix undefined behavior, already fixed in Wine. Modified: trunk/reactos/dll/directx/dsound/capture.c Modified: trunk/reactos/dll/directx/dsound/capture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/dsound/capture…
============================================================================== --- trunk/reactos/dll/directx/dsound/capture.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/dsound/capture.c [iso-8859-1] Sun Sep 27 13:56:35 2009 @@ -428,7 +428,7 @@ if (This->state == STATE_STARTING) This->state = STATE_CAPTURING; capture_CheckNotify(Moi, (DWORD_PTR)This->pwave[index].lpData - (DWORD_PTR)This->buffer, This->pwave[index].dwBufferLength); - This->index = (++This->index) % This->nrofpwaves; + This->index = (This->index + 1) % This->nrofpwaves; if ( (This->index == 0) && !(This->capture_buffer->flags & DSCBSTART_LOOPING) ) { TRACE("end of buffer\n"); This->state = STATE_STOPPED;
15 years, 2 months
1
0
0
0
[dgorbachev] 43182: Kill goto, avoid compiler warnings.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sun Sep 27 13:56:16 2009 New Revision: 43182 URL:
http://svn.reactos.org/svn/reactos?rev=43182&view=rev
Log: Kill goto, avoid compiler warnings. Modified: trunk/reactos/dll/win32/user32/windows/message.c Modified: trunk/reactos/dll/win32/user32/windows/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Sun Sep 27 13:56:16 2009 @@ -390,7 +390,10 @@ static BOOL FASTCALL MsgiAnsiToUnicodeMessage(LPMSG UnicodeMsg, LPMSG AnsiMsg) { + UNICODE_STRING UnicodeString; + *UnicodeMsg = *AnsiMsg; + switch (AnsiMsg->message) { case WM_GETTEXT: @@ -415,7 +418,9 @@ case LB_ADDFILE: case EM_REPLACESEL: { - goto ConvertLParamString; + RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)AnsiMsg->lParam); + UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer; + break; } case LB_ADDSTRING: @@ -432,7 +437,8 @@ if (!(dwStyle & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) && (dwStyle & LBS_HASSTRINGS)) { - goto ConvertLParamString; + RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)AnsiMsg->lParam); + UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer; } break; } @@ -447,9 +453,6 @@ if (!(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) && (dwStyle & CBS_HASSTRINGS)) { - UNICODE_STRING UnicodeString; - -ConvertLParamString: RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)AnsiMsg->lParam); UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer; } @@ -459,13 +462,13 @@ case WM_NCCREATE: case WM_CREATE: { - UNICODE_STRING UnicodeBuffer; struct s { CREATESTRUCTW cs; /* new structure */ LPCWSTR lpszName; /* allocated Name */ LPCWSTR lpszClass; /* allocated Class */ }; + struct s *xs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct s)); if (!xs) { @@ -474,13 +477,13 @@ xs->cs = *(CREATESTRUCTW *)AnsiMsg->lParam; if (!IS_INTRESOURCE(xs->cs.lpszName)) { - RtlCreateUnicodeStringFromAsciiz(&UnicodeBuffer, (LPSTR)xs->cs.lpszName); - xs->lpszName = xs->cs.lpszName = UnicodeBuffer.Buffer; + RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)xs->cs.lpszName); + xs->lpszName = xs->cs.lpszName = UnicodeString.Buffer; } if (!IS_ATOM(xs->cs.lpszClass)) { - RtlCreateUnicodeStringFromAsciiz(&UnicodeBuffer, (LPSTR)xs->cs.lpszClass); - xs->lpszClass = xs->cs.lpszClass = UnicodeBuffer.Buffer; + RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)xs->cs.lpszClass); + xs->lpszClass = xs->cs.lpszClass = UnicodeString.Buffer; } UnicodeMsg->lParam = (LPARAM)xs; break; @@ -488,7 +491,6 @@ case WM_MDICREATE: { - UNICODE_STRING UnicodeBuffer; MDICREATESTRUCTW *cs = (MDICREATESTRUCTW *)HeapAlloc(GetProcessHeap(), 0, sizeof(*cs)); @@ -501,12 +503,12 @@ if (!IS_ATOM(cs->szClass)) { - RtlCreateUnicodeStringFromAsciiz(&UnicodeBuffer, (LPSTR)cs->szClass); - cs->szClass = UnicodeBuffer.Buffer; + RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)cs->szClass); + cs->szClass = UnicodeString.Buffer; } - RtlCreateUnicodeStringFromAsciiz(&UnicodeBuffer, (LPSTR)cs->szTitle); - cs->szTitle = UnicodeBuffer.Buffer; + RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)cs->szTitle); + cs->szTitle = UnicodeString.Buffer; UnicodeMsg->lParam = (LPARAM)cs; break; @@ -520,6 +522,8 @@ static BOOL FASTCALL MsgiAnsiToUnicodeCleanup(LPMSG UnicodeMsg, LPMSG AnsiMsg) { + UNICODE_STRING UnicodeString; + switch (AnsiMsg->message) { case WM_GETTEXT: @@ -537,7 +541,9 @@ case LB_ADDFILE: case EM_REPLACESEL: { - goto FreeLParamString; + RtlInitUnicodeString(&UnicodeString, (PCWSTR)UnicodeMsg->lParam); + RtlFreeUnicodeString(&UnicodeString); + break; } case LB_ADDSTRING: @@ -554,7 +560,8 @@ if (!(dwStyle & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) && (dwStyle & LBS_HASSTRINGS)) { - goto FreeLParamString; + RtlInitUnicodeString(&UnicodeString, (PCWSTR)UnicodeMsg->lParam); + RtlFreeUnicodeString(&UnicodeString); } break; } @@ -569,26 +576,22 @@ if (!(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) && (dwStyle & CBS_HASSTRINGS)) { - UNICODE_STRING UnicodeString; - -FreeLParamString: RtlInitUnicodeString(&UnicodeString, (PCWSTR)UnicodeMsg->lParam); RtlFreeUnicodeString(&UnicodeString); } break; } - case WM_NCCREATE: case WM_CREATE: { - UNICODE_STRING UnicodeString; struct s { CREATESTRUCTW cs; /* new structure */ LPWSTR lpszName; /* allocated Name */ LPWSTR lpszClass; /* allocated Class */ }; + struct s *xs = (struct s *)UnicodeMsg->lParam; if (xs->lpszName) { @@ -601,12 +604,11 @@ RtlFreeUnicodeString(&UnicodeString); } HeapFree(GetProcessHeap(), 0, xs); + break; } - break; case WM_MDICREATE: { - UNICODE_STRING UnicodeString; MDICREATESTRUCTW *cs = (MDICREATESTRUCTW *)UnicodeMsg->lParam; RtlInitUnicodeString(&UnicodeString, (PCWSTR)cs->szTitle); RtlFreeUnicodeString(&UnicodeString); @@ -616,9 +618,10 @@ RtlFreeUnicodeString(&UnicodeString); } HeapFree(GetProcessHeap(), 0, cs); + break; } - break; - } + } + return(TRUE); } @@ -652,6 +655,9 @@ static BOOL FASTCALL MsgiUnicodeToAnsiMessage(LPMSG AnsiMsg, LPMSG UnicodeMsg) { + ANSI_STRING AnsiString; + UNICODE_STRING UnicodeString; + *AnsiMsg = *UnicodeMsg; switch(UnicodeMsg->message) @@ -661,8 +667,6 @@ { CREATESTRUCTA* CsA; CREATESTRUCTW* CsW; - UNICODE_STRING UString; - ANSI_STRING AString; NTSTATUS Status; CsW = (CREATESTRUCTW*)(UnicodeMsg->lParam); @@ -673,26 +677,26 @@ } memcpy(CsA, CsW, sizeof(CREATESTRUCTW)); - RtlInitUnicodeString(&UString, CsW->lpszName); - Status = RtlUnicodeStringToAnsiString(&AString, &UString, TRUE); + RtlInitUnicodeString(&UnicodeString, CsW->lpszName); + Status = RtlUnicodeStringToAnsiString(&AnsiString, &UnicodeString, TRUE); if (! NT_SUCCESS(Status)) { RtlFreeHeap(GetProcessHeap(), 0, CsA); return FALSE; } - CsA->lpszName = AString.Buffer; + CsA->lpszName = AnsiString.Buffer; if (HIWORD((ULONG)CsW->lpszClass) != 0) { - RtlInitUnicodeString(&UString, CsW->lpszClass); - Status = RtlUnicodeStringToAnsiString(&AString, &UString, TRUE); + RtlInitUnicodeString(&UnicodeString, CsW->lpszClass); + Status = RtlUnicodeStringToAnsiString(&AnsiString, &UnicodeString, TRUE); if (! NT_SUCCESS(Status)) { - RtlInitAnsiString(&AString, CsA->lpszName); - RtlFreeAnsiString(&AString); + RtlInitAnsiString(&AnsiString, CsA->lpszName); + RtlFreeAnsiString(&AnsiString); RtlFreeHeap(GetProcessHeap(), 0, CsA); return FALSE; } - CsA->lpszClass = AString.Buffer; + CsA->lpszClass = AnsiString.Buffer; } AnsiMsg->lParam = (LPARAM)CsA; break; @@ -713,8 +717,16 @@ case LB_DIR: case LB_ADDFILE: { - goto ConvertLParamString; - } + RtlInitUnicodeString(&UnicodeString, (PWSTR) UnicodeMsg->lParam); + if (! NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiString, + &UnicodeString, + TRUE))) + { + return FALSE; + } + AnsiMsg->lParam = (LPARAM) AnsiString.Buffer; + break; + } case LB_ADDSTRING: case LB_ADDSTRING_LOWER: @@ -730,25 +742,6 @@ if (!(dwStyle & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) && (dwStyle & LBS_HASSTRINGS)) { - goto ConvertLParamString; - } - break; - } - - case CB_ADDSTRING: - case CB_INSERTSTRING: - case CB_FINDSTRING: - case CB_FINDSTRINGEXACT: - case CB_SELECTSTRING: - { - DWORD dwStyle = GetWindowLongPtrW(AnsiMsg->hwnd, GWL_STYLE); - if (!(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) && - (dwStyle & CBS_HASSTRINGS)) - { - ANSI_STRING AnsiString; - UNICODE_STRING UnicodeString; - -ConvertLParamString: RtlInitUnicodeString(&UnicodeString, (PWSTR) UnicodeMsg->lParam); if (! NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiString, &UnicodeString, @@ -761,45 +754,65 @@ break; } - case WM_MDICREATE: - { - ANSI_STRING AnsiBuffer; - UNICODE_STRING UnicodeString; - MDICREATESTRUCTA *cs = - (MDICREATESTRUCTA *)HeapAlloc(GetProcessHeap(), 0, sizeof(*cs)); - - if (!cs) + case CB_ADDSTRING: + case CB_INSERTSTRING: + case CB_FINDSTRING: + case CB_FINDSTRINGEXACT: + case CB_SELECTSTRING: + { + DWORD dwStyle = GetWindowLongPtrW(AnsiMsg->hwnd, GWL_STYLE); + if (!(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) && + (dwStyle & CBS_HASSTRINGS)) { - return FALSE; - } - - *cs = *(MDICREATESTRUCTA *)UnicodeMsg->lParam; - - if (!IS_ATOM(cs->szClass)) - { - RtlInitUnicodeString(&UnicodeString, (LPCWSTR)cs->szClass); - if (! NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiBuffer, + RtlInitUnicodeString(&UnicodeString, (PWSTR) UnicodeMsg->lParam); + if (! NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiString, &UnicodeString, TRUE))) { return FALSE; } - cs->szClass = AnsiBuffer.Buffer; + AnsiMsg->lParam = (LPARAM) AnsiString.Buffer; } + break; + } + + case WM_MDICREATE: + { + MDICREATESTRUCTA *cs = + (MDICREATESTRUCTA *)HeapAlloc(GetProcessHeap(), 0, sizeof(*cs)); + + if (!cs) + { + return FALSE; + } + + *cs = *(MDICREATESTRUCTA *)UnicodeMsg->lParam; + + if (!IS_ATOM(cs->szClass)) + { + RtlInitUnicodeString(&UnicodeString, (LPCWSTR)cs->szClass); + if (! NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiString, + &UnicodeString, + TRUE))) + { + return FALSE; + } + cs->szClass = AnsiString.Buffer; + } RtlInitUnicodeString(&UnicodeString, (LPCWSTR)cs->szTitle); - if (! NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiBuffer, + if (! NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiString, &UnicodeString, TRUE))) { if (!IS_ATOM(cs->szClass)) { - RtlInitAnsiString(&AnsiBuffer, cs->szClass); - RtlFreeAnsiString(&AnsiBuffer); + RtlInitAnsiString(&AnsiString, cs->szClass); + RtlFreeAnsiString(&AnsiString); } return FALSE; } - cs->szTitle = AnsiBuffer.Buffer; + cs->szTitle = AnsiString.Buffer; AnsiMsg->lParam = (LPARAM)cs; break; @@ -813,6 +826,8 @@ static BOOL FASTCALL MsgiUnicodeToAnsiCleanup(LPMSG AnsiMsg, LPMSG UnicodeMsg) { + ANSI_STRING AnsiString; + switch(UnicodeMsg->message) { case WM_GETTEXT: @@ -822,21 +837,22 @@ } case WM_SETTEXT: { - goto FreeLParamString; + RtlInitAnsiString(&AnsiString, (PSTR) AnsiMsg->lParam); + RtlFreeAnsiString(&AnsiString); + break; } case WM_CREATE: case WM_NCCREATE: { CREATESTRUCTA* Cs; - ANSI_STRING AString; Cs = (CREATESTRUCTA*) AnsiMsg->lParam; - RtlInitAnsiString(&AString, Cs->lpszName); - RtlFreeAnsiString(&AString); + RtlInitAnsiString(&AnsiString, Cs->lpszName); + RtlFreeAnsiString(&AnsiString); if (HIWORD((ULONG)Cs->lpszClass) != 0) { - RtlInitAnsiString(&AString, Cs->lpszClass); - RtlFreeAnsiString(&AString); + RtlInitAnsiString(&AnsiString, Cs->lpszClass); + RtlFreeAnsiString(&AnsiString); } RtlFreeHeap(GetProcessHeap(), 0, Cs); break; @@ -856,7 +872,8 @@ if (!(dwStyle & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) && (dwStyle & LBS_HASSTRINGS)) { - goto FreeLParamString; + RtlInitAnsiString(&AnsiString, (PSTR) AnsiMsg->lParam); + RtlFreeAnsiString(&AnsiString); } break; } @@ -871,18 +888,14 @@ if (!(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) && (dwStyle & CBS_HASSTRINGS)) { - ANSI_STRING AString; - -FreeLParamString: - RtlInitAnsiString(&AString, (PSTR) AnsiMsg->lParam); - RtlFreeAnsiString(&AString); + RtlInitAnsiString(&AnsiString, (PSTR) AnsiMsg->lParam); + RtlFreeAnsiString(&AnsiString); } break; } case WM_MDICREATE: { - ANSI_STRING AnsiString; MDICREATESTRUCTA *cs = (MDICREATESTRUCTA *)AnsiMsg->lParam; RtlInitAnsiString(&AnsiString, (PCSTR)cs->szTitle); RtlFreeAnsiString(&AnsiString);
15 years, 2 months
1
0
0
0
[dgorbachev] 43181: Give a name to a structure.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sun Sep 27 13:55:47 2009 New Revision: 43181 URL:
http://svn.reactos.org/svn/reactos?rev=43181&view=rev
Log: Give a name to a structure. Modified: trunk/reactos/include/psdk/rpcndr.h Modified: trunk/reactos/include/psdk/rpcndr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/rpcndr.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/rpcndr.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/rpcndr.h [iso-8859-1] Sun Sep 27 13:55:47 2009 @@ -128,7 +128,7 @@ (RpcExceptionCode() == RPC_X_BAD_STUB_DATA) || \ (RpcExceptionCode() == RPC_S_INVALID_BOUND)) -typedef struct +typedef struct _NDR_SCONTEXT { void *pad[2]; void *userContext;
15 years, 2 months
1
0
0
0
[sginsberg] 43180: - Change CPUID to match the old Ki386Cpuid and take 4 output arguments instead of an array. This way we save some stack when using a dummy cpuid for synchronization and can query only the registers we want in the case we don't want all 4. - Simplify Ke386GetTr and Ke386GetLocalDescriptorTable to return by value instead of reference. - Make RDMSR smaller by making it fastcall as rdmsr takes its argument in ecx. - Fix KiGetCacheInformation -- it only handled the Intel and AMD ca
by sginsberg@svn.reactos.org
Author: sginsberg Date: Sun Sep 27 12:09:38 2009 New Revision: 43180 URL:
http://svn.reactos.org/svn/reactos?rev=43180&view=rev
Log: - Change CPUID to match the old Ki386Cpuid and take 4 output arguments instead of an array. This way we save some stack when using a dummy cpuid for synchronization and can query only the registers we want in the case we don't want all 4. - Simplify Ke386GetTr and Ke386GetLocalDescriptorTable to return by value instead of reference. - Make RDMSR smaller by making it fastcall as rdmsr takes its argument in ecx. - Fix KiGetCacheInformation -- it only handled the Intel and AMD case. - Replace Ke386HaltProcessor with __halt. - KiHaltProcessorDpcRoutine: Always halt the processor for the architectures we support for consistency. - Clean up x86 and PPC headers from deprecated stuff. - Fix broken LOCK undefine in v86m_sup.S -- LOCK is used both in a macro and the code, so only undefine it where required and redefine it after it is used (this worked because LOCK was interpreted as lock). Get rid of KeArch*: - Rename KeArchInitThreadWithContext to KiInitializeContextThread and use the same name for all architectures. - Kill KeArchHaltProcessor. Use __halt and KeArmHaltProcessor directly instead. - Use Ke386FnInit instead of KeArchFnInit -- it is only used for x86. Modified: trunk/reactos/hal/halx86/generic/processor.c trunk/reactos/hal/halx86/generic/reboot.c trunk/reactos/include/crt/mingw32/intrin_x86.h trunk/reactos/include/crt/msc/intrin.h trunk/reactos/ntoskrnl/config/i386/cmhardwr.c trunk/reactos/ntoskrnl/ex/shutdown.c trunk/reactos/ntoskrnl/include/internal/arm/ke.h trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h trunk/reactos/ntoskrnl/include/internal/i386/ke.h trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/include/internal/ke_x.h trunk/reactos/ntoskrnl/include/internal/powerpc/ke.h trunk/reactos/ntoskrnl/kdbg/kdb_cli.c trunk/reactos/ntoskrnl/ke/arm/thrdini.c trunk/reactos/ntoskrnl/ke/bug.c trunk/reactos/ntoskrnl/ke/i386/cpu.c trunk/reactos/ntoskrnl/ke/i386/kiinit.c trunk/reactos/ntoskrnl/ke/i386/thrdini.c trunk/reactos/ntoskrnl/ke/i386/v86m_sup.S trunk/reactos/ntoskrnl/ke/powerpc/thrdini.c trunk/reactos/ntoskrnl/ke/thrdobj.c Modified: trunk/reactos/hal/halx86/generic/processor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/process…
============================================================================== --- trunk/reactos/hal/halx86/generic/processor.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/processor.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -70,7 +70,7 @@ { /* Enable interrupts and halt the processor */ _enable(); - Ke386HaltProcessor(); + __halt(); } /* Modified: trunk/reactos/hal/halx86/generic/reboot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/reboot.…
============================================================================== --- trunk/reactos/hal/halx86/generic/reboot.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/reboot.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -67,7 +67,7 @@ HalpWriteResetCommand(); /* Halt the CPU */ - Ke386HaltProcessor(); + __halt(); } /* PUBLIC FUNCTIONS **********************************************************/ Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
============================================================================== --- trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -1107,6 +1107,10 @@ __asm__("sti"); } +__INTRIN_INLINE void __halt(void) +{ + __asm__("hlt\n\t"); +} /*** Protected memory management ***/ Modified: trunk/reactos/include/crt/msc/intrin.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/msc/intrin.h?r…
============================================================================== --- trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -145,6 +145,7 @@ void __int2c(void); void _disable(void); void _enable(void); +void __halt(void); /*** Protected memory management ***/ void __writecr0(const unsigned __int64 Data); Modified: trunk/reactos/ntoskrnl/config/i386/cmhardwr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/i386/cmhar…
============================================================================== --- trunk/reactos/ntoskrnl/config/i386/cmhardwr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/config/i386/cmhardwr.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -238,7 +238,7 @@ HANDLE KeyHandle, BiosHandle, SystemHandle, FpuHandle, SectionHandle; CONFIGURATION_COMPONENT_DATA ConfigData; CHAR Buffer[128]; - ULONG ExtendedId, CpuInfo[4]; + ULONG ExtendedId, Dummy; PKPRCB Prcb; USHORT IndexTable[MaximumType + 1] = {0}; ANSI_STRING TempString; @@ -428,8 +428,7 @@ else { /* Check if we have extended CPUID that supports name ID */ - CPUID(CpuInfo, 0x80000000); - ExtendedId = CpuInfo[0]; + CPUID(0x80000000, &ExtendedId, &Dummy, &Dummy, &Dummy); if (ExtendedId >= 0x80000004) { /* Do all the CPUIDs required to get the full name */ @@ -437,8 +436,11 @@ for (ExtendedId = 2; ExtendedId <= 4; ExtendedId++) { /* Do the CPUID and save the name string */ - CPUID((PULONG)PartialString, - 0x80000000 | ExtendedId); + CPUID(0x80000000 | ExtendedId, + (PULONG)PartialString, + (PULONG)PartialString + 1, + (PULONG)PartialString + 2, + (PULONG)PartialString + 3); /* Go to the next name string */ PartialString += 16; Modified: trunk/reactos/ntoskrnl/ex/shutdown.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/shutdown.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ex/shutdown.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/shutdown.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -14,26 +14,30 @@ /* FUNCTIONS *****************************************************************/ -VOID NTAPI +VOID +NTAPI KiHaltProcessorDpcRoutine(IN PKDPC Dpc, - IN PVOID DeferredContext, - IN PVOID SystemArgument1, - IN PVOID SystemArgument2) -{ - KIRQL OldIrql; - if (DeferredContext) - { - ExFreePool(DeferredContext); - } - while (TRUE) - { - KeRaiseIrql(SYNCH_LEVEL, &OldIrql); -#if defined(_M_IX86) - Ke386HaltProcessor(); + IN PVOID DeferredContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2) +{ + KIRQL OldIrql; + if (DeferredContext) + { + ExFreePool(DeferredContext); + } + + while (TRUE) + { + KeRaiseIrql(SYNCH_LEVEL, &OldIrql); +#if defined(_M_IX86) || defined(_M_AMD64) + __halt(); +#elif defined(_M_ARM) + KeArmHaltProcessor(); #else - HalProcessorIdle(); + HalProcessorIdle(); #endif - } + } } VOID NTAPI Modified: trunk/reactos/ntoskrnl/include/internal/arm/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arm/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/arm/ke.h [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -6,18 +6,6 @@ // #define PCR_ENTRY 0 #define PDR_ENTRY 2 - -#define KeArchHaltProcessor() KeArmHaltProcessor() - -VOID -NTAPI -KeArmInitThreadWithContext( - IN PKTHREAD Thread, - IN PKSYSTEM_ROUTINE SystemRoutine, - IN PKSTART_ROUTINE StartRoutine, - IN PVOID StartContext, - IN PCONTEXT Context -); VOID KiPassiveRelease( @@ -44,7 +32,6 @@ VOID ); -#define KeArchInitThreadWithContext KeArmInitThreadWithContext #define KiSystemStartupReal KiSystemStartup #define KiGetPreviousMode(tf) \ Modified: trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -1,11 +1,5 @@ #ifndef _INTRIN_INTERNAL_ #define _INTRIN_INTERNAL_ - -#ifdef CONFIG_SMP -#define LOCK "lock ; " -#else -#define LOCK "" -#endif #if defined(__GNUC__) @@ -20,11 +14,17 @@ : /* no input */ \ : "memory"); -#define Ke386GetLocalDescriptorTable(X) \ - __asm__("sldt %0\n\t" \ - : "=m" (*X) \ - : /* no input */ \ +FORCEINLINE +USHORT +Ke386GetLocalDescriptorTable() +{ + USHORT Ldt; + __asm__("sldt %0\n\t" + : "=m" (Ldt) + : /* no input */ : "memory"); + return Ldt; +} #define Ke386SetLocalDescriptorTable(X) \ __asm__("lldt %w0\n\t" \ @@ -33,19 +33,23 @@ #define Ke386SetTr(X) __asm__ __volatile__("ltr %%ax" : :"a" (X)); -#define Ke386GetTr(X) \ - __asm__("str %0\n\t" \ - : "=m" (*X)); +FORCEINLINE +USHORT +Ke386GetTr(VOID) +{ + USHORT Tr; + __asm__("str %0\n\t" + : "=m" (Tr)); + return Tr; +} #define _Ke386GetSeg(N) ({ \ unsigned int __d; \ __asm__("movl %%" #N ",%0\n\t" :"=r" (__d)); \ __d; \ - }) + }) #define _Ke386SetSeg(N,X) __asm__ __volatile__("movl %0,%%" #N : :"r" (X)); - -#define Ke386HaltProcessor() __asm__("hlt\n\t"); #define Ke386FnInit() __asm__("fninit\n\t"); @@ -77,13 +81,6 @@ FORCEINLINE VOID -Ke386HaltProcessor(VOID) -{ - __asm hlt; -} - -FORCEINLINE -VOID Ke386GetGlobalDescriptorTable(OUT PVOID Descriptor) { __asm sgdt [Descriptor]; @@ -97,12 +94,10 @@ } FORCEINLINE -VOID -Ke386GetLocalDescriptorTable(OUT PUSHORT Descriptor) -{ - USHORT _Descriptor; - __asm sldt _Descriptor; - *Descriptor = _Descriptor; +USHORT +Ke386GetLocalDescriptorTable(VOID) +{ + __asm sldt ax; } FORCEINLINE @@ -121,11 +116,9 @@ FORCEINLINE USHORT -Ke386GetTr(OUT PUSHORT Tr) -{ - USHORT _Tr; - __asm str _Tr; - *Tr = _Tr; +Ke386GetTr(VOID) +{ + __asm str ax; } // Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -1,23 +1,12 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H #define __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H - -#define FRAME_EDITED 0xFFF8 #ifndef __ASM__ #include "intrin_i.h" #include "v86m.h" -#define KeArchFnInit() Ke386FnInit() -#define KeArchHaltProcessor() Ke386HaltProcessor() - extern ULONG Ke386CacheAlignment; - -struct _KPCR; -VOID -KiInitializeGdt(struct _KPCR* Pcr); -VOID -Ki386ApplicationProcessorInitializeTSS(VOID); VOID FASTCALL @@ -26,13 +15,6 @@ IN PKIDTENTRY Idt, IN PKGDTENTRY Gdt ); - -VOID -KiGdtPrepareForApplicationProcessorInit(ULONG Id); -VOID -Ki386InitializeLdt(VOID); -VOID -Ki386SetProcessorFeatures(VOID); VOID NTAPI @@ -62,23 +44,6 @@ NTAPI KiGetFeatureBits(VOID); -ULONG KeAllocateGdtSelector(ULONG Desc[2]); -VOID KeFreeGdtSelector(ULONG Entry); -VOID -KeApplicationProcessorInitDispatcher(VOID); -VOID -KeCreateApplicationProcessorIdleThread(ULONG Id); - -VOID -NTAPI -Ke386InitThreadWithContext(PKTHREAD Thread, - PKSYSTEM_ROUTINE SystemRoutine, - PKSTART_ROUTINE StartRoutine, - PVOID StartContext, - PCONTEXT Context); -#define KeArchInitThreadWithContext(Thread,SystemRoutine,StartRoutine,StartContext,Context) \ - Ke386InitThreadWithContext(Thread,SystemRoutine,StartRoutine,StartContext,Context) - #ifdef _NTOSKRNL_ /* FIXME: Move flags above to NDK instead of here */ VOID NTAPI Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -276,8 +276,11 @@ VOID NTAPI CPUID( - OUT ULONG CpuInfo[4], - IN ULONG InfoType + IN ULONG InfoType, + OUT PULONG CpuInfoEax, + OUT PULONG CpuInfoEbx, + OUT PULONG CpuInfoEcx, + OUT PULONG CpuInfoEdx ); BOOLEAN @@ -482,6 +485,16 @@ VOID NTAPI +KiInitializeContextThread( + PKTHREAD Thread, + PKSYSTEM_ROUTINE SystemRoutine, + PKSTART_ROUTINE StartRoutine, + PVOID StartContext, + PCONTEXT Context +); + +VOID +NTAPI KeStartThread( IN OUT PKTHREAD Thread ); Modified: trunk/reactos/ntoskrnl/include/internal/ke_x.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke_x.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ke_x.h [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -392,7 +392,7 @@ { /* Clear it */ KeGetCurrentPrcb()->NpxThread = NULL; - KeArchFnInit(); + Ke386FnInit(); } #endif } Modified: trunk/reactos/ntoskrnl/include/internal/powerpc/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/powerpc/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/powerpc/ke.h [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -35,96 +35,9 @@ extern ULONG KePPCCacheAlignment; -struct _KPCR; -VOID -KiInitializeGdt(struct _KPCR* Pcr); -VOID -KiPPCApplicationProcessorInitializeTSS(VOID); -VOID -KiPPCBootInitializeTSS(VOID); -VOID -KiGdtPrepareForApplicationProcessorInit(ULONG Id); -VOID -KiPPCInitializeLdt(VOID); -VOID -KiPPCSetProcessorFeatures(VOID); -ULONG KeAllocateGdtSelector(ULONG Desc[2]); -VOID KeFreeGdtSelector(ULONG Entry); - -#ifdef CONFIG_SMP -#define LOCK "isync ; " -#else -#define LOCK "" -#endif - - -static inline LONG KePPCTestAndClearBit(ULONG BitPos, volatile PULONG Addr) -{ - ULONG OldValue, NewValue; - - __asm__ __volatile__ ("lwarx %0,0,%1" - : "=r" (OldValue), "=r" (*Addr) - : - : "memory"); - - NewValue = OldValue & ~(1<<BitPos); - - __asm__ __volatile__ ("stwcx. %0,0,%3\n\t" - "beq success\n\t" - "add %2,0,%1\n" - "success:\n\t" - "isync\n\t" - : "=r" (NewValue), "=r" (OldValue) - : "w" (NewValue), "w" (*Addr) - : "memory"); - - return NewValue & (1 << BitPos); -} - -static inline LONG KePPCTestAndSetBit(ULONG BitPos, volatile PULONG Addr) -{ - ULONG OldValue, NewValue; - - __asm__ __volatile__ ("lwarx %0,0,%1" - : "=r" (OldValue), "=r" (*Addr) - : - : "memory"); - - NewValue = OldValue | (1<<BitPos); - - __asm__ __volatile__ ("stwcx. %0,0,%3\n\t" - "beq success\n\t" - "add %2,0,%1\n" - "success:\n\t" - "isync\n\t" - : "=r" (NewValue), "=r" (OldValue) - : "w" (NewValue), "w" (*Addr) - : "memory"); - - return NewValue & (1 << BitPos); -} - #define KePPCRdmsr(msr,val1,val2) __asm__ __volatile__("mfmsr 3") #define KePPCWrmsr(msr,val1,val2) __asm__ __volatile__("mtmsr 3") - - -#define KePPCDisableInterrupts() \ -__asm__ __volatile__("mfmsr 0\n\t" \ - "li 8,0x7fff\n\t" \ - "and 0,8,0\n\t" \ - "mtmsr 0\n\t") - -#define KePPCEnableInterrupts() \ - __asm__ __volatile__("mfmsr 0\n\t" \ - "lis 8,0x8000@ha\n\t" \ - "or 0,8,0\n\t" \ - "mtmsr 0\n\t") - -#define KePPCHaltProcessor() - -#define KeArchEraseFlags() -#define KeArchDisableInterrupts() KePPCDisableInterrupts() #define PPC_MIN_CACHE_LINE_SIZE 32 @@ -132,30 +45,6 @@ VOID) { return (struct _KPCR *)__readfsdword(0x1c); -} - -VOID -NTAPI -KePPCInitThreadWithContext( - PKTHREAD Thread, - PKSYSTEM_ROUTINE SystemRoutine, - PKSTART_ROUTINE StartRoutine, - PVOID StartContext, - PCONTEXT Context); - -VOID -NTAPI -KeApplicationProcessorInitDispatcher( - VOID); - -VOID -NTAPI -KeCreateApplicationProcessorIdleThread( - ULONG Id); - -static VOID KePPCFnInit() -{ - __asm__("mfmsr 0\n\tori 0,0,0x2000\n\tmtmsr 0"); } #ifdef _NTOSKRNL_ /* FIXME: Move flags above to NDK instead of here */ @@ -167,16 +56,8 @@ BOOLEAN UserThread, KTRAP_FRAME TrapFrame); #endif -VOID -NTAPI -KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState); #endif /* __ASM__ */ - -#define KeArchFnInit() KePPCFnInit() -#define KeArchHaltProcessor() KePPCHaltProcessor() -#define KeArchInitThreadWithContext(Thread,SystemRoutine,StartRoutine,StartContext,Context) \ - KePPCInitThreadWithContext(Thread,SystemRoutine,StartRoutine,StartContext,Context) #endif /* __NTOSKRNL_INCLUDE_INTERNAL_POWERPC_KE_H */ Modified: trunk/reactos/ntoskrnl/kdbg/kdb_cli.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb_cli.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -648,8 +648,8 @@ else if (Argv[0][0] == 'c') /* cregs */ { ULONG Cr0, Cr2, Cr3, Cr4; - KDESCRIPTOR Gdtr, Ldtr, Idtr; - ULONG Tr; + KDESCRIPTOR Gdtr, Idtr; + USHORT Ldtr; static const PCHAR Cr0Bits[32] = { " PE", " MP", " EM", " TS", " ET", " NE", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, " WP", NULL, " AM", NULL, NULL, NULL, NULL, NULL, @@ -666,11 +666,8 @@ /* Get descriptor table regs */ Ke386GetGlobalDescriptorTable(&Gdtr.Limit); - Ke386GetLocalDescriptorTable(&Ldtr.Limit); + Ldtr = Ke386GetLocalDescriptorTable(); __sidt(&Idtr.Limit); - - /* Get the task register */ - Ke386GetTr((PUSHORT)&Tr); /* Display the control registers */ KdbpPrint("CR0 0x%08x ", Cr0); @@ -700,7 +697,7 @@ /* Display the descriptor table regs */ KdbpPrint("\nGDTR Base 0x%08x Size 0x%04x\n", Gdtr.Base, Gdtr.Limit); - KdbpPrint("LDTR Base 0x%08x Size 0x%04x\n", Ldtr.Base, Ldtr.Limit); + KdbpPrint("LDTR 0x%04x\n", Ldtr); KdbpPrint("IDTR Base 0x%08x Size 0x%04x\n", Idtr.Base, Idtr.Limit); } else if (Argv[0][0] == 's') /* sregs */ @@ -1619,7 +1616,8 @@ ASSERT(Argv[0][0] == 'l'); /* Read LDTR */ - Ke386GetLocalDescriptorTable(&Reg.Limit); + Reg.Limit = Ke386GetLocalDescriptorTable(); + Reg.Base = 0; i = 0; ul = 1 << 2; } Modified: trunk/reactos/ntoskrnl/ke/arm/thrdini.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/thrdini.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/thrdini.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/thrdini.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -34,11 +34,11 @@ VOID NTAPI -KeArmInitThreadWithContext(IN PKTHREAD Thread, - IN PKSYSTEM_ROUTINE SystemRoutine, - IN PKSTART_ROUTINE StartRoutine, - IN PVOID StartContext, - IN PCONTEXT ContextPointer) +KiInitializeContextThread(IN PKTHREAD Thread, + IN PKSYSTEM_ROUTINE SystemRoutine, + IN PKSTART_ROUTINE StartRoutine, + IN PVOID StartContext, + IN PCONTEXT ContextPointer) { PKTRAP_FRAME TrapFrame; PKEXCEPTION_FRAME ExceptionFrame = NULL, CtxSwitchFrame; Modified: trunk/reactos/ntoskrnl/ke/bug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/bug.c?rev=4318…
============================================================================== --- trunk/reactos/ntoskrnl/ke/bug.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/bug.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -552,7 +552,13 @@ KiBugCheckDebugBreak(IN ULONG StatusCode) { /* If KDBG isn't connected, freeze the CPU, otherwise, break */ - if (KdDebuggerNotPresent) for (;;) KeArchHaltProcessor(); +#if defined(_M_IX86) || defined(_M_AMD64) + if (KdDebuggerNotPresent) for (;;) __halt(); +#elif defined(_M_ARM) + if (KdDebuggerNotPresent) for (;;) KeArmHaltProcessor(); +#else +#error +#endif DbgBreakPointWithStatus(StatusCode); while (TRUE); } @@ -1176,7 +1182,13 @@ else if (KeBugCheckOwnerRecursionCount > 2) { /* Halt the CPU */ - for (;;) KeArchHaltProcessor(); +#if defined(_M_IX86) || defined(_M_AMD64) + for (;;) __halt(); +#elif defined(_M_ARM) + for (;;) KeArmHaltProcessor(); +#else +#error +#endif } } Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -87,11 +87,22 @@ VOID NTAPI -CPUID(OUT ULONG CpuInfo[4], - IN ULONG InfoType) -{ +CPUID(IN ULONG InfoType, + OUT PULONG CpuInfoEax, + OUT PULONG CpuInfoEbx, + OUT PULONG CpuInfoEcx, + OUT PULONG CpuInfoEdx) +{ + ULONG CpuInfo[4]; + /* Perform the CPUID Operation */ __cpuid((int*)CpuInfo, InfoType); + + /* Return the results */ + *CpuInfoEax = CpuInfo[0]; + *CpuInfoEbx = CpuInfo[1]; + *CpuInfoEcx = CpuInfo[2]; + *CpuInfoEdx = CpuInfo[3]; } VOID @@ -104,7 +115,7 @@ } LONGLONG -NTAPI +FASTCALL RDMSR(IN ULONG Register) { /* Read from the MSR */ @@ -118,7 +129,7 @@ KiSetProcessorType(VOID) { ULONG EFlags, NewEFlags; - ULONG Reg[4]; + ULONG Reg, Dummy; ULONG Stepping, Type; /* Start by assuming no CPUID data */ @@ -140,11 +151,11 @@ __writeeflags(EFlags); /* Peform CPUID 0 to see if CPUID 1 is supported */ - CPUID(Reg, 0); - if (Reg[0] > 0) + CPUID(0, &Reg, &Dummy, &Dummy, &Dummy); + if (Reg > 0) { /* Do CPUID 1 now */ - CPUID(Reg, 1); + CPUID(1, &Reg, &Dummy, &Dummy, &Dummy); /* * Get the Stepping and Type. The stepping contains both the @@ -153,11 +164,11 @@ * * For the stepping, we convert this: zzzzzzxy into this: x0y */ - Stepping = Reg[0] & 0xF0; + Stepping = Reg & 0xF0; Stepping <<= 4; - Stepping += (Reg[0] & 0xFF); + Stepping += (Reg & 0xFF); Stepping &= 0xF0F; - Type = Reg[0] & 0xF00; + Type = Reg & 0xF00; Type >>= 8; /* Save them in the PRCB */ @@ -192,7 +203,7 @@ if (!Prcb->CpuID) return 0; /* Get the Vendor ID and null-terminate it */ - CPUID(Vendor, 0); + CPUID(0, &Vendor[0], &Vendor[1], &Vendor[2], &Vendor[3]); Vendor[4] = 0; /* Re-arrange vendor string */ @@ -247,7 +258,7 @@ PKPRCB Prcb = KeGetCurrentPrcb(); ULONG Vendor; ULONG FeatureBits = KF_WORKING_PTE; - ULONG Reg[4]; + ULONG Reg[4], Dummy; BOOLEAN ExtendedCPUID = TRUE; ULONG CpuFeatures = 0; @@ -258,7 +269,7 @@ if (!Vendor) return FeatureBits; /* Get the CPUID Info. Features are in Reg[3]. */ - CPUID(Reg, 1); + CPUID(1, &Reg[0], &Reg[1], &Dummy, &Reg[3]); /* Set the initial APIC ID */ Prcb->InitialApicId = (UCHAR)(Reg[1] >> 24); @@ -267,12 +278,13 @@ { /* Intel CPUs */ case CPU_INTEL: - /* Check if it's a P6 */ + + /* Check if it's a P6 or higher */ if (Prcb->CpuType == 6) { /* Perform the special sequence to get the MicroCode Signature */ WRMSR(0x8B, 0); - CPUID(Reg, 1); + CPUID(1, &Dummy, &Dummy, &Dummy, &Dummy); Prcb->UpdateSignature.QuadPart = RDMSR(0x8B); } else if (Prcb->CpuType == 5) @@ -356,10 +368,14 @@ /* Cyrix CPUs */ case CPU_CYRIX: + + /* FIXME: CMPXCGH8B */ + break; /* Transmeta CPUs */ case CPU_TRANSMETA: + /* Enable CMPXCHG8B if the family (>= 5), model and stepping (>= 4.2) support it */ if ((Reg[0] & 0x0FFF) >= 0x0542) { @@ -372,6 +388,7 @@ /* Centaur, IDT, Rise and VIA CPUs */ case CPU_CENTAUR: case CPU_RISE: + /* These CPUs don't report the presence of CMPXCHG8B through CPUID. However, this feature exists and operates properly without any additional steps. */ FeatureBits |= KF_CMPXCHG8B; @@ -416,14 +433,14 @@ if (ExtendedCPUID) { /* Do the call */ - CPUID(Reg, 0x80000000); + CPUID(0x80000000, &Reg[0], &Dummy, &Dummy, &Dummy); if ((Reg[0] & 0xffffff00) == 0x80000000) { /* Check if CPUID 0x80000001 is supported */ if (Reg[0] >= 0x80000001) { /* Check which extended features are available. */ - CPUID(Reg, 0x80000001); + CPUID(0x80000001, &Dummy, &Dummy, &Dummy, &Reg[3]); /* Check if NX-bit is supported */ if (Reg[3] & 0x00100000) FeatureBits |= KF_NX_BIT; @@ -450,7 +467,7 @@ { PKIPCR Pcr = (PKIPCR)KeGetPcr(); ULONG Vendor; - ULONG Data[4]; + ULONG Data[4], Dummy; ULONG CacheRequests = 0, i; ULONG CurrentRegister; UCHAR RegisterByte; @@ -470,14 +487,14 @@ case CPU_INTEL: /*Check if we support CPUID 2 */ - CPUID(Data, 0); + CPUID(0, &Data[0], &Dummy, &Dummy, &Dummy); if (Data[0] >= 2) { /* We need to loop for the number of times CPUID will tell us to */ do { /* Do the CPUID call */ - CPUID(Data, 2); + CPUID(2, &Data[0], &Data[1], &Data[2], &Data[3]); /* Check if it was the first call */ if (FirstPass) @@ -539,15 +556,23 @@ case CPU_AMD: /* Check if we support CPUID 0x80000006 */ - CPUID(Data, 0x80000000); + CPUID(0x80000000, &Data[0], &Dummy, &Dummy, &Dummy); if (Data[0] >= 6) { /* Get 2nd level cache and tlb size */ - CPUID(Data, 0x80000006); + CPUID(0x80000006, &Dummy, &Dummy, &Data[2], &Dummy); /* Set the L2 Cache Size */ Pcr->SecondLevelCacheSize = (Data[2] & 0xFFFF0000) >> 6; } + break; + + case CPU_CYRIX: + case CPU_TRANSMETA: + case CPU_CENTAUR: + case CPU_RISE: + + /* FIXME */ break; } } @@ -760,8 +785,8 @@ /* Save GDT, IDT, LDT and TSS */ Ke386GetGlobalDescriptorTable(&ProcessorState->SpecialRegisters.Gdtr.Limit); __sidt(&ProcessorState->SpecialRegisters.Idtr.Limit); - Ke386GetTr(&ProcessorState->SpecialRegisters.Tr); - Ke386GetLocalDescriptorTable(&ProcessorState->SpecialRegisters.Ldtr); + ProcessorState->SpecialRegisters.Tr = Ke386GetTr(); + ProcessorState->SpecialRegisters.Ldtr = Ke386GetLocalDescriptorTable(); } VOID Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/kiinit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -32,7 +32,7 @@ ULONG i, Affinity, Sample = 0; PFX_SAVE_AREA FxSaveArea; ULONG MXCsrMask = 0xFFBF; - ULONG Dummy[4]; + ULONG Dummy; KI_SAMPLE_MAP Samples[4]; PKI_SAMPLE_MAP CurrentSample = Samples; @@ -179,7 +179,7 @@ for (;;) { /* Do a dummy CPUID to start the sample */ - CPUID(Dummy, 0); + CPUID(0, &Dummy, &Dummy, &Dummy, &Dummy); /* Fill out the starting data */ CurrentSample->PerfStart = KeQueryPerformanceCounter(NULL); @@ -192,7 +192,7 @@ &CurrentSample->PerfFreq); /* Do another dummy CPUID */ - CPUID(Dummy, 0); + CPUID(0, &Dummy, &Dummy, &Dummy, &Dummy); /* Fill out the ending data */ CurrentSample->PerfEnd = @@ -620,7 +620,7 @@ *Idt = (PKIDTENTRY)IdtDescriptor.Base; /* Get TSS and FS Selectors */ - Ke386GetTr(&Tr); + Tr = Ke386GetTr(); if (Tr != KGDT_TSS) Tr = KGDT_TSS; // FIXME: HACKHACK Fs = Ke386GetFs(); Modified: trunk/reactos/ntoskrnl/ke/i386/thrdini.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/thrdini.c…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/thrdini.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/thrdini.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -46,11 +46,11 @@ VOID NTAPI -Ke386InitThreadWithContext(IN PKTHREAD Thread, - IN PKSYSTEM_ROUTINE SystemRoutine, - IN PKSTART_ROUTINE StartRoutine, - IN PVOID StartContext, - IN PCONTEXT ContextPointer) +KiInitializeContextThread(IN PKTHREAD Thread, + IN PKSYSTEM_ROUTINE SystemRoutine, + IN PKSTART_ROUTINE StartRoutine, + IN PVOID StartContext, + IN PCONTEXT ContextPointer) { PFX_SAVE_AREA FxSaveArea; PFXSAVE_FORMAT FxSaveFormat; Modified: trunk/reactos/ntoskrnl/ke/i386/v86m_sup.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/v86m_sup.…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/v86m_sup.S [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/v86m_sup.S [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -10,7 +10,6 @@ #include <asm.h> #include <internal/i386/asmmacro.S> -#undef LOCK .intel_syntax noprefix /* FIXME: Can we make a nice macro to generate V86 Opcode handlers? */ @@ -140,6 +139,8 @@ UNHANDLED_V86_OPCODE .endfunc +#undef LOCK + GENERATE_PREFIX_HANDLER ES GENERATE_PREFIX_HANDLER CS GENERATE_PREFIX_HANDLER DS @@ -151,6 +152,12 @@ GENERATE_PREFIX_HANDLER LOCK GENERATE_PREFIX_HANDLER REP GENERATE_PREFIX_HANDLER REPNE + +#ifdef CONFIG_SMP +#define LOCK lock +#else +#define LOCK +#endif .func OpcodeINSBV86 _OpcodeINSBV86: Modified: trunk/reactos/ntoskrnl/ke/powerpc/thrdini.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/powerpc/thrdin…
============================================================================== --- trunk/reactos/ntoskrnl/ke/powerpc/thrdini.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/powerpc/thrdini.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -50,11 +50,11 @@ VOID NTAPI -KePPCInitThreadWithContext(IN PKTHREAD Thread, - IN PKSYSTEM_ROUTINE SystemRoutine, - IN PKSTART_ROUTINE StartRoutine, - IN PVOID StartContext, - IN PCONTEXT ContextPointer) +KiInitializeContextThread(IN PKTHREAD Thread, + IN PKSYSTEM_ROUTINE SystemRoutine, + IN PKSTART_ROUTINE StartRoutine, + IN PVOID StartContext, + IN PCONTEXT ContextPointer) { PFX_SAVE_AREA FxSaveArea; PKSTART_FRAME StartFrame; Modified: trunk/reactos/ntoskrnl/ke/thrdobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/thrdobj.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] Sun Sep 27 12:09:38 2009 @@ -818,11 +818,11 @@ _SEH2_TRY { /* Initalize the Thread Context */ - KeArchInitThreadWithContext(Thread, - SystemRoutine, - StartRoutine, - StartContext, - Context); + KiInitializeContextThread(Thread, + SystemRoutine, + StartRoutine, + StartContext, + Context); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
15 years, 2 months
1
0
0
0
[fireball] 43179: [uniata] - Revert most of the 41684: "-fix support for ICH7, ICH7M, ICH8, ICH8M, ICH9, ICH9R, ICH9M and ICH10 in compat mode". Those controllers should be supported now, and when set to compat mode the driver falls back to UDMA automatically. - ICH7 real hw testing is required. ICH9 doesn't work in Enhanced mode, works in Compat mode.
by fireball@svn.reactos.org
Author: fireball Date: Sun Sep 27 12:04:21 2009 New Revision: 43179 URL:
http://svn.reactos.org/svn/reactos?rev=43179&view=rev
Log: [uniata] - Revert most of the 41684: "-fix support for ICH7,ICH7M,ICH8,ICH8M,ICH9,ICH9R,ICH9M and ICH10 in compat mode". Those controllers should be supported now, and when set to compat mode the driver falls back to UDMA automatically. - ICH7 real hw testing is required. ICH9 doesn't work in Enhanced mode, works in Compat mode. Modified: trunk/reactos/drivers/storage/ide/uniata/bm_devs.h Modified: trunk/reactos/drivers/storage/ide/uniata/bm_devs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/bm_devs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/bm_devs.h [iso-8859-1] Sun Sep 27 12:04:21 2009 @@ -558,18 +558,19 @@ PCI_DEV_HW_SPEC_BM( 2651, 8086, 0x00, ATA_SA150, "Intel ICH6" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2652, 8086, 0x00, ATA_SA150, "Intel ICH6" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2653, 8086, 0x00, ATA_SA150, "Intel ICH6M" , UNIATA_SATA | UNIATA_AHCI ), - PCI_DEV_HW_SPEC_BM( 27c0, 8086, 0x00, ATA_UDMA5, "Intel ICH7" , 0 ), + PCI_DEV_HW_SPEC_BM( 27c0, 8086, 0x00, ATA_SA300, "Intel ICH7" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 27c1, 8086, 0x00, ATA_SA300, "Intel ICH7" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 27c3, 8086, 0x00, ATA_SA300, "Intel ICH7" , UNIATA_SATA | UNIATA_AHCI ), - PCI_DEV_HW_SPEC_BM( 27c4, 8086, 0x00, ATA_UDMA5, "Intel ICH7M" , 0 ), - PCI_DEV_HW_SPEC_BM( 27c5, 8086, 0x00, ATA_SA150, "Intel ICH7M" , UNIATA_SATA | UNIATA_AHCI ), - PCI_DEV_HW_SPEC_BM( 27c6, 8086, 0x00, ATA_SA150, "Intel ICH7M" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 27c4, 8086, 0x00, ATA_SA300, "Intel ICH7M" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 27c5, 8086, 0x00, ATA_SA300, "Intel ICH7M" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 27c6, 8086, 0x00, ATA_SA300, "Intel ICH7M" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 27df, 8086, 0x00, ATA_UDMA5, "Intel ICH7" , 0 ), PCI_DEV_HW_SPEC_BM( 269e, 8086, 0x00, ATA_UDMA5, "Intel 63XXESB2" , 0 ), PCI_DEV_HW_SPEC_BM( 2680, 8086, 0x00, ATA_SA300, "Intel 63XXESB2" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2681, 8086, 0x00, ATA_SA300, "Intel 63XXESB2" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2682, 8086, 0x00, ATA_SA300, "Intel 63XXESB2" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2683, 8086, 0x00, ATA_SA300, "Intel 63XXESB2" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 2820, 8086, 0x00, ATA_UDMA5, "Intel ICH8" , 0 ), PCI_DEV_HW_SPEC_BM( 2821, 8086, 0x00, ATA_SA300, "Intel ICH8" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2822, 8086, 0x00, ATA_SA300, "Intel ICH8" , UNIATA_SATA | UNIATA_AHCI ), @@ -584,7 +585,7 @@ PCI_DEV_HW_SPEC_BM( 2921, 8086, 0x00, ATA_UDMA5, "Intel ICH9" , 0 ), PCI_DEV_HW_SPEC_BM( 2922, 8086, 0x00, ATA_SA300, "Intel ICH9" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2923, 8086, 0x00, ATA_SA300, "Intel ICH9" , UNIATA_SATA | UNIATA_AHCI ), - PCI_DEV_HW_SPEC_BM( 2926, 8086, 0x00, ATA_UDMA5, "Intel ICH9" , 0 ), + PCI_DEV_HW_SPEC_BM( 2926, 8086, 0x00, ATA_SA300, "Intel ICH9" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2928, 8086, 0x00, ATA_UDMA5, "Intel ICH9M/M-E" , 0 ), PCI_DEV_HW_SPEC_BM( 2929, 8086, 0x00, ATA_SA300, "Intel ICH9M/M-E" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 292d, 8086, 0x00, ATA_UDMA5, "Intel ICH9M/M-E" , 0 ),
15 years, 2 months
1
0
0
0
[janderwald] 43178: - Add a few nodetypes
by janderwald@svn.reactos.org
Author: janderwald Date: Sun Sep 27 11:56:14 2009 New Revision: 43178 URL:
http://svn.reactos.org/svn/reactos?rev=43178&view=rev
Log: - Add a few nodetypes Modified: trunk/reactos/include/psdk/ksmedia.h Modified: trunk/reactos/include/psdk/ksmedia.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ksmedia.h?rev…
============================================================================== --- trunk/reactos/include/psdk/ksmedia.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ksmedia.h [iso-8859-1] Sun Sep 27 11:56:14 2009 @@ -132,6 +132,11 @@ DEFINE_GUIDSTRUCT("4D837FE0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_ADC); #define KSNODETYPE_ADC DEFINE_GUIDNAMED(KSNODETYPE_ADC) +#define STATIC_KSNODETYPE_AGC\ + 0xE88C9BA0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 +DEFINE_GUIDSTRUCT("E88C9BA0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_AGC); +#define KSNODETYPE_AGC DEFINE_GUIDNAMED(KSNODETYPE_AGC) + #define STATIC_KSNODETYPE_3D_EFFECTS\ 0x55515860L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 DEFINE_GUIDSTRUCT("55515860-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_3D_EFFECTS); @@ -167,6 +172,17 @@ DEFINE_GUIDSTRUCT("DFF220E3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_CD_PLAYER); #define KSNODETYPE_CD_PLAYER DEFINE_GUIDNAMED(KSNODETYPE_CD_PLAYER) +#define STATIC_KSNODETYPE_CHORUS\ + 0x20173F20L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 +DEFINE_GUIDSTRUCT("20173F20-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_CHORUS); +#define KSNODETYPE_CHORUS DEFINE_GUIDNAMED(KSNODETYPE_CHORUS) + +#define STATIC_KSNODETYPE_REVERB\ + 0xEF0328E0L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 +DEFINE_GUIDSTRUCT("EF0328E0-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_REVERB); +#define KSNODETYPE_REVERB DEFINE_GUIDNAMED(KSNODETYPE_REVERB) + + #define STATIC_KSNODETYPE_LINE_CONNECTOR\ DEFINE_USB_TERMINAL_GUID(0x0603) DEFINE_GUIDSTRUCT("DFF21FE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LINE_CONNECTOR); @@ -292,6 +308,20 @@ DEFINE_GUIDSTRUCT("185FEDE4-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MASTER_MUTE); #define KSAUDFNAME_MASTER_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MASTER_MUTE) +#define STATIC_KSNODETYPE_PEAKMETER\ + 0xa085651eL, 0x5f0d, 0x4b36, 0xa8, 0x69, 0xd1, 0x95, 0xd6, 0xab, 0x4b, 0x9e +DEFINE_GUIDSTRUCT("A085651E-5F0D-4b36-A869-D195D6AB4B9E", KSNODETYPE_PEAKMETER); +#define KSNODETYPE_PEAKMETER DEFINE_GUIDNAMED(KSNODETYPE_PEAKMETER) + +#define STATIC_KSNODETYPE_STEREO_WIDE\ + 0xA9E69800L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 +DEFINE_GUIDSTRUCT("A9E69800-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_STEREO_WIDE); +#define KSNODETYPE_STEREO_WIDE DEFINE_GUIDNAMED(KSNODETYPE_STEREO_WIDE) + +#define STATIC_KSNODETYPE_TONE\ + 0x7607E580L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 +DEFINE_GUIDSTRUCT("7607E580-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_TONE); +#define KSNODETYPE_TONE DEFINE_GUIDNAMED(KSNODETYPE_TONE) /* Pins
15 years, 2 months
1
0
0
0
[fireball] 43177: - Add more supported ICH/PCH ids, confirmed by bearwindows.
by fireball@svn.reactos.org
Author: fireball Date: Sun Sep 27 11:26:59 2009 New Revision: 43177 URL:
http://svn.reactos.org/svn/reactos?rev=43177&view=rev
Log: - Add more supported ICH/PCH ids, confirmed by bearwindows. Modified: trunk/reactos/drivers/storage/ide/uniata/bm_devs.h Modified: trunk/reactos/drivers/storage/ide/uniata/bm_devs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/bm_devs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/bm_devs.h [iso-8859-1] Sun Sep 27 11:26:59 2009 @@ -579,6 +579,7 @@ PCI_DEV_HW_SPEC_BM( 2829, 8086, 0x00, ATA_SA300, "Intel ICH8M" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 282a, 8086, 0x00, ATA_SA300, "Intel ICH8M" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2850, 8086, 0x00, ATA_UDMA5, "Intel ICH8M" , 0 ), + PCI_DEV_HW_SPEC_BM( 2920, 8086, 0x00, ATA_UDMA5, "Intel ICH9R/DO/DH", 0 ), PCI_DEV_HW_SPEC_BM( 2921, 8086, 0x00, ATA_UDMA5, "Intel ICH9" , 0 ), PCI_DEV_HW_SPEC_BM( 2922, 8086, 0x00, ATA_SA300, "Intel ICH9" , UNIATA_SATA | UNIATA_AHCI ), @@ -587,6 +588,8 @@ PCI_DEV_HW_SPEC_BM( 2928, 8086, 0x00, ATA_UDMA5, "Intel ICH9M/M-E" , 0 ), PCI_DEV_HW_SPEC_BM( 2929, 8086, 0x00, ATA_SA300, "Intel ICH9M/M-E" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 292d, 8086, 0x00, ATA_UDMA5, "Intel ICH9M/M-E" , 0 ), + PCI_DEV_HW_SPEC_BM( 292e, 8086, 0x00, ATA_UDMA5, "Intel ICH9M/M-E" , 0 ), + PCI_DEV_HW_SPEC_BM( 3a00, 8086, 0x00, ATA_UDMA5, "Intel ICH10" , 0 ), PCI_DEV_HW_SPEC_BM( 3a02, 8086, 0x00, ATA_SA300, "Intel ICH10" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 3a03, 8086, 0x00, ATA_SA300, "Intel ICH10" , UNIATA_SATA | UNIATA_AHCI ), @@ -595,6 +598,17 @@ PCI_DEV_HW_SPEC_BM( 3a22, 8086, 0x00, ATA_SA300, "Intel ICH10" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 3a23, 8086, 0x00, ATA_SA300, "Intel ICH10" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 3a26, 8086, 0x00, ATA_UDMA5, "Intel ICH10" , 0 ), + + PCI_DEV_HW_SPEC_BM( 3b20, 8086, 0x00, ATA_UDMA5, "Intel PCH" , 0 ), + PCI_DEV_HW_SPEC_BM( 3b21, 8086, 0x00, ATA_UDMA5, "Intel PCH" , 0 ), + PCI_DEV_HW_SPEC_BM( 3b22, 8086, 0x00, ATA_SA300, "Intel PCH" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 3b23, 8086, 0x00, ATA_SA300, "Intel PCH" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 3b26, 8086, 0x00, ATA_UDMA5, "Intel PCH" , 0 ), + PCI_DEV_HW_SPEC_BM( 3b28, 8086, 0x00, ATA_UDMA5, "Intel PCH" , 0 ), + PCI_DEV_HW_SPEC_BM( 3b29, 8086, 0x00, ATA_SA300, "Intel PCH" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 3b2D, 8086, 0x00, ATA_UDMA5, "Intel PCH" , 0 ), + PCI_DEV_HW_SPEC_BM( 3b2E, 8086, 0x00, ATA_UDMA5, "Intel PCH" , 0 ), + PCI_DEV_HW_SPEC_BM( 3b2F, 8086, 0x00, ATA_SA300, "Intel PCH" , UNIATA_SATA | UNIATA_AHCI ), // PCI_DEV_HW_SPEC_BM( 3200, 8086, 0x00, ATA_SA150, "Intel 31244" , UNIATA_SATA ), /*
15 years, 2 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
27
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Results per page:
10
25
50
100
200