[EXPLORER_NEW]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 2 Feb 2013 10:55:29 +0000 (10:55 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 2 Feb 2013 10:55:29 +0000 (10:55 +0000)
- Prefer HEAP_ZERO_MEMORY over a separate ZeroMemory call. Patch by Carlo Bramini.
CORE-6928 #resolve

svn path=/trunk/; revision=58263

reactos/base/shell/explorer-new/dragdrop.c
reactos/base/shell/explorer-new/startmnu.c
reactos/base/shell/explorer-new/taskband.c
reactos/base/shell/explorer-new/taskswnd.c
reactos/base/shell/explorer-new/tbsite.c
reactos/base/shell/explorer-new/trayntfy.c
reactos/base/shell/explorer-new/traywnd.c

index 100c84d..ae1cb64 100644 (file)
@@ -131,14 +131,11 @@ CreateDropTarget(IN HWND hwndTarget,
     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;
index e5f2f15..845f538 100644 (file)
@@ -773,14 +773,11 @@ IStartMenuSiteImpl_Construct(IN ITrayWindow *Tray)
     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;
     This->lpStartMenuCallbackVtbl = &ITrayPrivImpl_Vtbl;
index dc7a54f..b884a7a 100644 (file)
@@ -629,13 +629,11 @@ ITaskBandImpl_Construct(IN OUT ITrayWindow *Tray)
     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;
index 54ee643..fbc6db7 100644 (file)
@@ -709,13 +709,10 @@ TaskSwitchWnd_AddToTaskGroup(IN OUT PTASK_SWITCH_WND This,
 
     /* 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 @@ ForwardContextMenuMsg:
             {
                 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;
index 3cc190d..d27240b 100644 (file)
@@ -910,13 +910,11 @@ ITrayBandSiteImpl_Construct(IN OUT ITrayWindow *Tray,
     *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;
index aa877a8..731286b 100644 (file)
@@ -615,12 +615,10 @@ CreateSysPagerWnd(IN HWND hWndParent,
     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 @@ CreateTrayClockWnd(IN HWND hWndParent,
     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 @@ CreateTrayNotifyWnd(IN OUT ITrayWindow *TrayWindow,
         return NULL;
 
     TnData = HeapAlloc(hProcessHeap,
-                       0,
+                       HEAP_ZERO_MEMORY,
                        sizeof(*TnData));
     if (TnData != NULL)
     {
-        ZeroMemory(TnData,
-                   sizeof(*TnData));
-
         TnData->TrayWindow = TrayWindow;
         TnData->HideClock = bHideClock;
 
index ca5b6ad..c5cd756 100644 (file)
@@ -1620,13 +1620,11 @@ ITrayWindowImpl_Construct(VOID)
     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;