Re: [ros-dev] [ros-diffs] [ekohl] 68313: [NTOSKRNL] Add CmpDestroySecurityCache() and CmpDestroyHiveViewList() stubs and call them in CmpDestroyHive and CmUnloadKey(). CORE-6492 #resolve #comment Than

2015-06-29 Thread Thomas Faber

On 2015-06-29 20:26, ek...@svn.reactos.org wrote:

Modified: trunk/reactos/ntoskrnl/config/cmmapvw.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmmapvw.c?rev=68313r1=68312r2=68313view=diff
==
--- trunk/reactos/ntoskrnl/config/cmmapvw.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmmapvw.c [iso-8859-1] Mon Jun 29 
18:26:56 2015
@@ -29,3 +29,54 @@
  Hive-PinnedViews = 0;
  Hive-UseCount = 0;
  }
+
+VOID
+NTAPI
+CmpDestroyHiveViewList(IN PCMHIVE Hive)
+{
+PCM_VIEW_OF_FILE CmView;
+PLIST_ENTRY EntryList;
+
+/* Do NOT destroy the views of read-only hives */
+ASSERT(Hive-Hive.ReadOnly == FALSE);
+
+/* Free all the views inside the Pinned View List */
+EntryList = RemoveHeadList(Hive-PinViewListHead);
+while (EntryList != Hive-PinViewListHead)


In case you haven't found it yourself yet maybe I can speed things up in
identifying the test failures here:
I made RemoveHeadList on an empty list cause a security check failure
a while back because when done unintentionally it can indicate a bug in
the code, while OTOH it's super easy to avoid.
So I'm guessing this is probably the cause, and should use a
while (!IsListEmpty()) RemoveHeadList(); or similar pattern.

If you have strong feelings against this check (which MS's headers
don't do), let me know.



+{
+CmView = CONTAINING_RECORD(EntryList, CM_VIEW_OF_FILE, PinViewList);
+
+/* FIXME: Unmap the view if it is mapped */
+
+ExFreePool(CmView);
+
+Hive-PinnedViews--;
+
+EntryList = RemoveHeadList(Hive-PinViewListHead);
+}
+
+/* The Pinned View List should be empty */
+ASSERT(IsListEmpty(Hive-PinViewListHead) == TRUE);
+ASSERT(Hive-PinnedViews == 0);
+
+/* Now, free all the views inside the LRU View List */
+EntryList = RemoveHeadList(Hive-LRUViewListHead);
+while (EntryList != Hive-LRUViewListHead)
+{
+CmView = CONTAINING_RECORD(EntryList, CM_VIEW_OF_FILE, LRUViewList);
+
+/* FIXME: Unmap the view if it is mapped */
+
+ExFreePool(CmView);
+
+Hive-MappedViews--;
+
+EntryList = RemoveHeadList(Hive-LRUViewListHead);
+}



___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev


Re: [ros-dev] [ros-diffs] [ekohl] 68313: [NTOSKRNL] Add CmpDestroySecurityCache() and CmpDestroyHiveViewList() stubs and call them in CmpDestroyHive and CmUnloadKey(). CORE-6492 #resolve #comment Than

2015-06-29 Thread Eric Kohl
Hi Thomas,

thank you for the hint!

The while (!IsListEmpty()) RemoveHeadList(); pattern looks nice and
seems to do the job. Will test and commit it!

Regards,
Eric

Am 29.06.2015 20:51, schrieb Thomas Faber:
 On 2015-06-29 20:26, ek...@svn.reactos.org wrote:
 Modified: trunk/reactos/ntoskrnl/config/cmmapvw.c
 URL:
 http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmmapvw.c?rev=68313r1=68312r2=68313view=diff

 ==

 --- trunk/reactos/ntoskrnl/config/cmmapvw.c[iso-8859-1] (original)
 +++ trunk/reactos/ntoskrnl/config/cmmapvw.c[iso-8859-1] Mon Jun 29
 18:26:56 2015
 @@ -29,3 +29,54 @@
   Hive-PinnedViews = 0;
   Hive-UseCount = 0;
   }
 +
 +VOID
 +NTAPI
 +CmpDestroyHiveViewList(IN PCMHIVE Hive)
 +{
 +PCM_VIEW_OF_FILE CmView;
 +PLIST_ENTRY EntryList;
 +
 +/* Do NOT destroy the views of read-only hives */
 +ASSERT(Hive-Hive.ReadOnly == FALSE);
 +
 +/* Free all the views inside the Pinned View List */
 +EntryList = RemoveHeadList(Hive-PinViewListHead);
 +while (EntryList != Hive-PinViewListHead)
 
 In case you haven't found it yourself yet maybe I can speed things up in
 identifying the test failures here:
 I made RemoveHeadList on an empty list cause a security check failure
 a while back because when done unintentionally it can indicate a bug in
 the code, while OTOH it's super easy to avoid.
 So I'm guessing this is probably the cause, and should use a
 while (!IsListEmpty()) RemoveHeadList(); or similar pattern.
 
 If you have strong feelings against this check (which MS's headers
 don't do), let me know.
 
 
 +{
 +CmView = CONTAINING_RECORD(EntryList, CM_VIEW_OF_FILE,
 PinViewList);
 +
 +/* FIXME: Unmap the view if it is mapped */
 +
 +ExFreePool(CmView);
 +
 +Hive-PinnedViews--;
 +
 +EntryList = RemoveHeadList(Hive-PinViewListHead);
 +}
 +
 +/* The Pinned View List should be empty */
 +ASSERT(IsListEmpty(Hive-PinViewListHead) == TRUE);
 +ASSERT(Hive-PinnedViews == 0);
 +
 +/* Now, free all the views inside the LRU View List */
 +EntryList = RemoveHeadList(Hive-LRUViewListHead);
 +while (EntryList != Hive-LRUViewListHead)
 +{
 +CmView = CONTAINING_RECORD(EntryList, CM_VIEW_OF_FILE,
 LRUViewList);
 +
 +/* FIXME: Unmap the view if it is mapped */
 +
 +ExFreePool(CmView);
 +
 +Hive-MappedViews--;
 +
 +EntryList = RemoveHeadList(Hive-LRUViewListHead);
 +}
 
 
 ___
 Ros-dev mailing list
 Ros-dev@reactos.org
 http://www.reactos.org/mailman/listinfo/ros-dev
 


___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev


Re: [ros-dev] [ros-diffs] [cwittich] 68305: [BROWSEUI] don't exposesome interfaces expose IID_IContextMenu3 from CBandSiteMenu

2015-06-29 Thread Christoph von Wittich
Please revert it then

- Ursprüngliche Nachricht -
Von: Pierre Schweitzer pie...@reactos.org
Gesendet: ‎29.‎06.‎2015 21:36
An: ros-dev@reactos.org ros-dev@reactos.org; Christoph von Wittich 
christ...@apiviewer.de
Betreff: Re: [ros-dev] [ros-diffs] [cwittich] 68305: [BROWSEUI] don't 
exposesome interfaces expose IID_IContextMenu3 from CBandSiteMenu

This commit regressed (badly) explorer:
https://www3.heisspiter.net/explorer.png

On 28/06/2015 20:22, cwitt...@svn.reactos.org wrote:
 Author: cwittich
 Date: Sun Jun 28 18:22:02 2015
 New Revision: 68305
 
 URL: http://svn.reactos.org/svn/reactos?rev=68305view=rev
 Log:
 [BROWSEUI]
 don't expose some interfaces
 expose IID_IContextMenu3 from CBandSiteMenu
 
 Modified:
 trunk/reactos/dll/win32/browseui/addressband.h
 trunk/reactos/dll/win32/browseui/addresseditbox.h
 trunk/reactos/dll/win32/browseui/bandsitemenu.h
 trunk/reactos/dll/win32/browseui/internettoolbar.h
 
 Modified: trunk/reactos/dll/win32/browseui/addressband.h
 URL: 
 http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/addressband.h?rev=68305r1=68304r2=68305view=diff
 ==
 --- trunk/reactos/dll/win32/browseui/addressband.h[iso-8859-1] (original)
 +++ trunk/reactos/dll/win32/browseui/addressband.h[iso-8859-1] Sun Jun 28 
 18:22:02 2015
 @@ -136,6 +136,5 @@
  COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite)
  COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
  COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
 -COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
  END_COM_MAP()
  };
 
 Modified: trunk/reactos/dll/win32/browseui/addresseditbox.h
 URL: 
 http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/addresseditbox.h?rev=68305r1=68304r2=68305view=diff
 ==
 --- trunk/reactos/dll/win32/browseui/addresseditbox.h [iso-8859-1] (original)
 +++ trunk/reactos/dll/win32/browseui/addresseditbox.h [iso-8859-1] Sun Jun 28 
 18:22:02 2015
 @@ -97,7 +97,6 @@
  COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
  COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
  COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
 -COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
  COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
  END_COM_MAP()
  };
 
 Modified: trunk/reactos/dll/win32/browseui/bandsitemenu.h
 URL: 
 http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/bandsitemenu.h?rev=68305r1=68304r2=68305view=diff
 ==
 --- trunk/reactos/dll/win32/browseui/bandsitemenu.h   [iso-8859-1] (original)
 +++ trunk/reactos/dll/win32/browseui/bandsitemenu.h   [iso-8859-1] Sun Jun 28 
 18:22:02 2015
 @@ -55,6 +55,7 @@
  BEGIN_COM_MAP(CBandSiteMenu)
  COM_INTERFACE_ENTRY_IID(IID_IShellService, IShellService)
  COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
 +COM_INTERFACE_ENTRY_IID(IID_IContextMenu3, IContextMenu3)
  COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
  END_COM_MAP()
  };
 
 Modified: trunk/reactos/dll/win32/browseui/internettoolbar.h
 URL: 
 http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/internettoolbar.h?rev=68305r1=68304r2=68305view=diff
 ==
 --- trunk/reactos/dll/win32/browseui/internettoolbar.h[iso-8859-1] 
 (original)
 +++ trunk/reactos/dll/win32/browseui/internettoolbar.h[iso-8859-1] 
 Sun Jun 28 18:22:02 2015
 @@ -228,7 +228,6 @@
  COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
  COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow)
  COM_INTERFACE_ENTRY_IID(IID_IDockingWindow, IDockingWindow)
 -COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
  //COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
  COM_INTERFACE_ENTRY_IID(IID_IPersistStreamInit, IPersistStreamInit)
  COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
 @@ -237,7 +236,5 @@
  COM_INTERFACE_ENTRY_IID(IID_IShellChangeNotify, IShellChangeNotify)
  COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
  COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
 -COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
 -COM_INTERFACE_ENTRY_IID(IID_IBandSite, IBandSite)
  END_COM_MAP()
  };
 
 


