ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2005
----- 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
26 participants
609 discussions
Start a n
N
ew thread
[ea] 14015: ea@reactos.com
by ea@svn.reactos.com
ea(a)reactos.com Make SmConnectApiPort more safe. Modified: trunk/reactos/lib/smdll/connect.c _____ Modified: trunk/reactos/lib/smdll/connect.c --- trunk/reactos/lib/smdll/connect.c 2005-03-13 16:44:15 UTC (rev 14014) +++ trunk/reactos/lib/smdll/connect.c 2005-03-13 17:00:19 UTC (rev 14015) @@ -61,9 +61,12 @@ } RtlZeroMemory (& ConnectData, sizeof ConnectData); ConnectData.Subsystem = dwSubsystem; - RtlCopyMemory (& ConnectData.SbName, - pSbApiPortName->Buffer, - pSbApiPortName->Length); + if (pSbApiPortName->Length > 0) + { + RtlCopyMemory (& ConnectData.SbName, + pSbApiPortName->Buffer, + pSbApiPortName->Length); + } } ConnectDataLength = sizeof ConnectData; @@ -73,7 +76,7 @@ SecurityQos.EffectiveOnly = TRUE; RtlInitUnicodeString (& SmApiPortName, SM_API_PORT_NAME); -DbgPrint("SMDLL: calling NtConnectPort\n"); + Status = NtConnectPort ( phSmApiPort, & SmApiPortName,
19 years, 9 months
1
0
0
0
[hbirr] 14014: Removed CloseInProcess from object header structure.
by hbirr@svn.reactos.com
Removed CloseInProcess from object header structure. Modified: trunk/reactos/ntoskrnl/include/internal/ob.h Modified: trunk/reactos/ntoskrnl/ob/object.c _____ Modified: trunk/reactos/ntoskrnl/include/internal/ob.h --- trunk/reactos/ntoskrnl/include/internal/ob.h 2005-03-13 16:41:05 UTC (rev 14013) +++ trunk/reactos/ntoskrnl/include/internal/ob.h 2005-03-13 16:44:15 UTC (rev 14014) @@ -157,7 +157,6 @@ LIST_ENTRY Entry; LONG RefCount; LONG HandleCount; - BOOLEAN CloseInProcess; BOOLEAN Permanent; BOOLEAN Inherit; struct _DIRECTORY_OBJECT* Parent; _____ Modified: trunk/reactos/ntoskrnl/ob/object.c --- trunk/reactos/ntoskrnl/ob/object.c 2005-03-13 16:41:05 UTC (rev 14013) +++ trunk/reactos/ntoskrnl/ob/object.c 2005-03-13 16:44:15 UTC (rev 14014) @@ -894,7 +894,7 @@ DPRINT("eip %x\n", ((PULONG)&Object)[-1]); } - if (Header->CloseInProcess) + if (Header->RefCount == 0 && !Header->Permanent) { if (Header->ObjectType == PsProcessType) { @@ -907,7 +907,10 @@ return(STATUS_UNSUCCESSFUL); } - InterlockedIncrement(&Header->RefCount); + if (1 == InterlockedIncrement(&Header->RefCount) && !Header->Permanent) + { + KEBUGCHECK(0); + } return(STATUS_SUCCESS); } @@ -1023,12 +1026,6 @@ KEBUGCHECK(0); } - if (ObjectHeader->CloseInProcess) - { - KEBUGCHECK(0); - return STATUS_UNSUCCESSFUL; - } - ObjectHeader->CloseInProcess = TRUE; switch (KeGetCurrentIrql ()) { @@ -1094,12 +1091,11 @@ Header = BODY_TO_HEADER(Object); /* No one should be referencing an object once we are deleting it. */ - if (Header->CloseInProcess) - { - KEBUGCHECK(0); - } + if (InterlockedIncrement(&Header->RefCount) == 1 && !Header->Permanent) + { + KEBUGCHECK(0); + } - InterlockedIncrement(&Header->RefCount); }
19 years, 9 months
1
0
0
0
[hbirr] 14013: Added two missing calls to KeLeaveCriticalRegion.
by hbirr@svn.reactos.com
Added two missing calls to KeLeaveCriticalRegion. Modified: trunk/reactos/ntoskrnl/ob/handle.c _____ Modified: trunk/reactos/ntoskrnl/ob/handle.c --- trunk/reactos/ntoskrnl/ob/handle.c 2005-03-13 15:43:02 UTC (rev 14012) +++ trunk/reactos/ntoskrnl/ob/handle.c 2005-03-13 16:41:05 UTC (rev 14013) @@ -169,6 +169,7 @@ ExSourceHandle); if (SourceHandleEntry == NULL) { + KeLeaveCriticalRegion(); return STATUS_INVALID_HANDLE; } @@ -506,7 +507,7 @@ return STATUS_SUCCESS; } - + KeLeaveCriticalRegion(); return STATUS_INVALID_HANDLE; }
19 years, 9 months
1
0
0
0
[mf] 14012: launch display properties dialog via desktop context menu
by mf@svn.reactos.com
launch display properties dialog via desktop context menu Modified: trunk/reactos/lib/shell32/shell32_main.h Modified: trunk/reactos/lib/shell32/shfldr_desktop.c Modified: trunk/reactos/lib/shell32/shlview.c Modified: trunk/reactos/lib/shell32/shv_bg_cmenu.c _____ Modified: trunk/reactos/lib/shell32/shell32_main.h --- trunk/reactos/lib/shell32/shell32_main.h 2005-03-13 15:30:29 UTC (rev 14011) +++ trunk/reactos/lib/shell32/shell32_main.h 2005-03-13 15:43:02 UTC (rev 14012) @@ -81,7 +81,7 @@ LPCLASSFACTORY IClassFactory_Constructor(REFCLSID); IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *aPidls, UINT uItemCount); -IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent); +IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop); LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER); HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); _____ Modified: trunk/reactos/lib/shell32/shfldr_desktop.c --- trunk/reactos/lib/shell32/shfldr_desktop.c 2005-03-13 15:30:29 UTC (rev 14011) +++ trunk/reactos/lib/shell32/shfldr_desktop.c 2005-03-13 15:43:02 UTC (rev 14012) @@ -473,32 +473,48 @@ if (ppvOut) { *ppvOut = NULL; - if (IsEqualIID (riid, &IID_IContextMenu)) { - pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl); - hr = S_OK; - } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { - pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl); - hr = S_OK; - } else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) { - pidl = ILCombine (This->pidlRoot, apidl[0]); - pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl); - SHFree (pidl); - hr = S_OK; - } else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) { - pidl = ILCombine (This->pidlRoot, apidl[0]); - pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl); - SHFree (pidl); - hr = S_OK; - } else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) { - hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj); - } else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA)) - && (cidl == 1)) { - pidl = ILCombine (This->pidlRoot, apidl[0]); - hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj); - SHFree (pidl); - } else { - hr = E_NOINTERFACE; - } + if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) + { + pObj = (LPUNKNOWN) IDataObject_Constructor( hwndOwner, + This->pidlRoot, apidl, cidl); + hr = S_OK; + } + else if ((IsEqualIID(riid,&IID_IShellLinkW) || + IsEqualIID(riid,&IID_IShellLinkA)) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj); + SHFree (pidl); + } + else if (IsEqualIID (riid, &IID_IContextMenu)) + { + if (cidl > 0) + pObj = (LPUNKNOWN) ISvItemCm_Constructor( (IShellFolder *) iface, This->pidlRoot, apidl, cidl); + else + pObj = (LPUNKNOWN) ISvBgCm_Constructor( (IShellFolder *) iface, TRUE); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl); + SHFree (pidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl); + SHFree (pidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) + { + hr = IShellFolder_QueryInterface (iface, + &IID_IDropTarget, (LPVOID *) & pObj); + } + else + hr = E_NOINTERFACE; if (SUCCEEDED(hr) && !pObj) hr = E_OUTOFMEMORY; _____ Modified: trunk/reactos/lib/shell32/shlview.c --- trunk/reactos/lib/shell32/shlview.c 2005-03-13 15:30:29 UTC (rev 14011) +++ trunk/reactos/lib/shell32/shlview.c 2005-03-13 15:43:02 UTC (rev 14012) @@ -988,7 +988,7 @@ { hMenu = CreatePopupMenu(); - pCM = ISvBgCm_Constructor(This->pSFParent); + pCM = ISvBgCm_Constructor(This->pSFParent, FALSE); IContextMenu2_QueryContextMenu(pCM, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, 0); uCommand = TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL); @@ -1977,7 +1977,7 @@ switch(uItem) { case SVGIO_BACKGROUND: - *ppvOut = ISvBgCm_Constructor(This->pSFParent); + *ppvOut = ISvBgCm_Constructor(This->pSFParent, FALSE); break; case SVGIO_SELECTION: _____ Modified: trunk/reactos/lib/shell32/shv_bg_cmenu.c --- trunk/reactos/lib/shell32/shv_bg_cmenu.c 2005-03-13 15:30:29 UTC (rev 14011) +++ trunk/reactos/lib/shell32/shv_bg_cmenu.c 2005-03-13 15:43:02 UTC (rev 14012) @@ -46,6 +46,7 @@ IContextMenu2Vtbl *lpVtbl; IShellFolder* pSFParent; DWORD ref; + BOOL bDesktop; } BgCmImpl; @@ -54,7 +55,7 @@ /*********************************************************************** *** * ISVBgCm_Constructor() */ -IContextMenu2 *ISvBgCm_Constructor(IShellFolder* pSFParent) +IContextMenu2 *ISvBgCm_Constructor(IShellFolder* pSFParent, BOOL bDesktop) { BgCmImpl* cm; @@ -62,6 +63,7 @@ cm->lpVtbl = &cmvt; cm->ref = 1; cm->pSFParent = pSFParent; + cm->bDesktop = bDesktop; if(pSFParent) IShellFolder_AddRef(pSFParent); TRACE("(%p)->()\n",cm); @@ -362,12 +364,22 @@ case FCIDM_SHVIEW_NEWFOLDER: DoNewFolder(iface, lpSV); break; + case FCIDM_SHVIEW_INSERT: DoPaste(iface); break; + + case FCIDM_SHVIEW_PROPERTIES: + if (This->bDesktop) { + ShellExecuteA(lpcmi->hwnd, "open", "rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL); + } else { + FIXME("launch item properties dialog\n"); + } + break; + default: /* if it's a id just pass it to the parent shv */ - SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0),0 ); + if (hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0),0 ); break; } }
19 years, 9 months
1
0
0
0
[mf] 14011: remove temporary desktop context menu code from explorer
by mf@svn.reactos.com
remove temporary desktop context menu code from explorer Modified: trunk/reactos/subsys/system/explorer/desktop/desktop.cpp Modified: trunk/reactos/subsys/system/explorer/explorer_intres.h Modified: trunk/reactos/subsys/system/explorer/explorer_intres.rc _____ Modified: trunk/reactos/subsys/system/explorer/desktop/desktop.cpp --- trunk/reactos/subsys/system/explorer/desktop/desktop.cpp 2005-03-13 15:29:53 UTC (rev 14010) +++ trunk/reactos/subsys/system/explorer/desktop/desktop.cpp 2005-03-13 15:30:29 UTC (rev 14011) @@ -526,7 +526,7 @@ { switch(nmsg) { case WM_CONTEXTMENU: - if (!DoContextMenu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam), _cm_ifs)) + if (!DoContextMenu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam))) DoDesktopContextMenu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)); break; @@ -558,7 +558,7 @@ return super::Notify(id, pnmh); } -bool DesktopShellView::DoContextMenu(int x, int y, CtxMenuInterfaces& cm_ifs) +bool DesktopShellView::DoContextMenu(int x, int y) { IDataObject* selection; @@ -588,7 +588,7 @@ for(int i=pida->cidl; i>0; --i) apidl[i-1] = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i]); - hr = ShellFolderContextMenu(ShellFolder(parent_pidl), _hwnd, pida->cidl, apidl, x, y, cm_ifs); + hr = ShellFolderContextMenu(ShellFolder(parent_pidl), _hwnd, pida->cidl, apidl, x, y, _cm_ifs); selection->Release(); @@ -612,7 +612,6 @@ hr = pcm->QueryContextMenu(hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST-1, CMF_NORMAL|CMF_EXPLORE); if (SUCCEEDED(hr)) { - AppendMenu(hmenu, 0, FCIDM_SHVIEWLAST-3, ResString(IDS_PROPERTIES_EXPLORER)); AppendMenu(hmenu, MF_SEPARATOR, 0, NULL); AppendMenu(hmenu, 0, FCIDM_SHVIEWLAST-1, ResString(IDS_ABOUT_EXPLORER)); @@ -620,24 +619,6 @@ _cm_ifs.reset(); - if (idCmd == FCIDM_SHVIEWLAST-3) { - ShellExecute (_hwnd, _T("open"), _T("c:\\reactos\\system32\\rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0"), NULL, NULL, SW_SHOWNORMAL); - - - //explorer_about(_hwnd); - //system("c:\\reactos\\system32\\cmd.exe"); - - //ShellExecute (_hwnd, _T("open"), _T("%SystemRoot%\\system32\\cmd.exe"), NULL, NULL, SW_SHOWNORMAL); - - //ShellExecute(NULL,"open","c:\\windows\\system32\\cmd.exe",NULL,NULL,SW _SHOWNORMAL); - //WCHAR* pFile="%SystemRoot%\system32\cmd.exe"; - //int rcode; - //TCHAR pFile[256]; - //strcopy("%SystemRoot%\\system32\\cmd.exe",pFile); - //ShellExecute(NULL, NULL, pFile, NULL, "C:\\", SW_SHOW); - //HINSTANCE rcode=ShellExecute(NULL, "open", pFile, NULL, "C:\\", SW_SHOW); - //ShellExecute(hwnd, __TEXT("open"), __TEXT("%SystemRoot%\system32\cmd.exe"), __TEXT("c:\"), SH_SHOW); - } if (idCmd == FCIDM_SHVIEWLAST-1) { explorer_about(_hwnd); } else if (idCmd) { _____ Modified: trunk/reactos/subsys/system/explorer/explorer_intres.h --- trunk/reactos/subsys/system/explorer/explorer_intres.h 2005-03-13 15:29:53 UTC (rev 14010) +++ trunk/reactos/subsys/system/explorer/explorer_intres.h 2005-03-13 15:30:29 UTC (rev 14011) @@ -46,7 +46,6 @@ #define IDS_NOTIFY_AUTOHIDE 42 #define IDS_SHOW_HIDDEN_ICONS 43 #define IDS_HIDE_ICONS 44 -#define IDS_PROPERTIES_EXPLORER 45 #define IDI_REACTOS 100 #define IDI_EXPLORER 101 #define IDI_STARTMENU 102 _____ Modified: trunk/reactos/subsys/system/explorer/explorer_intres.rc --- trunk/reactos/subsys/system/explorer/explorer_intres.rc 2005-03-13 15:29:53 UTC (rev 14010) +++ trunk/reactos/subsys/system/explorer/explorer_intres.rc 2005-03-13 15:30:29 UTC (rev 14011) @@ -1103,7 +1103,6 @@ IDS_ALL_USERS "All Users\\" IDS_SEARCH "Search" IDS_ABOUT_EXPLORER "&About Explorer..." - IDS_PROPERTIES_EXPLORER "&Properties" IDS_LAUNCH_MANY_PROGRAMS "You have selected more than one program.\nAre you sure you want to launch all of them?" IDS_DESKTOPBAR_SETTINGS "Desktop Settings"
19 years, 9 months
1
0
0
0
[mf] 14010: a little context menu code cleanup
by mf@svn.reactos.com
a little context menu code cleanup Modified: trunk/reactos/subsys/system/explorer/desktop/desktop.h _____ Modified: trunk/reactos/subsys/system/explorer/desktop/desktop.h --- trunk/reactos/subsys/system/explorer/desktop/desktop.h 2005-03-13 14:49:59 UTC (rev 14009) +++ trunk/reactos/subsys/system/explorer/desktop/desktop.h 2005-03-13 15:29:53 UTC (rev 14010) @@ -180,7 +180,7 @@ int Command(int id, int code); int Notify(int id, NMHDR* pnmh); - bool DoContextMenu(int x, int y, CtxMenuInterfaces& cm_ifs); + bool DoContextMenu(int x, int y); HRESULT DoDesktopContextMenu(int x, int y); void PositionIcons(int dir=1);
19 years, 9 months
1
0
0
0
[ekohl] 14009: Fix gcc warnings in generated client stub.
by ekohl@svn.reactos.com
Fix gcc warnings in generated client stub. Modified: trunk/reactos/tools/widl/ChangeLog Modified: trunk/reactos/tools/widl/client.c _____ Modified: trunk/reactos/tools/widl/ChangeLog --- trunk/reactos/tools/widl/ChangeLog 2005-03-13 14:29:09 UTC (rev 14008) +++ trunk/reactos/tools/widl/ChangeLog 2005-03-13 14:49:59 UTC (rev 14009) @@ -1,8 +1,15 @@ ChangeLog -2005-03-12 ekohl +2005-03-13 ekohl tools/widl/client.c + +Fix gcc warnings in generated client stub. + + +2005-03-13 ekohl + + tools/widl/client.c tools/widl/server.c Implement [string] attribute for pointers to char and wchar_t. _____ Modified: trunk/reactos/tools/widl/client.c --- trunk/reactos/tools/widl/client.c 2005-03-13 14:29:09 UTC (rev 14008) +++ trunk/reactos/tools/widl/client.c 2005-03-13 14:49:59 UTC (rev 14009) @@ -273,6 +273,8 @@ { size = 12; alignment = 0; + if (last_size != -1) + fprintf(client, " +"); fprintf(client, " %dU", (size == 0) ? 0 : size + alignment); nothing_printed = 0; } @@ -880,8 +882,11 @@ static void write_bindinghandledecl(type_t *iface) { - print_client("static RPC_BINDING_HANDLE %s__MIDL_AutoBindHandle;\n", iface->name); - fprintf(client, "\n"); + if (!get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE)) + { + print_client("static RPC_BINDING_HANDLE %s__MIDL_AutoBindHandle;\n", iface->name); + fprintf(client, "\n"); + } } @@ -903,9 +908,9 @@ print_client("MIDL_user_allocate,\n"); print_client("MIDL_user_free,\n"); if (implicit_handle) - print_client("&%s,\n", implicit_handle); + print_client("{&%s},\n", implicit_handle); else - print_client("&%s__MIDL_AutoBindHandle,\n", iface->name); + print_client("{&%s__MIDL_AutoBindHandle},\n", iface->name); print_client("0,\n"); print_client("0,\n"); print_client("0,\n");
19 years, 9 months
1
0
0
0
[weiden] 14008: revert changes to the config file. I accidently committed it, sorry.
by weiden@svn.reactos.com
revert changes to the config file. I accidently committed it, sorry. Modified: trunk/reactos/config _____ Modified: trunk/reactos/config --- trunk/reactos/config 2005-03-13 14:21:47 UTC (rev 14007) +++ trunk/reactos/config 2005-03-13 14:29:09 UTC (rev 14008) @@ -15,22 +15,22 @@ # be optimized for. # -OARCH := i586 +OARCH := i486 # # Whether to compile in the kernel debugger # -KDBG := 1 +KDBG := 0 # # Whether to compile for debugging # -DBG := 1 +DBG := 0 # # Whether to compile with optimizations # -OPTIMIZED := 1 +OPTIMIZED := 0 # # Whether to compile a multiprocessor or single processor version
19 years, 9 months
1
0
0
0
[weiden] 14007: - fixed handle table structures
by weiden@svn.reactos.com
- fixed handle table structures - implement generic executive handle tables (since there don't exist documents that describe the parameters of most of these functions (which are kernel internal only), i made them up as required) - adjusted OB's handle manager to use ex handle tables - adjusted the client id manager to use ex handle tables Modified: trunk/reactos/config Modified: trunk/reactos/include/ddk/kefuncs.h Modified: trunk/reactos/include/ntos/obtypes.h Modified: trunk/reactos/ntoskrnl/Makefile Added: trunk/reactos/ntoskrnl/ex/handle.c Modified: trunk/reactos/ntoskrnl/ex/init.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ex/work.c Modified: trunk/reactos/ntoskrnl/include/internal/ex.h Modified: trunk/reactos/ntoskrnl/include/internal/ob.h Modified: trunk/reactos/ntoskrnl/include/internal/ps.h Modified: trunk/reactos/ntoskrnl/io/iomgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c Modified: trunk/reactos/ntoskrnl/lpc/close.c Modified: trunk/reactos/ntoskrnl/ob/handle.c Modified: trunk/reactos/ntoskrnl/ob/object.c Modified: trunk/reactos/ntoskrnl/ps/cid.c Modified: trunk/reactos/ntoskrnl/ps/create.c Modified: trunk/reactos/ntoskrnl/ps/idle.c Modified: trunk/reactos/ntoskrnl/ps/kill.c Modified: trunk/reactos/ntoskrnl/ps/process.c Modified: trunk/reactos/ntoskrnl/ps/psmgr.c Modified: trunk/reactos/ntoskrnl/ps/thread.c Modified: trunk/reactos/subsys/win32k/misc/object.c _____ Modified: trunk/reactos/config --- trunk/reactos/config 2005-03-13 13:59:06 UTC (rev 14006) +++ trunk/reactos/config 2005-03-13 14:21:47 UTC (rev 14007) @@ -15,22 +15,22 @@ # be optimized for. # -OARCH := i486 +OARCH := i586 # # Whether to compile in the kernel debugger # -KDBG := 0 +KDBG := 1 # # Whether to compile for debugging # -DBG := 0 +DBG := 1 # # Whether to compile with optimizations # -OPTIMIZED := 0 +OPTIMIZED := 1 # # Whether to compile a multiprocessor or single processor version _____ Modified: trunk/reactos/include/ddk/kefuncs.h --- trunk/reactos/include/ddk/kefuncs.h 2005-03-13 13:59:06 UTC (rev 14006) +++ trunk/reactos/include/ddk/kefuncs.h 2005-03-13 14:21:47 UTC (rev 14007) @@ -42,6 +42,15 @@ #ifndef __USE_W32API +static __inline +VOID +KeMemoryBarrier( + VOID) +{ + volatile LONG Barrier; + __asm__ __volatile__ ("xchg %%eax, %0" : : "m" (Barrier) : "%eax"); +} + VOID STDCALL KeAcquireSpinLockAtDpcLevel (IN PKSPIN_LOCK SpinLock); #define KefAcquireSpinLockAtDpcLevel KeAcquireSpinLockAtDpcLevel _____ Modified: trunk/reactos/include/ntos/obtypes.h --- trunk/reactos/include/ntos/obtypes.h 2005-03-13 13:59:06 UTC (rev 14006) +++ trunk/reactos/include/ntos/obtypes.h 2005-03-13 14:21:47 UTC (rev 14007) @@ -87,18 +87,42 @@ PVOID SecurityQualityOfService; } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; +typedef struct _HANDLE_TABLE_ENTRY_INFO { + ULONG AuditMask; +} HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO; + +typedef struct _HANDLE_TABLE_ENTRY { + union { + PVOID Object; + ULONG_PTR ObAttributes; + PHANDLE_TABLE_ENTRY_INFO InfoTable; + ULONG_PTR Value; + } u1; + union { + ULONG GrantedAccess; + USHORT GrantedAccessIndex; + LONG NextFreeTableEntry; + } u2; +} HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY; + #endif /* __USE_W32API */ typedef struct _HANDLE_TABLE { - LIST_ENTRY ListHead; - KSPIN_LOCK ListLock; -} HANDLE_TABLE; + ULONG Flags; + LONG HandleCount; + PHANDLE_TABLE_ENTRY **Table; + PEPROCESS QuotaProcess; + HANDLE UniqueProcessId; + LONG FirstFreeTableEntry; + LONG NextIndexNeedingPool; + ERESOURCE HandleTableLock; + LIST_ENTRY HandleTableList; + KEVENT HandleContentionEvent; +} HANDLE_TABLE, *PHANDLE_TABLE; #ifndef __USE_W32API -typedef struct _HANDLE_TABLE *PHANDLE_TABLE; - /* * FIXME: These will eventually become centerfold in the compliant Ob Manager * For now, they are only here so Device Map is properly defined before the header _____ Modified: trunk/reactos/ntoskrnl/Makefile --- trunk/reactos/ntoskrnl/Makefile 2005-03-13 13:59:06 UTC (rev 14006) +++ trunk/reactos/ntoskrnl/Makefile 2005-03-13 14:21:47 UTC (rev 14007) @@ -239,6 +239,7 @@ ex/event.o \ ex/evtpair.o \ ex/fmutex.o \ + ex/handle.o \ ex/hashtab.o \ ex/init.o \ ex/interlck.o \ _____ Added: trunk/reactos/ntoskrnl/ex/handle.c --- trunk/reactos/ntoskrnl/ex/handle.c 2005-03-13 13:59:06 UTC (rev 14006) +++ trunk/reactos/ntoskrnl/ex/handle.c 2005-03-13 14:21:47 UTC (rev 14007) @@ -0,0 +1,949 @@ +/* $Id:$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/ex/handle.c + * PURPOSE: Generic Executive Handle Tables + * + * PROGRAMMERS: Thomas Weidenmueller <w3seek(a)reactos.com> + * + * TODO: + * + * - the last entry of a subhandle list should be reserved for auditing + * + * ExSweepHandleTable (???) + * ExReferenceHandleDebugInfo + * ExSnapShotHandleTables + * ExpMoveFreeHandles (???) + */ + +/* INCLUDES *****************************************************************/ + +#include <ntoskrnl.h> + +#define NDEBUG +#include <internal/debug.h> + +static LIST_ENTRY ExpHandleTableHead; +static FAST_MUTEX ExpHandleTableListLock; +static LARGE_INTEGER ExpHandleShortWait; + +#define ExAcquireHandleTableListLock() \ + ExAcquireFastMutexUnsafe(&ExpHandleTableListLock) + +#define ExReleaseHandleTableListLock() \ + ExReleaseFastMutexUnsafe(&ExpHandleTableListLock) + +#define ExAcquireHandleTableLockExclusive(HandleTable) \ + ExAcquireResourceExclusiveLite(&(HandleTable)->HandleTableLock, TRUE) + +#define ExAcquireHandleTableLockShared(HandleTable) \ + ExAcquireResourceSharedLite(&(HandleTable)->HandleTableLock, TRUE) + +#define ExReleaseHandleTableLock(HandleTable) \ + ExReleaseResourceLite(&(HandleTable)->HandleTableLock) + +/* + 5 bits: reserved + 8 bits: top level index + 10 bits: middle level index + 9 bits: sub handle index +*/ +#define N_TLI_BITS 8 /* top level index */ +#define N_MLI_BITS 10 /* middle level index */ +#define N_EI_BITS 9 /* sub handle index */ +#define TLI_OFFSET (N_MLI_BITS + N_EI_BITS) +#define MLI_OFFSET N_EI_BITS +#define EI_OFFSET 0 + +#define N_TOPLEVEL_POINTERS (1 << N_TLI_BITS) +#define N_MIDDLELEVEL_POINTERS (1 << N_MLI_BITS) +#define N_SUBHANDLE_ENTRIES (1 << N_EI_BITS) +#define EX_MAX_HANDLES (N_TOPLEVEL_POINTERS * N_MIDDLELEVEL_POINTERS * N_SUBHANDLE_ENTRIES) + +#define VALID_HANDLE_MASK (((N_TOPLEVEL_POINTERS - 1) << TLI_OFFSET) | \ + ((N_MIDDLELEVEL_POINTERS - 1) << MLI_OFFSET) | ((N_SUBHANDLE_ENTRIES - 1) << EI_OFFSET)) +#define TLI_FROM_HANDLE(index) (ULONG)(((index) >> TLI_OFFSET) & (N_TOPLEVEL_POINTERS - 1)) +#define MLI_FROM_HANDLE(index) (ULONG)(((index) >> MLI_OFFSET) & (N_MIDDLELEVEL_POINTERS - 1)) +#define ELI_FROM_HANDLE(index) (ULONG)(((index) >> EI_OFFSET) & (N_SUBHANDLE_ENTRIES - 1)) + +#define N_MAX_HANDLE (N_TOPLEVEL_POINTERS * N_MIDDLELEVEL_POINTERS * N_SUBHANDLE_ENTRIES) + +#define BUILD_HANDLE(tli, mli, eli) ((((tli) & (N_TOPLEVEL_POINTERS - 1)) << TLI_OFFSET) | \ + (((mli) & (N_MIDDLELEVEL_POINTERS - 1)) << MLI_OFFSET) | (((eli) & (N_SUBHANDLE_ENTRIES - 1)) << EI_OFFSET)) + +#define IS_INVALID_EX_HANDLE(index) \ + (((index) & ~VALID_HANDLE_MASK) != 0) +#define IS_VALID_EX_HANDLE(index) \ + (((index) & ~VALID_HANDLE_MASK) == 0) + +/********************************************************************** ********/ + +VOID +ExpInitializeHandleTables(VOID) +{ + ExpHandleShortWait.QuadPart = -50000; + InitializeListHead(&ExpHandleTableHead); + ExInitializeFastMutex(&ExpHandleTableListLock); +} + +PHANDLE_TABLE +ExCreateHandleTable(IN PEPROCESS QuotaProcess OPTIONAL) +{ + PHANDLE_TABLE HandleTable; + + PAGED_CODE(); + + if(QuotaProcess != NULL) + { + /* FIXME - Charge process quota before allocating the handle table! */ + } + + /* allocate enough memory for the handle table and the lowest level */ + HandleTable = ExAllocatePoolWithTag(NonPagedPool, + sizeof(HANDLE_TABLE) + (N_TOPLEVEL_POINTERS * sizeof(PHANDLE_TABLE_ENTRY*)), + TAG('E', 'x', 'H', 't')); + if(HandleTable != NULL) + { + /* initialize the handle table */ + HandleTable->Flags = 0; + HandleTable->HandleCount = 0; + HandleTable->Table = (PHANDLE_TABLE_ENTRY**)(HandleTable + 1); + HandleTable->QuotaProcess = QuotaProcess; + HandleTable->FirstFreeTableEntry = -1; /* no entries freed so far */ + HandleTable->NextIndexNeedingPool = 0; /* no entries freed so far, so we have to allocate already for the first handle */ + HandleTable->UniqueProcessId = (QuotaProcess ? QuotaProcess->UniqueProcessId : PsGetCurrentProcessId()); + + ExInitializeResource(&HandleTable->HandleTableLock); + + KeInitializeEvent(&HandleTable->HandleContentionEvent, + NotificationEvent, + FALSE); + + RtlZeroMemory(HandleTable->Table, N_TOPLEVEL_POINTERS * sizeof(PHANDLE_TABLE_ENTRY*)); + + /* during bootup KeGetCurrentThread() might be NULL, needs to be fixed... */ + if(KeGetCurrentThread() != NULL) + { + /* insert it into the global handle table list */ + KeEnterCriticalRegion(); + + ExAcquireHandleTableListLock(); + InsertTailList(&ExpHandleTableHead, + &HandleTable->HandleTableList); + ExReleaseHandleTableListLock(); + + KeLeaveCriticalRegion(); + } + else + { + InsertTailList(&ExpHandleTableHead, + &HandleTable->HandleTableList); + } + } + else + { + /* FIXME - return the quota to the process */ + } + + return HandleTable; +} + +static BOOLEAN +ExLockHandleTableEntryNoDestructionCheck(IN PHANDLE_TABLE HandleTable, + IN PHANDLE_TABLE_ENTRY Entry) +{ + ULONG_PTR Current, New; + + PAGED_CODE(); + + DPRINT("Entering handle table entry 0x%x lock...\n", Entry); + + ASSERT(HandleTable); + ASSERT(Entry); + + for(;;) + { + Current = (volatile ULONG_PTR)Entry->u1.Object; + + if(!Current) + { + DPRINT("Attempted to lock empty handle table entry 0x%x or handle table shut down\n", Entry); + break; + } + + if(!(Current & EX_HANDLE_ENTRY_LOCKED)) + { + New = Current | EX_HANDLE_ENTRY_LOCKED; + if(InterlockedCompareExchangePointer(&Entry->u1.Object, + (PVOID)New, + (PVOID)Current) == (PVOID)Current) + { + DPRINT("SUCCESS handle table 0x%x entry 0x%x lock\n", HandleTable, Entry); + /* we acquired the lock */ + return TRUE; + } + } + + /* wait about 5ms at maximum so we don't wait forever in unfortunate + co-incidences where releasing the lock in another thread happens right + before we're waiting on the contention event to get pulsed, which might + never happen again... */ + KeWaitForSingleObject(&HandleTable->HandleContentionEvent, + Executive, + KernelMode, + FALSE, + &ExpHandleShortWait); + } + + return FALSE; +} + +VOID +ExDestroyHandleTable(IN PHANDLE_TABLE HandleTable, + IN PEX_DESTROY_HANDLE_CALLBACK DestroyHandleCallback OPTIONAL, + IN PVOID Context OPTIONAL) +{ + PHANDLE_TABLE_ENTRY **tlp, **lasttlp, *mlp, *lastmlp; + PEPROCESS QuotaProcess; + + PAGED_CODE(); + + ASSERT(HandleTable); + + KeEnterCriticalRegion(); + + /* ensure there's no other operations going by acquiring an exclusive lock */ + ExAcquireHandleTableLockExclusive(HandleTable); + + ASSERT(!(HandleTable->Flags & EX_HANDLE_TABLE_CLOSING)); + + HandleTable->Flags |= EX_HANDLE_TABLE_CLOSING; + + KePulseEvent(&HandleTable->HandleContentionEvent, + EVENT_INCREMENT, + FALSE); + + /* remove the handle table from the global handle table list */ + ExAcquireHandleTableListLock(); + RemoveEntryList(&HandleTable->HandleTableList); + ExReleaseHandleTableListLock(); + + /* call the callback function to cleanup the objects associated with the + handle table */ + if(DestroyHandleCallback != NULL) + { + for(tlp = HandleTable->Table, lasttlp = HandleTable->Table + N_TOPLEVEL_POINTERS; + tlp != lasttlp; + tlp++) + { + if((*tlp) != NULL) + { + for(mlp = *tlp, lastmlp = (*tlp) + N_MIDDLELEVEL_POINTERS; + mlp != lastmlp; + mlp++) + { + if((*mlp) != NULL) + { + PHANDLE_TABLE_ENTRY curee, laste; + + for(curee = *mlp, laste = *mlp + N_SUBHANDLE_ENTRIES; + curee != laste; + curee++) + { + if(curee->u1.Object != NULL && ExLockHandleTableEntryNoDestructionCheck(HandleTable, curee)) + { + DestroyHandleCallback(HandleTable, curee->u1.Object, curee->u2.GrantedAccess, Context); + ExUnlockHandleTableEntry(HandleTable, curee); + } + } + } + } + } + } + } + + QuotaProcess = HandleTable->QuotaProcess; + + /* free the tables */ + for(tlp = HandleTable->Table, lasttlp = HandleTable->Table + N_TOPLEVEL_POINTERS; + tlp != lasttlp; + tlp++) + { + if((*tlp) != NULL) + { + for(mlp = *tlp, lastmlp = (*tlp) + N_MIDDLELEVEL_POINTERS; + mlp != lastmlp; + mlp++) + { + if((*mlp) != NULL) + { + ExFreePool(*mlp); + + if(QuotaProcess != NULL) + { + /* FIXME - return the quota to the process */ + } + } + } + + ExFreePool(*tlp); + + if(QuotaProcess != NULL) + { + /* FIXME - return the quota to the process */ + } + } + } + + ExReleaseHandleTableLock(HandleTable); + + KeLeaveCriticalRegion(); + + /* free the handle table */ + ExDeleteResource(&HandleTable->HandleTableLock); + ExFreePool(HandleTable); + + if(QuotaProcess != NULL) + { + /* FIXME - return the quota to the process */ + } +} + +PHANDLE_TABLE +ExDupHandleTable(IN PEPROCESS QuotaProcess OPTIONAL, + IN PEX_DUPLICATE_HANDLE_CALLBACK DuplicateHandleCallback OPTIONAL, + IN PVOID Context OPTIONAL, + IN PHANDLE_TABLE SourceHandleTable) +{ + PHANDLE_TABLE HandleTable; + + PAGED_CODE(); + + ASSERT(SourceHandleTable); + + HandleTable = ExCreateHandleTable(QuotaProcess); + if(HandleTable != NULL) + { + PHANDLE_TABLE_ENTRY **tlp, **srctlp, **etlp, *mlp, *srcmlp, *emlp, stbl, srcstbl, estbl; + LONG tli, mli, eli; + + tli = mli = eli = 0; + + /* make sure the other handle table isn't being changed during the duplication */ + ExAcquireHandleTableLockShared(SourceHandleTable); + + /* allocate enough tables */ + etlp = SourceHandleTable->Table + N_TOPLEVEL_POINTERS; + for(srctlp = SourceHandleTable->Table, tlp = HandleTable->Table; + srctlp != etlp; + srctlp++, tlp++) + { + if(*srctlp != NULL) + { + /* allocate middle level entry tables */ + if(QuotaProcess != NULL) + { + /* FIXME - Charge process quota before allocating the handle table! */ + } + + *tlp = ExAllocatePoolWithTag(PagedPool, + N_MIDDLELEVEL_POINTERS * sizeof(PHANDLE_TABLE_ENTRY), + TAG('E', 'x', 'H', 't')); + if(*tlp != NULL) + { + RtlZeroMemory(*tlp, N_MIDDLELEVEL_POINTERS * sizeof(PHANDLE_TABLE_ENTRY)); + + KeMemoryBarrier(); + + emlp = *srctlp + N_MIDDLELEVEL_POINTERS; + for(srcmlp = *srctlp, mlp = *tlp; + srcmlp != emlp; + srcmlp++, mlp++) + { + if(*srcmlp != NULL) + { + /* allocate subhandle tables */ + if(QuotaProcess != NULL) + { + /* FIXME - Charge process quota before allocating the handle table! */ + } + + *mlp = ExAllocatePoolWithTag(PagedPool, + N_SUBHANDLE_ENTRIES * sizeof(HANDLE_TABLE_ENTRY), + TAG('E', 'x', 'H', 't')); + if(*mlp != NULL) + { + RtlZeroMemory(*mlp, N_SUBHANDLE_ENTRIES * sizeof(HANDLE_TABLE_ENTRY)); + } + else + { + goto freehandletable; + } + } + else + { + *mlp = NULL; + } + } + } + else + { +freehandletable: + DPRINT1("Failed to duplicate handle table 0x%x\n", SourceHandleTable); + + ExReleaseHandleTableLock(SourceHandleTable); + + ExDestroyHandleTable(HandleTable, + NULL, + NULL); + /* allocate an empty handle table */ + return ExCreateHandleTable(QuotaProcess); + } + } + } + + /* duplicate the handles */ + HandleTable->HandleCount = SourceHandleTable->HandleCount; + HandleTable->FirstFreeTableEntry = SourceHandleTable->FirstFreeTableEntry; + HandleTable->NextIndexNeedingPool = SourceHandleTable->NextIndexNeedingPool; + + /* make sure all tables are zeroed */ + KeMemoryBarrier(); + + etlp = SourceHandleTable->Table + N_TOPLEVEL_POINTERS; + for(srctlp = SourceHandleTable->Table, tlp = HandleTable->Table; + srctlp != etlp; + srctlp++, tlp++, tli++) + { + if(*srctlp != NULL) + { + ASSERT(*tlp != NULL); + + emlp = *srctlp + N_MIDDLELEVEL_POINTERS; + for(srcmlp = *srctlp, mlp = *tlp; + srcmlp != emlp; + srcmlp++, mlp++, mli++) + { + if(*srcmlp != NULL) + { + ASSERT(*mlp != NULL); + + /* walk all handle entries and duplicate them if wanted */ + estbl = *srcmlp + N_SUBHANDLE_ENTRIES; + for(srcstbl = *srcmlp, stbl = *mlp; + srcstbl != estbl; + srcstbl++, stbl++, eli++) + { + /* try to duplicate the source handle */ + if(srcstbl->u1.Object != NULL && + ExLockHandleTableEntry(SourceHandleTable, + srcstbl)) + { + /* ask the caller if this handle should be duplicated */ + if(DuplicateHandleCallback != NULL && + !DuplicateHandleCallback(HandleTable, + srcstbl, + Context)) + { + /* free the entry and chain it into the free list */ + HandleTable->HandleCount--; + stbl->u1.Object = NULL; + stbl->u2.NextFreeTableEntry = HandleTable->FirstFreeTableEntry; + HandleTable->FirstFreeTableEntry = BUILD_HANDLE(tli, mli, eli); + } + else + { + /* duplicate the handle and unlock it */ + stbl->u2.GrantedAccess = srcstbl->u2.GrantedAccess; + stbl->u1.ObAttributes = srcstbl->u1.ObAttributes & ~EX_HANDLE_ENTRY_LOCKED; + } + ExUnlockHandleTableEntry(SourceHandleTable, + srcstbl); + } + else + { + /* this is a free handle table entry, copy over the entire + structure as-is */ + *stbl = *srcstbl; + } + } + } + } + } + } + + /* release the source handle table */ + ExReleaseHandleTableLock(SourceHandleTable); + } + + return HandleTable; +} + +static PHANDLE_TABLE_ENTRY +ExpAllocateHandleTableEntry(IN PHANDLE_TABLE HandleTable, + OUT PLONG Handle) +{ + PHANDLE_TABLE_ENTRY Entry = NULL; + + PAGED_CODE(); + + ASSERT(HandleTable); + ASSERT(Handle); + ASSERT(KeGetCurrentThread() != NULL); + + DPRINT("HT[0x%x]: HandleCount: %d\n", HandleTable, HandleTable->HandleCount); + + if(HandleTable->HandleCount < EX_MAX_HANDLES) + { + ULONG tli, mli, eli; + + if(HandleTable->FirstFreeTableEntry != -1) + { + /* there's a free handle entry we can just grab and use */ + tli = TLI_FROM_HANDLE(HandleTable->FirstFreeTableEntry); + mli = MLI_FROM_HANDLE(HandleTable->FirstFreeTableEntry); + eli = ELI_FROM_HANDLE(HandleTable->FirstFreeTableEntry); + + /* the pointer should be valid in any way!!! */ + ASSERT(HandleTable->Table[tli]); + ASSERT(HandleTable->Table[tli][mli]); + + Entry = &HandleTable->Table[tli][mli][eli]; + + *Handle = HandleTable->FirstFreeTableEntry; + + /* save the index to the next free handle (if available) */ + HandleTable->FirstFreeTableEntry = Entry->u2.NextFreeTableEntry; + Entry->u2.NextFreeTableEntry = 0; + Entry->u1.Object = NULL; + + HandleTable->HandleCount++; + } + else + { + /* we need to allocate a new subhandle table first */ + PHANDLE_TABLE_ENTRY cure, laste, ntbl, *nmtbl; + ULONG i; + BOOLEAN AllocatedMtbl; + + ASSERT(HandleTable->NextIndexNeedingPool <= N_MAX_HANDLE); + + /* the index of the next table to be allocated was saved in + NextIndexNeedingPool the last time a handle entry was allocated and + the subhandle entry list was full. the subhandle entry index of + NextIndexNeedingPool should be 0 here! */ + tli = TLI_FROM_HANDLE(HandleTable->NextIndexNeedingPool); + mli = MLI_FROM_HANDLE(HandleTable->NextIndexNeedingPool); + DPRINT("HandleTable->NextIndexNeedingPool: 0x%x\n", HandleTable->NextIndexNeedingPool); + DPRINT("tli: 0x%x mli: 0x%x eli: 0x%x\n", tli, mli, ELI_FROM_HANDLE(HandleTable->NextIndexNeedingPool)); + + ASSERT(ELI_FROM_HANDLE(HandleTable->NextIndexNeedingPool) == 0); + + DPRINT("HandleTable->Table[%d] == 0x%x\n", tli, HandleTable->Table[tli]); + + /* allocate a middle level entry list if required */ + nmtbl = HandleTable->Table[tli]; + if(nmtbl == NULL) + { + if(HandleTable->QuotaProcess != NULL) + { + /* FIXME - Charge process quota before allocating the handle table! */ + } + + nmtbl = ExAllocatePoolWithTag(PagedPool, + N_MIDDLELEVEL_POINTERS * sizeof(PHANDLE_TABLE_ENTRY), + TAG('E', 'x', 'H', 't')); + if(nmtbl == NULL) + { + if(HandleTable->QuotaProcess != NULL) + { + /* FIXME - return the quota to the process */ + } + + return NULL; + } + + /* clear the middle level entry list */ + RtlZeroMemory(nmtbl, N_MIDDLELEVEL_POINTERS * sizeof(PHANDLE_TABLE_ENTRY)); + + /* make sure the table was zeroed before we set one item */ + KeMemoryBarrier(); + + /* note, don't set the the pointer in the top level list yet because we + might screw up lookups if allocating a subhandle entry table failed + and this newly allocated table might get freed again */ + AllocatedMtbl = TRUE; + } + else + { + AllocatedMtbl = FALSE; + + /* allocate a subhandle entry table in any case! */ + ASSERT(nmtbl[mli] == NULL); + } + + DPRINT("HandleTable->Table[%d][%d] == 0x%x\n", tli, mli, nmtbl[mli]); + + if(HandleTable->QuotaProcess != NULL) + { + /* FIXME - Charge process quota before allocating the handle table! */ + } + + ntbl = ExAllocatePoolWithTag(PagedPool, + N_SUBHANDLE_ENTRIES * sizeof(HANDLE_TABLE_ENTRY), + TAG('E', 'x', 'H', 't')); + if(ntbl == NULL) + { + if(HandleTable->QuotaProcess != NULL) + { + /* FIXME - Return process quota charged */ + } + + /* free the middle level entry list, if allocated, because it's empty and + unused */ + if(AllocatedMtbl) + { + ExFreePool(nmtbl); + + if(HandleTable->QuotaProcess != NULL) + { + /* FIXME - Return process quota charged */ + } + } + + return NULL; + } + + /* let's just use the very first entry */ + Entry = ntbl; + Entry->u1.ObAttributes = EX_HANDLE_ENTRY_LOCKED; + Entry->u2.NextFreeTableEntry = 0; + + *Handle = HandleTable->NextIndexNeedingPool; + + HandleTable->HandleCount++; + + /* set the FirstFreeTableEntry member to the second entry and chain the + free entries */ + HandleTable->FirstFreeTableEntry = HandleTable->NextIndexNeedingPool + 1; + for(cure = Entry + 1, laste = Entry + N_SUBHANDLE_ENTRIES, i = HandleTable->FirstFreeTableEntry + 1; + cure != laste; + cure++, i++) + { + cure->u1.Object = NULL; + cure->u2.NextFreeTableEntry = i; + } + /* truncate the free entry list */ + (cure - 1)->u2.NextFreeTableEntry = -1; + + /* save the pointers to the allocated list(s) */ + InterlockedExchangePointer(&nmtbl[mli], ntbl); + if(AllocatedMtbl) + { + InterlockedExchangePointer(&HandleTable->Table[tli], nmtbl); + } + + /* increment the NextIndexNeedingPool to the next index where we need to + allocate new memory */ + HandleTable->NextIndexNeedingPool += N_SUBHANDLE_ENTRIES; + } + } + else + { + DPRINT1("Can't allocate any more handles in handle table 0x%x!\n", HandleTable); + } + + return Entry; +} + +static VOID +ExpFreeHandleTableEntry(IN PHANDLE_TABLE HandleTable, + IN PHANDLE_TABLE_ENTRY Entry, + IN LONG Handle) +{ + PAGED_CODE(); + + ASSERT(HandleTable); + ASSERT(Entry); + ASSERT(IS_VALID_EX_HANDLE(Handle)); + + DPRINT("ExpFreeHandleTableEntry HT:0x%x Entry:0x%x\n", HandleTable, Entry); + + /* automatically unlock the entry if currently locked. We however don't notify + anyone who waited on the handle because we're holding an exclusive lock after + all and these locks will fail then */ + InterlockedExchangePointer(&Entry->u1.Object, NULL); + Entry->u2.NextFreeTableEntry = HandleTable->FirstFreeTableEntry; + HandleTable->FirstFreeTableEntry = Handle; + + HandleTable->HandleCount--; +} + +static PHANDLE_TABLE_ENTRY +ExpLookupHandleTableEntry(IN PHANDLE_TABLE HandleTable, + IN LONG Handle) +{ + PHANDLE_TABLE_ENTRY Entry = NULL; + + PAGED_CODE(); + + ASSERT(HandleTable); + + if(IS_VALID_EX_HANDLE(Handle)) + { + ULONG tli, mli, eli; + PHANDLE_TABLE_ENTRY *mlp; + + tli = TLI_FROM_HANDLE(Handle); + mli = MLI_FROM_HANDLE(Handle); + eli = ELI_FROM_HANDLE(Handle); + + mlp = HandleTable->Table[tli]; + if(Handle < HandleTable->NextIndexNeedingPool && + mlp != NULL && mlp[mli] != NULL && mlp[mli][eli].u1.Object != NULL) + { + Entry = &mlp[mli][eli]; + DPRINT("handle lookup 0x%x -> entry 0x%x [HT:0x%x] ptr: 0x%x\n", Handle, Entry, HandleTable, mlp[mli][eli].u1.Object); + } + } + else + { + DPRINT("Looking up invalid handle 0x%x\n", Handle); + } + + return Entry; +} + +BOOLEAN +ExLockHandleTableEntry(IN PHANDLE_TABLE HandleTable, + IN PHANDLE_TABLE_ENTRY Entry) +{ + ULONG_PTR Current, New; + + PAGED_CODE(); + + DPRINT("Entering handle table entry 0x%x lock...\n", Entry); + + ASSERT(HandleTable); + ASSERT(Entry); + + for(;;) + { + Current = (volatile ULONG_PTR)Entry->u1.Object; + + if(!Current || (HandleTable->Flags & EX_HANDLE_TABLE_CLOSING)) + { + DPRINT("Attempted to lock empty handle table entry 0x%x or handle table shut down\n", Entry); + break; + } + + if(!(Current & EX_HANDLE_ENTRY_LOCKED)) + { + New = Current | EX_HANDLE_ENTRY_LOCKED; + if(InterlockedCompareExchangePointer(&Entry->u1.Object, + (PVOID)New, + (PVOID)Current) == (PVOID)Current) + { + DPRINT("SUCCESS handle table 0x%x entry 0x%x lock\n", HandleTable, Entry); + /* we acquired the lock */ + return TRUE; + } + } + + /* wait about 5ms at maximum so we don't wait forever in unfortunate + co-incidences where releasing the lock in another thread happens right + before we're waiting on the contention event to get pulsed, which might + never happen again... */ + KeWaitForSingleObject(&HandleTable->HandleContentionEvent, + Executive, + KernelMode, + FALSE, + &ExpHandleShortWait); + } + + return FALSE; +} + +VOID +ExUnlockHandleTableEntry(IN PHANDLE_TABLE HandleTable, + IN PHANDLE_TABLE_ENTRY Entry) +{ + ULONG_PTR Current, New; + + PAGED_CODE(); + + ASSERT(HandleTable); + ASSERT(Entry); + + DPRINT("ExUnlockHandleTableEntry HT:0x%x Entry:0x%x\n", HandleTable, Entry); + + Current = (volatile ULONG_PTR)Entry->u1.Object; + + ASSERT(Current & EX_HANDLE_ENTRY_LOCKED); + + New = Current & ~EX_HANDLE_ENTRY_LOCKED; + + InterlockedExchangePointer(&Entry->u1.Object, + (PVOID)New); + + /* we unlocked the entry, pulse the contention event so threads who're waiting + on the release can continue */ + KePulseEvent(&HandleTable->HandleContentionEvent, + EVENT_INCREMENT, + FALSE); +} + +LONG +ExCreateHandle(IN PHANDLE_TABLE HandleTable, + IN PHANDLE_TABLE_ENTRY Entry) +{ + PHANDLE_TABLE_ENTRY NewHandleTableEntry; + LONG Handle = EX_INVALID_HANDLE; + + PAGED_CODE(); + + ASSERT(HandleTable); + ASSERT(Entry); + + /* The highest bit in Entry->u1.Object has to be 1 so we make sure it's a + pointer to kmode memory. It will cleared though because it also indicates + the lock */ + ASSERT((ULONG_PTR)Entry->u1.Object & EX_HANDLE_ENTRY_LOCKED); + + KeEnterCriticalRegion(); + ExAcquireHandleTableLockExclusive(HandleTable); + + NewHandleTableEntry = ExpAllocateHandleTableEntry(HandleTable, + &Handle); + if(NewHandleTableEntry != NULL) + { + *NewHandleTableEntry = *Entry; + + ExUnlockHandleTableEntry(HandleTable, + NewHandleTableEntry); + } + + ExReleaseHandleTableLock(HandleTable); + KeLeaveCriticalRegion(); + + return Handle; +} + +BOOLEAN +ExDestroyHandle(IN PHANDLE_TABLE HandleTable, + IN LONG Handle) +{ + PHANDLE_TABLE_ENTRY HandleTableEntry; + BOOLEAN Ret = FALSE; + + PAGED_CODE(); + + ASSERT(HandleTable); + + KeEnterCriticalRegion(); + ExAcquireHandleTableLockExclusive(HandleTable); + + HandleTableEntry = ExpLookupHandleTableEntry(HandleTable, + Handle); + + if(HandleTableEntry != NULL && ExLockHandleTableEntry(HandleTable, HandleTableEntry)) + { + /* free and automatically unlock the handle. However we don't need to pulse + the contention event since other locks on this entry will fail */ + ExpFreeHandleTableEntry(HandleTable, + HandleTableEntry, + Handle); + Ret = TRUE; + } + + ExReleaseHandleTableLock(HandleTable); + KeLeaveCriticalRegion(); + + return Ret; +} + +VOID +ExDestroyHandleByEntry(IN PHANDLE_TABLE HandleTable, + IN PHANDLE_TABLE_ENTRY Entry, + IN LONG Handle) +{ + PAGED_CODE(); + + ASSERT(HandleTable); + ASSERT(Entry); + + /* This routine requires the entry to be locked */ + ASSERT((ULONG_PTR)Entry->u1.Object & EX_HANDLE_ENTRY_LOCKED); + + DPRINT("DestroyHandleByEntry HT:0x%x Entry:0x%x\n", HandleTable, Entry); + [truncated at 1000 lines; 2866 more skipped]
19 years, 9 months
1
0
0
0
[fireball] 14006: Removed excess copy of accidently inserted twice russian language resources.
by fireball@svn.reactos.com
Removed excess copy of accidently inserted twice russian language resources. Modified: trunk/reactos/lib/cpl/control/Ru.rc _____ Modified: trunk/reactos/lib/cpl/control/Ru.rc --- trunk/reactos/lib/cpl/control/Ru.rc 2005-03-13 13:47:45 UTC (rev 14005) +++ trunk/reactos/lib/cpl/control/Ru.rc 2005-03-13 13:59:06 UTC (rev 14006) @@ -25,32 +25,3 @@ MENUITEM "&? ´¯ÒÓýýÕ", IDM_ABOUT END END - -// Russian language resource file (unC0Rr, 2005-03-11) - -LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT - -/////////////////////////////////////////////////////////////////////// ////// -// -// Menu -// - -IDM_MAINMENU MENU DISCARDABLE -BEGIN - POPUP "&ÈÓÚÙ" - BEGIN - MENUITEM "&?¹§¯õ", IDM_CLOSE - END - POPUP "&?Þõ" - BEGIN - MENUITEM "¤Ù&Þ?ÛÓ", IDM_LARGEICONS - MENUITEM "&ÃÝÓ¸ÛÞ", IDM_SMALLICONS - MENUITEM "дޱ&¯Û", IDM_LIST - MENUITEM "&ÊÓßÙÞ÷Ó", IDM_DETAILS - END - POPUP "&дÓÔÛÓ" - BEGIN - MENUITEM "&? ´¯ÒÓýýÕ", IDM_ABOUT - END -END -
19 years, 9 months
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
61
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
Results per page:
10
25
50
100
200