diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 21c88308669..c2a3f041059 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -129,11 +129,9 @@ struct module* module_new(struct process* pcs, const WCHAR* name, struct module* module; assert(type == DMT_ELF || type == DMT_PE); - if (!(module = HeapAlloc(GetProcessHeap(), 0, sizeof(*module)))) + if (!(module = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*module)))) return NULL; - memset(module, 0, sizeof(*module)); - module->next = pcs->lmodules; pcs->lmodules = module; diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index fefb448141f..bfe2a4794a3 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -482,8 +482,7 @@ static void test_text_extents(void) } len = lstrlenW(wt); - extents = HeapAlloc(GetProcessHeap(), 0, len * sizeof extents[0]); - memset(extents, 0, len * sizeof extents[0]); + extents = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof extents[0]); extents[0] = 1; /* So that the increasing sequence test will fail if the extents array is untouched. */ GetTextExtentExPointW(hdc, wt, len, 32767, &fit1, extents, &sz1); diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 0aa28f0a8f1..bc3f7a9f10a 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -313,8 +313,7 @@ HIMC WINAPI ImmCreateContext(void) { InputContextData *new_context; - new_context = HeapAlloc(GetProcessHeap(),0,sizeof(InputContextData)); - ZeroMemory(new_context,sizeof(InputContextData)); + new_context = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(InputContextData)); return (HIMC)new_context; } diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c index 76516879f55..1361d30bd22 100644 --- a/dlls/msvfw32/msvideo_main.c +++ b/dlls/msvfw32/msvideo_main.c @@ -1294,10 +1294,9 @@ HANDLE VFWAPI ICImageDecompress( cbHdr = ICDecompressGetFormatSize(hic,lpbiIn); if ( cbHdr < sizeof(BITMAPINFOHEADER) ) goto err; - pHdr = HeapAlloc(GetProcessHeap(),0,cbHdr+sizeof(RGBQUAD)*256); + pHdr = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,cbHdr+sizeof(RGBQUAD)*256); if ( pHdr == NULL ) goto err; - ZeroMemory( pHdr, cbHdr+sizeof(RGBQUAD)*256 ); if ( ICDecompressGetFormat( hic, lpbiIn, (BITMAPINFO*)pHdr ) != ICERR_OK ) goto err; lpbiOut = (BITMAPINFO*)pHdr; diff --git a/dlls/ntdll/tests/port.c b/dlls/ntdll/tests/port.c index c64067d13a2..971591737a7 100644 --- a/dlls/ntdll/tests/port.c +++ b/dlls/ntdll/tests/port.c @@ -199,10 +199,9 @@ static DWORD WINAPI test_ports_client(LPVOID arg) ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %d\n", status); size = FIELD_OFFSET(LPC_MESSAGE, Data) + MAX_MESSAGE_LEN; - LpcMessage = HeapAlloc(GetProcessHeap(), 0, size); + LpcMessage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); out = HeapAlloc(GetProcessHeap(), 0, size); - memset(LpcMessage, 0, size); LpcMessage->DataSize = lstrlen(REQUEST1) + 1; LpcMessage->MessageSize = FIELD_OFFSET(LPC_MESSAGE, Data) + LpcMessage->DataSize; lstrcpy((LPSTR)LpcMessage->Data, REQUEST1); @@ -252,8 +251,7 @@ static void test_ports_server(void) if (status != STATUS_SUCCESS) return; size = FIELD_OFFSET(LPC_MESSAGE, Data) + MAX_MESSAGE_LEN; - LpcMessage = HeapAlloc(GetProcessHeap(), 0, size); - memset(LpcMessage, 0, size); + LpcMessage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); while (TRUE) { diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 97f53dfee7e..5b4314ffbf1 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -4223,16 +4223,13 @@ static StorageInternalImpl* StorageInternalImpl_Construct( /* * Allocate space for the new storage object */ - newStorage = HeapAlloc(GetProcessHeap(), 0, sizeof(StorageInternalImpl)); + newStorage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(StorageInternalImpl)); if (newStorage!=0) { - memset(newStorage, 0, sizeof(StorageInternalImpl)); - /* * Initialize the stream list */ - list_init(&newStorage->base.strmHead); /* diff --git a/dlls/winex11.drv/xfont.c b/dlls/winex11.drv/xfont.c index 60bd70da930..b53da7e5518 100644 --- a/dlls/winex11.drv/xfont.c +++ b/dlls/winex11.drv/xfont.c @@ -2035,13 +2035,10 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in if( !fr ) /* add new family */ { n_ff++; - fr = HeapAlloc(GetProcessHeap(), 0, sizeof(fontResource)); + fr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(fontResource)); if (fr) { - memset(fr, 0, sizeof(fontResource)); - - fr->resource = HeapAlloc(GetProcessHeap(), 0, sizeof(LFD)); - memset(fr->resource, 0, sizeof(LFD)); + fr->resource = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LFD)); TRACE("family: -%s-%s-\n", lfd.foundry, lfd.family ); fr->resource->foundry = HeapAlloc(GetProcessHeap(), 0, strlen(lfd.foundry)+1); diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index 40026fdaafb..604f3834359 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -2673,8 +2673,7 @@ static BOOL FTP_SendData(LPWININETFTPSESSIONW lpwfs, INT nDataSocket, HANDLE hFi CHAR *lpszBuffer; TRACE("\n"); - lpszBuffer = HeapAlloc(GetProcessHeap(), 0, sizeof(CHAR)*DATA_PACKET_SIZE); - memset(lpszBuffer, 0, sizeof(CHAR)*DATA_PACKET_SIZE); + lpszBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CHAR)*DATA_PACKET_SIZE); /* Get the size of the file. */ GetFileInformationByHandle(hFile, &fi); diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 6345a5b8905..3bfa62f4647 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -467,14 +467,13 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, /* Clear any error information */ INTERNET_SetLastError(0); - lpwai = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETAPPINFOW)); + lpwai = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WININETAPPINFOW)); if (NULL == lpwai) { INTERNET_SetLastError(ERROR_OUTOFMEMORY); goto lend; } - - memset(lpwai, 0, sizeof(WININETAPPINFOW)); + lpwai->hdr.htype = WH_HINIT; lpwai->hdr.dwFlags = dwFlags; lpwai->hdr.dwRefCount = 1; diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 8ecf795fc82..a6d65eaf2c1 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -2876,10 +2876,9 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter) } if(pi->pDevMode) dmW = pi->pDevMode; - else + else { - dmW = HeapAlloc(GetProcessHeap(), 0, size); - ZeroMemory(dmW,size); + dmW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); dmW->dmSize = size; if (0>DocumentPropertiesW(0,0,pi->pPrinterName,dmW,NULL,DM_OUT_BUFFER)) { diff --git a/programs/oleview/tree.c b/programs/oleview/tree.c index d776740bf20..348c4f248c4 100644 --- a/programs/oleview/tree.c +++ b/programs/oleview/tree.c @@ -41,8 +41,7 @@ static LPARAM CreateITEM_INFO(INT flag, const WCHAR *info, const WCHAR *clsid, c { ITEM_INFO *reg; - reg = HeapAlloc(GetProcessHeap(), 0, sizeof(ITEM_INFO)); - memset(reg, 0, sizeof(ITEM_INFO)); + reg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ITEM_INFO)); reg->cFlag = flag; lstrcpyW(reg->info, info); diff --git a/programs/oleview/typelib.c b/programs/oleview/typelib.c index baba62874aa..1acdd84d6fb 100644 --- a/programs/oleview/typelib.c +++ b/programs/oleview/typelib.c @@ -258,9 +258,8 @@ static TYPELIB_DATA *InitializeTLData(void) { TYPELIB_DATA *pTLData; - pTLData = HeapAlloc(GetProcessHeap(), 0, sizeof(TYPELIB_DATA)); + pTLData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TYPELIB_DATA)); - memset(pTLData, 0, sizeof(TYPELIB_DATA)); pTLData->idl = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)); pTLData->idl[0] = '\0';