-- 
Pierre Schweitzer pierre at reactos.org
System  Network Administrator
Senior Kernel Developer
ReactOS Deutschland e.V.

___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev

Re: [ros-dev] [ros-diffs] [cwittich] 68305: [BROWSEUI] don't expose some interfaces expose IID_IContextMenu3 from CBandSiteMenu

2015-06-29 Thread Pierre Schweitzer
This commit regressed (badly) explorer:
https://www3.heisspiter.net/explorer.png

On 28/06/2015 20:22, cwitt...@svn.reactos.org wrote:
 Author: cwittich
 Date: Sun Jun 28 18:22:02 2015
 New Revision: 68305
 
 URL: http://svn.reactos.org/svn/reactos?rev=68305view=rev
 Log:
 [BROWSEUI]
 don't expose some interfaces
 expose IID_IContextMenu3 from CBandSiteMenu
 
 Modified:
 trunk/reactos/dll/win32/browseui/addressband.h
 trunk/reactos/dll/win32/browseui/addresseditbox.h
 trunk/reactos/dll/win32/browseui/bandsitemenu.h
 trunk/reactos/dll/win32/browseui/internettoolbar.h
 
 Modified: trunk/reactos/dll/win32/browseui/addressband.h
 URL: 
 http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/addressband.h?rev=68305r1=68304r2=68305view=diff
 ==
 --- trunk/reactos/dll/win32/browseui/addressband.h[iso-8859-1] (original)
 +++ trunk/reactos/dll/win32/browseui/addressband.h[iso-8859-1] Sun Jun 28 
 18:22:02 2015
 @@ -136,6 +136,5 @@
  COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite)
  COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
  COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
 -COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
  END_COM_MAP()
  };
 
 Modified: trunk/reactos/dll/win32/browseui/addresseditbox.h
 URL: 
 http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/addresseditbox.h?rev=68305r1=68304r2=68305view=diff
 ==
 --- trunk/reactos/dll/win32/browseui/addresseditbox.h [iso-8859-1] (original)
 +++ trunk/reactos/dll/win32/browseui/addresseditbox.h [iso-8859-1] Sun Jun 28 
 18:22:02 2015
 @@ -97,7 +97,6 @@
  COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
  COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
  COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
 -COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
  COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
  END_COM_MAP()
  };
 
 Modified: trunk/reactos/dll/win32/browseui/bandsitemenu.h
 URL: 
 http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/bandsitemenu.h?rev=68305r1=68304r2=68305view=diff
 ==
 --- trunk/reactos/dll/win32/browseui/bandsitemenu.h   [iso-8859-1] (original)
 +++ trunk/reactos/dll/win32/browseui/bandsitemenu.h   [iso-8859-1] Sun Jun 28 
 18:22:02 2015
 @@ -55,6 +55,7 @@
  BEGIN_COM_MAP(CBandSiteMenu)
  COM_INTERFACE_ENTRY_IID(IID_IShellService, IShellService)
  COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
 +COM_INTERFACE_ENTRY_IID(IID_IContextMenu3, IContextMenu3)
  COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
  END_COM_MAP()
  };
 
 Modified: trunk/reactos/dll/win32/browseui/internettoolbar.h
 URL: 
 http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/internettoolbar.h?rev=68305r1=68304r2=68305view=diff
 ==
 --- trunk/reactos/dll/win32/browseui/internettoolbar.h[iso-8859-1] 
 (original)
 +++ trunk/reactos/dll/win32/browseui/internettoolbar.h[iso-8859-1] 
 Sun Jun 28 18:22:02 2015
 @@ -228,7 +228,6 @@
  COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
  COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow)
  COM_INTERFACE_ENTRY_IID(IID_IDockingWindow, IDockingWindow)
 -COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
  //COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
  COM_INTERFACE_ENTRY_IID(IID_IPersistStreamInit, IPersistStreamInit)
  COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
 @@ -237,7 +236,5 @@
  COM_INTERFACE_ENTRY_IID(IID_IShellChangeNotify, IShellChangeNotify)
  COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
  COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
 -COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
 -COM_INTERFACE_ENTRY_IID(IID_IBandSite, IBandSite)
  END_COM_MAP()
  };
 
 


-- 
Pierre Schweitzer pierre at reactos.org
System  Network Administrator
Senior Kernel Developer
ReactOS Deutschland e.V.



smime.p7s
Description: S/MIME Cryptographic Signature
___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev