Author: tfaber Date: Sat Feb 2 10:55:29 2013 New Revision: 58263
URL: http://svn.reactos.org/svn/reactos?rev=58263&view=rev Log: [EXPLORER_NEW] - Prefer HEAP_ZERO_MEMORY over a separate ZeroMemory call. Patch by Carlo Bramini. CORE-6928 #resolve
Modified: trunk/reactos/base/shell/explorer-new/dragdrop.c trunk/reactos/base/shell/explorer-new/startmnu.c trunk/reactos/base/shell/explorer-new/taskband.c trunk/reactos/base/shell/explorer-new/taskswnd.c trunk/reactos/base/shell/explorer-new/tbsite.c trunk/reactos/base/shell/explorer-new/trayntfy.c trunk/reactos/base/shell/explorer-new/traywnd.c
Modified: trunk/reactos/base/shell/explorer-new/dragdrop.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/dra... ============================================================================== --- trunk/reactos/base/shell/explorer-new/dragdrop.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/dragdrop.c [iso-8859-1] Sat Feb 2 10:55:29 2013 @@ -131,14 +131,11 @@ HRESULT hr;
This = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, FIELD_OFFSET(IDropTargetImpl, Formats[nSupportedFormats])); if (This != NULL) { - ZeroMemory(This, - sizeof(*This)); - This->lpVtbl = &IDropTargetImpl_Vtbl; This->Ref = 1; This->hwndTarget = hwndTarget;
Modified: trunk/reactos/base/shell/explorer-new/startmnu.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/sta... ============================================================================== --- trunk/reactos/base/shell/explorer-new/startmnu.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/startmnu.c [iso-8859-1] Sat Feb 2 10:55:29 2013 @@ -773,13 +773,10 @@ IStartMenuSiteImpl *This;
This = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(*This)); if (This == NULL) return NULL; - - ZeroMemory(This, - sizeof(*This));
This->lpVtbl = &IStartMenuSiteImpl_Vtbl; This->lpServiceProviderVtbl = &IServiceProviderImpl_Vtbl;
Modified: trunk/reactos/base/shell/explorer-new/taskband.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tas... ============================================================================== --- trunk/reactos/base/shell/explorer-new/taskband.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/taskband.c [iso-8859-1] Sat Feb 2 10:55:29 2013 @@ -629,13 +629,11 @@ ITaskBandImpl *This;
This = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(*This)); if (This == NULL) return NULL;
- ZeroMemory(This, - sizeof(*This)); This->lpVtbl = &ITaskBandImpl_Vtbl; This->lpDeskBandVtbl = &IDeskBandImpl_Vtbl; This->lpObjectWithSiteVtbl = &IObjectWithSiteImpl_Vtbl;
Modified: trunk/reactos/base/shell/explorer-new/taskswnd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tas... ============================================================================== --- trunk/reactos/base/shell/explorer-new/taskswnd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/taskswnd.c [iso-8859-1] Sat Feb 2 10:55:29 2013 @@ -709,13 +709,10 @@
/* Allocate a new task group */ TaskGroup = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(*TaskGroup)); if (TaskGroup != NULL) { - ZeroMemory(TaskGroup, - sizeof(*TaskGroup)); - TaskGroup->dwTaskCount = 1; TaskGroup->dwProcessId = dwProcessId; TaskGroup->Index = -1; @@ -2065,13 +2062,11 @@ { LPCREATESTRUCT CreateStruct = (LPCREATESTRUCT)lParam; This = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(*This)); if (This == NULL) return FALSE;
- ZeroMemory(This, - sizeof(*This)); This->hWnd = hwnd; This->hWndNotify = CreateStruct->hwndParent; This->Tray = (ITrayWindow*)CreateStruct->lpCreateParams;
Modified: trunk/reactos/base/shell/explorer-new/tbsite.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tbs... ============================================================================== --- trunk/reactos/base/shell/explorer-new/tbsite.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/tbsite.c [iso-8859-1] Sat Feb 2 10:55:29 2013 @@ -910,13 +910,11 @@ *phwndTaskSwitch = NULL;
This = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(*This)); if (This == NULL) return NULL;
- ZeroMemory(This, - sizeof(*This)); This->lpVtbl = &ITrayBandSiteImpl_Vtbl; This->lpBandSiteVtbl = &IBandSiteImpl_Vtbl; This->Ref = 1;
Modified: trunk/reactos/base/shell/explorer-new/trayntfy.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tra... ============================================================================== --- trunk/reactos/base/shell/explorer-new/trayntfy.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/trayntfy.c [iso-8859-1] Sat Feb 2 10:55:29 2013 @@ -615,12 +615,10 @@ HWND hWnd = NULL;
SpData = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(*SpData)); if (SpData != NULL) { - ZeroMemory(SpData, sizeof(*SpData)); - /* Create the window. The tray window is going to move it to the correct position and resize it as needed. */ dwStyle = WS_CHILD | WS_CLIPSIBLINGS; @@ -1357,13 +1355,10 @@ HWND hWnd = NULL;
TcData = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(*TcData)); if (TcData != NULL) { - ZeroMemory(TcData, - sizeof(*TcData)); - TcData->IsHorizontal = TRUE; /* Create the window. The tray window is going to move it to the correct position and resize it as needed. */ @@ -1841,13 +1836,10 @@ return NULL;
TnData = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(*TnData)); if (TnData != NULL) { - ZeroMemory(TnData, - sizeof(*TnData)); - TnData->TrayWindow = TrayWindow; TnData->HideClock = bHideClock;
Modified: trunk/reactos/base/shell/explorer-new/traywnd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tra... ============================================================================== --- trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] Sat Feb 2 10:55:29 2013 @@ -1620,13 +1620,11 @@ ITrayWindowImpl *This;
This = HeapAlloc(hProcessHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(*This)); if (This == NULL) return NULL;
- ZeroMemory(This, - sizeof(*This)); This->lpVtbl = &ITrayWindowImpl_Vtbl; This->lpVtblShellDesktopTray = &IShellDesktopTrayImpl_Vtbl; This->Ref = 1;