winehq.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
2025
February
January
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2009
----- 2025 -----
February 2025
January 2025
----- 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1348 discussions
Start a n
N
ew thread
Alexandre Julliard : regedit: Fix integer printf formats in resource strings.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: 259e8f61c87afbe39b6c6e7029b8476cfaba53ea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=259e8f61c87afbe39b6c6e702…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 21:09:20 2009 +0100 regedit: Fix integer printf formats in resource strings. --- programs/regedit/Bg.rc | 4 ++-- programs/regedit/Cs.rc | 4 ++-- programs/regedit/Da.rc | 4 ++-- programs/regedit/De.rc | 4 ++-- programs/regedit/En.rc | 4 ++-- programs/regedit/Es.rc | 4 ++-- programs/regedit/Fr.rc | 4 ++-- programs/regedit/Hu.rc | 4 ++-- programs/regedit/It.rc | 4 ++-- programs/regedit/Ja.rc | 4 ++-- programs/regedit/Ko.rc | 4 ++-- programs/regedit/Nl.rc | 4 ++-- programs/regedit/No.rc | 4 ++-- programs/regedit/Pl.rc | 4 ++-- programs/regedit/Pt.rc | 8 ++++---- programs/regedit/Ru.rc | 4 ++-- programs/regedit/Si.rc | 4 ++-- programs/regedit/Tr.rc | 4 ++-- programs/regedit/Zh.rc | 8 ++++---- 19 files changed, 42 insertions(+), 42 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=259e8f61c87afbe39b6c6…
1
0
0
0
Alexandre Julliard : winefile: Get rid of hack to load vswprintf from msvcrt.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: 8f2a863ff8678e2181216a12a71e70ac5947f08f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f2a863ff8678e2181216a12a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 20:52:55 2009 +0100 winefile: Get rid of hack to load vswprintf from msvcrt. --- programs/winefile/winefile.c | 96 +++++++++++++----------------------------- programs/winefile/winefile.h | 2 - 2 files changed, 30 insertions(+), 68 deletions(-) diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index a49c2ab..b3e5471 100644 --- a/programs/winefile/winefile.c +++ b/programs/winefile/winefile.c @@ -33,6 +33,7 @@ #include "winefile.h" #include "resource.h" +#include "wine/unicode.h" #ifdef _NO_EXTENSIONS #undef _LEFT_FILES @@ -196,8 +197,17 @@ static const TCHAR sQMarks[] = {'?','?','?','\0'}; 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 TCHAR sLongHexFmt[] = {'%','I','6','4','X','\0'}; -static const TCHAR sLongNumFmt[] = {'%','I','6','4','u','\0'}; +static void format_longlong(LPWSTR ret, ULONGLONG val) +{ + WCHAR buffer[65], *p = &buffer[64]; + + *p = 0; + do { + *(--p) = '0' + val % 10; + val /= 10; + } while (val); + lstrcpyW( ret, p ); +} /* load resource string */ @@ -299,52 +309,6 @@ static inline void choose_font(HWND hwnd) ReleaseDC(hwnd, hdc); } -#ifdef __WINE__ - -#ifdef UNICODE - -/* call vswprintf() in msvcrt.dll */ -/*TODO: fix swprintf() in non-msvcrt mode, so that this dynamic linking function can be removed */ -static int msvcrt_swprintf(WCHAR* buffer, const WCHAR* fmt, ...) -{ - static int (__cdecl *pvswprintf)(WCHAR*, const WCHAR*, va_list) = NULL; - va_list ap; - int ret; - - if (!pvswprintf) { - HMODULE hModMsvcrt = LoadLibraryA("msvcrt"); - pvswprintf = (int(__cdecl*)(WCHAR*,const WCHAR*,va_list)) GetProcAddress(hModMsvcrt, "vswprintf"); - } - - va_start(ap, fmt); - ret = (*pvswprintf)(buffer, fmt, ap); - va_end(ap); - - return ret; -} - -static LPCWSTR my_wcsrchr(LPCWSTR str, WCHAR c) -{ - LPCWSTR p = str; - - while(*p) - ++p; - - do { - if (--p < str) - return NULL; - } while(*p != c); - - return p; -} - -#define _tcsrchr my_wcsrchr -#else /* UNICODE */ -#define _tcsrchr strrchr -#endif /* UNICODE */ - -#endif /* __WINE__ */ - /* allocate and initialise a directory entry */ static Entry* alloc_entry(void) @@ -1219,8 +1183,8 @@ static int compareExt(const void* arg1, const void* arg2) name1 = fd1->cFileName; name2 = fd2->cFileName; - ext1 = _tcsrchr(name1, '.'); - ext2 = _tcsrchr(name2, '.'); + ext1 = strrchrW(name1, '.'); + ext2 = strrchrW(name2, '.'); if (ext1) ext1++; @@ -2032,7 +1996,6 @@ static INT_PTR CALLBACK PropertiesDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wpa static const TCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'}; TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; LPWIN32_FIND_DATA pWFD; - ULONGLONG size; dlg = (struct PropertiesDialog*) lparam; pWFD = (LPWIN32_FIND_DATA) &dlg->entry.data; @@ -2044,8 +2007,7 @@ static INT_PTR CALLBACK PropertiesDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wpa format_date(&pWFD->ftLastWriteTime, b1, COL_DATE|COL_TIME); SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_LASTCHANGE), b1); - size = ((ULONGLONG)pWFD->nFileSizeHigh << 32) | pWFD->nFileSizeLow; - _stprintf(b1, sLongNumFmt, size); + format_longlong( b1, ((ULONGLONG)pWFD->nFileSizeHigh << 32) | pWFD->nFileSizeLow ); wsprintf(b2, sByteFmt, b1); SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_SIZE), b2); @@ -2907,17 +2869,18 @@ 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}; float fBytes = (float)bytes; if (bytes >= 1073741824) /* 1 GB */ - _stprintf(buffer, sFmtGB, fBytes/1073741824.f+.5f); + sprintfW(buffer, sFmtGB, fBytes/1073741824.f+.5f); else if (bytes >= 1048576) /* 1 MB */ - _stprintf(buffer, sFmtMB, fBytes/1048576.f+.5f); + sprintfW(buffer, sFmtMB, fBytes/1048576.f+.5f); else if (bytes >= 1024) /* 1 kB */ - _stprintf(buffer, sFmtkB, fBytes/1024.f+.5f); + sprintfW(buffer, sFmtkB, fBytes/1024.f+.5f); else - _stprintf(buffer, sLongNumFmt, bytes); + sprintfW(buffer, sFmtB, (DWORD)bytes); } static void set_space_status(void) @@ -3141,7 +3104,7 @@ static BOOL is_registered_type(LPCTSTR ext) static enum FILE_TYPE get_file_type(LPCTSTR filename) { - LPCTSTR ext = _tcsrchr(filename, '.'); + LPCTSTR ext = strrchrW(filename, '.'); if (!ext) ext = sEmpty; @@ -3354,11 +3317,7 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi if (!(attrs&FILE_ATTRIBUTE_DIRECTORY)) #endif { - ULONGLONG size; - - size = ((ULONGLONG)entry->data.nFileSizeHigh << 32) | entry->data.nFileSizeLow; - - _stprintf(buffer, sLongNumFmt, size); + format_longlong( buffer, ((ULONGLONG)entry->data.nFileSizeHigh << 32) | entry->data.nFileSizeLow ); if (calcWidthCol == -1) output_number(pane, dis, col, buffer); @@ -3397,10 +3356,15 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi #ifndef _NO_EXTENSIONS if (entry->bhfi_valid) { - ULONGLONG index = ((ULONGLONG)entry->bhfi.nFileIndexHigh << 32) | entry->bhfi.nFileIndexLow; - if (visible_cols & COL_INDEX) { - _stprintf(buffer, sLongHexFmt, index); + static const TCHAR fmtlow[] = {'%','X',0}; + static const TCHAR fmthigh[] = {'%','X','%','0','8','X',0}; + + if (entry->bhfi.nFileIndexHigh) + wsprintf(buffer, fmthigh, + entry->bhfi.nFileIndexHigh, entry->bhfi.nFileIndexLow ); + else + wsprintf(buffer, fmtlow, entry->bhfi.nFileIndexLow ); if (calcWidthCol == -1) output_text(pane, dis, col, buffer, DT_RIGHT); diff --git a/programs/winefile/winefile.h b/programs/winefile/winefile.h index cba4843..7c1f66c 100644 --- a/programs/winefile/winefile.h +++ b/programs/winefile/winefile.h @@ -150,11 +150,9 @@ extern WINEFILE_GLOBALS Globals; #ifdef UNICODE extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); #define _tsplitpath _wsplitpath -#define _stprintf msvcrt_swprintf #else extern void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext); #define _tsplitpath _splitpath -#define _stprintf sprintf #endif #else
1
0
0
0
Alexandre Julliard : kernel32: #ifdef out some code that is not needed on non-i386.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: 13df062d3686a9b1961f0877aa8aaccd1fdc7332 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=13df062d3686a9b1961f0877a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 20:29:28 2009 +0100 kernel32: #ifdef out some code that is not needed on non-i386. --- dlls/kernel32/instr.c | 4 +++ dlls/kernel32/kernel32.spec | 48 +++++++++++++++++++++--------------------- dlls/kernel32/relay16.c | 25 +-------------------- dlls/kernel32/thunk.c | 44 +++----------------------------------- dlls/kernel32/utthunk.c | 4 +++ dlls/ntoskrnl.exe/ntoskrnl.c | 10 ++++++-- 6 files changed, 45 insertions(+), 90 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=13df062d3686a9b1961f0…
1
0
0
0
Alexandre Julliard : kernel32: Moved the 16-bit WOW thunk routines to thunk .c.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: 27bb18a531bdd8831f9376d9bb207e8facc176e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=27bb18a531bdd8831f9376d9b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 20:28:08 2009 +0100 kernel32: Moved the 16-bit WOW thunk routines to thunk.c. --- dlls/kernel32/thunk.c | 230 +++++++++++++++++++++++++++++++++++++++++++ dlls/kernel32/wowthunk.c | 243 ---------------------------------------------- 2 files changed, 230 insertions(+), 243 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=27bb18a531bdd8831f937…
1
0
0
0
Alexandre Julliard : kernel32: Moved _DebugOutput to kernel16.c.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: 1b2ceb5718365d2a122b4b07c940ca6fd406b957 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1b2ceb5718365d2a122b4b07c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 20:27:51 2009 +0100 kernel32: Moved _DebugOutput to kernel16.c. --- dlls/kernel32/debugger.c | 19 ------------------- dlls/kernel32/kernel16.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dlls/kernel32/debugger.c b/dlls/kernel32/debugger.c index 6e7b4b1..b83647c 100644 --- a/dlls/kernel32/debugger.c +++ b/dlls/kernel32/debugger.c @@ -25,7 +25,6 @@ #include "wine/winbase16.h" #include "wine/server.h" #include "kernel_private.h" -#include "kernel16_private.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(debugstr); @@ -409,24 +408,6 @@ BOOL WINAPI CheckRemoteDebuggerPresent(HANDLE process, PBOOL DebuggerPresent) } /*********************************************************************** - * _DebugOutput (KERNEL.328) - */ -void WINAPIV _DebugOutput( WORD flags, LPCSTR spec, VA_LIST16 valist ) -{ - char caller[101]; - - /* Decode caller address */ - if (!GetModuleName16( GetExePtr(CURRENT_STACK16->cs), caller, sizeof(caller) )) - sprintf( caller, "%04X:%04X", CURRENT_STACK16->cs, CURRENT_STACK16->ip ); - - /* FIXME: cannot use wvsnprintf16 from kernel */ - /* wvsnprintf16( temp, sizeof(temp), spec, valist ); */ - - /* Output */ - FIXME("%s %04x %s\n", caller, flags, debugstr_a(spec) ); -} - -/*********************************************************************** * DebugSetProcessKillOnExit (KERNEL32.@) * * Let a debugger decide whether a debuggee will be killed upon debugger diff --git a/dlls/kernel32/kernel16.c b/dlls/kernel32/kernel16.c index 7ae378d..b904057 100644 --- a/dlls/kernel32/kernel16.c +++ b/dlls/kernel32/kernel16.c @@ -19,6 +19,7 @@ */ #include <stdarg.h> +#include <stdio.h> #include "windef.h" #include "winbase.h" @@ -264,3 +265,21 @@ void WINAPI WINHELP_EntryPoint( CONTEXT86 *context ) HeapFree( GetProcessHeap(), 0, cmdline ); ExitThread( exit_code ); } + +/*********************************************************************** + * _DebugOutput (KERNEL.328) + */ +void WINAPIV _DebugOutput( WORD flags, LPCSTR spec, VA_LIST16 valist ) +{ + char caller[101]; + + /* Decode caller address */ + if (!GetModuleName16( GetExePtr(CURRENT_STACK16->cs), caller, sizeof(caller) )) + sprintf( caller, "%04X:%04X", CURRENT_STACK16->cs, CURRENT_STACK16->ip ); + + /* FIXME: cannot use wvsnprintf16 from kernel */ + /* wvsnprintf16( temp, sizeof(temp), spec, valist ); */ + + /* Output */ + FIXME("%s %04x %s\n", caller, flags, debugstr_a(spec) ); +}
1
0
0
0
Alexandre Julliard : ntdll: Replaced get_cpu_context by RtlCaptureContext. Implemented it for x86_64.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: 14c452fe787deceb3776d205d7be867421a59fe1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=14c452fe787deceb3776d205d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 17:50:34 2009 +0100 ntdll: Replaced get_cpu_context by RtlCaptureContext. Implemented it for x86_64. --- dlls/ntdll/exception.c | 19 ------------------- dlls/ntdll/ntdll_misc.h | 1 - dlls/ntdll/signal_i386.c | 8 +++----- dlls/ntdll/signal_powerpc.c | 7 +++---- dlls/ntdll/signal_sparc.c | 7 +++---- dlls/ntdll/signal_x86_64.c | 9 ++++----- dlls/ntdll/thread.c | 2 +- 7 files changed, 14 insertions(+), 39 deletions(-) diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 0298918..607d0e2 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -400,25 +400,6 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL return status; } -/*********************************************************************** - * RtlCaptureContext (NTDLL.@) - */ -void WINAPI __regs_RtlCaptureContext( CONTEXT *context_out, CONTEXT *context_in ) -{ - *context_out = *context_in; -} - -/**********************************************************************/ - -#ifdef DEFINE_REGS_ENTRYPOINT -DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 1 ) -#else -void WINAPI RtlCaptureContext( CONTEXT *context_out ) -{ - memset( context_out, 0, sizeof(*context_out) ); -} -#endif - /*********************************************************************** * RtlRaiseException (NTDLL.@) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 831e0fc..dc121f5 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -41,7 +41,6 @@ struct drive_info /* exceptions */ extern void wait_suspend( CONTEXT *context ); extern void WINAPI __regs_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT ); -extern void get_cpu_context( CONTEXT *context ); extern void set_cpu_context( const CONTEXT *context ); /* debug helper */ diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 32c39f3..1543664 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -886,17 +886,15 @@ static inline void restore_context( const CONTEXT *context, SIGCONTEXT *sigconte /*********************************************************************** - * get_cpu_context - * - * Register function to get the context of the current thread. + * RtlCaptureContext (NTDLL.@) */ -void WINAPI __regs_get_cpu_context( CONTEXT *context, CONTEXT *regs ) +void WINAPI __regs_RtlCaptureContext( CONTEXT *context, CONTEXT *regs ) { *context = *regs; if (fpux_support) save_fpux( context ); else save_fpu( context ); } -DEFINE_REGS_ENTRYPOINT( get_cpu_context, 1 ) +DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 1 ) /*********************************************************************** diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index 4fa44e7..c790f84 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -268,13 +268,12 @@ static inline void restore_fpu( CONTEXT *context, const SIGCONTEXT *sigcontext ) /*********************************************************************** - * get_cpu_context - * - * Get the context of the current thread. + * RtlCaptureContext (NTDLL.@) */ -void get_cpu_context( CONTEXT *context ) +void WINAPI RtlCaptureContext( CONTEXT *context ) { FIXME("not implemented\n"); + memset( context, 0, sizeof(*context) ); } diff --git a/dlls/ntdll/signal_sparc.c b/dlls/ntdll/signal_sparc.c index 4c14633..54165ee 100644 --- a/dlls/ntdll/signal_sparc.c +++ b/dlls/ntdll/signal_sparc.c @@ -149,13 +149,12 @@ static void restore_fpu( CONTEXT *context, ucontext_t *ucontext ) /*********************************************************************** - * get_cpu_context - * - * Get the context of the current thread. + * RtlCaptureContext (NTDLL.@) */ -void get_cpu_context( CONTEXT *context ) +void WINAPI RtlCaptureContext( CONTEXT *context ) { FIXME("not implemented\n"); + memset( context, 0, sizeof(*context) ); } diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 35c9f1b..8e9dd7c 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -199,14 +199,13 @@ static void restore_context( const CONTEXT *context, SIGCONTEXT *sigcontext ) /*********************************************************************** - * get_cpu_context - * - * Get the context of the current thread. + * RtlCaptureContext (NTDLL.@) */ -void get_cpu_context( CONTEXT *context ) +void WINAPI __regs_RtlCaptureContext( CONTEXT *context, CONTEXT *regs ) { - FIXME("not implemented\n"); + *context = *regs; } +DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 1 ) /*********************************************************************** diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 51b190a..7d4675a 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -1134,7 +1134,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) { if (needed_flags) { - get_cpu_context( &ctx ); + RtlCaptureContext( &ctx ); copy_context( context, &ctx, ctx.ContextFlags & needed_flags ); } #ifdef __i386__
1
0
0
0
Alexandre Julliard : ntdll: Print exception context on x86_64.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: d1e8a85b1ff66639a5726ee88fa8b9930947b7e1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d1e8a85b1ff66639a5726ee88…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 17:02:13 2009 +0100 ntdll: Print exception context on x86_64. --- dlls/ntdll/exception.c | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index de27434..0298918 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -320,8 +320,9 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f { DWORD c; - TRACE( "code=%x flags=%x addr=%p\n", - rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress ); + TRACE( "code=%x flags=%x addr=%p ip=%p tid=%04x\n", + rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, + GET_IP(context), GetCurrentThreadId() ); for (c = 0; c < rec->NumberParameters; c++) TRACE( " info[%d]=%08lx\n", c, rec->ExceptionInformation[c] ); if (rec->ExceptionCode == EXCEPTION_WINE_STUB) @@ -335,17 +336,26 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f rec->ExceptionAddress, (char*)rec->ExceptionInformation[0], rec->ExceptionInformation[1] ); } -#ifdef __i386__ else { +#ifdef __i386__ TRACE(" eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\n", context->Eax, context->Ebx, context->Ecx, context->Edx, context->Esi, context->Edi ); TRACE(" ebp=%08x esp=%08x cs=%04x ds=%04x es=%04x fs=%04x gs=%04x flags=%08x\n", context->Ebp, context->Esp, context->SegCs, context->SegDs, context->SegEs, context->SegFs, context->SegGs, context->EFlags ); - } +#elif defined(__x86_64__) + TRACE(" rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx\n", + context->Rax, context->Rbx, context->Rcx, context->Rdx ); + TRACE(" rsi=%016lx rdi=%016lx rbp=%016lx rsp=%016lx\n", + context->Rsi, context->Rdi, context->Rbp, context->Rsp ); + TRACE(" r8=%016lx r9=%016lx r10=%016lx r11=%016lx\n", + context->R8, context->R9, context->R10, context->R11 ); + TRACE(" r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", + context->R12, context->R13, context->R14, context->R15 ); #endif + } status = send_debug_event( rec, TRUE, context ); if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) return STATUS_SUCCESS;
1
0
0
0
Alexandre Julliard : ntdll: Implement relay debugging for register entry points on x86_64.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: 814edb45202307f916bb721d408abd7cb6eb55f5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=814edb45202307f916bb721d4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 17:01:56 2009 +0100 ntdll: Implement relay debugging for register entry points on x86_64. --- dlls/ntdll/relay.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 70 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index d369c16..6eeb453 100644 --- a/dlls/ntdll/relay.c +++ b/dlls/ntdll/relay.c @@ -479,7 +479,76 @@ void WINAPI __regs_relay_call_regs( struct relay_descr *descr, unsigned int idx, } extern void WINAPI relay_call_regs(void); DEFINE_REGS_ENTRYPOINT( relay_call_regs, 4 ) -#endif + +#else /* __i386__ */ + +void WINAPI __regs_relay_call_regs( struct relay_descr *descr, INT_PTR idx, + INT_PTR *stack, CONTEXT *context ) +{ + WORD ordinal = LOWORD(idx); + BYTE nb_args = LOBYTE(HIWORD(idx)); + struct relay_private_data *data = descr->private; + struct relay_entry_point *entry_point = data->entry_points + ordinal; + BYTE *orig_func = entry_point->orig_func; + INT_PTR *args = stack + 1; + INT_PTR args_copy[32]; + + /* restore the context to what it was before the relay thunk */ + context->Rip = stack[0]; + context->Rsp = (INT_PTR)args; + + if (TRACE_ON(relay)) + { + if (entry_point->name) + DPRINTF( "%04x:Call %s.%s(", GetCurrentThreadId(), data->dllname, entry_point->name ); + else + DPRINTF( "%04x:Call %s.%u(", GetCurrentThreadId(), data->dllname, data->base + ordinal ); + RELAY_PrintArgs( args, nb_args, descr->arg_types[ordinal] ); + DPRINTF( ") ret=%08lx\n", context->Rip ); + + DPRINTF( "%04x: rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx rsi=%016lx rdi=%016lx rbp=%016lx rsp=%016lx\n", + GetCurrentThreadId(), context->Rax, context->Rbx, context->Rcx, context->Rdx, + context->Rsi, context->Rdi, context->Rbp, context->Rsp ); + DPRINTF( "%04x: r8=%016lx r9=%016lx r10=%016lx r11=%016lx r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", + GetCurrentThreadId(), context->R8, context->R9, context->R10, context->R11, + context->R12, context->R13, context->R14, context->R15 ); + + assert( orig_func[17] == 0x48 /* leaq */ ); + assert( orig_func[18] == 0x8d ); + assert( orig_func[19] == 0x15 ); + assert( orig_func[24] == 0xe8 /* call */ ); + } + + /* now call the real function */ + + memcpy( args_copy, args, nb_args * sizeof(args[0]) ); + args_copy[nb_args++] = (INT_PTR)context; /* append context argument */ + + call_entry_point( orig_func + 24 + *(int *)(orig_func + 20), nb_args, args_copy ); + + + if (TRACE_ON(relay)) + { + if (entry_point->name) + DPRINTF( "%04x:Ret %s.%s() retval=%08lx ret=%08lx\n", + GetCurrentThreadId(), data->dllname, entry_point->name, + context->Rax, context->Rip ); + else + DPRINTF( "%04x:Ret %s.%u() retval=%08lx ret=%08lx\n", + GetCurrentThreadId(), data->dllname, data->base + ordinal, + context->Rax, context->Rip ); + DPRINTF( "%04x: rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx rsi=%016lx rdi=%016lx rbp=%016lx rsp=%016lx\n", + GetCurrentThreadId(), context->Rax, context->Rbx, context->Rcx, context->Rdx, + context->Rsi, context->Rdi, context->Rbp, context->Rsp ); + DPRINTF( "%04x: r8=%016lx r9=%016lx r10=%016lx r11=%016lx r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", + GetCurrentThreadId(), context->R8, context->R9, context->R10, context->R11, + context->R12, context->R13, context->R14, context->R15 ); + } +} +extern void WINAPI relay_call_regs(void); +DEFINE_REGS_ENTRYPOINT( relay_call_regs, 3 ) + +#endif /* __i386__ */ /*********************************************************************** @@ -529,9 +598,7 @@ void RELAY_SetupDLL( HMODULE module ) return; descr->relay_call = relay_call; -#ifdef __i386__ descr->relay_call_regs = relay_call_regs; -#endif descr->private = data; data->module = module;
1
0
0
0
Alexandre Julliard : winebuild: Implement register entry points for x86_64.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: 465ddc51dc2ec237f9fa6aa85708df3a25fcbd52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=465ddc51dc2ec237f9fa6aa85…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 17:01:30 2009 +0100 winebuild: Implement register entry points for x86_64. --- dlls/ntdll/ntdll_misc.h | 9 ++- tools/winebuild/relay.c | 201 +++++++++++++++++++++++++++++++++++++++++++--- tools/winebuild/spec32.c | 2 +- 3 files changed, 197 insertions(+), 15 deletions(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index d8777bc..831e0fc 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -223,7 +223,14 @@ static inline struct ntdll_thread_regs *ntdll_get_thread_regs(void) ".long " __ASM_NAME("__regs_") #name "-.-11\n\t" \ ".byte 0x6a," #args "\n\t" /* pushl $args */ \ "call " __ASM_NAME("__wine_call_from_32_regs")) -/* FIXME: add support for other CPUs */ +#elif defined(__x86_64__) +#define DEFINE_REGS_ENTRYPOINT( name, args ) \ + __ASM_GLOBAL_FUNC( name, \ + "movq %rcx,8(%rsp)\n\t" \ + "movq %rdx,16(%rsp)\n\t" \ + "movq $" #args ",%rcx\n\t" \ + "leaq " __ASM_NAME("__regs_") #name "(%rip),%rdx\n\t" \ + "call " __ASM_NAME("__wine_call_from_regs")) #endif #endif diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c index 2dfda98..8b08cde 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -983,6 +983,173 @@ void BuildRelays16(void) output_gnu_stack_note(); } + +/******************************************************************* + * build_call_from_regs_x86_64 + * + * Build the register saving code for a 'register' entry point. + * + * Stack layout: + * ... + * (rsp+16) first arg + * (rsp+8) ret addr to user code + * (rsp) ret addr to relay code + * (rsp-128) buffer area to allow stack frame manipulation + * + * Parameters: + * %rcx number of args + * %rdx entry point + */ +static void build_call_from_regs_x86_64(void) +{ + static const int STACK_SPACE = 128 + 0x4d0; /* size of x86_64 context */ + + /* Function header */ + + function_header( "__wine_call_from_regs" ); + + output( "\tsubq $%u,%%rsp\n", STACK_SPACE ); + + /* save registers into the context */ + + output( "\tmovq %%rax,0x78(%%rsp)\n" ); + output( "\tmovq %u(%%rsp),%%rax\n", STACK_SPACE + 16 ); /* saved %rcx on stack */ + output( "\tmovq %%rax,0x80(%%rsp)\n" ); + output( "\tmovq %u(%%rsp),%%rax\n", STACK_SPACE + 24 ); /* saved %rdx on stack */ + output( "\tmovq %%rax,0x88(%%rsp)\n" ); + output( "\tmovq %%rbx,0x90(%%rsp)\n" ); + output( "\tleaq %u(%%rsp),%%rax\n", STACK_SPACE + 16 ); + output( "\tmovq %%rax,0x98(%%rsp)\n" ); + output( "\tmovq %%rbp,0xa0(%%rsp)\n" ); + output( "\tmovq %%rsi,0xa8(%%rsp)\n" ); + output( "\tmovq %%rdi,0xb0(%%rsp)\n" ); + output( "\tmovq %%r8,0xb8(%%rsp)\n" ); + output( "\tmovq %%r9,0xc0(%%rsp)\n" ); + output( "\tmovq %%r10,0xc8(%%rsp)\n" ); + output( "\tmovq %%r11,0xd0(%%rsp)\n" ); + output( "\tmovq %%r12,0xd8(%%rsp)\n" ); + output( "\tmovq %%r13,0xe0(%%rsp)\n" ); + output( "\tmovq %%r14,0xe8(%%rsp)\n" ); + output( "\tmovq %%r15,0xf0(%%rsp)\n" ); + output( "\tmovq %u(%%rsp),%%rax\n", STACK_SPACE + 8 ); + output( "\tmovq %%rax,0xf8(%%rsp)\n" ); + + output( "\tstmxcsr 0x34(%%rsp)\n" ); + output( "\tfxsave 0x100(%%rsp)\n" ); + output( "\tmovdqa %%xmm0,0x1a0(%%rsp)\n" ); + output( "\tmovdqa %%xmm1,0x1b0(%%rsp)\n" ); + output( "\tmovdqa %%xmm2,0x1c0(%%rsp)\n" ); + output( "\tmovdqa %%xmm3,0x1d0(%%rsp)\n" ); + output( "\tmovdqa %%xmm4,0x1e0(%%rsp)\n" ); + output( "\tmovdqa %%xmm5,0x1f0(%%rsp)\n" ); + output( "\tmovdqa %%xmm6,0x200(%%rsp)\n" ); + output( "\tmovdqa %%xmm7,0x210(%%rsp)\n" ); + output( "\tmovdqa %%xmm8,0x220(%%rsp)\n" ); + output( "\tmovdqa %%xmm9,0x230(%%rsp)\n" ); + output( "\tmovdqa %%xmm10,0x240(%%rsp)\n" ); + output( "\tmovdqa %%xmm11,0x250(%%rsp)\n" ); + output( "\tmovdqa %%xmm12,0x260(%%rsp)\n" ); + output( "\tmovdqa %%xmm13,0x270(%%rsp)\n" ); + output( "\tmovdqa %%xmm14,0x280(%%rsp)\n" ); + output( "\tmovdqa %%xmm15,0x290(%%rsp)\n" ); + + output( "\tmovw %%cs,0x38(%%rsp)\n" ); + output( "\tmovw %%ds,0x3a(%%rsp)\n" ); + output( "\tmovw %%es,0x3c(%%rsp)\n" ); + output( "\tmovw %%fs,0x3e(%%rsp)\n" ); + output( "\tmovw %%gs,0x40(%%rsp)\n" ); + output( "\tmovw %%ss,0x42(%%rsp)\n" ); + output( "\tpushfq\n" ); + output( "\tpopq %%rax\n" ); + output( "\tmovl %%eax,0x44(%%rsp)\n" ); + + output( "\tmovl $0x%x,0x30(%%rsp)\n", 0x0010000f ); + + /* transfer the arguments */ + + output( "\tmovq %%r8,%u(%%rsp)\n", STACK_SPACE + 32 ); + output( "\tmovq %%r9,%u(%%rsp)\n", STACK_SPACE + 40 ); + output( "\tmovq $4,%%rax\n" ); + output( "\tleaq %u(%%rsp),%%rsi\n", STACK_SPACE + 16 ); + output( "\tcmpq %%rax,%%rcx\n" ); + output( "\tcmovgq %%rcx,%%rax\n" ); + output( "\tmovq %%rsp,%%rbx\n" ); + output( "\tleaq 16(,%%rax,8),%%rax\n" ); /* add 8 for context arg and 8 for rounding */ + output( "\tandq $~15,%%rax\n" ); + output( "\tsubq %%rax,%%rsp\n" ); + output( "\tmovq %%rsp,%%rdi\n" ); + output( "\tjrcxz 1f\n" ); + output( "\tcld\n" ); + output( "\trep\n\tmovsq\n" ); + output( "1:\tmovq %%rbx,0(%%rdi)\n" ); /* context arg */ + + /* call the entry point */ + + output( "\tmovq %%rdx,%%rax\n" ); + output( "\tmovq 0(%%rsp),%%rcx\n" ); + output( "\tmovq 8(%%rsp),%%rdx\n" ); + output( "\tmovq 16(%%rsp),%%r8\n" ); + output( "\tmovq 24(%%rsp),%%r9\n" ); + output( "\tcallq *%%rax\n" ); + + /* restore the context structure */ + + output( "1:\tmovq 0x80(%%rbx),%%rcx\n" ); + output( "\tmovq 0x88(%%rbx),%%rdx\n" ); + output( "\tmovq 0xa0(%%rbx),%%rbp\n" ); + output( "\tmovq 0xa8(%%rbx),%%rsi\n" ); + output( "\tmovq 0xb0(%%rbx),%%rdi\n" ); + output( "\tmovq 0xb8(%%rbx),%%r8\n" ); + output( "\tmovq 0xc0(%%rbx),%%r9\n" ); + output( "\tmovq 0xc8(%%rbx),%%r10\n" ); + output( "\tmovq 0xd0(%%rbx),%%r11\n" ); + output( "\tmovq 0xd8(%%rbx),%%r12\n" ); + output( "\tmovq 0xe0(%%rbx),%%r13\n" ); + output( "\tmovq 0xe8(%%rbx),%%r14\n" ); + output( "\tmovq 0xf0(%%rbx),%%r15\n" ); + + output( "\tmovdqa 0x1a0(%%rbx),%%xmm0\n" ); + output( "\tmovdqa 0x1b0(%%rbx),%%xmm1\n" ); + output( "\tmovdqa 0x1c0(%%rbx),%%xmm2\n" ); + output( "\tmovdqa 0x1d0(%%rbx),%%xmm3\n" ); + output( "\tmovdqa 0x1e0(%%rbx),%%xmm4\n" ); + output( "\tmovdqa 0x1f0(%%rbx),%%xmm5\n" ); + output( "\tmovdqa 0x200(%%rbx),%%xmm6\n" ); + output( "\tmovdqa 0x210(%%rbx),%%xmm7\n" ); + output( "\tmovdqa 0x220(%%rbx),%%xmm8\n" ); + output( "\tmovdqa 0x230(%%rbx),%%xmm9\n" ); + output( "\tmovdqa 0x240(%%rbx),%%xmm10\n" ); + output( "\tmovdqa 0x250(%%rbx),%%xmm11\n" ); + output( "\tmovdqa 0x260(%%rbx),%%xmm12\n" ); + output( "\tmovdqa 0x270(%%rbx),%%xmm13\n" ); + output( "\tmovdqa 0x280(%%rbx),%%xmm14\n" ); + output( "\tmovdqa 0x290(%%rbx),%%xmm15\n" ); + output( "\tfxrstor 0x100(%%rbx)\n" ); + output( "\tldmxcsr 0x34(%%rbx)\n" ); + + output( "\tmovl 0x44(%%rbx),%%eax\n" ); + output( "\tpushq %%rax\n" ); + output( "\tpopfq\n" ); + + output( "\tmovq 0x98(%%rbx),%%rax\n" ); /* stack pointer */ + output( "\tpushq 0xf8(%%rbx)\n" ); /* return address */ + output( "\tpopq -8(%%rax)\n" ); + output( "\tpushq 0x78(%%rbx)\n" ); /* rax */ + output( "\tpopq -16(%%rax)\n" ); + output( "\tmovq 0x90(%%rbx),%%rbx\n" ); + output( "\tleaq -16(%%rax),%%rsp\n" ); + output( "\tpopq %%rax\n" ); + output( "\tret\n" ); + + output_function_size( "__wine_call_from_regs" ); + + function_header( "__wine_restore_regs" ); + output( "\tmovq %%rcx,%%rbx\n" ); + output( "\tjmp 1b\n" ); + output_function_size( "__wine_restore_regs" ); +} + + /******************************************************************* * BuildRelays32 * @@ -990,21 +1157,29 @@ void BuildRelays16(void) */ void BuildRelays32(void) { - if (target_cpu != CPU_x86) + switch (target_cpu) { + case CPU_x86: + output( "/* File generated automatically. Do not edit! */\n\n" ); + output( "\t.text\n" ); + output( "%s:\n\n", asm_name("__wine_spec_thunk_text_32") ); + + /* 32-bit register entry point */ + BuildCallFrom32Regs(); + + output_function_size( "__wine_spec_thunk_text_32" ); + output_gnu_stack_note(); + break; + + case CPU_x86_64: + output( "/* File generated automatically. Do not edit! */\n\n" ); + output( "\t.text\n" ); + build_call_from_regs_x86_64(); + output_gnu_stack_note(); + break; + + default: output( "/* File not used with this architecture. Do not edit! */\n\n" ); return; } - - /* File header */ - - output( "/* File generated automatically. Do not edit! */\n\n" ); - output( "\t.text\n" ); - output( "%s:\n\n", asm_name("__wine_spec_thunk_text_32") ); - - /* 32-bit register entry point */ - BuildCallFrom32Regs(); - - output_function_size( "__wine_spec_thunk_text_32" ); - output_gnu_stack_note(); } diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 2000937..583c422 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -170,7 +170,7 @@ static void output_relay_debug( DLLSPEC *spec ) output( "\tmovq $%u,%%rdx\n", (flags << 24) | (args << 16) | (i - spec->base) ); output( "\tleaq .L__wine_spec_relay_descr(%%rip),%%rcx\n" ); output( "\tsubq $40,%%rsp\n" ); - output( "\tcallq *8(%%rcx)\n" ); + output( "\tcallq *%u(%%rcx)\n", (odp->flags & FLAG_REGISTER) ? 16 : 8 ); output( "\taddq $40,%%rsp\n" ); output( "\tret\n" ); break;
1
0
0
0
Alexandre Julliard : include: Document offsets in the x86_64 context structure.
by Alexandre Julliard
07 Jan '09
07 Jan '09
Module: wine Branch: master Commit: a3a02d430a1bbe3d6572629e764690943e899700 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a3a02d430a1bbe3d6572629e7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 6 17:00:27 2009 +0100 include: Document offsets in the x86_64 context structure. --- include/winnt.h | 160 +++++++++++++++++++++++++++--------------------------- 1 files changed, 80 insertions(+), 80 deletions(-) diff --git a/include/winnt.h b/include/winnt.h index 57f4c5c..6dadf9e 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -879,109 +879,109 @@ typedef struct DECLSPEC_ALIGN(16) _M128A { } M128A, *PM128A; typedef struct _XMM_SAVE_AREA32 { - WORD ControlWord; - WORD StatusWord; - BYTE TagWord; - BYTE Reserved1; - WORD ErrorOpcode; - DWORD ErrorOffset; - WORD ErrorSelector; - WORD Reserved2; - DWORD DataOffset; - WORD DataSelector; - WORD Reserved3; - DWORD MxCsr; - DWORD MxCsr_Mask; - M128A FloatRegisters[8]; - M128A XmmRegisters[16]; - BYTE Reserved4[96]; + WORD ControlWord; /* 000 */ + WORD StatusWord; /* 002 */ + BYTE TagWord; /* 004 */ + BYTE Reserved1; /* 005 */ + WORD ErrorOpcode; /* 006 */ + DWORD ErrorOffset; /* 008 */ + WORD ErrorSelector; /* 00c */ + WORD Reserved2; /* 00e */ + DWORD DataOffset; /* 010 */ + WORD DataSelector; /* 014 */ + WORD Reserved3; /* 016 */ + DWORD MxCsr; /* 018 */ + DWORD MxCsr_Mask; /* 01c */ + M128A FloatRegisters[8]; /* 020 */ + M128A XmmRegisters[16]; /* 0a0 */ + BYTE Reserved4[96]; /* 1a0 */ } XMM_SAVE_AREA32, *PXMM_SAVE_AREA32; typedef struct DECLSPEC_ALIGN(16) _CONTEXT { - DWORD64 P1Home; - DWORD64 P2Home; - DWORD64 P3Home; - DWORD64 P4Home; - DWORD64 P5Home; - DWORD64 P6Home; + DWORD64 P1Home; /* 000 */ + DWORD64 P2Home; /* 008 */ + DWORD64 P3Home; /* 010 */ + DWORD64 P4Home; /* 018 */ + DWORD64 P5Home; /* 020 */ + DWORD64 P6Home; /* 028 */ /* Control flags */ - DWORD ContextFlags; - DWORD MxCsr; + DWORD ContextFlags; /* 030 */ + DWORD MxCsr; /* 034 */ /* Segment */ - WORD SegCs; - WORD SegDs; - WORD SegEs; - WORD SegFs; - WORD SegGs; - WORD SegSs; - DWORD EFlags; + WORD SegCs; /* 038 */ + WORD SegDs; /* 03a */ + WORD SegEs; /* 03c */ + WORD SegFs; /* 03e */ + WORD SegGs; /* 040 */ + WORD SegSs; /* 042 */ + DWORD EFlags; /* 044 */ /* Debug */ - DWORD64 Dr0; - DWORD64 Dr1; - DWORD64 Dr2; - DWORD64 Dr3; - DWORD64 Dr6; - DWORD64 Dr7; + DWORD64 Dr0; /* 048 */ + DWORD64 Dr1; /* 050 */ + DWORD64 Dr2; /* 058 */ + DWORD64 Dr3; /* 060 */ + DWORD64 Dr6; /* 068 */ + DWORD64 Dr7; /* 070 */ /* Integer */ - DWORD64 Rax; - DWORD64 Rcx; - DWORD64 Rdx; - DWORD64 Rbx; - DWORD64 Rsp; - DWORD64 Rbp; - DWORD64 Rsi; - DWORD64 Rdi; - DWORD64 R8; - DWORD64 R9; - DWORD64 R10; - DWORD64 R11; - DWORD64 R12; - DWORD64 R13; - DWORD64 R14; - DWORD64 R15; + DWORD64 Rax; /* 078 */ + DWORD64 Rcx; /* 080 */ + DWORD64 Rdx; /* 088 */ + DWORD64 Rbx; /* 090 */ + DWORD64 Rsp; /* 098 */ + DWORD64 Rbp; /* 0a0 */ + DWORD64 Rsi; /* 0a8 */ + DWORD64 Rdi; /* 0b0 */ + DWORD64 R8; /* 0b8 */ + DWORD64 R9; /* 0c0 */ + DWORD64 R10; /* 0c8 */ + DWORD64 R11; /* 0d0 */ + DWORD64 R12; /* 0d8 */ + DWORD64 R13; /* 0e0 */ + DWORD64 R14; /* 0e8 */ + DWORD64 R15; /* 0f0 */ /* Counter */ - DWORD64 Rip; + DWORD64 Rip; /* 0f8 */ /* Floating point */ union { - XMM_SAVE_AREA32 FltSave; + XMM_SAVE_AREA32 FltSave; /* 100 */ struct { - M128A Header[2]; - M128A Legacy[8]; - M128A Xmm0; - M128A Xmm1; - M128A Xmm2; - M128A Xmm3; - M128A Xmm4; - M128A Xmm5; - M128A Xmm6; - M128A Xmm7; - M128A Xmm8; - M128A Xmm9; - M128A Xmm10; - M128A Xmm11; - M128A Xmm12; - M128A Xmm13; - M128A Xmm14; - M128A Xmm15; + M128A Header[2]; /* 100 */ + M128A Legacy[8]; /* 120 */ + M128A Xmm0; /* 1a0 */ + M128A Xmm1; /* 1b0 */ + M128A Xmm2; /* 1c0 */ + M128A Xmm3; /* 1d0 */ + M128A Xmm4; /* 1e0 */ + M128A Xmm5; /* 1f0 */ + M128A Xmm6; /* 200 */ + M128A Xmm7; /* 210 */ + M128A Xmm8; /* 220 */ + M128A Xmm9; /* 230 */ + M128A Xmm10; /* 240 */ + M128A Xmm11; /* 250 */ + M128A Xmm12; /* 260 */ + M128A Xmm13; /* 270 */ + M128A Xmm14; /* 280 */ + M128A Xmm15; /* 290 */ } DUMMYSTRUCTNAME; } DUMMYUNIONNAME; /* Vector */ - M128A VectorRegister[26]; - DWORD64 VectorControl; + M128A VectorRegister[26]; /* 300 */ + DWORD64 VectorControl; /* 4a0 */ /* Debug control */ - DWORD64 DebugControl; - DWORD64 LastBranchToRip; - DWORD64 LastBranchFromRip; - DWORD64 LastExceptionToRip; - DWORD64 LastExceptionFromRip; + DWORD64 DebugControl; /* 4a8 */ + DWORD64 LastBranchToRip; /* 4b0 */ + DWORD64 LastBranchFromRip; /* 4b8 */ + DWORD64 LastExceptionToRip; /* 4c0 */ + DWORD64 LastExceptionFromRip; /* 4c8 */ } CONTEXT; typedef struct _RUNTIME_FUNCTION
1
0
0
0
← Newer
1
...
106
107
108
109
110
111
112
...
135
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Results per page:
10
25
50
100
200