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
2025
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
List overview
Download
Ros-diffs
November 2007
----- 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
ros-diffs@reactos.org
20 participants
888 discussions
Start a n
N
ew thread
[arty] 30369: Handle recvfrom with no address buffer.
by arty@svn.reactos.org
Author: arty Date: Mon Nov 12 01:28:39 2007 New Revision: 30369 URL:
http://svn.reactos.org/svn/reactos?rev=30369&view=rev
Log: Handle recvfrom with no address buffer. Modified: trunk/reactos/drivers/network/afd/afd/lock.c Modified: trunk/reactos/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/lock.c (original) +++ trunk/reactos/drivers/network/afd/afd/lock.c Mon Nov 12 01:28:39 2007 @@ -46,12 +46,12 @@ BOOLEAN Write, BOOLEAN LockAddress ) { UINT i; /* Copy the buffer array so we don't lose it */ - UINT Lock = LockAddress ? 2 : 0; + UINT Lock = (LockAddress && AddressLen) ? 2 : 0; UINT Size = sizeof(AFD_WSABUF) * (Count + Lock); PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size * 2 ); PMDL NewMdl; - AFD_DbgPrint(MID_TRACE,("Called\n")); + AFD_DbgPrint(MID_TRACE,("Called(%08x)\n", NewBuf)); if( NewBuf ) { PAFD_MAPBUF MapBuf = (PAFD_MAPBUF)(NewBuf + Count + Lock);
17 years, 1 month
1
0
0
0
[arty] 30368: Properly handle access violation copying from userland.
by arty@svn.reactos.org
Author: arty Date: Mon Nov 12 01:21:37 2007 New Revision: 30368 URL:
http://svn.reactos.org/svn/reactos?rev=30368&view=rev
Log: Properly handle access violation copying from userland. Modified: trunk/reactos/drivers/network/afd/afd/read.c Modified: trunk/reactos/drivers/network/afd/afd/read.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/read.c (original) +++ trunk/reactos/drivers/network/afd/afd/read.c Mon Nov 12 01:21:37 2007 @@ -559,6 +559,11 @@ RecvReq->AddressLength, TRUE, TRUE ); + if( !RecvReq->BufferArray ) { /* access violation in userspace */ + return UnlockAndMaybeComplete + ( FCB, STATUS_ACCESS_VIOLATION, Irp, 0, NULL, FALSE ); + } + if( !IsListEmpty( &FCB->DatagramList ) ) { ListEntry = RemoveHeadList( &FCB->DatagramList ); DatagramRecv = CONTAINING_RECORD
17 years, 1 month
1
0
0
0
[janderwald] 30367: - hackfix build
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Nov 12 01:10:53 2007 New Revision: 30367 URL:
http://svn.reactos.org/svn/reactos?rev=30367&view=rev
Log: - hackfix build Modified: trunk/reactos/dll/win32/shell32/shellole.c trunk/reactos/dll/win32/shell32/shv_item_cmenu.c trunk/reactos/dll/win32/shell32/shv_item_new.c Modified: trunk/reactos/dll/win32/shell32/shellole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellole…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellole.c (original) +++ trunk/reactos/dll/win32/shell32/shellole.c Mon Nov 12 01:10:53 2007 @@ -50,7 +50,7 @@ extern HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); static const WCHAR sShell32[12] = {'S','H','E','L','L','3','2','.','D','L','L','\0'}; - +static const GUID dummy1 = {0xD969A300, 0xE7FF, 0x11d0, {0xA9, 0x3B, 0x00, 0xA0, 0xC9, 0x0F, 0x27, 0x19} }; /************************************************************************** * Default ClassFactory types */ @@ -78,7 +78,7 @@ {&CLSID_Printers, &ISF_Printers_Constructor}, {&CLSID_RecycleBin, &RecycleBin_Constructor}, {&CLSID_OpenWith, &SHEOW_Constructor}, - {&CLSID_NewMenu, &INewItem_Constructor}, + {&dummy1, &INewItem_Constructor}, {NULL,NULL} }; Modified: trunk/reactos/dll/win32/shell32/shv_item_cmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item…
============================================================================== --- trunk/reactos/dll/win32/shell32/shv_item_cmenu.c (original) +++ trunk/reactos/dll/win32/shell32/shv_item_cmenu.c Mon Nov 12 01:10:53 2007 @@ -817,6 +817,7 @@ ShellExecuteA(hwnd, "open", "rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL); return; } +#if 0 else if (_ILIsDrive(This->apidl[0])) { WCHAR buffer[111]; @@ -824,6 +825,7 @@ SH_ShowDriveProperties(buffer); return; } +#endif else if (_ILIsBitBucket(This->apidl[0])) { ///FIXME Modified: trunk/reactos/dll/win32/shell32/shv_item_new.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item…
============================================================================== --- trunk/reactos/dll/win32/shell32/shv_item_new.c (original) +++ trunk/reactos/dll/win32/shell32/shv_item_new.c Mon Nov 12 01:10:53 2007 @@ -55,7 +55,6 @@ PSHELLNEW_ITEM s_SnHead; }INewMenuImpl; -const GUID CLSID_NewMenu = {0xD969A300, 0xE7FF, 0x11d0, {0xA9, 0x3B, 0x00, 0xA0, 0xC9, 0x0F, 0x27, 0x19} }; static const IContextMenu2Vtbl cmvt; static WCHAR szNew[100];
17 years, 1 month
1
0
0
0
[janderwald] 30366: - make INewItem_Constructor compatible to be loaded as a shell extension - fix api definition of CDefFolderMenu_Create2 - disable loading of inewitem api (reenabled when default context menu api implementation is ready)
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Nov 12 00:38:44 2007 New Revision: 30366 URL:
http://svn.reactos.org/svn/reactos?rev=30366&view=rev
Log: - make INewItem_Constructor compatible to be loaded as a shell extension - fix api definition of CDefFolderMenu_Create2 - disable loading of inewitem api (reenabled when default context menu api implementation is ready) Modified: trunk/reactos/dll/win32/shell32/shell32_main.h trunk/reactos/dll/win32/shell32/shellole.c trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c trunk/reactos/dll/win32/shell32/shv_item_cmenu.c trunk/reactos/dll/win32/shell32/shv_item_new.c Modified: trunk/reactos/dll/win32/shell32/shell32_main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32_main.h (original) +++ trunk/reactos/dll/win32/shell32/shell32_main.h Mon Nov 12 00:38:44 2007 @@ -82,7 +82,7 @@ LPCLASSFACTORY IClassFactory_Constructor(REFCLSID); IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *aPidls, UINT uItemCount); -HRESULT WINAPI INewItem_Constructor(LPSHELLFOLDER pSFParent, REFIID riid, LPVOID *ppv); +HRESULT WINAPI INewItem_Constructor(IUnknown * pUnkOuter, REFIID riif, LPVOID *ppv); IContextMenu2 * ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *apidl, UINT cidl, HKEY hKey); IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop); LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER); Modified: trunk/reactos/dll/win32/shell32/shellole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellole…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellole.c (original) +++ trunk/reactos/dll/win32/shell32/shellole.c Mon Nov 12 00:38:44 2007 @@ -78,6 +78,7 @@ {&CLSID_Printers, &ISF_Printers_Constructor}, {&CLSID_RecycleBin, &RecycleBin_Constructor}, {&CLSID_OpenWith, &SHEOW_Constructor}, + {&CLSID_NewMenu, &INewItem_Constructor}, {NULL,NULL} }; Modified: trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_bg_c…
============================================================================== --- trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c (original) +++ trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c Mon Nov 12 00:38:44 2007 @@ -226,7 +226,7 @@ * FIXME * load other shell extensions */ - +#if 0 if (SUCCEEDED(INewItem_Constructor(This->pSFParent, &IID_IContextMenu2, (LPVOID*)&icm))) { if (SUCCEEDED(IContextMenu_QueryContextMenu(icm, hMenu, 10, idCmdFirst, idCmdLast, uFlags))) @@ -239,6 +239,7 @@ This->icm_new = NULL; } } +#endif if (This->bDesktop) { Modified: trunk/reactos/dll/win32/shell32/shv_item_cmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item…
============================================================================== --- trunk/reactos/dll/win32/shell32/shv_item_cmenu.c (original) +++ trunk/reactos/dll/win32/shell32/shv_item_cmenu.c Mon Nov 12 00:38:44 2007 @@ -1291,7 +1291,9 @@ * */ -INT CDefFolderMenu_Create2( +INT +WINAPI +CDefFolderMenu_Create2( LPCITEMIDLIST pidlFolder, HWND hwnd, UINT cidl, Modified: trunk/reactos/dll/win32/shell32/shv_item_new.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item…
============================================================================== --- trunk/reactos/dll/win32/shell32/shv_item_new.c (original) +++ trunk/reactos/dll/win32/shell32/shv_item_new.c Mon Nov 12 00:38:44 2007 @@ -55,7 +55,7 @@ PSHELLNEW_ITEM s_SnHead; }INewMenuImpl; -static const GUID CLSID_NewMenu = {0xD969A300, 0xE7FF, 0x11d0, {0xA9, 0x3B, 0x00, 0xA0, 0xC9, 0x0F, 0x27, 0x19} }; +const GUID CLSID_NewMenu = {0xD969A300, 0xE7FF, 0x11d0, {0xA9, 0x3B, 0x00, 0xA0, 0xC9, 0x0F, 0x27, 0x19} }; static const IContextMenu2Vtbl cmvt; static WCHAR szNew[100]; @@ -791,7 +791,7 @@ INewItem_IContextMenu_fnHandleMenuMsg }; -HRESULT WINAPI INewItem_Constructor(LPSHELLFOLDER pSFParent, REFIID riid, LPVOID *ppv) +HRESULT WINAPI INewItem_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv) { INewMenuImpl * ow; HRESULT res; @@ -820,8 +820,8 @@ { IShellFolder_Release(cached_ow->pSFParent); } - cached_ow->pSFParent = pSFParent; - IShellFolder_AddRef(pSFParent); + // cached_ow->pSFParent = pSFParent; + // IShellFolder_AddRef(pSFParent); res = INewItem_fnQueryInterface( cached_ow, riid, ppv ); return res;
17 years, 1 month
1
0
0
0
[janderwald] 30365: - fix api definition - add clsid for new object service
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Nov 12 00:29:31 2007 New Revision: 30365 URL:
http://svn.reactos.org/svn/reactos?rev=30365&view=rev
Log: - fix api definition - add clsid for new object service Modified: trunk/reactos/include/psdk/shlguid.h trunk/reactos/include/psdk/shlobj.h Modified: trunk/reactos/include/psdk/shlguid.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlguid.h?rev…
============================================================================== --- trunk/reactos/include/psdk/shlguid.h (original) +++ trunk/reactos/include/psdk/shlguid.h Mon Nov 12 00:29:31 2007 @@ -57,7 +57,7 @@ DEFINE_GUID(IID_IACList, 0x77A130B0L,0x94FD,0x11D0,0xA5,0x44,0x00,0xC0,0x4F,0xD7,0xD0,0x62); DEFINE_GUID(IID_IACList2, 0x470141A0L,0x5186,0x11D2,0xBB,0xB6,0x00,0x60,0x97,0x7B,0x46,0x4C); DEFINE_GUID(IID_IObjMgr, 0x00BB2761L,0x6A77,0x11D0,0xA5,0x35,0x00,0xC0,0x4F,0xD7,0xD0,0x62); - +DEFINE_GUID(CLSID_NewMenu, 0xd969A300L,0xe7FF,0x11D0,0xA9,0x3B,0x00,0xA0,0xC9,0x0F,0x27,0x19); /* avoid duplicate definitions with shobjidl.h (FIXME) */ /* DEFINE_SHLGUID(IID_IShellPropSheetExt, 0x000214E9L, 0, 0); */ /* DEFINE_SHLGUID(IID_IExtractIconA, 0x000214EBL, 0, 0); */ Modified: trunk/reactos/include/psdk/shlobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlobj.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/shlobj.h (original) +++ trunk/reactos/include/psdk/shlobj.h Mon Nov 12 00:29:31 2007 @@ -1401,7 +1401,7 @@ HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *,REFIID,void **ppv); typedef HRESULT (CALLBACK * LPFNDFMCALLBACK)(IShellFolder*,HWND,IDataObject*,UINT,WPARAM,LPARAM); -INT CDefFolderMenu_Create2(LPCITEMIDLIST,HWND,UINT,LPCITEMIDLIST*,IShellFolder*,LPFNDFMCALLBACK,UINT,HKEY *,IContextMenu **); +INT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST,HWND,UINT,LPCITEMIDLIST*,IShellFolder*,LPFNDFMCALLBACK,UINT,HKEY *,IContextMenu **); /**************************************************************************** * SHCreateDefaultContextMenu API
17 years, 1 month
1
0
0
0
[janderwald] 30364: - add open with clsid && clsid for new object service
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Nov 12 00:28:10 2007 New Revision: 30364 URL:
http://svn.reactos.org/svn/reactos?rev=30364&view=rev
Log: - add open with clsid && clsid for new object service Modified: trunk/reactos/boot/bootdata/hivecls.inf Modified: trunk/reactos/boot/bootdata/hivecls.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls.inf?…
============================================================================== --- trunk/reactos/boot/bootdata/hivecls.inf (original) +++ trunk/reactos/boot/bootdata/hivecls.inf Mon Nov 12 00:28:10 2007 @@ -6,8 +6,8 @@ ; Default key -;HKCR,"*","",0x00000000,"" -;HKCR,"*\shellex\ContextMenuHandlers\Open With","",0x00000000,"{09799AFB-AD67-11d1-ABCD-00C04FC30936}" +HKCR,"*","",0x00000000,"" +HKCR,"*\shellex\ContextMenuHandlers\Open With","",0x00000000,"{09799AFB-AD67-11d1-ABCD-00C04FC30936}" ; Folders HKCR,"Folder","",0x00000000,"Folder" @@ -16,6 +16,17 @@ HKCR,"Folder\shell\explore\command","",0x00000000,"explorer.exe /e,""%1""" HKCR,"Folder\shell\rootexplore","",0x00000000,"Explore from here" HKCR,"Folder\shell\rootexplore\command","",0x00000000,"explorer.exe /e,/root,""%1""" + +; Drive property page +HKCR,"CLSID\{5F5295E0-429F-1069-A2E2-08002B30309D}","",0x00000000,"Drive Property Page Extension" +HKCR,"CLSID\{5F5295E0-429F-1069-A2E2-08002B30309D}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{5F5295E0-429F-1069-A2E2-08002B30309D}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + +; New Object Service +HKCR,"CLSID\{D969A300-E7FF-11d0-A93B-00A0C90F2719}","",0x00000000,"ReactOS New Object Service" +HKCR,"CLSID\{D969A300-E7FF-11d0-A93B-00A0C90F2719}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{D969A300-E7FF-11d0-A93B-00A0C90F2719}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + ; Virtual Device Drivers HKCR,".386","",0x00000000,"vxdfile" @@ -219,11 +230,11 @@ HKCR,"CLSID\{4657278A-411B-11d2-839A-00C04FD918D0}\InProcServer32","ThreadingModel",0x00000000,"Apartment" ; Open With shell extension -;HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}","",0x00000000,"Open With Context Menu Handler" -;HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\InProcServer32","",0x00000000,"shell32.dll" -;HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\InProcServer32","ThreadingModel",0x00000000,"Apartment" -;HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\shellex\MayChangeDefaultMenu","",0x00000000,"" -;HKCR,"SystemFileAssociations","",0x00000000,"" +HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}","",0x00000000,"Open With Context Menu Handler" +HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\shellex\MayChangeDefaultMenu","",0x00000000,"" +HKCR,"SystemFileAssociations","",0x00000000,"" ; Recycle bin is not implemented
17 years, 1 month
1
0
0
0
[fireball] 30363: - Winesync cppexcept.c. This fixes try/catch C++ exception handling in various apps (like MFC based apps).
by fireball@svn.reactos.org
Author: fireball Date: Sun Nov 11 23:40:21 2007 New Revision: 30363 URL:
http://svn.reactos.org/svn/reactos?rev=30363&view=rev
Log: - Winesync cppexcept.c. This fixes try/catch C++ exception handling in various apps (like MFC based apps). Modified: trunk/reactos/lib/sdk/crt/except/cppexcept.c trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h trunk/reactos/lib/sdk/crt/include/internal/wine/msvcrt.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/lib/sdk/crt/except/cppexcept.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/cppexce…
============================================================================== --- trunk/reactos/lib/sdk/crt/except/cppexcept.c (original) +++ trunk/reactos/lib/sdk/crt/except/cppexcept.c Sun Nov 11 23:40:21 2007 @@ -15,7 +15,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTES * A good reference is the article "How a C++ compiler implements @@ -39,44 +39,59 @@ #include <internal/wine/cppexcept.h> +#ifdef __i386__ /* CxxFrameHandler is not supported on non-i386 */ + WINE_DEFAULT_DEBUG_CHANNEL(seh); -#ifdef __i386__ /* CxxFrameHandler is not supported on non-i386 */ - -static DWORD cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame, - PCONTEXT exc_context, EXCEPTION_REGISTRATION_RECORD** dispatch, - cxx_function_descr *descr, EXCEPTION_REGISTRATION_RECORD* nested_frame, - int nested_trylevel ); +DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame, + PCONTEXT context, EXCEPTION_REGISTRATION_RECORD** dispatch, + const cxx_function_descr *descr, + EXCEPTION_REGISTRATION_RECORD* nested_frame, int nested_trylevel ); /* call a function with a given ebp */ -__inline static void *call_ebp_func( void *func, void *ebp ) +static inline void *call_ebp_func( void *func, void *ebp ) { void *ret; - __asm__ __volatile__ ("pushl %%ebp; movl %2,%%ebp; call *%%eax; popl %%ebp" \ - : "=a" (ret) : "0" (func), "g" (ebp) : "ecx", "edx", "memory" ); + int dummy; + __asm__ __volatile__ ("pushl %%ebx\n\t" + "pushl %%ebp\n\t" + "movl %4,%%ebp\n\t" + "call *%%eax\n\t" + "popl %%ebp\n\t" + "popl %%ebx" + : "=a" (ret), "=S" (dummy), "=D" (dummy) + : "0" (func), "1" (ebp) : "ecx", "edx", "memory" ); return ret; } /* call a copy constructor */ -__inline static void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) +static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) { TRACE( "calling copy ctor %p object %p src %p\n", func, this, src ); if (has_vbase) /* in that case copy ctor takes an extra bool indicating whether to copy the base class */ __asm__ __volatile__("pushl $1; pushl %2; call *%0" - : : "r" (func), "c" (this), "g" (src) : "eax", "edx", "memory" ); + : : "r" (func), "c" (this), "r" (src) : "eax", "edx", "memory" ); else __asm__ __volatile__("pushl %2; call *%0" - : : "r" (func), "c" (this), "g" (src) : "eax", "edx", "memory" ); + : : "r" (func), "c" (this), "r" (src) : "eax", "edx", "memory" ); } /* call the destructor of the exception object */ -__inline static void call_dtor( void *func, void *object ) +static inline void call_dtor( void *func, void *object ) { __asm__ __volatile__("call *%0" : : "r" (func), "c" (object) : "eax", "edx", "memory" ); } -static void dump_type( const cxx_type_info *type ) +/* continue execution to the specified address after exception is caught */ +static inline void DECLSPEC_NORETURN continue_after_catch( cxx_exception_frame* frame, void *addr ) +{ + __asm__ __volatile__("movl -4(%0),%%esp; leal 12(%0),%%ebp; jmp *%1" + : : "r" (frame), "a" (addr) ); + for (;;) ; /* unreached */ +} + +static inline void dump_type( const cxx_type_info *type ) { TRACE( "flags %x type %p %s offsets %d,%d,%d size %d copy ctor %p\n", type->flags, type->type_info, dbgstr_type_info(type->type_info), @@ -88,49 +103,47 @@ { UINT i; - DPRINTF( "exception type:\n" ); - DPRINTF( "flags %x destr %p handler %p type info %p\n", + TRACE( "flags %x destr %p handler %p type info %p\n", type->flags, type->destructor, type->custom_handler, type->type_info_table ); for (i = 0; i < type->type_info_table->count; i++) { - DPRINTF( " %d: ", i ); + TRACE( " %d: ", i ); dump_type( type->type_info_table->info[i] ); } } -static void dump_function_descr( const cxx_function_descr *descr, const cxx_exception_type *info ) +static void dump_function_descr( const cxx_function_descr *descr ) { UINT i; int j; - DPRINTF( "function descr:\n" ); - DPRINTF( "magic %x\n", descr->magic ); - DPRINTF( "unwind table: %p %d\n", descr->unwind_table, descr->unwind_count ); + TRACE( "magic %x\n", descr->magic ); + TRACE( "unwind table: %p %d\n", descr->unwind_table, descr->unwind_count ); for (i = 0; i < descr->unwind_count; i++) { - DPRINTF( " %d: prev %d func %p\n", i, + TRACE( " %d: prev %d func %p\n", i, descr->unwind_table[i].prev, descr->unwind_table[i].handler ); } - DPRINTF( "try table: %p %d\n", descr->tryblock, descr->tryblock_count ); + TRACE( "try table: %p %d\n", descr->tryblock, descr->tryblock_count ); for (i = 0; i < descr->tryblock_count; i++) { - DPRINTF( " %d: start %d end %d catchlevel %d catch %p %d\n", i, + TRACE( " %d: start %d end %d catchlevel %d catch %p %d\n", i, descr->tryblock[i].start_level, descr->tryblock[i].end_level, descr->tryblock[i].catch_level, descr->tryblock[i].catchblock, descr->tryblock[i].catchblock_count ); for (j = 0; j < descr->tryblock[i].catchblock_count; j++) { - catchblock_info *ptr = &descr->tryblock[i].catchblock[j]; - DPRINTF( " %d: flags %x offset %d handler %p type %p", - j, ptr->flags, ptr->offset, ptr->handler, ptr->type_info ); - if (ptr->type_info) DPRINTF( " (%p %s)", ptr->type_info->name, ptr->type_info->mangled ); - DPRINTF( "\n" ); + const catchblock_info *ptr = &descr->tryblock[i].catchblock[j]; + TRACE( " %d: flags %x offset %d handler %p type %p %s\n", + j, ptr->flags, ptr->offset, ptr->handler, + ptr->type_info, dbgstr_type_info( ptr->type_info ) ); } } } /* check if the exception type is caught by a given catch block, and return the type that matched */ -static const cxx_type_info *find_caught_type( cxx_exception_type *exc_type, catchblock_info *catchblock ) +static const cxx_type_info *find_caught_type( cxx_exception_type *exc_type, + const catchblock_info *catchblock ) { UINT i; @@ -156,7 +169,7 @@ /* copy the exception object where the catch block wants it */ static void copy_exception( void *object, cxx_exception_frame *frame, - catchblock_info *catchblock, const cxx_type_info *type ) + const catchblock_info *catchblock, const cxx_type_info *type ) { void **dest_ptr; @@ -185,14 +198,14 @@ } /* unwind the local function up to a given trylevel */ -static void cxx_local_unwind( cxx_exception_frame* frame, cxx_function_descr *descr, int last_level) +static void cxx_local_unwind( cxx_exception_frame* frame, const cxx_function_descr *descr, int last_level) { void (*handler)(); int trylevel = frame->trylevel; while (trylevel != last_level) { - if (trylevel < 0 || trylevel >= (int)descr->unwind_count) + if (trylevel < 0 || trylevel >= descr->unwind_count) { ERR( "invalid trylevel %d\n", trylevel ); MSVCRT_terminate(); @@ -215,8 +228,9 @@ EXCEPTION_REGISTRATION_RECORD frame; /* standard exception frame */ EXCEPTION_RECORD *prev_rec; /* previous record to restore in thread data */ cxx_exception_frame *cxx_frame; /* frame of parent exception */ - cxx_function_descr *descr; /* descriptor of parent exception */ + const cxx_function_descr *descr; /* descriptor of parent exception */ int trylevel; /* current try level */ + EXCEPTION_RECORD *rec; /* rec associated with frame */ }; /* handler for exceptions happening while calling a catch function */ @@ -230,20 +244,41 @@ msvcrt_get_thread_data()->exc_record = nested_frame->prev_rec; return ExceptionContinueSearch; } - else - { - TRACE( "got nested exception in catch function\n" ); - return cxx_frame_handler( rec, nested_frame->cxx_frame, context, - NULL, nested_frame->descr, &nested_frame->frame, - nested_frame->trylevel ); - } + + TRACE( "got nested exception in catch function\n" ); + + if(rec->ExceptionCode == CXX_EXCEPTION) + { + PEXCEPTION_RECORD prev_rec = nested_frame->rec; + if(rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0) + { + /* exception was rethrown */ + rec->ExceptionInformation[1] = prev_rec->ExceptionInformation[1]; + rec->ExceptionInformation[2] = prev_rec->ExceptionInformation[2]; + TRACE("detect rethrow: re-propagate: obj: %lx, type: %lx\n", + rec->ExceptionInformation[1], rec->ExceptionInformation[2]); + } + else { + /* new exception in exception handler, destroy old */ + void *object = (void*)prev_rec->ExceptionInformation[1]; + cxx_exception_type *info = (cxx_exception_type*) prev_rec->ExceptionInformation[2]; + TRACE("detect threw new exception in catch block - destroy old(obj: %p type: %p)\n", + object, info); + if(info && info->destructor) + call_dtor( info->destructor, object ); + } + } + + return cxx_frame_handler( rec, nested_frame->cxx_frame, context, + NULL, nested_frame->descr, &nested_frame->frame, + nested_frame->trylevel ); } /* find and call the appropriate catch block for an exception */ /* returns the address to continue execution to after the catch block was called */ -__inline static void *call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame *frame, - cxx_function_descr *descr, int nested_trylevel, - cxx_exception_type *info ) +static inline void call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame *frame, + const cxx_function_descr *descr, int nested_trylevel, + cxx_exception_type *info ) { UINT i; int j; @@ -251,10 +286,11 @@ struct catch_func_nested_frame nested_frame; int trylevel = frame->trylevel; MSVCRT_thread_data *thread_data = msvcrt_get_thread_data(); + DWORD save_esp = ((DWORD*)frame)[-1]; for (i = 0; i < descr->tryblock_count; i++) { - tryblock_info *tryblock = &descr->tryblock[i]; + const tryblock_info *tryblock = &descr->tryblock[i]; if (trylevel < tryblock->start_level) continue; if (trylevel > tryblock->end_level) continue; @@ -262,14 +298,24 @@ /* got a try block */ for (j = 0; j < tryblock->catchblock_count; j++) { - catchblock_info *catchblock = &tryblock->catchblock[j]; - const cxx_type_info *type = find_caught_type( info, catchblock ); - if (!type) continue; - - TRACE( "matched type %p in tryblock %d catchblock %d\n", type, i, j ); - - /* copy the exception to its destination on the stack */ - copy_exception( object, frame, catchblock, type ); + const catchblock_info *catchblock = &tryblock->catchblock[j]; + if(info) + { + const cxx_type_info *type = find_caught_type( info, catchblock ); + if (!type) continue; + + TRACE( "matched type %p in tryblock %d catchblock %d\n", type, i, j ); + + /* copy the exception to its destination on the stack */ + copy_exception( object, frame, catchblock, type ); + } + else + { + /* no CXX_EXCEPTION only proceed with a catch(...) block*/ + if(catchblock->type_info) + continue; + TRACE("found catch(...) block\n"); + } /* unwind the stack */ RtlUnwind( frame, 0, rec, 0 ); @@ -277,17 +323,17 @@ frame->trylevel = tryblock->end_level + 1; /* call the catch block */ - TRACE( "calling catch block %p for type %p addr %p ebp %p\n", - catchblock, type, catchblock->handler, &frame->ebp ); + TRACE( "calling catch block %p addr %p ebp %p\n", + catchblock, catchblock->handler, &frame->ebp ); /* setup an exception block for nested exceptions */ - //nested_frame.frame.Handler = catch_function_nested_handler; nested_frame.frame.Handler = (PEXCEPTION_HANDLER)catch_function_nested_handler; nested_frame.prev_rec = thread_data->exc_record; nested_frame.cxx_frame = frame; nested_frame.descr = descr; nested_frame.trylevel = nested_trylevel + 1; + nested_frame.rec = rec; __wine_push_frame( &nested_frame.frame ); thread_data->exc_record = rec; @@ -295,12 +341,13 @@ thread_data->exc_record = nested_frame.prev_rec; __wine_pop_frame( &nested_frame.frame ); - if (info->destructor) call_dtor( info->destructor, object ); + ((DWORD*)frame)[-1] = save_esp; + if (info && info->destructor) call_dtor( info->destructor, object ); TRACE( "done, continuing at %p\n", addr ); - return addr; - } - } - return NULL; + + continue_after_catch( frame, addr ); + } + } } @@ -309,14 +356,13 @@ * * Implementation of __CxxFrameHandler. */ -static DWORD cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame, - PCONTEXT exc_context, EXCEPTION_REGISTRATION_RECORD** dispatch, - cxx_function_descr *descr, EXCEPTION_REGISTRATION_RECORD* nested_frame, - int nested_trylevel ) +DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame, + PCONTEXT context, EXCEPTION_REGISTRATION_RECORD** dispatch, + const cxx_function_descr *descr, + EXCEPTION_REGISTRATION_RECORD* nested_frame, + int nested_trylevel ) { cxx_exception_type *exc_type; - void *next_ip; - PEXCEPTION_RECORD orig_rec = rec; if (descr->magic != CXX_FRAME_MAGIC) { @@ -330,71 +376,88 @@ } if (!descr->tryblock_count) return ExceptionContinueSearch; - exc_type = (cxx_exception_type *)rec->ExceptionInformation[2]; - if (rec->ExceptionCode == CXX_EXCEPTION && - rec->ExceptionInformation[0] > CXX_FRAME_MAGIC && - exc_type->custom_handler) - { - return exc_type->custom_handler( rec, frame, exc_context, dispatch, + if(rec->ExceptionCode == CXX_EXCEPTION) + { + exc_type = (cxx_exception_type *)rec->ExceptionInformation[2]; + + if (rec->ExceptionInformation[0] > CXX_FRAME_MAGIC && + exc_type->custom_handler) + { + return exc_type->custom_handler( rec, frame, context, dispatch, descr, nested_trylevel, nested_frame, 0 ); - } - - if (!exc_type) /* nested exception, fetch info from original exception */ - { - rec = msvcrt_get_thread_data()->exc_record; - exc_type = (cxx_exception_type *)rec->ExceptionInformation[2]; - } - - if (TRACE_ON(seh)) - { - TRACE("handling C++ exception rec %p frame %p trylevel %d descr %p nested_frame %p\n", - rec, frame, frame->trylevel, descr, nested_frame ); - dump_exception_type( exc_type ); - dump_function_descr( descr, exc_type ); - } - - next_ip = call_catch_block( rec, frame, descr, frame->trylevel, exc_type ); - - if (!next_ip) return ExceptionContinueSearch; - orig_rec->ExceptionFlags &= ~EH_NONCONTINUABLE; - exc_context->Eip = (DWORD)next_ip; - exc_context->Ebp = (DWORD)&frame->ebp; - exc_context->Esp = ((DWORD*)frame)[-1]; - return ExceptionContinueExecution; + } + + if (TRACE_ON(seh)) + { + TRACE("handling C++ exception rec %p frame %p trylevel %d descr %p nested_frame %p\n", + rec, frame, frame->trylevel, descr, nested_frame ); + dump_exception_type( exc_type ); + dump_function_descr( descr ); + } + } + else + { + exc_type = NULL; + TRACE("handling C exception code %x rec %p frame %p trylevel %d descr %p nested_frame %p\n", + rec->ExceptionCode, rec, frame, frame->trylevel, descr, nested_frame ); + } + + call_catch_block( rec, frame, descr, frame->trylevel, exc_type ); + return ExceptionContinueSearch; } /********************************************************************* * __CxxFrameHandler (MSVCRT.@) */ -DWORD __CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame, - PCONTEXT exc_context, EXCEPTION_REGISTRATION_RECORD** dispatch ) -{ - cxx_function_descr *descr; - - __asm__ __volatile__("mov %%eax, %0\n" : "=m"(descr)); - return cxx_frame_handler(rec, (cxx_exception_frame *)frame, - exc_context, dispatch, descr, NULL, 0 ); -} +extern DWORD CDECL __CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame, + PCONTEXT context, EXCEPTION_REGISTRATION_RECORD** dispatch ); +__ASM_GLOBAL_FUNC( __CxxFrameHandler, + "pushl $0\n\t" /* nested_trylevel */ + "pushl $0\n\t" /* nested_frame */ + "pushl %eax\n\t" /* descr */ + "pushl 28(%esp)\n\t" /* dispatch */ + "pushl 28(%esp)\n\t" /* context */ + "pushl 28(%esp)\n\t" /* frame */ + "pushl 28(%esp)\n\t" /* rec */ + "call " __ASM_NAME("cxx_frame_handler") "\n\t" + "add $28,%esp\n\t" + "ret" ) + + +/********************************************************************* + * __CxxLongjmpUnwind (MSVCRT.@) + * + * Callback meant to be used as UnwindFunc for setjmp/longjmp. + */ +void __stdcall __CxxLongjmpUnwind( const struct MSVCRT___JUMP_BUFFER *buf ) +{ + cxx_exception_frame *frame = (cxx_exception_frame *)buf->Registration; + const cxx_function_descr *descr = (const cxx_function_descr *)buf->UnwindData[0]; + + TRACE( "unwinding frame %p descr %p trylevel %ld\n", frame, descr, buf->TryLevel ); + cxx_local_unwind( frame, descr, buf->TryLevel ); +} + #endif /* __i386__ */ /********************************************************************* * _CxxThrowException (MSVCRT.@) */ -void _CxxThrowException( void *object, const cxx_exception_type *type ) -{ - DWORD args[3]; +void CDECL _CxxThrowException( exception *object, const cxx_exception_type *type ) +{ + ULONG_PTR args[3]; args[0] = CXX_FRAME_MAGIC; - args[1] = (DWORD)object; - args[2] = (DWORD)type; + args[1] = (ULONG_PTR)object; + args[2] = (ULONG_PTR)type; RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 3, args ); } /********************************************************************* * __CxxDetectRethrow (MSVCRT.@) */ -BOOL __CxxDetectRethrow(PEXCEPTION_POINTERS ptrs) +BOOL CDECL __CxxDetectRethrow(PEXCEPTION_POINTERS ptrs) { PEXCEPTION_RECORD rec; @@ -417,7 +480,7 @@ /********************************************************************* * __CxxQueryExceptionSize (MSVCRT.@) */ -unsigned int __CxxQueryExceptionSize(void) +unsigned int CDECL __CxxQueryExceptionSize(void) { return sizeof(cxx_exception_type); } Modified: trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/include/intern…
============================================================================== --- trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h (original) +++ trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h Sun Nov 11 23:40:21 2007 @@ -121,7 +121,7 @@ typedef DWORD (*cxx_exc_custom_handler)( PEXCEPTION_RECORD, cxx_exception_frame*, PCONTEXT, EXCEPTION_REGISTRATION_RECORD**, - cxx_function_descr*, int nested_trylevel, + const cxx_function_descr*, int nested_trylevel, EXCEPTION_REGISTRATION_RECORD *nested_frame, DWORD unknown3 ); /* type information for an exception object */ @@ -133,7 +133,7 @@ const cxx_type_info_table *type_info_table; /* list of types for this exception object */ } cxx_exception_type; -void _CxxThrowException(void*,const cxx_exception_type*); +void _CxxThrowException(exception*,const cxx_exception_type*); static inline const char *dbgstr_type_info( const type_info *info ) { Modified: trunk/reactos/lib/sdk/crt/include/internal/wine/msvcrt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/include/intern…
============================================================================== --- trunk/reactos/lib/sdk/crt/include/internal/wine/msvcrt.h (original) +++ trunk/reactos/lib/sdk/crt/include/internal/wine/msvcrt.h Sun Nov 11 23:40:21 2007 @@ -166,6 +166,23 @@ #define _RT_CRNL 252 #define _RT_BANNER 255 +#ifdef __i386__ +struct MSVCRT___JUMP_BUFFER { + unsigned long Ebp; + unsigned long Ebx; + unsigned long Edi; + unsigned long Esi; + unsigned long Esp; + unsigned long Eip; + unsigned long Registration; + unsigned long TryLevel; + /* Start of new struct members */ + unsigned long Cookie; + unsigned long UnwindFunc; + unsigned long UnwindData[6]; +}; +#endif /* __i386__ */ + typedef void* (*malloc_func_t)(size_t); typedef void (*free_func_t)(void*); #define MSVCRT_malloc malloc Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE (original) +++ trunk/reactos/media/doc/README.WINE Sun Nov 11 23:40:21 2007 @@ -119,8 +119,8 @@ msvcrt - reactos/dll/win32/msvcrt/wine/*.c # Out of sync - reactos/lib/sdk/crt/except # Synced at XXXXXXXX reactos/lib/sdk/crt/cpp.c # Synced at 20071111 + reactos/lib/sdk/crt/cppexcept.c # Synced at 20071111 reactos/lib/sdk/crt/wine # Synced at XXXXXXXX User32 -
17 years, 1 month
1
0
0
0
[janderwald] 30362: - move Shell_MergeMenus to shlobj.h where it belongs
by janderwald@svn.reactos.org
Author: janderwald Date: Sun Nov 11 21:14:11 2007 New Revision: 30362 URL:
http://svn.reactos.org/svn/reactos?rev=30362&view=rev
Log: - move Shell_MergeMenus to shlobj.h where it belongs Modified: trunk/reactos/dll/win32/shell32/shell32_main.h trunk/reactos/include/psdk/shlobj.h Modified: trunk/reactos/dll/win32/shell32/shell32_main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32_main.h (original) +++ trunk/reactos/dll/win32/shell32/shell32_main.h Sun Nov 11 21:14:11 2007 @@ -112,11 +112,6 @@ LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST); LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST); -/* menu merging */ -#define MM_ADDSEPARATOR 0x00000001L -#define MM_SUBMENUSHAVEIDS 0x00000002L -HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags); - /* initialisation for FORMATETC */ #define InitFormatEtc(fe, cf, med) \ {\ Modified: trunk/reactos/include/psdk/shlobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlobj.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/shlobj.h (original) +++ trunk/reactos/include/psdk/shlobj.h Sun Nov 11 21:14:11 2007 @@ -1372,6 +1372,15 @@ #include <poppack.h> + +/* menu merging */ +#define MM_ADDSEPARATOR 0x00000001L +#define MM_SUBMENUSHAVEIDS 0x00000002L +#define MM_DONTREMOVESEPS 0x00000004L + +HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags); + + /**************************************************************************** * SHCreateDefaultContextMenu API */
17 years, 1 month
1
0
0
0
[fireball] 30361: - Update MSVCRT_thread_data - Winesync cpp.c.
by fireball@svn.reactos.org
Author: fireball Date: Sun Nov 11 20:03:20 2007 New Revision: 30361 URL:
http://svn.reactos.org/svn/reactos?rev=30361&view=rev
Log: - Update MSVCRT_thread_data - Winesync cpp.c. Modified: trunk/reactos/lib/sdk/crt/except/cpp.c trunk/reactos/lib/sdk/crt/except/cppexcept.c trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h trunk/reactos/lib/sdk/crt/include/internal/wine/msvcrt.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/lib/sdk/crt/except/cpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/cpp.c?r…
============================================================================== --- trunk/reactos/lib/sdk/crt/except/cpp.c (original) +++ trunk/reactos/lib/sdk/crt/except/cpp.c Sun Nov 11 20:03:20 2007 @@ -2,7 +2,7 @@ * msvcrt.dll C++ objects * * Copyright 2000 Jon Griffiths - * Copyright 2003 Alexandre Julliard + * Copyright 2003, 2004 Alexandre Julliard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,7 +16,7 @@ * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "wine/config.h" @@ -41,81 +41,101 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); -/* - * exception object: base for exception, bad_cast, bad_typeid, __non_rtti_object - */ -typedef struct -{ - void* pfn_vector_dtor; - void* pfn_what; -} exception_vtable; - -typedef struct __exception -{ - const exception_vtable *vtable; - char *name; /* Name of this exception, always a new copy for each object */ - int do_free; /* Whether to free 'name' in our dtor */ -} exception; - typedef exception bad_cast; typedef exception bad_typeid; typedef exception __non_rtti_object; typedef struct _rtti_base_descriptor { - type_info *type_descriptor; + const type_info *type_descriptor; int num_base_classes; + this_ptr_offsets offsets; /* offsets for computing the this pointer */ + unsigned int attributes; +} rtti_base_descriptor; + +typedef struct _rtti_base_array +{ + const rtti_base_descriptor *bases[3]; /* First element is the class itself */ +} rtti_base_array; + +typedef struct _rtti_object_hierarchy +{ + unsigned int signature; + unsigned int attributes; + int array_len; /* Size of the array pointed to by 'base_classes' */ + const rtti_base_array *base_classes; +} rtti_object_hierarchy; + +typedef struct _rtti_object_locator +{ + unsigned int signature; int base_class_offset; unsigned int flags; - int unknown1; - int unknown2; -} rtti_base_descriptor; - -typedef struct _rtti_base_array -{ - const rtti_base_descriptor *bases[3]; /* First element is the class itself */ -} rtti_base_array; - -typedef struct _rtti_object_hierachy -{ - int unknown1; - int unknown2; - int array_len; /* Size of the array pointed to by 'base_classes' */ - const rtti_base_array *base_classes; -} rtti_object_hierachy; - -typedef struct _rtti_object_locator -{ - int unknown1; - int base_class_offset; - unsigned int flags; - type_info *type_descriptor; - const rtti_object_hierachy *type_hierachy; + const type_info *type_descriptor; + const rtti_object_hierarchy *type_hierarchy; } rtti_object_locator; #ifdef __i386__ /* thiscall functions are i386-specific */ -#define DEFINE_THISCALL_WRAPPER0(func) \ - extern void __thiscall_ ## func(); \ +#define THISCALL(func) __thiscall_ ## func +#define THISCALL_NAME(func) __ASM_NAME("__thiscall_" #func) +#define DEFINE_THISCALL_WRAPPER(func) \ + extern void THISCALL(func)(); \ __ASM_GLOBAL_FUNC(__thiscall_ ## func, \ "popl %eax\n\t" \ "pushl %ecx\n\t" \ "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) "@4" ) -#define DEFINE_THISCALL_WRAPPER1(func) \ - extern void __thiscall_ ## func(); \ - __ASM_GLOBAL_FUNC(__thiscall_ ## func, \ - "popl %eax\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) "@8" ) - -const exception_vtable MSVCRT_exception_vtable; -const exception_vtable MSVCRT_bad_typeid_vtable; -const exception_vtable MSVCRT_bad_cast_vtable; -const exception_vtable MSVCRT___non_rtti_object_vtable; -static const exception_vtable MSVCRT_type_info_vtable; + "jmp " __ASM_NAME(#func) ) +#else /* __i386__ */ + +#define THISCALL(func) func +#define THISCALL_NAME(func) __ASM_NAME(#func) +#define DEFINE_THISCALL_WRAPPER(func) /* nothing */ + +#endif /* __i386__ */ + +extern const vtable_ptr MSVCRT_exception_vtable; +extern const vtable_ptr MSVCRT_bad_typeid_vtable; +extern const vtable_ptr MSVCRT_bad_cast_vtable; +extern const vtable_ptr MSVCRT___non_rtti_object_vtable; +extern const vtable_ptr MSVCRT_type_info_vtable; + +/* get the vtable pointer for a C++ object */ +static inline const vtable_ptr *get_vtable( void *obj ) +{ + return *(const vtable_ptr **)obj; +} + +static inline const rtti_object_locator *get_obj_locator( void *cppobj ) +{ + const vtable_ptr *vtable = get_vtable( cppobj ); + return (const rtti_object_locator *)vtable[-1]; +} + +static void dump_obj_locator( const rtti_object_locator *ptr ) +{ + int i; + const rtti_object_hierarchy *h = ptr->type_hierarchy; + + TRACE( "%p: sig=%08x base_offset=%08x flags=%08x type=%p %s hierarchy=%p\n", + ptr, ptr->signature, ptr->base_class_offset, ptr->flags, + ptr->type_descriptor, dbgstr_type_info(ptr->type_descriptor), ptr->type_hierarchy ); + TRACE( " hierarchy: sig=%08x attr=%08x len=%d base classes=%p\n", + h->signature, h->attributes, h->array_len, h->base_classes ); + for (i = 0; i < h->array_len; i++) + { + TRACE( " base class %p: num %d off %d,%d,%d attr %08x type %p %s\n", + h->base_classes->bases[i], + h->base_classes->bases[i]->num_base_classes, + h->base_classes->bases[i]->offsets.this_offset, + h->base_classes->bases[i]->offsets.vbase_descr, + h->base_classes->bases[i]->offsets.vbase_offset, + h->base_classes->bases[i]->attributes, + h->base_classes->bases[i]->type_descriptor, + dbgstr_type_info(h->base_classes->bases[i]->type_descriptor) ); + } +} /* Internal common ctor for exception */ static void WINAPI EXCEPTION_ctor(exception *_this, const char** name) @@ -125,7 +145,7 @@ { size_t name_len = strlen(*name) + 1; _this->name = MSVCRT_malloc(name_len); - memcpy(_this->name, *name, name_len); + memcpy(_this->name, *name, name_len); _this->do_free = TRUE; } else @@ -138,7 +158,7 @@ /****************************************************************** * ??0exception@@QAE@ABQBD@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_ctor); +DEFINE_THISCALL_WRAPPER(MSVCRT_exception_ctor) exception * __stdcall MSVCRT_exception_ctor(exception * _this, const char ** name) { TRACE("(%p,%s)\n", _this, *name); @@ -149,7 +169,7 @@ /****************************************************************** * ??0exception@@QAE@ABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_copy_ctor); +DEFINE_THISCALL_WRAPPER(MSVCRT_exception_copy_ctor) exception * __stdcall MSVCRT_exception_copy_ctor(exception * _this, const exception * rhs) { TRACE("(%p,%p)\n", _this, rhs); @@ -169,7 +189,7 @@ /****************************************************************** * ??0exception@@QAE@XZ (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER0(MSVCRT_exception_default_ctor); +DEFINE_THISCALL_WRAPPER(MSVCRT_exception_default_ctor) exception * __stdcall MSVCRT_exception_default_ctor(exception * _this) { static const char* empty = NULL; @@ -182,7 +202,7 @@ /****************************************************************** * ??1exception@@UAE@XZ (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER0(MSVCRT_exception_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_exception_dtor) void __stdcall MSVCRT_exception_dtor(exception * _this) { TRACE("(%p)\n", _this); @@ -193,7 +213,7 @@ /****************************************************************** * ??4exception@@QAEAAV0@ABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_opequals); +DEFINE_THISCALL_WRAPPER(MSVCRT_exception_opequals) exception * __stdcall MSVCRT_exception_opequals(exception * _this, const exception * rhs) { TRACE("(%p %p)\n", _this, rhs); @@ -209,7 +229,7 @@ /****************************************************************** * ??_Eexception@@UAEPAXI@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_vector_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_exception_vector_dtor) void * __stdcall MSVCRT_exception_vector_dtor(exception * _this, unsigned int flags) { TRACE("(%p %x)\n", _this, flags); @@ -232,7 +252,7 @@ /****************************************************************** * ??_Gexception@@UAEPAXI@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_scalar_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_exception_scalar_dtor) void * __stdcall MSVCRT_exception_scalar_dtor(exception * _this, unsigned int flags) { TRACE("(%p %x)\n", _this, flags); @@ -244,7 +264,7 @@ /****************************************************************** * ?what@exception@@UBEPBDXZ (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER0(MSVCRT_what_exception); +DEFINE_THISCALL_WRAPPER(MSVCRT_what_exception) const char * __stdcall MSVCRT_what_exception(exception * _this) { TRACE("(%p) returning %s\n", _this, _this->name); @@ -254,7 +274,7 @@ /****************************************************************** * ??0bad_typeid@@QAE@ABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_copy_ctor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_copy_ctor) bad_typeid * __stdcall MSVCRT_bad_typeid_copy_ctor(bad_typeid * _this, const bad_typeid * rhs) { TRACE("(%p %p)\n", _this, rhs); @@ -266,7 +286,7 @@ /****************************************************************** * ??0bad_typeid@@QAE@PBD@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_ctor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_ctor) bad_typeid * __stdcall MSVCRT_bad_typeid_ctor(bad_typeid * _this, const char * name) { TRACE("(%p %s)\n", _this, name); @@ -278,7 +298,7 @@ /****************************************************************** * ??1bad_typeid@@UAE@XZ (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER0(MSVCRT_bad_typeid_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_dtor) void __stdcall MSVCRT_bad_typeid_dtor(bad_typeid * _this) { TRACE("(%p)\n", _this); @@ -288,7 +308,7 @@ /****************************************************************** * ??4bad_typeid@@QAEAAV0@ABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_opequals); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_opequals) bad_typeid * __stdcall MSVCRT_bad_typeid_opequals(bad_typeid * _this, const bad_typeid * rhs) { TRACE("(%p %p)\n", _this, rhs); @@ -299,7 +319,7 @@ /****************************************************************** * ??_Ebad_typeid@@UAEPAXI@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_vector_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_vector_dtor) void * __stdcall MSVCRT_bad_typeid_vector_dtor(bad_typeid * _this, unsigned int flags) { TRACE("(%p %x)\n", _this, flags); @@ -322,7 +342,7 @@ /****************************************************************** * ??_Gbad_typeid@@UAEPAXI@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_scalar_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_scalar_dtor) void * __stdcall MSVCRT_bad_typeid_scalar_dtor(bad_typeid * _this, unsigned int flags) { TRACE("(%p %x)\n", _this, flags); @@ -334,7 +354,7 @@ /****************************************************************** * ??0__non_rtti_object@@QAE@ABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_copy_ctor); +DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_copy_ctor) __non_rtti_object * __stdcall MSVCRT___non_rtti_object_copy_ctor(__non_rtti_object * _this, const __non_rtti_object * rhs) { @@ -347,7 +367,7 @@ /****************************************************************** * ??0__non_rtti_object@@QAE@PBD@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_ctor); +DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_ctor) __non_rtti_object * __stdcall MSVCRT___non_rtti_object_ctor(__non_rtti_object * _this, const char * name) { @@ -360,7 +380,7 @@ /****************************************************************** * ??1__non_rtti_object@@UAE@XZ (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER0(MSVCRT___non_rtti_object_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_dtor) void __stdcall MSVCRT___non_rtti_object_dtor(__non_rtti_object * _this) { TRACE("(%p)\n", _this); @@ -370,7 +390,7 @@ /****************************************************************** * ??4__non_rtti_object@@QAEAAV0@ABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_opequals); +DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_opequals) __non_rtti_object * __stdcall MSVCRT___non_rtti_object_opequals(__non_rtti_object * _this, const __non_rtti_object *rhs) { @@ -382,7 +402,7 @@ /****************************************************************** * ??_E__non_rtti_object@@UAEPAXI@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_vector_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_vector_dtor) void * __stdcall MSVCRT___non_rtti_object_vector_dtor(__non_rtti_object * _this, unsigned int flags) { TRACE("(%p %x)\n", _this, flags); @@ -405,7 +425,7 @@ /****************************************************************** * ??_G__non_rtti_object@@UAEPAXI@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_scalar_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_scalar_dtor) void * __stdcall MSVCRT___non_rtti_object_scalar_dtor(__non_rtti_object * _this, unsigned int flags) { TRACE("(%p %x)\n", _this, flags); @@ -417,7 +437,7 @@ /****************************************************************** * ??0bad_cast@@QAE@ABQBD@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_ctor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_ctor) bad_cast * __stdcall MSVCRT_bad_cast_ctor(bad_cast * _this, const char ** name) { TRACE("(%p %s)\n", _this, *name); @@ -429,7 +449,7 @@ /****************************************************************** * ??0bad_cast@@QAE@ABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_copy_ctor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_copy_ctor) bad_cast * __stdcall MSVCRT_bad_cast_copy_ctor(bad_cast * _this, const bad_cast * rhs) { TRACE("(%p %p)\n", _this, rhs); @@ -441,7 +461,7 @@ /****************************************************************** * ??1bad_cast@@UAE@XZ (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER0(MSVCRT_bad_cast_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_dtor) void __stdcall MSVCRT_bad_cast_dtor(bad_cast * _this) { TRACE("(%p)\n", _this); @@ -451,7 +471,7 @@ /****************************************************************** * ??4bad_cast@@QAEAAV0@ABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_opequals); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_opequals) bad_cast * __stdcall MSVCRT_bad_cast_opequals(bad_cast * _this, const bad_cast * rhs) { TRACE("(%p %p)\n", _this, rhs); @@ -462,7 +482,7 @@ /****************************************************************** * ??_Ebad_cast@@UAEPAXI@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_vector_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_vector_dtor) void * __stdcall MSVCRT_bad_cast_vector_dtor(bad_cast * _this, unsigned int flags) { TRACE("(%p %x)\n", _this, flags); @@ -485,7 +505,7 @@ /****************************************************************** * ??_Gbad_cast@@UAEPAXI@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_scalar_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_scalar_dtor) void * __stdcall MSVCRT_bad_cast_scalar_dtor(bad_cast * _this, unsigned int flags) { TRACE("(%p %x)\n", _this, flags); @@ -497,7 +517,7 @@ /****************************************************************** * ??8type_info@@QBEHABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_type_info_opequals_equals); +DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_opequals_equals) int __stdcall MSVCRT_type_info_opequals_equals(type_info * _this, const type_info * rhs) { int ret = !strcmp(_this->mangled + 1, rhs->mangled + 1); @@ -508,7 +528,7 @@ /****************************************************************** * ??9type_info@@QBEHABV0@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_type_info_opnot_equals); +DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_opnot_equals) int __stdcall MSVCRT_type_info_opnot_equals(type_info * _this, const type_info * rhs) { int ret = !!strcmp(_this->mangled + 1, rhs->mangled + 1); @@ -519,7 +539,7 @@ /****************************************************************** * ?before@type_info@@QBEHABV1@@Z (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_type_info_before); +DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_before) int __stdcall MSVCRT_type_info_before(type_info * _this, const type_info * rhs) { int ret = strcmp(_this->mangled + 1, rhs->mangled + 1) < 0; @@ -530,18 +550,17 @@ /****************************************************************** * ??1type_info@@UAE@XZ (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER0(MSVCRT_type_info_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_dtor) void __stdcall MSVCRT_type_info_dtor(type_info * _this) { TRACE("(%p)\n", _this); - if (_this->name) - MSVCRT_free(_this->name); + MSVCRT_free(_this->name); } /****************************************************************** * ?name@type_info@@QBEPBDXZ (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER0(MSVCRT_type_info_name); +DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_name) const char * __stdcall MSVCRT_type_info_name(type_info * _this) { if (!_this->name) @@ -582,7 +601,7 @@ /****************************************************************** * ?raw_name@type_info@@QBEPBDXZ (MSVCRT.@) */ -DEFINE_THISCALL_WRAPPER0(MSVCRT_type_info_raw_name); +DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_raw_name) const char * __stdcall MSVCRT_type_info_raw_name(type_info * _this) { TRACE("(%p) returning %s\n", _this, _this->mangled); @@ -590,7 +609,7 @@ } /* Unexported */ -DEFINE_THISCALL_WRAPPER1(MSVCRT_type_info_vector_dtor); +DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_vector_dtor) void * __stdcall MSVCRT_type_info_vector_dtor(type_info * _this, unsigned int flags) { TRACE("(%p %x)\n", _this, flags); @@ -612,41 +631,37 @@ /* vtables */ -const exception_vtable MSVCRT_exception_vtable = -{ - __thiscall_MSVCRT_exception_vector_dtor, - __thiscall_MSVCRT_what_exception -}; - -const exception_vtable MSVCRT_bad_typeid_vtable = -{ - __thiscall_MSVCRT_bad_typeid_vector_dtor, - __thiscall_MSVCRT_what_exception -}; - -const exception_vtable MSVCRT_bad_cast_vtable = -{ - __thiscall_MSVCRT_bad_cast_vector_dtor, - __thiscall_MSVCRT_what_exception -}; - -const exception_vtable MSVCRT___non_rtti_object_vtable = -{ - __thiscall_MSVCRT___non_rtti_object_vector_dtor, - __thiscall_MSVCRT_what_exception -}; - -static const exception_vtable MSVCRT_type_info_vtable = -{ - __thiscall_MSVCRT_type_info_vector_dtor, - NULL -}; +#define __ASM_VTABLE(name,funcs) \ + __asm__(".data\n" \ + "\t.align 4\n" \ + "\t.long " __ASM_NAME(#name "_rtti") "\n" \ + "\t.globl " __ASM_NAME("MSVCRT_" #name "_vtable") "\n" \ + __ASM_NAME("MSVCRT_" #name "_vtable") ":\n" \ + "\t.long " THISCALL_NAME(MSVCRT_ ## name ## _vector_dtor) "\n" \ + funcs "\n\t.text"); + +#define __ASM_EXCEPTION_VTABLE(name) \ + __ASM_VTABLE(name, "\t.long " THISCALL_NAME(MSVCRT_what_exception) ) + +#ifndef __GNUC__ +void __asm_dummy_vtables(void) { +#endif + +__ASM_VTABLE(type_info,"") +__ASM_EXCEPTION_VTABLE(exception) +__ASM_EXCEPTION_VTABLE(bad_typeid) +__ASM_EXCEPTION_VTABLE(bad_cast) +__ASM_EXCEPTION_VTABLE(__non_rtti_object) + +#ifndef __GNUC__ +} +#endif /* Static RTTI for exported objects */ -static type_info exception_type_info = -{ - (void*)&MSVCRT_type_info_vtable, +static const type_info exception_type_info = +{ + &MSVCRT_type_info_vtable, NULL, ".?AVexception@@" }; @@ -655,9 +670,7 @@ { &exception_type_info, 0, - 0, - 0, - 0, + { 0, -1, 0 }, 0 }; @@ -670,7 +683,7 @@ } }; -static const rtti_object_hierachy exception_type_hierachy = +static const rtti_object_hierarchy exception_type_hierarchy = { 0, 0, @@ -678,29 +691,27 @@ &exception_rtti_base_array }; -static const rtti_object_locator exception_rtti = +const rtti_object_locator exception_rtti = { 0, 0, 0, &exception_type_info, - &exception_type_hierachy + &exception_type_hierarchy }; static const cxx_type_info exception_cxx_type_info = { 0, &exception_type_info, - 0, - -1, - 0, + { 0, -1, 0 }, sizeof(exception), - (cxx_copy_ctor)__thiscall_MSVCRT_exception_copy_ctor -}; - -static type_info bad_typeid_type_info = -{ - (void*)&MSVCRT_type_info_vtable, + (cxx_copy_ctor)THISCALL(MSVCRT_exception_copy_ctor) +}; + +static const type_info bad_typeid_type_info = +{ + &MSVCRT_type_info_vtable, NULL, ".?AVbad_typeid@@" }; @@ -709,9 +720,7 @@ { &bad_typeid_type_info, 1, - 0, - 0xffffffff, - 0, + { 0, -1, 0 }, 0 }; @@ -724,7 +733,7 @@ } }; -static const rtti_object_hierachy bad_typeid_type_hierachy = +static const rtti_object_hierarchy bad_typeid_type_hierarchy = { 0, 0, @@ -732,29 +741,27 @@ &bad_typeid_rtti_base_array }; -static const rtti_object_locator bad_typeid_rtti = +const rtti_object_locator bad_typeid_rtti = { 0, 0, 0, &bad_typeid_type_info, - &bad_typeid_type_hierachy + &bad_typeid_type_hierarchy }; static const cxx_type_info bad_typeid_cxx_type_info = { 0, &bad_typeid_type_info, - 0, - -1, - 0, + { 0, -1, 0 }, sizeof(exception), - (cxx_copy_ctor)__thiscall_MSVCRT_bad_typeid_copy_ctor -}; - -static type_info bad_cast_type_info = -{ - (void*)&MSVCRT_type_info_vtable, + (cxx_copy_ctor)THISCALL(MSVCRT_bad_typeid_copy_ctor) +}; + +static const type_info bad_cast_type_info = +{ + &MSVCRT_type_info_vtable, NULL, ".?AVbad_cast@@" }; @@ -763,9 +770,7 @@ { &bad_cast_type_info, 1, - 0, - 0xffffffff, - 0, + { 0, -1, 0 }, 0 }; @@ -778,7 +783,7 @@ } }; -static const rtti_object_hierachy bad_cast_type_hierachy = +static const rtti_object_hierarchy bad_cast_type_hierarchy = { 0, 0, @@ -786,29 +791,27 @@ &bad_cast_rtti_base_array }; -static const rtti_object_locator bad_cast_rtti = +const rtti_object_locator bad_cast_rtti = { 0, 0, 0, &bad_cast_type_info, - &bad_cast_type_hierachy + &bad_cast_type_hierarchy }; static const cxx_type_info bad_cast_cxx_type_info = { 0, &bad_cast_type_info, - 0, - -1, - 0, + { 0, -1, 0 }, sizeof(exception), - (cxx_copy_ctor)__thiscall_MSVCRT_bad_cast_copy_ctor -}; - -static type_info __non_rtti_object_type_info = -{ - (void*)&MSVCRT_type_info_vtable, + (cxx_copy_ctor)THISCALL(MSVCRT_bad_cast_copy_ctor) +}; + +static const type_info __non_rtti_object_type_info = +{ + &MSVCRT_type_info_vtable, NULL, ".?AV__non_rtti_object@@" }; @@ -817,9 +820,7 @@ { &__non_rtti_object_type_info, 2, - 0, - 0xffffffff, - 0, + { 0, -1, 0 }, 0 }; @@ -832,7 +833,7 @@ } }; -static const rtti_object_hierachy __non_rtti_object_type_hierachy = +static const rtti_object_hierarchy __non_rtti_object_type_hierarchy = { 0, 0, @@ -840,29 +841,27 @@ &__non_rtti_object_rtti_base_array }; -static const rtti_object_locator __non_rtti_object_rtti = +const rtti_object_locator __non_rtti_object_rtti = { 0, 0, 0, &__non_rtti_object_type_info, - &__non_rtti_object_type_hierachy + &__non_rtti_object_type_hierarchy }; static const cxx_type_info __non_rtti_object_cxx_type_info = { 0, &__non_rtti_object_type_info, - 0, - -1, - 0, + { 0, -1, 0 }, sizeof(exception), - (cxx_copy_ctor)__thiscall_MSVCRT___non_rtti_object_copy_ctor -}; - -static type_info type_info_type_info = -{ - (void*)&MSVCRT_type_info_vtable, + (cxx_copy_ctor)THISCALL(MSVCRT___non_rtti_object_copy_ctor) +}; + +static const type_info type_info_type_info = +{ + &MSVCRT_type_info_vtable, NULL, ".?AVtype_info@@" }; @@ -871,9 +870,7 @@ { &type_info_type_info, 0, - 0, - 0xffffffff, - 0, + { 0, -1, 0 }, 0 }; @@ -886,7 +883,7 @@ } }; -static const rtti_object_hierachy type_info_type_hierachy = +static const rtti_object_hierarchy type_info_type_hierarchy = { 0, 0, @@ -894,13 +891,13 @@ &type_info_rtti_base_array }; -static const rtti_object_locator type_info_rtti = +const rtti_object_locator type_info_rtti = { 0, 0, 0, &type_info_type_info, - &type_info_type_hierachy + &type_info_type_hierarchy }; /* @@ -919,7 +916,7 @@ static const cxx_exception_type bad_cast_exception_type = { 0, - (void*)__thiscall_MSVCRT_bad_cast_dtor, + (void*)THISCALL(MSVCRT_bad_cast_dtor), NULL, &bad_cast_type_info_table }; @@ -937,7 +934,7 @@ static const cxx_exception_type bad_typeid_exception_type = { 0, - (void*)__thiscall_MSVCRT_bad_typeid_dtor, + (void*)THISCALL(MSVCRT_bad_typeid_dtor), NULL, &bad_cast_type_info_table }; @@ -945,13 +942,11 @@ static const cxx_exception_type __non_rtti_object_exception_type = { 0, - (void*)__thiscall_MSVCRT___non_rtti_object_dtor, + (void*)THISCALL(MSVCRT___non_rtti_object_dtor), NULL, &bad_typeid_type_info_table }; -#endif /* __i386__ */ - /****************************************************************** * ?set_terminate@@YAP6AXXZP6AXXZ@Z (MSVCRT.@) @@ -964,7 +959,7 @@ * RETURNS * The previously installed handler function, if any. */ -terminate_function MSVCRT_set_terminate(terminate_function func) +terminate_function CDECL MSVCRT_set_terminate(terminate_function func) { MSVCRT_thread_data *data = msvcrt_get_thread_data(); terminate_function previous = data->terminate_handler; @@ -984,7 +979,7 @@ * RETURNS * The previously installed handler function, if any. */ -unexpected_function MSVCRT_set_unexpected(unexpected_function func) +unexpected_function CDECL MSVCRT_set_unexpected(unexpected_function func) { MSVCRT_thread_data *data = msvcrt_get_thread_data(); unexpected_function previous = data->unexpected_handler; @@ -996,7 +991,7 @@ /****************************************************************** * ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z (MSVCRT.@) */ -_se_translator_function MSVCRT__set_se_translator(_se_translator_function func) +_se_translator_function CDECL MSVCRT__set_se_translator(_se_translator_function func) { MSVCRT_thread_data *data = msvcrt_get_thread_data(); _se_translator_function previous = data->se_translator; @@ -1018,7 +1013,7 @@ * handler installed by calling set_terminate(), or (by default) abort() * is called. */ -void MSVCRT_terminate(void) +void CDECL MSVCRT_terminate(void) { MSVCRT_thread_data *data = msvcrt_get_thread_data(); if (data->terminate_handler) data->terminate_handler(); @@ -1028,59 +1023,13 @@ /****************************************************************** * ?unexpected@@YAXXZ (MSVCRT.@) */ -void MSVCRT_unexpected(void) +void CDECL MSVCRT_unexpected(void) { MSVCRT_thread_data *data = msvcrt_get_thread_data(); if (data->unexpected_handler) data->unexpected_handler(); MSVCRT_terminate(); } -/* Get type info from an object (internal) */ -static const rtti_object_locator* RTTI_GetObjectLocator(type_info *cppobj) -{ - const rtti_object_locator *obj_locator = NULL; - -#ifdef __i386__ - const exception_vtable* vtable = (const exception_vtable*)cppobj->vtable; - - /* Perhaps this is one of classes we export? */ - if (vtable == &MSVCRT_exception_vtable) - { - TRACE("returning exception_rtti\n"); - return &exception_rtti; - } - else if (vtable == &MSVCRT_bad_typeid_vtable) - { - TRACE("returning bad_typeid_rtti\n"); - return &bad_typeid_rtti; - } - else if (vtable == &MSVCRT_bad_cast_vtable) - { - TRACE("returning bad_cast_rtti\n"); - return &bad_cast_rtti; - } - else if (vtable == &MSVCRT___non_rtti_object_vtable) - { - TRACE("returning __non_rtti_object_rtti\n"); - return &__non_rtti_object_rtti; - } - else if (vtable == &MSVCRT_type_info_vtable) - { - TRACE("returning type_info_rtti\n"); - return &type_info_rtti; - } -#endif - - if (!IsBadReadPtr(cppobj, sizeof(void *)) && - !IsBadReadPtr(cppobj->vtable - 1,sizeof(void *)) && - !IsBadReadPtr((void*)cppobj->vtable[-1], sizeof(rtti_object_locator))) - { - obj_locator = (rtti_object_locator *)cppobj->vtable[-1]; - TRACE("returning type_info from vtable (%p)\n", obj_locator); - } - - return obj_locator; -} /****************************************************************** * __RTtypeid (MSVCRT.@) @@ -1100,39 +1049,32 @@ * This function is usually called by compiler generated code as a result * of using one of the C++ dynamic cast statements. */ -type_info* MSVCRT___RTtypeid(type_info *cppobj) -{ - const rtti_object_locator *obj_locator = RTTI_GetObjectLocator(cppobj); - -#ifdef __i386__ - if (!obj_locator) - { - static const char* szNullPtr = "Attempted a typeid of NULL pointer!"; - static const char* szBadPtr = "Bad read pointer - no RTTI data!"; - const cxx_exception_type *e_type; - exception e; - - /* Throw a bad_typeid or __non_rtti_object exception */ +const type_info* CDECL MSVCRT___RTtypeid(void *cppobj) +{ + const type_info *ret; + if (!cppobj) { - EXCEPTION_ctor(&e, &szNullPtr); - e.vtable = &MSVCRT_bad_typeid_vtable; - e_type = &bad_typeid_exception_type; - } - else - { - EXCEPTION_ctor(&e, &szBadPtr); - e.vtable = &MSVCRT___non_rtti_object_vtable; - e_type = &__non_rtti_object_exception_type; - } - - _CxxThrowException(&e, e_type); - DebugBreak(); - } - return obj_locator->type_descriptor; -#else - return NULL; -#endif + bad_typeid e; + MSVCRT_bad_typeid_ctor( &e, "Attempted a typeid of NULL pointer!" ); + _CxxThrowException( &e, &bad_typeid_exception_type ); + return NULL; + } + + __TRY + { + const rtti_object_locator *obj_locator = get_obj_locator( cppobj ); + ret = obj_locator->type_descriptor; + } + __EXCEPT_PAGE_FAULT + { + __non_rtti_object e; + MSVCRT___non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" ); + _CxxThrowException( &e, &bad_typeid_exception_type ); + return NULL; + } + __ENDTRY + return ret; } /****************************************************************** @@ -1157,66 +1099,67 @@ * This function is usually called by compiler generated code as a result * of using one of the C++ dynamic cast statements. */ -void* MSVCRT___RTDynamicCast(type_info *cppobj, int unknown, - type_info *src, type_info *dst, - int do_throw) -{ - const rtti_object_locator *obj_locator; - - /* Note: cppobj _isn't_ a type_info, we use that struct for its vtable ptr */ - TRACE("(%p,%d,%p,%p,%d)\n", cppobj, unknown, src, dst, do_throw); - if (!cppobj) - return 0; - obj_locator= RTTI_GetObjectLocator(cppobj); - if (unknown) - FIXME("Unknown parameter is non-zero: please report\n"); - - /* To cast an object at runtime: - * 1.Find out the true type of the object from the typeinfo at vtable[-1] - * 2.Search for the destination type in the class heirachy - * 3.If destination type is found, return base object address + dest offset - * Otherwise, fail the cast - */ - if (obj_locator) - { - int count = 0; - const rtti_object_hierachy *obj_bases = obj_locator->type_hierachy; - const rtti_base_descriptor* const *base_desc = obj_bases->base_classes->bases; - int src_offset = obj_locator->base_class_offset, dst_offset = -1; - - while (count < obj_bases->array_len) - { - const type_info *typ = (*base_desc)->type_descriptor; - - if (!strcmp(typ->mangled, dst->mangled)) - { - dst_offset = (*base_desc)->base_class_offset; - break; - } - base_desc++; - count++; - } - if (dst_offset >= 0) - return (void*)((unsigned long)cppobj - src_offset + dst_offset); - } - -#ifdef __i386__ - /* VC++ sets do_throw to 1 when the result of a dynamic_cast is assigned - * to a reference, since references cannot be NULL. - */ - if (do_throw) - { - static const char* exception_text = "Bad dynamic_cast!"; - exception e; - - /* Throw a bad_cast exception */ - EXCEPTION_ctor(&e, &exception_text); - e.vtable = &MSVCRT_bad_cast_vtable; - _CxxThrowException(&e, &bad_cast_exception_type); - DebugBreak(); - } -#endif - return NULL; +void* CDECL MSVCRT___RTDynamicCast(void *cppobj, int unknown, + type_info *src, type_info *dst, + int do_throw) +{ + void *ret; + + if (!cppobj) return NULL; + + TRACE("obj: %p unknown: %d src: %p %s dst: %p %s do_throw: %d)\n", + cppobj, unknown, src, dbgstr_type_info(src), dst, dbgstr_type_info(dst), do_throw); + + /* To cast an object at runtime: + * 1.Find out the true type of the object from the typeinfo at vtable[-1] + * 2.Search for the destination type in the class hierarchy + * 3.If destination type is found, return base object address + dest offset + * Otherwise, fail the cast + * + * FIXME: the unknown parameter doesn't seem to be used for anything + */ + __TRY + { + int i; + const rtti_object_locator *obj_locator = get_obj_locator( cppobj ); + const rtti_object_hierarchy *obj_bases = obj_locator->type_hierarchy; + const rtti_base_descriptor * const* base_desc = obj_bases->base_classes->bases; + + if (TRACE_ON(msvcrt)) dump_obj_locator(obj_locator); + + ret = NULL; + for (i = 0; i < obj_bases->array_len; i++) + { + const type_info *typ = base_desc[i]->type_descriptor; + + if (!strcmp(typ->mangled, dst->mangled)) + { + /* compute the correct this pointer for that base class */ + void *this_ptr = (char *)cppobj - obj_locator->base_class_offset; + ret = get_this_pointer( &base_desc[i]->offsets, this_ptr ); + break; + } + } + /* VC++ sets do_throw to 1 when the result of a dynamic_cast is assigned + * to a reference, since references cannot be NULL. + */ + if (!ret && do_throw) + { + const char *msg = "Bad dynamic_cast!"; + bad_cast e; + MSVCRT_bad_cast_ctor( &e, &msg ); + _CxxThrowException( &e, &bad_cast_exception_type ); + } + } + __EXCEPT_PAGE_FAULT + { + __non_rtti_object e; + MSVCRT___non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); + _CxxThrowException( &e, &bad_typeid_exception_type ); + return NULL; + } + __ENDTRY + return ret; } @@ -1236,15 +1179,24 @@ * This function is usually called by compiler generated code as a result * of using one of the C++ dynamic cast statements. */ -void* MSVCRT___RTCastToVoid(type_info *cppobj) -{ - const rtti_object_locator *obj_locator = RTTI_GetObjectLocator(cppobj); - - /* Note: cppobj _isn't_ a type_info, we use that struct for its vtable ptr */ - TRACE("(%p)\n", cppobj); - - /* Casts to void* simply cast to the base object */ - if (obj_locator) - return (void*)((unsigned long)cppobj - obj_locator->base_class_offset); - return NULL; -} +void* CDECL MSVCRT___RTCastToVoid(void *cppobj) +{ + void *ret; + + if (!cppobj) return NULL; + + __TRY + { + const rtti_object_locator *obj_locator = get_obj_locator( cppobj ); + ret = (char *)cppobj - obj_locator->base_class_offset; + } + __EXCEPT_PAGE_FAULT + { + __non_rtti_object e; + MSVCRT___non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); + _CxxThrowException( &e, &bad_typeid_exception_type ); + return NULL; + } + __ENDTRY + return ret; +} Modified: trunk/reactos/lib/sdk/crt/except/cppexcept.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/cppexce…
============================================================================== --- trunk/reactos/lib/sdk/crt/except/cppexcept.c (original) +++ trunk/reactos/lib/sdk/crt/except/cppexcept.c Sun Nov 11 20:03:20 2007 @@ -78,10 +78,10 @@ static void dump_type( const cxx_type_info *type ) { - DPRINTF( "flags %x type %p", type->flags, type->type_info ); - if (type->type_info) DPRINTF( " (%p %s)", type->type_info->name, type->type_info->mangled ); - DPRINTF( " offset %d vbase %d,%d size %d copy ctor %p\n", type->this_offset, - type->vbase_descr, type->vbase_offset, type->size, type->copy_ctor ); + TRACE( "flags %x type %p %s offsets %d,%d,%d size %d copy ctor %p\n", + type->flags, type->type_info, dbgstr_type_info(type->type_info), + type->offsets.this_offset, type->offsets.vbase_descr, type->offsets.vbase_offset, + type->size, type->copy_ctor ); } static void dump_exception_type( const cxx_exception_type *type ) @@ -129,25 +129,6 @@ } } -/* compute the this pointer for a base class of a given type */ -static void *get_this_pointer( const cxx_type_info *type, void *object ) -{ - void *this_ptr; - int *offset_ptr; - - if (!object) return NULL; - this_ptr = (char *)object + type->this_offset; - if (type->vbase_descr >= 0) - { - /* move this ptr to vbase descriptor */ - this_ptr = (char *)this_ptr + type->vbase_descr; - /* and fetch additional offset from vbase descriptor */ - offset_ptr = (int *)(*(char **)this_ptr + type->vbase_offset); - this_ptr = (char *)this_ptr + *offset_ptr; - } - return this_ptr; -} - /* check if the exception type is caught by a given catch block, and return the type that matched */ static const cxx_type_info *find_caught_type( cxx_exception_type *exc_type, catchblock_info *catchblock ) { @@ -185,21 +166,21 @@ if (catchblock->flags & TYPE_FLAG_REFERENCE) { - *dest_ptr = get_this_pointer( type, object ); + *dest_ptr = get_this_pointer( &type->offsets, object ); } else if (type->flags & CLASS_IS_SIMPLE_TYPE) { memmove( dest_ptr, object, type->size ); /* if it is a pointer, adjust it */ - if (type->size == sizeof(void *)) *dest_ptr = get_this_pointer( type, *dest_ptr ); + if (type->size == sizeof(void *)) *dest_ptr = get_this_pointer( &type->offsets, *dest_ptr ); } else /* copy the object */ { if (type->copy_ctor) - call_copy_ctor( type->copy_ctor, dest_ptr, get_this_pointer(type,object), + call_copy_ctor( type->copy_ctor, dest_ptr, get_this_pointer(&type->offsets,object), (type->flags & CLASS_HAS_VIRTUAL_BASE_CLASS) ); else - memmove( dest_ptr, get_this_pointer(type,object), type->size ); + memmove( dest_ptr, get_this_pointer(&type->offsets,object), type->size ); } } Modified: trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/include/intern…
============================================================================== --- trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h (original) +++ trunk/reactos/lib/sdk/crt/include/internal/wine/cppexcept.h Sun Nov 11 20:03:20 2007 @@ -29,10 +29,18 @@ /* type_info object, see cpp.c for inplementation */ typedef struct __type_info { - vtable_ptr *vtable; - char *name; /* Unmangled name, allocated lazily */ - char mangled[32]; /* Variable length, but we declare it large enough for static RTTI */ + const vtable_ptr *vtable; + char *name; /* Unmangled name, allocated lazily */ + char mangled[32]; /* Variable length, but we declare it large enough for static RTTI */ } type_info; + +/* exception object */ +typedef struct __exception +{ + const vtable_ptr *vtable; + char *name; /* Name of this exception, always a new copy for each object */ + int do_free; /* Whether to free 'name' in our dtor */ +} exception; /* the exception frame used by CxxFrameHandler */ typedef struct __cxx_exception_frame @@ -84,16 +92,22 @@ typedef void (*cxx_copy_ctor)(void); +/* offsets for computing the this pointer */ +typedef struct +{ + int this_offset; /* offset of base class this pointer from start of object */ + int vbase_descr; /* offset of virtual base class descriptor */ + int vbase_offset; /* offset of this pointer offset in virtual base class descriptor */ +} this_ptr_offsets; + /* complete information about a C++ type */ typedef struct __cxx_type_info { - UINT flags; /* flags (see CLASS_* flags below) */ - type_info *type_info; /* C++ type info */ - int this_offset; /* offset of base class this pointer from start of object */ - int vbase_descr; /* offset of virtual base class descriptor */ - int vbase_offset; /* offset of this pointer offset in virtual base class descriptor */ - size_t size; /* object size */ - cxx_copy_ctor copy_ctor; /* copy constructor */ + UINT flags; /* flags (see CLASS_* flags below) */ + const type_info *type_info; /* C++ type info */ + this_ptr_offsets offsets; /* offsets for computing the this pointer */ + unsigned int size; /* object size */ + cxx_copy_ctor copy_ctor; /* copy constructor */ } cxx_type_info; #define CLASS_IS_SIMPLE_TYPE 1 #define CLASS_HAS_VIRTUAL_BASE_CLASS 4 @@ -121,4 +135,30 @@ void _CxxThrowException(void*,const cxx_exception_type*); +static inline const char *dbgstr_type_info( const type_info *info ) +{ + if (!info) return "{}"; + return wine_dbg_sprintf( "{vtable=%p name=%s (%s)}", + info->vtable, info->mangled, info->name ? info->name : "" ); +} + +/* compute the this pointer for a base class of a given type */ +static inline void *get_this_pointer( const this_ptr_offsets *off, void *object ) +{ + void *this_ptr; + int *offset_ptr; + + if (!object) return NULL; + this_ptr = (char *)object + off->this_offset; + if (off->vbase_descr >= 0) + { + /* move this ptr to vbase descriptor */ + this_ptr = (char *)this_ptr + off->vbase_descr; + /* and fetch additional offset from vbase descriptor */ + offset_ptr = (int *)(*(char **)this_ptr + off->vbase_offset); + this_ptr = (char *)this_ptr + *offset_ptr; + } + return this_ptr; +} + #endif /* __MSVCRT_CPPEXCEPT_H */ Modified: trunk/reactos/lib/sdk/crt/include/internal/wine/msvcrt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/include/intern…
============================================================================== --- trunk/reactos/lib/sdk/crt/include/internal/wine/msvcrt.h (original) +++ trunk/reactos/lib/sdk/crt/include/internal/wine/msvcrt.h Sun Nov 11 20:03:20 2007 @@ -31,19 +31,60 @@ //#include "msvcrt/string.h" #include "eh.h" +typedef unsigned short MSVCRT_wchar_t; +typedef unsigned short MSVCRT_wint_t; +typedef unsigned short MSVCRT_wctype_t; +typedef unsigned short MSVCRT__ino_t; +typedef unsigned long MSVCRT__fsize_t; +#ifdef _WIN64 +typedef unsigned __int64 MSVCRT_size_t; +typedef __int64 MSVCRT_intptr_t; +typedef unsigned __int64 MSVCRT_uintptr_t; +#else +typedef unsigned int MSVCRT_size_t; +typedef int MSVCRT_intptr_t; +typedef unsigned int MSVCRT_uintptr_t; +#endif +typedef unsigned int MSVCRT__dev_t; +typedef int MSVCRT__off_t; +typedef long MSVCRT_clock_t; +typedef long MSVCRT_time_t; +typedef __int64 MSVCRT___time64_t; +typedef __int64 MSVCRT_fpos_t; + +struct MSVCRT_tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; +}; + /* TLS data */ extern DWORD MSVCRT_tls_index; typedef struct __MSVCRT_thread_data { - int _errno; // ros - unsigned long doserrno; - char *mbstok_next; /* next ptr for mbstok() */ - char *efcvt_buffer; /* buffer for ecvt/fcvt */ - terminate_function terminate_handler; - unexpected_function unexpected_handler; - _se_translator_function se_translator; - EXCEPTION_RECORD *exc_record; + int thread_errno; + unsigned long thread_doserrno; + unsigned int random_seed; /* seed for rand() */ + char *strtok_next; /* next ptr for strtok() */ + unsigned char *mbstok_next; /* next ptr for mbstok() */ + MSVCRT_wchar_t *wcstok_next; /* next ptr for wcstok() */ + char *efcvt_buffer; /* buffer for ecvt/fcvt */ + char *asctime_buffer; /* buffer for asctime */ + MSVCRT_wchar_t *wasctime_buffer; /* buffer for wasctime */ + struct MSVCRT_tm time_buffer; /* buffer for localtime/gmtime */ + char *strerror_buffer; /* buffer for strerror */ + int fpecode; + terminate_function terminate_handler; + unexpected_function unexpected_handler; + _se_translator_function se_translator; + EXCEPTION_RECORD *exc_record; } MSVCRT_thread_data; extern MSVCRT_thread_data *msvcrt_get_thread_data(void); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE (original) +++ trunk/reactos/media/doc/README.WINE Sun Nov 11 20:03:20 2007 @@ -120,6 +120,7 @@ msvcrt - reactos/dll/win32/msvcrt/wine/*.c # Out of sync reactos/lib/sdk/crt/except # Synced at XXXXXXXX + reactos/lib/sdk/crt/cpp.c # Synced at 20071111 reactos/lib/sdk/crt/wine # Synced at XXXXXXXX User32 -
17 years, 1 month
1
0
0
0
[cfinck] 30360: - Avoid confusions about double escaping certain quotes by now using PHP's addslashes() function for all strings, which are inserted into JavaScript strings. All strings in the translations now have to be escaped the "usual" way. - Move the translation correctly in "languages.inc.php".
by cfinck@svn.reactos.org
Author: cfinck Date: Sun Nov 11 18:56:58 2007 New Revision: 30360 URL:
http://svn.reactos.org/svn/reactos?rev=30360&view=rev
Log: - Avoid confusions about double escaping certain quotes by now using PHP's addslashes() function for all strings, which are inserted into JavaScript strings. All strings in the translations now have to be escaped the "usual" way. - Move the translation correctly in "languages.inc.php". Modified:
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php
trunk/web/reactos.org/htdocs/getbuilds/index.php
trunk/web/reactos.org/htdocs/getbuilds/lang/fr.inc.php
trunk/web/reactos.org/htdocs/getbuilds/lang/it.inc.php
trunk/web/reactos.org/htdocs/getbuilds/languages.inc.php
Modified:
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/g…
============================================================================== ---
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php
(original) +++
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php
Sun Nov 11 18:56:58 2007 @@ -91,7 +91,7 @@ { // For some errors, we show a localized error message if( http_request.responseXML.getElementsByTagName("message")[0].firstChild.data == "LIMIT" ) - alert( '<?php printf( $getbuilds_langres["rangelimitexceeded"], "' + http_request.responseXML.getElementsByTagName(\"limit\")[0].firstChild.data + '" ); ?>' ); + alert( '<?php printf( addslashes($getbuilds_langres["rangelimitexceeded"]), "' + http_request.responseXML.getElementsByTagName(\"limit\")[0].firstChild.data + '" ); ?>' ); else alert( http_request.responseXML.getElementsByTagName("message")[0].firstChild.data ); @@ -108,7 +108,7 @@ if( data["requesttype"] == "FirstPageFullLoad" ) { filenum = parseInt( http_request.responseXML.getElementsByTagName("filenum")[0].firstChild.data ); - html += '<?php printf( $getbuilds_langres["foundfiles"], "<span id=\"filenum\">' + filenum + '</span>" ); ?>'; + html += '<?php printf( addslashes($getbuilds_langres["foundfiles"]), "<span id=\"filenum\">' + filenum + '</span>" ); ?>'; } else html += document.getElementById("infobox").innerHTML; @@ -121,12 +121,12 @@ if( currentpage == 1 ) { html += '<strong>«</strong> '; - html += '<strong>‹ <?php echo $getbuilds_langres["prevpage"]; ?></strong> '; - } - else - { - html += '<a href="javascript:firstPage()" title="<?php echo $getbuilds_langres["firstpage_title"]; ?>">«</a> '; - html += '<a href="javascript:prevPage()" title="<?php echo $getbuilds_langres["prevpage_title"]; ?>">‹ <?php echo $getbuilds_langres["prevpage"]; ?></a> '; + html += '<strong>‹ <?php echo addslashes($getbuilds_langres["prevpage"]); ?></strong> '; + } + else + { + html += '<a href="javascript:firstPage()" title="<?php echo addslashes($getbuilds_langres["firstpage_title"]); ?>">«</a> '; + html += '<a href="javascript:prevPage()" title="<?php echo addslashes($getbuilds_langres["prevpage_title"]); ?>">‹ <?php echo addslashes($getbuilds_langres["prevpage"]); ?></a> '; } html += '<select id="pagesel" size="1" onchange="pageboxChange(this)">'; @@ -135,7 +135,7 @@ { pagecount = 1; - html += '<option selected="selected" value="' + currentpage + '-' + startrev + '"><?php echo $getbuilds_langres["page"]; ?> ' + currentpage; + html += '<option selected="selected" value="' + currentpage + '-' + startrev + '"><?php echo addslashes($getbuilds_langres["page"]); ?> ' + currentpage; if( http_request.responseXML.getElementsByTagName("filenum")[0].firstChild.data > 0 ) html += ' - ' + http_request.responseXML.getElementsByTagName("firstrev")[0].firstChild.data + ' ... ' + http_request.responseXML.getElementsByTagName("lastrev")[0].firstChild.data + '</option>'; @@ -147,26 +147,26 @@ if( http_request.responseXML.getElementsByTagName("morefiles")[0].firstChild.data == 0 ) { - html += '<strong><?php echo $getbuilds_langres["nextpage"]; ?> ›</strong> '; + html += '<strong><?php echo addslashes($getbuilds_langres["nextpage"]); ?> ›</strong> '; html += '<strong>»</strong>'; } else { - html += '<a href="javascript:nextPage()" title="<?php echo $getbuilds_langres["nextpage_title"]; ?>"><?php echo $getbuilds_langres["nextpage"]; ?> ›</a> '; - html += '<a href="javascript:lastPage()" title="<?php echo $getbuilds_langres["lastpage_title"]; ?>">»</a>'; + html += '<a href="javascript:nextPage()" title="<?php echo addslashes($getbuilds_langres["nextpage_title"]); ?>"><?php echo addslashes($getbuilds_langres["nextpage"]); ?> ›</a> '; + html += '<a href="javascript:lastPage()" title="<?php echo addslashes($getbuilds_langres["lastpage_title"]); ?>">»</a>'; } html += '</td></tr></table>'; // File table html += '<table class="datatable" cellspacing="0" cellpadding="1">'; - html += '<thead><tr class="head"><th class="fname"><?php echo $getbuilds_langres["filename"]; ?></th><th class="fsize"><?php echo $getbuilds_langres["filesize"]; ?></th><th class="fdate"><?php echo $getbuilds_langres["filedate"]; ?></th></tr></thead>'; + html += '<thead><tr class="head"><th class="fname"><?php echo addslashes($getbuilds_langres["filename"]); ?></th><th class="fsize"><?php echo addslashes($getbuilds_langres["filesize"]); ?></th><th class="fdate"><?php echo addslashes($getbuilds_langres["filedate"]); ?></th></tr></thead>'; html += '<tbody>'; var files = http_request.responseXML.getElementsByTagName("file"); if( files.length == 0 ) - html += '<tr class="odd"><td><?php printf( $getbuilds_langres["nofiles"], "' + fullrange + '" ); ?></td><td> </td><td> </td></tr>'; + html += '<tr class="odd"><td><?php printf( addslashes($getbuilds_langres["nofiles"]), "' + fullrange + '" ); ?></td><td> </td><td> </td></tr>'; else { var oddeven = false; @@ -216,7 +216,7 @@ // If I use "innerHTML" here, the first <OPTION> start tag gets dropped in the IE... // Therefore I have to use the DOM functions in this case. var option_elem = document.createElement("option"); - var option_text = document.createTextNode( '<?php echo $getbuilds_langres["page"]; ?> ' + pagecount + ' - ' + http_request.responseXML.getElementsByTagName("firstrev")[0].firstChild.data + ' ... ' + http_request.responseXML.getElementsByTagName("lastrev")[0].firstChild.data ); + var option_text = document.createTextNode( '<?php echo addslashes($getbuilds_langres["page"]); ?> ' + pagecount + ' - ' + http_request.responseXML.getElementsByTagName("firstrev")[0].firstChild.data + ' ... ' + http_request.responseXML.getElementsByTagName("lastrev")[0].firstChild.data ); option_elem.value = pagecount + "-" + data["new_startrev"]; option_elem.appendChild( option_text ); Modified:
trunk/web/reactos.org/htdocs/getbuilds/index.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/i…
============================================================================== ---
trunk/web/reactos.org/htdocs/getbuilds/index.php
(original) +++
trunk/web/reactos.org/htdocs/getbuilds/index.php
Sun Nov 11 18:56:58 2007 @@ -149,19 +149,19 @@ document.write( '<table id="showrev" cellspacing="0" cellpadding="5">' + '<tr>' + - '<td><?php echo $getbuilds_langres["showrevfiles"]; ?>: </td>' + + '<td><?php echo addslashes($getbuilds_langres["showrevfiles"]); ?>: </td>' + '<td>' + '<span id="revcontrols">' + - '<img src="images/leftarrow.gif" alt="<" title="<?php echo $getbuilds_langres["prevrev"]; ?>" onclick="prevRev();"> ' + + '<img src="images/leftarrow.gif" alt="<" title="<?php echo addslashes($getbuilds_langres["prevrev"]); ?>" onclick="prevRev();"> ' + '<input type="text" id="revnum" value="<?php echo $rev; ?>" size="12" onkeyup="checkRevNum(this);"> ' + - '<img src="images/rightarrow.gif" alt=">" title="<?php echo $getbuilds_langres["nextrev"]; ?>" onclick="nextRev();"><br>' + + '<img src="images/rightarrow.gif" alt=">" title="<?php echo addslashes($getbuilds_langres["nextrev"]); ?>" onclick="nextRev();"><br>' + '</span>' + - '<img src="images/info.gif" alt="INFO:"> <?php printf( $getbuilds_langres["rangeinfo"], $rev, ($rev - 50), $rev ); ?>' + + '<img src="images/info.gif" alt="INFO:"> <?php printf( addslashes($getbuilds_langres["rangeinfo"]), $rev, ($rev - 50), $rev ); ?>' + '</td>' + '</tr>' + '<tr>' + - '<td><?php echo $getbuilds_langres["isotype"]; ?>: </td>' + + '<td><?php echo addslashes($getbuilds_langres["isotype"]); ?>: </td>' + '<td>' + '<input type="checkbox" id="bootcd-dbg" checked="checked"> Debug Boot CDs ' + '<input type="checkbox" id="livecd-dbg" checked="checked"> Debug Live CDs ' + @@ -172,10 +172,10 @@ '</table>' + '<div id="controlbox">' + - '<input type="button" onclick="showRev();" value="<?php echo $getbuilds_langres["showrev"]; ?>" />' + + '<input type="button" onclick="showRev();" value="<?php echo addslashes($getbuilds_langres["showrev"]); ?>" />' + '<span id="ajaxloadinginfo">' + - '<img src="images/ajax_loading.gif"> <?php echo $getbuilds_langres["gettinglist"]; ?>...' + + '<img src="images/ajax_loading.gif"> <?php echo addslashes($getbuilds_langres["gettinglist"]); ?>...' + '</span>' + '</div>' + @@ -183,14 +183,14 @@ '<table class="datatable" cellspacing="0" cellpadding="1">' + '<thead>' + '<tr class="head">' + - '<th class="fname"><?php echo $getbuilds_langres["filename"]; ?></th>' + - '<th class="fsize"><?php echo $getbuilds_langres["filesize"]; ?></th>' + - '<th class="fdate"><?php echo $getbuilds_langres["filedate"]; ?></th>' + + '<th class="fname"><?php echo addslashes($getbuilds_langres["filename"]); ?></th>' + + '<th class="fsize"><?php echo addslashes($getbuilds_langres["filesize"]); ?></th>' + + '<th class="fdate"><?php echo addslashes($getbuilds_langres["filedate"]); ?></th>' + '</tr>' + '</thead>' + '<tbody>' + '<tr class="odd">' + - '<td><?php echo $getbuilds_langres["pleasewait"]; ?>...</td>' + + '<td><?php echo addslashes($getbuilds_langres["pleasewait"]); ?>...</td>' + '<td> </td>' + '<td> </td>' + '</tr>' + Modified:
trunk/web/reactos.org/htdocs/getbuilds/lang/fr.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/l…
============================================================================== ---
trunk/web/reactos.org/htdocs/getbuilds/lang/fr.inc.php
(original) +++
trunk/web/reactos.org/htdocs/getbuilds/lang/fr.inc.php
Sun Nov 11 18:56:58 2007 @@ -31,7 +31,7 @@ $getbuilds_langres["showrev"] = "Montrer"; $getbuilds_langres["gettinglist"] = "Récupération de la liste des fichiers"; $getbuilds_langres["rangeinfo"] = "Vous pouvez entrer un numéro de révision (p.e. %s) ou un intervalle de révisions (p.e. %s-%s)"; - $getbuilds_langres["isotype"] = "Montrer les types d\'images de CD "; + $getbuilds_langres["isotype"] = "Montrer les types d'images de CD "; $getbuilds_langres["foundfiles"] = "%s fichiers trouvés !"; @@ -48,8 +48,8 @@ $getbuilds_langres["filedate"] = "Derniers changements"; $getbuilds_langres["pleasewait"] = "Veuillez patienter"; - $getbuilds_langres["nofiles"] = "Il n\'y a pas de fichiers disponibles pour la révision %s !"; + $getbuilds_langres["nofiles"] = "Il n'y a pas de fichiers disponibles pour la révision %s !"; $getbuilds_langres["invalidrev"] = "Numéro de révision invalide !"; - $getbuilds_langres["rangelimitexceeded"] = "L\'intervalle de révisions ne peut contenir qu\'un maximum de %s révisions !"; + $getbuilds_langres["rangelimitexceeded"] = "L'intervalle de révisions ne peut contenir qu'un maximum de %s révisions !"; ?> Modified:
trunk/web/reactos.org/htdocs/getbuilds/lang/it.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/l…
============================================================================== ---
trunk/web/reactos.org/htdocs/getbuilds/lang/it.inc.php
(original) +++
trunk/web/reactos.org/htdocs/getbuilds/lang/it.inc.php
Sun Nov 11 18:56:58 2007 @@ -29,7 +29,7 @@ $getbuilds_langres["prevrev"] = "Revisione precedente"; $getbuilds_langres["nextrev"] = "Revisione successiva"; $getbuilds_langres["showrev"] = "Mostrare"; - $getbuilds_langres["gettinglist"] = "Ottentendo l\'elenco dei file"; + $getbuilds_langres["gettinglist"] = "Ottentendo l'elenco dei file"; $getbuilds_langres["rangeinfo"] = "Puoi inserire un numero di revisione (ad es. %s) oppure un range di revisioni (ad es. %s-%s)"; $getbuilds_langres["isotype"] = "Mostrare imagini cd"; @@ -41,7 +41,7 @@ $getbuilds_langres["page"] = "Pagina"; $getbuilds_langres["nextpage"] = "Successiva"; $getbuilds_langres["nextpage_title"] = "Pagina successiva"; - $getbuilds_langres["lastpage_title"] = "Andare all\'ultima pagina"; + $getbuilds_langres["lastpage_title"] = "Andare all'ultima pagina"; $getbuilds_langres["filename"] = "Nome file"; $getbuilds_langres["filesize"] = "Dimensioni"; Modified:
trunk/web/reactos.org/htdocs/getbuilds/languages.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/l…
============================================================================== ---
trunk/web/reactos.org/htdocs/getbuilds/languages.inc.php
(original) +++
trunk/web/reactos.org/htdocs/getbuilds/languages.inc.php
Sun Nov 11 18:56:58 2007 @@ -11,8 +11,8 @@ $getbuilds_languages = array( "en" => "English", "de" => "Deutsch (German)", + "es" => "Español (Spanish)", "fr" => "Français (French)", - "es" => "Español (Spanish)", "it" => "Italiano (Italian)", "lt" => "Lietuvių (Lithuanian)", );
17 years, 1 month
1
0
0
0
← Newer
1
...
53
54
55
56
57
58
59
...
89
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
Results per page:
10
25
50
100
200