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 2011
----- 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
2 participants
879 discussions
Start a n
N
ew thread
Owen Rudge : hhctrl.ocx: Implement Sync button functionality.
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: 16b35e00edbbfbc1af92878f8aa5f54090ec6004 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=16b35e00edbbfbc1af92878f8…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Mon Jan 17 22:26:46 2011 +0000 hhctrl.ocx: Implement Sync button functionality. --- dlls/hhctrl.ocx/content.c | 16 +++++++++++ dlls/hhctrl.ocx/help.c | 62 ++++++++++++++++++++++++++++++++++++++------ dlls/hhctrl.ocx/hhctrl.h | 1 + 3 files changed, 70 insertions(+), 9 deletions(-) diff --git a/dlls/hhctrl.ocx/content.c b/dlls/hhctrl.ocx/content.c index bfe25cf..2dad7c8 100644 --- a/dlls/hhctrl.ocx/content.c +++ b/dlls/hhctrl.ocx/content.c @@ -1,5 +1,6 @@ /* * Copyright 2007 Jacek Caban for CodeWeavers + * Copyright 2011 Owen Rudge for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -312,3 +313,18 @@ void ReleaseContent(HHInfo *info) { free_content_item(info->content); } + +void ActivateContentTopic(HWND hWnd, LPCWSTR filename, ContentItem *item) +{ + if (lstrcmpiW(item->local, filename) == 0) + { + SendMessageW(hWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM) item->id); + return; + } + + if (item->next) + ActivateContentTopic(hWnd, filename, item->next); + + if (item->child) + ActivateContentTopic(hWnd, filename, item->child); +} diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 9d732a6..3dcad10 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -111,21 +111,15 @@ BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl) return ret; } -BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index) +BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index) { - WCHAR buf[INTERNET_MAX_URL_LENGTH]; - WCHAR full_path[MAX_PATH]; - LPWSTR ptr; - static const WCHAR url_format[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s','%','s',0}; static const WCHAR slash[] = {'/',0}; static const WCHAR empty[] = {0}; + WCHAR full_path[MAX_PATH]; - TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index)); - - if (!info->web_browser) - return FALSE; + TRACE("%s %p %s\n", debugstr_w(file), buf, debugstr_w(index)); if(!GetFullPathNameW(file, sizeof(full_path)/sizeof(full_path[0]), full_path, NULL)) { WARN("GetFullPathName failed: %u\n", GetLastError()); @@ -133,6 +127,18 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index) } wsprintfW(buf, url_format, full_path, (!index || index[0] == '/') ? empty : slash, index); + return TRUE; +} + +BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index) +{ + WCHAR buf[INTERNET_MAX_URL_LENGTH]; + LPWSTR ptr; + + TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index)); + + if ((!info->web_browser) || !AppendFullPathURL(file, buf, index)) + return FALSE; /* FIXME: HACK */ if((ptr = strchrW(buf, '#'))) @@ -141,6 +147,42 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index) return SUCCEEDED(navigate_url(info, buf)); } +static void DoSync(HHInfo *info) +{ + WCHAR buf[INTERNET_MAX_URL_LENGTH]; + HRESULT hres; + DWORD len; + BSTR url; + + hres = IWebBrowser2_get_LocationURL(info->web_browser, &url); + + if (FAILED(hres)) + { + WARN("get_LocationURL failed: %08x\n", hres); + return; + } + + /* If we're not currently viewing a page in the active .chm file, abort */ + if ((!AppendFullPathURL(info->pszFile, buf, NULL)) || (len = lstrlenW(buf) > lstrlenW(url))) + { + SysFreeString(url); + return; + } + + if (lstrcmpiW(buf, url) > 0) + { + static const WCHAR delimW[] = {':',':','/',0}; + const WCHAR *index; + + index = strstrW(url, delimW); + + if (index) + ActivateContentTopic(info->tabs[TAB_CONTENTS].hwnd, index + 3, info->content); /* skip over ::/ */ + } + + SysFreeString(url); +} + /* Size Bar */ #define SIZEBAR_WIDTH 4 @@ -654,6 +696,8 @@ static void TB_OnClick(HWND hWnd, DWORD dwID) ExpandContract(info); break; case IDTB_SYNC: + DoSync(info); + break; case IDTB_OPTIONS: case IDTB_BROWSE_FWD: case IDTB_BROWSE_BACK: diff --git a/dlls/hhctrl.ocx/hhctrl.h b/dlls/hhctrl.ocx/hhctrl.h index 03a4807..c0ec009 100644 --- a/dlls/hhctrl.ocx/hhctrl.h +++ b/dlls/hhctrl.ocx/hhctrl.h @@ -169,6 +169,7 @@ void DoPageAction(HHInfo*,DWORD); void InitContent(HHInfo*); void ReleaseContent(HHInfo*); +void ActivateContentTopic(HWND,LPCWSTR,ContentItem *); void InitIndex(HHInfo*); void ReleaseIndex(HHInfo*);
1
0
0
0
Owen Rudge : hhctrl.ocx: Implement Show/Hide functionality.
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: deda1b2c4e7ca439f2cbafe7bd8b755851ee9dfb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=deda1b2c4e7ca439f2cbafe7b…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Mon Jan 17 22:26:40 2011 +0000 hhctrl.ocx: Implement Show/Hide functionality. --- dlls/hhctrl.ocx/help.c | 98 +++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 85 insertions(+), 13 deletions(-) diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 31a7c1b..9d732a6 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -3,6 +3,7 @@ * * Copyright 2005 James Hawkins * Copyright 2007 Jacek Caban for CodeWeavers + * Copyright 2011 Owen Rudge for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp); static LRESULT Help_OnSize(HWND hWnd); +static void ExpandContract(HHInfo *pHHInfo); /* Window type defaults */ @@ -264,10 +266,13 @@ static BOOL HH_AddSizeBar(HHInfo *pHHInfo) { HWND hWnd; HWND hwndParent = pHHInfo->WinType.hwndHelp; - DWORD dwStyles = WS_CHILDWINDOW | WS_VISIBLE | WS_OVERLAPPED; + DWORD dwStyles = WS_CHILDWINDOW | WS_OVERLAPPED; DWORD dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR; RECT rc; + if (!pHHInfo->WinType.fNotExpanded) + dwStyles |= WS_VISIBLE; + SB_GetSizeBarRect(pHHInfo, &rc); hWnd = CreateWindowExW(dwExStyles, szSizeBarClass, szEmpty, dwStyles, @@ -646,6 +651,8 @@ static void TB_OnClick(HWND hWnd, DWORD dwID) break; case IDTB_EXPAND: case IDTB_CONTRACT: + ExpandContract(info); + break; case IDTB_SYNC: case IDTB_OPTIONS: case IDTB_BROWSE_FWD: @@ -671,12 +678,20 @@ static void TB_AddButton(TBBUTTON *pButtons, DWORD dwIndex, DWORD dwID) pButtons[dwIndex].iString = 0; } -static void TB_AddButtonsFromFlags(TBBUTTON *pButtons, DWORD dwButtonFlags, LPDWORD pdwNumButtons) +static void TB_AddButtonsFromFlags(HHInfo *pHHInfo, TBBUTTON *pButtons, DWORD dwButtonFlags, LPDWORD pdwNumButtons) { *pdwNumButtons = 0; if (dwButtonFlags & HHWIN_BUTTON_EXPAND) + { TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_EXPAND); + TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_CONTRACT); + + if (pHHInfo->WinType.fNotExpanded) + pButtons[1].fsState |= TBSTATE_HIDDEN; + else + pButtons[0].fsState |= TBSTATE_HIDDEN; + } if (dwButtonFlags & HHWIN_BUTTON_BACK) TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_BACK); @@ -733,7 +748,7 @@ static BOOL HH_AddToolbar(HHInfo *pHHInfo) else toolbarFlags = HHWIN_DEF_BUTTONS; - TB_AddButtonsFromFlags(buttons, toolbarFlags, &dwNumButtons); + TB_AddButtonsFromFlags(pHHInfo, buttons, toolbarFlags, &dwNumButtons); dwStyles = WS_CHILDWINDOW | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_WRAPABLE | TBSTYLE_TOOLTIPS | CCS_NODIVIDER; @@ -815,10 +830,13 @@ static BOOL HH_AddNavigationPane(HHInfo *info) { HWND hWnd, hwndTabCtrl; HWND hwndParent = info->WinType.hwndHelp; - DWORD dwStyles = WS_CHILDWINDOW | WS_VISIBLE; + DWORD dwStyles = WS_CHILDWINDOW; DWORD dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR; RECT rc; + if (!info->WinType.fNotExpanded) + dwStyles |= WS_VISIBLE; + NP_GetNavigationRect(info, &rc); hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles, @@ -829,7 +847,7 @@ static BOOL HH_AddNavigationPane(HHInfo *info) SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)info); - hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles, + hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles | WS_VISIBLE, 0, TAB_TOP_PADDING, rc.right - TAB_RIGHT_PADDING, rc.bottom - TAB_TOP_PADDING, @@ -864,10 +882,16 @@ static void HP_GetHTMLRect(HHInfo *info, RECT *rc) GetClientRect(info->WinType.hwndHelp, &rectWND); GetClientRect(info->WinType.hwndToolBar, &rectTB); - GetClientRect(info->WinType.hwndNavigation, &rectNP); GetClientRect(info->hwndSizeBar, &rectSB); - rc->left = rectNP.right + rectSB.right; + if (info->WinType.fNotExpanded) + rc->left = 0; + else + { + GetClientRect(info->WinType.hwndNavigation, &rectNP); + rc->left = rectNP.right + rectSB.right; + } + rc->top = rectTB.bottom; rc->right = rectWND.right - rc->left; rc->bottom = rectWND.bottom - rectTB.bottom; @@ -1203,6 +1227,37 @@ static BOOL AddIndexPopup(HHInfo *info) /* Viewer Window */ +static void ExpandContract(HHInfo *pHHInfo) +{ + RECT r, nav; + + pHHInfo->WinType.fNotExpanded = !pHHInfo->WinType.fNotExpanded; + GetWindowRect(pHHInfo->WinType.hwndHelp, &r); + NP_GetNavigationRect(pHHInfo, &nav); + + /* hide/show both the nav bar and the size bar */ + if (pHHInfo->WinType.fNotExpanded) + { + ShowWindow(pHHInfo->WinType.hwndNavigation, SW_HIDE); + ShowWindow(pHHInfo->hwndSizeBar, SW_HIDE); + r.left = r.left + nav.right; + + SendMessageW(pHHInfo->WinType.hwndToolBar, TB_HIDEBUTTON, IDTB_EXPAND, MAKELPARAM(FALSE, 0)); + SendMessageW(pHHInfo->WinType.hwndToolBar, TB_HIDEBUTTON, IDTB_CONTRACT, MAKELPARAM(TRUE, 0)); + } + else + { + ShowWindow(pHHInfo->WinType.hwndNavigation, SW_SHOW); + ShowWindow(pHHInfo->hwndSizeBar, SW_SHOW); + r.left = r.left - nav.right; + + SendMessageW(pHHInfo->WinType.hwndToolBar, TB_HIDEBUTTON, IDTB_EXPAND, MAKELPARAM(TRUE, 0)); + SendMessageW(pHHInfo->WinType.hwndToolBar, TB_HIDEBUTTON, IDTB_CONTRACT, MAKELPARAM(FALSE, 0)); + } + + MoveWindow(pHHInfo->WinType.hwndHelp, r.left, r.top, r.right-r.left, r.bottom-r.top, TRUE); +} + static LRESULT Help_OnSize(HWND hWnd) { HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); @@ -1212,13 +1267,17 @@ static LRESULT Help_OnSize(HWND hWnd) if (!pHHInfo) return 0; - NP_GetNavigationRect(pHHInfo, &rc); - SetWindowPos(pHHInfo->WinType.hwndNavigation, HWND_TOP, 0, 0, - rc.right, rc.bottom, SWP_NOMOVE); + if (!pHHInfo->WinType.fNotExpanded) + { + NP_GetNavigationRect(pHHInfo, &rc); + SetWindowPos(pHHInfo->WinType.hwndNavigation, HWND_TOP, 0, 0, + rc.right, rc.bottom, SWP_NOMOVE); - SB_GetSizeBarRect(pHHInfo, &rc); - SetWindowPos(pHHInfo->hwndSizeBar, HWND_TOP, rc.left, rc.top, - rc.right, rc.bottom, SWP_SHOWWINDOW); + SB_GetSizeBarRect(pHHInfo, &rc); + SetWindowPos(pHHInfo->hwndSizeBar, HWND_TOP, rc.left, rc.top, + rc.right, rc.bottom, SWP_SHOWWINDOW); + + } HP_GetHTMLRect(pHHInfo, &rc); SetWindowPos(pHHInfo->WinType.hwndHTML, HWND_TOP, rc.left, rc.top, @@ -1312,6 +1371,19 @@ static BOOL HH_CreateHelpWindow(HHInfo *info) height = WINTYPE_DEFAULT_HEIGHT; } + if (info->WinType.fNotExpanded) + { + if (!(info->WinType.fsValidMembers & HHWIN_PARAM_NAV_WIDTH) && + info->WinType.iNavWidth == 0) + { + info->WinType.iNavWidth = WINTYPE_DEFAULT_NAVWIDTH; + } + + x += info->WinType.iNavWidth; + width -= info->WinType.iNavWidth; + } + + caption = info->WinType.pszCaption; if (!*caption) caption = info->pCHMInfo->defTitle;
1
0
0
0
Eric Pouech : dbghelp: When failing to look up for a PDB file, don' t keep a module format object around.
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: e72d5d6de458b22faba37e874916a4787d168576 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e72d5d6de458b22faba37e874…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Jan 17 21:57:46 2011 +0100 dbghelp: When failing to look up for a PDB file, don't keep a module format object around. --- dlls/dbghelp/msc.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 5fe3349..91927b3 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -2790,6 +2790,11 @@ static BOOL pdb_process_file(const struct process* pcs, msc_dbg->module->module.SourceIndexed = TRUE; msc_dbg->module->module.Publics = TRUE; } + else + { + msc_dbg->module->format_info[DFI_PDB] = NULL; + HeapFree(GetProcessHeap(), 0, modfmt); + } return ret; }
1
0
0
0
Eric Pouech : dbghelp: Get stream indexes out of PDB files ( instead of hardwired values).
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: 711f71639dc064e05138d861b3387a7c2d238e64 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=711f71639dc064e05138d861b…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Jan 17 21:54:17 2011 +0100 dbghelp: Get stream indexes out of PDB files (instead of hardwired values). --- dlls/dbghelp/msc.c | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 50dd6e6..5fe3349 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -75,6 +75,7 @@ struct pdb_file_info HANDLE hMap; const char* image; struct pdb_stream_name* stream_dict; + unsigned fpoext_stream; union { struct @@ -2207,6 +2208,7 @@ static BOOL pdb_load_stream_name_table(struct pdb_file_info* pdb_file, const cha } /* add sentinel */ pdb_file->stream_dict[numok].name = NULL; + pdb_file->fpoext_stream = -1; return j == numok && i == count; } @@ -2646,7 +2648,8 @@ static BOOL pdb_process_internal(const struct process* pcs, BYTE* modimage; BYTE* file; int header_size = 0; - + PDB_STREAM_INDEXES* psi; + pdb_convert_symbols_header(&symbols, &header_size, symbols_image); switch (symbols.version) { @@ -2660,6 +2663,23 @@ static BOOL pdb_process_internal(const struct process* pcs, symbols.version, symbols.version); } + switch (symbols.stream_index_size) + { + case 0: + case sizeof(PDB_STREAM_INDEXES_OLD): + /* no fpo ext stream in this case */ + break; + case sizeof(PDB_STREAM_INDEXES): + psi = (PDB_STREAM_INDEXES*)((const char*)symbols_image + sizeof(PDB_SYMBOLS) + + symbols.module_size + symbols.offset_size + + symbols.hash_size + symbols.srcmodule_size + + symbols.pdbimport_size + symbols.unknown2_size); + pdb_file->fpoext_stream = psi->FPO_EXT; + break; + default: + FIXME("Unknown PDB_STREAM_INDEXES size (%d)\n", symbols.stream_index_size); + break; + } files_image = pdb_read_strings(pdb_file); if (files_image) files_size = *(const DWORD*)(files_image + 8); @@ -3070,8 +3090,8 @@ BOOL pdb_virtual_unwind(struct cpu_stack_walk* csw, DWORD_PTR ip, strbase = pdb_read_strings(&pdb_info->pdb_files[0]); if (!strbase) return FALSE; strsize = *(const DWORD*)(strbase + 8); - fpoext = pdb_read_file(&pdb_info->pdb_files[0], 10); - size = pdb_get_file_size(&pdb_info->pdb_files[0], 10); + fpoext = pdb_read_file(&pdb_info->pdb_files[0], pdb_info->pdb_files[0].fpoext_stream); + size = pdb_get_file_size(&pdb_info->pdb_files[0], pdb_info->pdb_files[0].fpoext_stream); if (fpoext && (size % sizeof(*fpoext)) == 0) { size /= sizeof(*fpoext);
1
0
0
0
Eric Pouech : dbghelp: Add support for stream lookup by name in PDB files and use it for strings stream .
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: 8595f6c6520a2ad686bb4d17e00e249c11916fd3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8595f6c6520a2ad686bb4d17e…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Jan 17 21:54:04 2011 +0100 dbghelp: Add support for stream lookup by name in PDB files and use it for strings stream. --- dlls/dbghelp/msc.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 72 insertions(+), 9 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 8ffbb6a..50dd6e6 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -62,12 +62,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_msc); #define MAX_PATHNAME_LEN 1024 +struct pdb_stream_name +{ + const char* name; + unsigned index; +}; + struct pdb_file_info { enum pdb_kind kind; DWORD age; HANDLE hMap; const char* image; + struct pdb_stream_name* stream_dict; union { struct @@ -2159,21 +2166,73 @@ static void pdb_free_file(struct pdb_file_info* pdb_file) pdb_file->u.ds.toc = NULL; break; } + HeapFree(GetProcessHeap(), 0, pdb_file->stream_dict); +} + +static BOOL pdb_load_stream_name_table(struct pdb_file_info* pdb_file, const char* str, unsigned cb) +{ + DWORD* pdw; + DWORD* ok_bits; + DWORD count, numok; + unsigned i, j; + char* cpstr; + + pdw = (DWORD*)(str + cb); + numok = *pdw++; + count = *pdw++; + + pdb_file->stream_dict = HeapAlloc(GetProcessHeap(), 0, (numok + 1) * sizeof(struct pdb_stream_name) + cb); + if (!pdb_file->stream_dict) return FALSE; + cpstr = (char*)(pdb_file->stream_dict + numok + 1); + memcpy(cpstr, str, cb); + + /* bitfield: first dword is len (in dword), then data */ + ok_bits = pdw; + pdw += *ok_bits++ + 1; + if (*pdw++ != 0) + { + FIXME("unexpected value\n"); + return -1; + } + + for (i = j = 0; i < count; i++) + { + if (ok_bits[i / 32] & (1 << (i % 32))) + { + if (j >= numok) break; + pdb_file->stream_dict[j].name = &cpstr[*pdw++]; + pdb_file->stream_dict[j].index = *pdw++; + j++; + } + } + /* add sentinel */ + pdb_file->stream_dict[numok].name = NULL; + return j == numok && i == count; +} + +static unsigned pdb_get_stream_by_name(const struct pdb_file_info* pdb_file, const char* name) +{ + struct pdb_stream_name* psn; + + for (psn = pdb_file->stream_dict; psn && psn->name; psn++) + { + if (!strcmp(psn->name, name)) return psn->index; + } + return -1; } static void* pdb_read_strings(const struct pdb_file_info* pdb_file) { + unsigned idx; void *ret; - /* FIXME: how to determine the correct file number? */ - /* 4 and 12 have been observed, there may be others */ - - ret = pdb_read_file( pdb_file, 4 ); - if (ret && *(const DWORD *)ret == 0xeffeeffe) return ret; - pdb_free( ret ); - ret = pdb_read_file( pdb_file, 12 ); - if (ret && *(const DWORD *)ret == 0xeffeeffe) return ret; - pdb_free( ret ); + idx = pdb_get_stream_by_name(pdb_file, "/names"); + if (idx != -1) + { + ret = pdb_read_file( pdb_file, idx ); + if (ret && *(const DWORD *)ret == 0xeffeeffe) return ret; + pdb_free( ret ); + } WARN("string table not found\n"); return NULL; } @@ -2411,6 +2470,8 @@ static BOOL pdb_init(const struct pdb_lookup* pdb_lookup, struct pdb_file_info* pdb_lookup->filename, root->Age, pdb_lookup->age); TRACE("found JG for %s: age=%x timestamp=%x\n", pdb_lookup->filename, root->Age, root->TimeDateStamp); + pdb_load_stream_name_table(pdb_file, &root->names[0], root->cbNames); + pdb_free(root); } else if (!memcmp(image, PDB_DS_IDENT, sizeof(PDB_DS_IDENT))) @@ -2447,6 +2508,8 @@ static BOOL pdb_init(const struct pdb_lookup* pdb_lookup, struct pdb_file_info* pdb_lookup->filename, root->Age, pdb_lookup->age); TRACE("found DS for %s: age=%x guid=%s\n", pdb_lookup->filename, root->Age, debugstr_guid(&root->guid)); + pdb_load_stream_name_table(pdb_file, &root->names[0], root->cbNames); + pdb_free(root); }
1
0
0
0
Eric Pouech : winedump: Also dump FPO data out of JG PDB files.
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: a43b38fe0c1c4188a23020e4a7e379b0b2e212e1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a43b38fe0c1c4188a23020e4a…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Jan 17 21:53:51 2011 +0100 winedump: Also dump FPO data out of JG PDB files. --- tools/winedump/pdb.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index 3baee33..77d5643 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -784,6 +784,7 @@ static void pdb_jg_dump(void) } pdb_dump_types(&reader); pdb_dump_symbols(&reader, &sidx); + pdb_dump_fpo(&reader, sidx.FPO); pdb_dump_segments(&reader, sidx.segments); } else printf("-Unable to get root\n");
1
0
0
0
Eric Pouech : winedump: Dump segment info out of PDB files.
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: 2b010ad3665e34ce6a0263ee8d8ea6aab8a3d45c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2b010ad3665e34ce6a0263ee8…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Jan 17 21:53:42 2011 +0100 winedump: Dump segment info out of PDB files. --- tools/winedump/pdb.c | 53 +++++++++++++++++++++++++++++-------------------- 1 files changed, 31 insertions(+), 22 deletions(-) diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index 9f90c89..3baee33 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -670,6 +670,35 @@ static void pdb_dump_fpo_ext(struct pdb_reader* reader, unsigned stream_idx) free(strbase); } +static void pdb_dump_segments(struct pdb_reader* reader, unsigned stream_idx) +{ + const char* segs; + DWORD size; + const char* ptr; + + if (stream_idx == (WORD)-1) return; + segs = reader->read_file(reader, stream_idx); + + if (segs) + { + size = pdb_get_file_size(reader, stream_idx); + for (ptr = segs; ptr < segs + size; ) + { + printf("Segment %s\n", ptr); + ptr += (strlen(ptr) + 1 + 3) & ~3; + printf("\tdword[0]: %08x\n", *(DWORD*)ptr); ptr += 4; + printf("\tdword[1]: %08x\n", *(DWORD*)ptr); ptr += 4; + printf("\tdword[2]: %08x\n", *(DWORD*)ptr); ptr += 4; + printf("\tdword[3]: %08x\n", *(DWORD*)ptr); ptr += 4; + printf("\tdword[4]: %08x\n", *(DWORD*)ptr); ptr += 4; + printf("\tdword[5]: %08x\n", *(DWORD*)ptr); ptr += 4; + printf("\tdword[6]: %08x\n", *(DWORD*)ptr); ptr += 4; + printf("\tdword[7]: %08x\n", *(DWORD*)ptr); ptr += 4; + } + free((char*)segs); + } else printf("nosdfsdffd\n"); +} + static const char pdb2[] = "Microsoft C/C++ program database 2.00"; static void pdb_jg_dump(void) @@ -755,28 +784,7 @@ static void pdb_jg_dump(void) } pdb_dump_types(&reader); pdb_dump_symbols(&reader, &sidx); -#if 0 - /* segments info, index is unknown */ - { - const void* segs = pdb_read_file(pdb, toc, 8); /* FIXME which index ??? */ - const void* ptr = segs; - - if (segs) while (ptr < segs + toc->file[8].size) - { - printf("Segment %s\n", (const char*)ptr); - ptr += (strlen(ptr) + 1 + 3) & ~3; - printf("\tdword[0]: %08lx\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[1]: %08lx\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[2]: %08lx\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[3]: %08lx\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[4]: %08lx\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[5]: %08lx\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[6]: %08lx\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[7]: %08lx\n", *(DWORD*)ptr); ptr += 4; - } - free(segs); - } -#endif + pdb_dump_segments(&reader, sidx.segments); } else printf("-Unable to get root\n"); @@ -921,6 +929,7 @@ static void pdb_ds_dump(void) pdb_dump_symbols(&reader, &sidx); pdb_dump_fpo(&reader, sidx.FPO); pdb_dump_fpo_ext(&reader, sidx.FPO_EXT); + pdb_dump_segments(&reader, sidx.segments); } else printf("-Unable to get root\n");
1
0
0
0
Eric Pouech : winedump: Make use of PDB_STREAM_INDEXES in order to get rid of hardwired indexes.
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: a7cdc540f3187fa34d1628f8adf3e5b8e48e4d59 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a7cdc540f3187fa34d1628f8a…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Jan 17 21:53:31 2011 +0100 winedump: Make use of PDB_STREAM_INDEXES in order to get rid of hardwired indexes. --- tools/winedump/pdb.c | 77 +++++++++++++++++++++++++++++-------------------- 1 files changed, 45 insertions(+), 32 deletions(-) diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index 0ba5b46..9f90c89 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -222,7 +222,7 @@ static void *read_string_table(struct pdb_reader* reader) return NULL; } -static void pdb_dump_symbols(struct pdb_reader* reader) +static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx) { PDB_SYMBOLS* symbols; unsigned char* modimage; @@ -230,8 +230,10 @@ static void pdb_dump_symbols(struct pdb_reader* reader) char* filesimage; DWORD filessize = 0; - symbols = reader->read_file(reader, 3); + sidx->FPO = sidx->unk0 = sidx->unk1 = sidx->unk2 = sidx->unk3 = sidx->segments = + sidx->unk4 = sidx->unk5 = sidx->unk6 = sidx->FPO_EXT = sidx->unk7 = -1; + symbols = reader->read_file(reader, 3); if (!symbols) return; switch (symbols->version) @@ -377,32 +379,33 @@ static void pdb_dump_symbols(struct pdb_reader* reader) } if (symbols->stream_index_size) { - const PDB_STREAM_INDEXES_OLD* sidx_old; - const PDB_STREAM_INDEXES* sidx; - printf("\t------------stream indexes--------------\n"); switch (symbols->stream_index_size) { case sizeof(PDB_STREAM_INDEXES_OLD): - sidx_old = (const PDB_STREAM_INDEXES_OLD*)((const char*)symbols + sizeof(PDB_SYMBOLS) + - symbols->module_size + symbols->offset_size + - symbols->hash_size + symbols->srcmodule_size + - symbols->pdbimport_size + symbols->unknown2_size); + /* PDB_STREAM_INDEXES is a superset of PDB_STREAM_INDEX_OLD + * FIXME: to be confirmed when all fields are fully understood + */ + memcpy(sidx, + (const char*)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size + + symbols->offset_size + symbols->hash_size + symbols->srcmodule_size + + symbols->pdbimport_size + symbols->unknown2_size, + sizeof(PDB_STREAM_INDEXES_OLD)); printf("\tFPO: %04x\n" "\t?: %04x\n" "\t?: %04x\n" "\t?: %04x\n" "\t?: %04x\n" "\tSegments: %04x\n", - sidx_old->FPO, sidx_old->unk0, sidx_old->unk1, sidx_old->unk2, sidx_old->unk3, - sidx_old->segments); + sidx->FPO, sidx->unk0, sidx->unk1, sidx->unk2, sidx->unk3, + sidx->segments); break; case sizeof(PDB_STREAM_INDEXES): - sidx = (const PDB_STREAM_INDEXES*)((const char*)symbols + sizeof(PDB_SYMBOLS) + - symbols->module_size + symbols->offset_size + - symbols->hash_size + symbols->srcmodule_size + - symbols->pdbimport_size + symbols->unknown2_size); - + memcpy(sidx, + (const char*)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size + + symbols->offset_size + symbols->hash_size + symbols->srcmodule_size + + symbols->pdbimport_size + symbols->unknown2_size, + sizeof(*sidx)); printf("\tFPO: %04x\n" "\t?: %04x\n" "\t?: %04x\n" @@ -613,16 +616,15 @@ static void pdb_dump_types(struct pdb_reader* reader) free(types); } -static void pdb_dump_fpo(struct pdb_reader* reader) +static void pdb_dump_fpo(struct pdb_reader* reader, unsigned stream_idx) { FPO_DATA* fpo; - PDB_FPO_DATA* fpoext; - unsigned i, size, strsize; - char* strbase; + unsigned i, size; const char* frame_type[4] = {"Fpo", "Trap", "Tss", "NonFpo"}; - fpo = reader->read_file(reader, 5); - size = pdb_get_file_size(reader, 5); + if (stream_idx == (WORD)-1) return; + fpo = reader->read_file(reader, stream_idx); + size = pdb_get_file_size(reader, stream_idx); if (fpo && (size % sizeof(*fpo)) == 0) { size /= sizeof(*fpo); @@ -636,13 +638,21 @@ static void pdb_dump_fpo(struct pdb_reader* reader) } } free(fpo); +} + +static void pdb_dump_fpo_ext(struct pdb_reader* reader, unsigned stream_idx) +{ + PDB_FPO_DATA* fpoext; + unsigned i, size, strsize; + char* strbase; + if (stream_idx == (WORD)-1) return; strbase = read_string_table(reader); if (!strbase) return; strsize = *(const DWORD*)(strbase + 8); - fpoext = reader->read_file(reader, 10); - size = pdb_get_file_size(reader, 10); + fpoext = reader->read_file(reader, stream_idx); + size = pdb_get_file_size(reader, stream_idx); if (fpoext && (size % sizeof(*fpoext)) == 0) { size /= sizeof(*fpoext); @@ -689,6 +699,7 @@ static void pdb_jg_dump(void) DWORD* ok_bits; DWORD numok, count; unsigned i; + PDB_STREAM_INDEXES sidx; printf("Root:\n" "\tVersion: %u\n" @@ -743,6 +754,7 @@ static void pdb_jg_dump(void) printf("-Unknown root block version %d\n", reader.u.jg.root->Version); } pdb_dump_types(&reader); + pdb_dump_symbols(&reader, &sidx); #if 0 /* segments info, index is unknown */ { @@ -765,7 +777,6 @@ static void pdb_jg_dump(void) free(segs); } #endif - pdb_dump_symbols(&reader); } else printf("-Unable to get root\n"); @@ -849,11 +860,11 @@ static void pdb_ds_dump(void) * 2: types * 3: modules * other known streams: - * string table: it's index is in the stream table from ROOT object under "/names" - * those other streams are likely not to have a fixed stream number - * 5: FPO data - * 8: segments - * 10: extended FPO data + * - string table: it's index is in the stream table from ROOT object under "/names" + * those streams get their indexes out of the PDB_STREAM_INDEXES object + * - FPO data + * - segments + * - extended FPO data */ reader.u.ds.root = reader.read_file(&reader, 1); if (reader.u.ds.root) @@ -862,6 +873,7 @@ static void pdb_ds_dump(void) DWORD* ok_bits; DWORD numok, count; unsigned i; + PDB_STREAM_INDEXES sidx; printf("Root:\n" "\tVersion: %u\n" @@ -906,8 +918,9 @@ static void pdb_ds_dump(void) if (numok) printf(">>> unmatched present field with found\n"); pdb_dump_types(&reader); - pdb_dump_symbols(&reader); - pdb_dump_fpo(&reader); + pdb_dump_symbols(&reader, &sidx); + pdb_dump_fpo(&reader, sidx.FPO); + pdb_dump_fpo_ext(&reader, sidx.FPO_EXT); } else printf("-Unable to get root\n");
1
0
0
0
Eric Pouech : winedump: Added stream header support.
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: 5199d04b42c67efefac25c85a64e7e99cb5d6786 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5199d04b42c67efefac25c85a…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Jan 17 21:53:25 2011 +0100 winedump: Added stream header support. --- include/wine/mscvpdb.h | 29 +++++++++++++++++++++- tools/winedump/pdb.c | 62 ++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 83 insertions(+), 8 deletions(-) diff --git a/include/wine/mscvpdb.h b/include/wine/mscvpdb.h index 637ed0f..99734c7 100644 --- a/include/wine/mscvpdb.h +++ b/include/wine/mscvpdb.h @@ -1914,12 +1914,39 @@ typedef struct _PDB_SYMBOLS DWORD hash_size; DWORD srcmodule_size; DWORD pdbimport_size; - DWORD resvd[3]; + DWORD resvd0; + DWORD stream_index_size; + DWORD unknown2_size; WORD resvd3; WORD machine; DWORD resvd4; } PDB_SYMBOLS, *PPDB_SYMBOLS; +typedef struct +{ + WORD FPO; + WORD unk0; + WORD unk1; + WORD unk2; + WORD unk3; + WORD segments; +} PDB_STREAM_INDEXES_OLD; + +typedef struct +{ + WORD FPO; + WORD unk0; + WORD unk1; + WORD unk2; + WORD unk3; + WORD segments; + WORD unk4; + WORD unk5; + WORD unk6; + WORD FPO_EXT; + WORD unk7; +} PDB_STREAM_INDEXES; + typedef struct _PDB_FPO_DATA { DWORD start; diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index cd2eb50..0ba5b46 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -257,10 +257,10 @@ static void pdb_dump_symbols(struct pdb_reader* reader) "\thash_size: %08x\n" "\tsrc_module_size: %08x\n" "\tpdbimport_size: %08x\n" - "\tresvd[0] %08x\n" - "\tresvd[1] %08x\n" - "\tresvd[2] %08x\n" - "\tresvd[3] %04x\n" + "\tresvd0: %08x\n" + "\tstream_idx_size: %08x\n" + "\tunknown2_size: %08x\n" + "\tresvd3: %04x\n" "\tmachine: %s\n" "\tresvd[4] %08x\n", symbols->signature, @@ -275,9 +275,9 @@ static void pdb_dump_symbols(struct pdb_reader* reader) symbols->hash_size, symbols->srcmodule_size, symbols->pdbimport_size, - symbols->resvd[0], - symbols->resvd[1], - symbols->resvd[2], + symbols->resvd0, + symbols->stream_index_size, + symbols->unknown2_size, symbols->resvd3, get_machine_str( symbols->machine ), symbols->resvd4); @@ -375,6 +375,54 @@ static void pdb_dump_symbols(struct pdb_reader* reader) imp = (const PDB_SYMBOL_IMPORT*)(first + ((ptr - first + strlen(ptr) + 1 + 3) & ~3)); } } + if (symbols->stream_index_size) + { + const PDB_STREAM_INDEXES_OLD* sidx_old; + const PDB_STREAM_INDEXES* sidx; + + printf("\t------------stream indexes--------------\n"); + switch (symbols->stream_index_size) + { + case sizeof(PDB_STREAM_INDEXES_OLD): + sidx_old = (const PDB_STREAM_INDEXES_OLD*)((const char*)symbols + sizeof(PDB_SYMBOLS) + + symbols->module_size + symbols->offset_size + + symbols->hash_size + symbols->srcmodule_size + + symbols->pdbimport_size + symbols->unknown2_size); + printf("\tFPO: %04x\n" + "\t?: %04x\n" + "\t?: %04x\n" + "\t?: %04x\n" + "\t?: %04x\n" + "\tSegments: %04x\n", + sidx_old->FPO, sidx_old->unk0, sidx_old->unk1, sidx_old->unk2, sidx_old->unk3, + sidx_old->segments); + break; + case sizeof(PDB_STREAM_INDEXES): + sidx = (const PDB_STREAM_INDEXES*)((const char*)symbols + sizeof(PDB_SYMBOLS) + + symbols->module_size + symbols->offset_size + + symbols->hash_size + symbols->srcmodule_size + + symbols->pdbimport_size + symbols->unknown2_size); + + printf("\tFPO: %04x\n" + "\t?: %04x\n" + "\t?: %04x\n" + "\t?: %04x\n" + "\t?: %04x\n" + "\tSegments: %04x\n" + "\t?: %04x\n" + "\t?: %04x\n" + "\t?: %04x\n" + "\tFPO-ext: %04x\n" + "\t?: %04x\n", + sidx->FPO, sidx->unk0, sidx->unk1, sidx->unk2, sidx->unk3, + sidx->segments, sidx->unk4, sidx->unk5, sidx->unk6, sidx->FPO_EXT, + sidx->unk7); + break; + default: + printf("unexpected size for stream index %d\n", symbols->stream_index_size); + break; + } + } /* Read global symbol table */ modimage = reader->read_file(reader, symbols->gsym_file);
1
0
0
0
Eric Pouech : winedump: Get string table stream index out of ROOT named streams list.
by Alexandre Julliard
18 Jan '11
18 Jan '11
Module: wine Branch: master Commit: 2cba84027b4b4ec54141de9942e4bd5cc1a1829c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2cba84027b4b4ec54141de994…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Mon Jan 17 21:53:20 2011 +0100 winedump: Get string table stream index out of ROOT named streams list. --- tools/winedump/pdb.c | 71 ++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 55 insertions(+), 16 deletions(-) diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index e508530..cd2eb50 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -163,17 +163,61 @@ static void pdb_exit(struct pdb_reader* reader) } } +static unsigned get_stream_by_name(struct pdb_reader* reader, const char* name) +{ + DWORD* pdw; + DWORD* ok_bits; + DWORD cbstr, count; + DWORD string_idx, stream_idx; + unsigned i; + const char* str; + + if (reader->read_file == pdb_jg_read_file) + { + str = &reader->u.jg.root->names[0]; + cbstr = reader->u.jg.root->cbNames; + } + else + { + str = &reader->u.ds.root->names[0]; + cbstr = reader->u.ds.root->cbNames; + } + + pdw = (DWORD*)(str + cbstr); + pdw++; /* number of ok entries */ + count = *pdw++; + + /* bitfield: first dword is len (in dword), then data */ + ok_bits = pdw; + pdw += *ok_bits++ + 1; + if (*pdw++ != 0) + { + printf("unexpected value\n"); + return -1; + } + + for (i = 0; i < count; i++) + { + if (ok_bits[i / 32] & (1 << (i % 32))) + { + string_idx = *pdw++; + stream_idx = *pdw++; + if (!strcmp(name, &str[string_idx])) return stream_idx; + } + } + return -1; +} + static void *read_string_table(struct pdb_reader* reader) { - void *ret; + unsigned stream_idx; + void* ret; - /* FIXME: how to determine the correct file number? */ - /* 4 and 12 have been observed, there may be others */ - ret = reader->read_file(reader, 4); - if (ret && *(const DWORD*)ret == 0xeffeeffe) return ret; - free( ret ); - ret = reader->read_file(reader, 12); + stream_idx = get_stream_by_name(reader, "/names"); + if (stream_idx == -1) return NULL; + ret = reader->read_file(reader, stream_idx); if (ret && *(const DWORD*)ret == 0xeffeeffe) return ret; + printf("wrong header %x expecting 0xeffeeffe\n", *(const DWORD*)ret); free( ret ); return NULL; } @@ -545,15 +589,9 @@ static void pdb_dump_fpo(struct pdb_reader* reader) } free(fpo); - strbase = reader->read_file(reader, 12); /* FIXME: really fixed ??? */ + strbase = read_string_table(reader); if (!strbase) return; - if (*(const DWORD*)strbase != 0xeffeeffe) - { - printf("wrong header %x expecting 0xeffeeffe\n", *(const DWORD*)strbase); - free(strbase); - return; - } strsize = *(const DWORD*)(strbase + 8); fpoext = reader->read_file(reader, 10); size = pdb_get_file_size(reader, 10); @@ -762,11 +800,12 @@ static void pdb_ds_dump(void) * 1: root structure * 2: types * 3: modules - * 4: string table (FIXME: in which case?) + * other known streams: + * string table: it's index is in the stream table from ROOT object under "/names" + * those other streams are likely not to have a fixed stream number * 5: FPO data * 8: segments * 10: extended FPO data - * 12: string table (FPO unwinder, files for linetab2...) */ reader.u.ds.root = reader.read_file(&reader, 1); if (reader.u.ds.root)
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
88
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
Results per page:
10
25
50
100
200